MclistaPlugin
Official plugin Minecraft server list mclista.pl
MclistaPlugin
<p align="center"> <img src="https://i.imgur.com/ngXnPK7.png" width="500" height="400"> </p>
Official plugin created for mclista.pl website. <br> Simple configuration, very fast and reliable. <br>
⚙️ 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 <br> Currently supported platforms: - bukkit - velocity (in feature)
Maven
```xml <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
```gradle maven { name = "mclistaRepositoryReleases" url = uri("https://repository.mclista.pl/releases") }
implementation("pl.mclista:mclista-{platform}-api:1.1.0-beta2") ``` <br>
🤖 API usage
In first order i recommend get class DeveloperService by registry. <br> Example for bukkit api:
```java RegisteredServiceProvider<DeveloperService> provider = Bukkit.getServicesManager().getRegistration(DeveloperService.class); if (provider != null) { DeveloperService developerService = provider.getProvider(); } ```
DeveloperService returns two objects, UserService and RewardApiClient. <br> Every action that returns object will return DeveloperService: ```java @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. <br>
UserService
Class UserService allows to operate on users, include offline users. <br> It gives you complete freedom in managing users.
```java 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. <br> To check whether the user has received a reward today, you need to compare the delay with the current time from the User object. <br> Alternatively, you can also set your own delay—the choice is yours!