为 mclista.pl 网站创建的官方插件。
配置简单,运行速度极快且可靠。
⚙️ 要求
- Paper 引擎 (1.8 - 1.21.8)
- 服务器需在 mclista.pl 网站上注册
- 可选:MySQL/MariaDB/MongoDB 数据库
? API 模块
API 可添加到项目的 Maven/Gradle 中。
目前支持的平台:
- Bukkit
- Velocity(即将推出)
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 用法
首先建议通过注册获取 DeveloperService 类。
Bukkit API 示例:
RegisteredServiceProvider<DeveloperService> provider = Bukkit.getServicesManager().getRegistration(DeveloperService.class);
if (provider != null) {
DeveloperService developerService = provider.getProvider();
}
DeveloperService 返回两个对象:UserService 和 RewardApiClient。
每个返回对象的操作都会返回 DeveloperService:
@NotNull RESULT getResult();
@Nullable Optional<Throwable> getThrowable();
事件处理
插件目前包含 2 个事件:
- PostRewardReceiveEvent(收到奖励后触发的事件)
- PreRewardReceiveEvent(收到奖励前触发的事件,可取消)
每个模块的事件都有平台前缀,例如:
BukkitPreRewardReceiveEvent。
UserService
UserService 类允许对用户进行操作,包括离线用户。
它赋予你管理用户的完全自由。
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
此对象允许你向 API 发送查询,并接收响应以指示玩家是否在我们的服务器上对该列表进行了投票。
要检查用户今天是否已领取奖励,你需要将延迟时间与来自 UserService 对象的当前时间进行比较。
或者,你也可以设置自己的延迟时间——由你决定!
? 项目状态
你是这个资源的作者?登录后可认领此资源。
相似资源
自定义你的Minecraft头像!
一个高度兼容、功能完善且稳定的 TPA 模组
专为 Velocity 打造的自制聊天插件,功能丰富——支持跨服群组/全局/私聊消息,并集成 LibertyBans 的禁言功能。
允许基岩版(Geyser)玩家使用自定义铁砧和锻造台配方。
Vault2.0 是什么? Vault2.0 是一个经济插件,它注册了一个兼容 Vault API 的 Bukkit Economy 服务,允许其他插件(商店、等级等)使用货币而无需依赖原始的 Vault.jar。它包含菜单、支付/收费流程
适用于服务器全面模组管控与自动化公平游戏的终极一站式安全套件。
评论 0
登录后参与评分
还没有评论,来抢沙发吧