Class WorldGuard7ProtectionHook
- All Implemented Interfaces:
IProtectionHookSpigot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanBreakBlock(org.bukkit.entity.Player player, org.bukkit.Location loc) Check if this compatibility hook allows a player to break blocks at a given location.canBreakBlocksInCuboid(org.bukkit.entity.Player player, org.bukkit.World world, Cuboid cuboid) Check if this compatibility hook allows a player to break blocks in a given cuboid.Get theProtectionHookContextthat is being used.preCheck(org.bukkit.entity.Player player, org.bukkit.World world) Method that runs before any other checks are done.preCheckAsync(org.bukkit.entity.Player player, org.bukkit.World world) Method that runs before any other checks are done.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IProtectionHookSpigot
getName, hasPermission, hasPermissionOffline, lazyFormatPlayerName
-
Constructor Details
-
WorldGuard7ProtectionHook
-
-
Method Details
-
preCheck
Description copied from interface:IProtectionHookSpigotMethod that runs before any other checks are done.The intention of this method is to allow for running quick checks that can prevent more expensive checks from being run.
This method is run on the main thread. If you need to run this method asynchronously, use
IProtectionHookSpigot.preCheckAsync(Player, World)instead.If the method returns
HookPreCheckResult.ALLOW, all further checks will be run as normal. This is the default behavior.- Specified by:
preCheckin interfaceIProtectionHookSpigot- Parameters:
player- The player to check.world- The world to check in.- Returns:
- True if the player is allowed to break blocks in the given world.
-
preCheckAsync
public CompletableFuture<HookPreCheckResult> preCheckAsync(org.bukkit.entity.Player player, org.bukkit.World world) Description copied from interface:IProtectionHookSpigotMethod that runs before any other checks are done.The intention of this method is to allow for running quick checks that can prevent more expensive checks from being run.
This method is run asynchronously. If you need to run this method on the main thread, use
IProtectionHookSpigot.preCheck(Player, World)instead.If the method returns
HookPreCheckResult.ALLOW, all further checks will be run as normal. This is the default behavior.- Specified by:
preCheckAsyncin interfaceIProtectionHookSpigot- Parameters:
player- The player to check.world- The world to check in.- Returns:
- True if the player is allowed to break blocks in the given world.
-
canBreakBlock
public CompletableFuture<Boolean> canBreakBlock(org.bukkit.entity.Player player, org.bukkit.Location loc) Description copied from interface:IProtectionHookSpigotCheck if this compatibility hook allows a player to break blocks at a given location.- Specified by:
canBreakBlockin interfaceIProtectionHookSpigot- Parameters:
player- The (fake) player to check.loc- The location to check.- Returns:
- True if the player is allowed to break blocks at the given location.
-
canBreakBlocksInCuboid
public CompletableFuture<Boolean> canBreakBlocksInCuboid(org.bukkit.entity.Player player, org.bukkit.World world, Cuboid cuboid) Description copied from interface:IProtectionHookSpigotCheck if this compatibility hook allows a player to break blocks in a given cuboid.- Specified by:
canBreakBlocksInCuboidin interfaceIProtectionHookSpigot- Parameters:
player- The (fake) player to check.world- The world to check in.cuboid- The cuboid to check.- Returns:
- True if the player is allowed to break all the blocks in the given cuboid.
-
getContext
Description copied from interface:IProtectionHookSpigotGet theProtectionHookContextthat is being used.- Specified by:
getContextin interfaceIProtectionHookSpigot- Returns:
- The
ProtectionHookContextthat is being used.
-