ProtectorAPI
PluginGPL-3.0-only

ProtectorAPI

An API aims to provide a standard protection API.

122
Downloads
0
Followers
2 months ago
Updated
📦
6
Versions

📖About ProtectorAPI

ProtectorAPI

An API try to provide a standard protection API.

What can it do?

  1. Get the protection range that protected by protection plugin
  2. Check player can place/break/interact the block
  3. Register flags easily
  4. You don't need to worry about multiple protection plugins in the server, ProtectorAPI handles it perfectly.

Supported Plugins

  1. Residence
  2. Dominion
  3. HuskClaims (since v1.0.3)
  4. PlotSquared
  5. WorldGuard
  6. RedProtect
  7. BentoBox
  8. BlockLocker
  9. Bolt
  10. ChestProtection
  11. ChestShop (since v1.0.2)
  12. FactionsUUID (since v1.0.3)
  13. FunnyGuilds (since v1.0.3)
  14. GriefPrevention (since v1.0.6)
  15. HuskTowns (since v1.0.6)
  16. Lands
  17. LockettePro (since v1.0.1)
  18. LWC (LWCX)
  19. NoBuildPlus (since v1.0.7)
  20. QuickShop-Reremake
  21. QuickShop-Hikari
  22. ShopChest
  23. Towny

Usage

See https://lijinhong11.gitbook.io/protectorapi/start/readme

Develop

See https://lijinhong11.gitbook.io/protectorapi/develop/setup
Javadocs: https://javadoc.io/doc/io.github.lijinhong11/protectorapi-api/latest

Develop Examples

Check whether a player can place

Player player = ...;

boolean allow = ProtectorAPI.allowPlace(player);

If you need to check wehether a player can place a block at a location (safer than previous method):

Player player = ...;
Block block = ...;

boolean allow = ProtectorAPI.allowPlace(player, block);

Check whether a player can break

Player player = ...;

boolean allow = ProtectorAPI.allowBreak(player);

If you need to check whether a player can break a block at a location (safer than previous method):

Player player = ...;
Block block = ...;

boolean allow = ProtectorAPI.allowBreak(player, block);

Check whether a player can interact

NOTE: RedProtect didn't have a more general interaction flag, so we uses "redstone" flag to check instead.

Player player = ...;

boolean allow = ProtectorAPI.allowInteract(player);

If you need to whether a player can interact block at a location (safer than previous method):

Player player = ...;
Block block = ...;

boolean allow = ProtectorAPI.allowInteract(player, block);