MclistaPlugin 图标

MclistaPlugin

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.1.1
本资源为搬运资源,原资源地址: https://modrinth.com/mod/mclista-plugin
资源信息

Minecraft 版本: 1.8.9 1.21.11

平台: bukkit

标签: social

资源介绍

Release

Official plugin created for mclista.pl website.


Simple configuration, very fast and reliable.

⚙️ Requirements

  • Paper engine (1.8 - 1.21.8)
  • Server on website mclista.pl
  • OPTIONAL: Database mysql/mariadb/mongodb

? API module

Api may add to project maven/gradle


Currently supported platforms:

  • bukkit
  • velocity (in feature)

Maven

<repositories>
  <repository>
    <id>mclista-repository-releases</id>
    <name>Repozytorium McLista</name>
    <url>https://repository.mclista.pl/releases</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>pl.mclista</groupId>
    <artifactId>mclista-{platform}-api</artifactId>
    <version>1.1.0-beta2</version>
  </dependency>
</dependencies>

Gradle

maven {
    name = "mclistaRepositoryReleases"
    url = uri("https://repository.mclista.pl/releases")
}

implementation("pl.mclista:mclista-{platform}-api:1.1.0-beta2")


? API usage

In first order i recommend get class DeveloperService by registry.


Example for bukkit api:

RegisteredServiceProvider<DeveloperService> provider = Bukkit.getServicesManager().getRegistration(DeveloperService.class);
if (provider != null) {
  DeveloperService developerService = provider.getProvider();
}

DeveloperService returns two objects, UserService and RewardApiClient.


Every action that returns object will return DeveloperService:

  @NotNull RESULT getResult();

  @Nullable Optional<Throwable> getThrowable();

Event handling

Plugin currently has 2 events:

  • PostRewardReceiveEvent (Event calling after receive reward)
  • PreRewardReceiveEvent (Event calling beforce receive reward, is cancellable)

Event for every module has prefix {platform}, e.g.:
BukkitPreRewardReceiveEvent.

UserService

Class UserService allows to operate on users, include offline users.


It gives you complete freedom in managing users.

  void addUser(@NotNull User user);

  void removeUser(@NotNull UUID uuid);

  Optional<User> getUser(@NotNull UUID uuid);

  @NotNull CompletableFuture<DeveloperAction<User>> loadUser(@NotNull UUID uuid);

  @NotNull CompletableFuture<DeveloperAction<User>> modifyUser(@NotNull UUID uuid, @NotNull Consumer<User> userConsumer);

  @NotNull CompletableFuture<DeveloperAction<Boolean>> saveUser(@NotNull User user);

  @NotNull Set<User> getUsers();

  @NotNull CompletableFuture<DeveloperAction<Set<User>>> loadUsers();

RewardApiClient

This object allows you to send a query to the API and receive a response indicating whether the player has voted on the list on our server or not.


To check whether the user has received a reward today, you need to compare the delay with the current time from the User object.


Alternatively, you can also set your own delay—the choice is yours!

? Project status

Alt

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Create: More Sandpapers

价格:0 墨喵币
下载量:0

查看详情
PluginPilot

价格:0 墨喵币
下载量:0

查看详情
Create: Adventures

价格:0 墨喵币
下载量:0

查看详情
Jujutsu Kaisen Anime Gui

价格:0 墨喵币
下载量:0

查看详情