An API aims to provide a standard protection API.
An API try to provide a standard protection API.
See https://lijinhong11.gitbook.io/protectorapi/start/readme
See https://lijinhong11.gitbook.io/protectorapi/develop/setup
Javadocs: https://javadoc.io/doc/io.github.lijinhong11/protectorapi-api/latest
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);
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);
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);