- 版权类型
- 原创
- 插件英文名称
- ProtectorAPI
- Plugin Name
- ProtectorAPI
- 支持的核心
- Spigot
- Paper
- Purpur
- PufferFish
- Folia
- 其他Spigot下游
- 其他Paper下游
- 资源语言
- 英语
- 支持版本(Java)
- 1.17
- 1.18
- 1.19
- 1.20
- 1.21
- 开源许可证
- GPL License 3.0
它能做什么?
- 获取由保护插件所保护的范围
- 检查玩家是否可以放置 / 破坏 / 交互方块
- 简单注册自定义标志(flags)
- 无需关心服务器上安装了多少种保护插件,ProtectorAPI 会自动处理兼容问题
已支持的插件
- Residence
- Dominion
- HuskClaims(自 v1.0.3 起支持)
- PlotSquared
- WorldGuard
- RedProtect
- BentoBox
- BlockLocker
- Bolt
- ChestProtection
- ChestShop(自 v1.0.2 起支持)
- FactionsUUID(自 v1.0.3 起支持)
- FunnyGuilds(自 v1.0.3 起支持)
- GriefPrevention(自 v1.0.6 起支持)
- HuskTowns(自 v1.0.6 起支持)
- Lands
- LockettePro(自 v1.0.1 起支持)
- LWC (LWCX)
- NoBuildPlus(自 v1.0.7 起支持)
- QuickShop-Reremake
- QuickShop-Hikari
- ShopChest
- Towny
使用方法
请看:https://lijinhong11.gitbook.io/protectorapi/start/readme开发文档
请看:https://lijinhong11.gitbook.io/protectorapi/develop/setupJavadocs: https://javadoc.io/doc/io.github.lijinhong11/protectorapi-api/latest
开发示例
检查玩家是否可以放置方块
Java:
Player player = ...;
boolean allow = ProtectorAPI.allowPlace(player);
Java:
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowPlace(player, block);
检查玩家是否可以破坏方块
Java:
[SIZE=4]Player player = ...;
boolean allow = ProtectorAPI.allowBreak(player);[/SIZE]
Java:
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowBreak(player, block);
检查玩家是否可以交互
注意:RedProtect 没有通用的交互标志,因此这里使用的是 "redstone" 标志进行检查。
Java:
Player player = ...;
boolean allow = ProtectorAPI.allowInteract(player);
Java:
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowInteract(player, block);