Class ProtectorAPI
java.lang.Object
io.github.lijinhong11.protector.api.ProtectorAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallowBreak(org.bukkit.entity.Player player) Check if the player can break a blockstatic booleanallowBreak(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can break a blockstatic booleanallowInteract(org.bukkit.entity.Player player) Check if the player can interact with a blockstatic booleanallowInteract(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can interact with the blockstatic booleanallowPlace(org.bukkit.entity.Player player) Check if the player can place a blockstatic booleanallowPlace(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can place a blockstatic @Nullable IBlockProtectionModulefindBlockModule(org.bukkit.entity.Player p, org.bukkit.Location block) Find the block protection module that protects the blockstatic @Nullable IProtectionModulefindModule(org.bukkit.Location location) Find the protection module that protects the protection rangestatic ProtectionAPIPluginstatic booleanisEventFake(@NotNull org.bukkit.event.Event event) static voidregister(IBlockProtectionModule module) static voidregister(IProtectionModule module) static voidsetPluginHost(ProtectionAPIPlugin plugin)
-
Constructor Details
-
ProtectorAPI
public ProtectorAPI()
-
-
Method Details
-
register
-
register
-
setPluginHost
-
getPluginHost
-
findModule
Find the protection module that protects the protection range- Parameters:
location- the location in the protection range- Returns:
- the protection module
-
findBlockModule
@Nullable public static @Nullable IBlockProtectionModule findBlockModule(org.bukkit.entity.Player p, org.bukkit.Location block) Find the block protection module that protects the block- Parameters:
p- the playerblock- the block- Returns:
- the block protection module
-
isEventFake
public static boolean isEventFake(@NotNull @NotNull org.bukkit.event.Event event) -
allowBreak
public static boolean allowBreak(org.bukkit.entity.Player player) Check if the player can break a block- Parameters:
player- the player- Returns:
- true if the player can break a block, false otherwise
-
allowBreak
public static boolean allowBreak(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can break a block- Parameters:
player- the playerblock- the block- Returns:
- true if the player can break a block, false otherwise
-
allowPlace
public static boolean allowPlace(org.bukkit.entity.Player player) Check if the player can place a block- Parameters:
player- the player- Returns:
- true if the player can place a block, false otherwise
-
allowPlace
public static boolean allowPlace(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can place a block- Parameters:
player- the playerblock- the block- Returns:
- true if the player can place a block, false otherwise
-
allowInteract
public static boolean allowInteract(org.bukkit.entity.Player player) Check if the player can interact with a block- Parameters:
player- the player- Returns:
- true if the player can interact with a block
-
allowInteract
public static boolean allowInteract(org.bukkit.entity.Player player, org.bukkit.Location block) Check if the player can interact with the block- Parameters:
player- the playerblock- the block- Returns:
- true if the player can interact with the block
-