Class WorldGuard7ProtectionHook

java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.hooks.worldguard7.WorldGuard7ProtectionHook
All Implemented Interfaces:
IProtectionHookSpigot

public class WorldGuard7ProtectionHook extends Object implements IProtectionHookSpigot
Protection hook for WorldGuard 7.
  • Constructor Details

  • Method Details

    • preCheck

      public HookPreCheckResult preCheck(org.bukkit.entity.Player player, org.bukkit.World world)
      Description copied from interface: IProtectionHookSpigot
      Method 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:
      preCheck in interface IProtectionHookSpigot
      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: IProtectionHookSpigot
      Method 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:
      preCheckAsync in interface IProtectionHookSpigot
      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: IProtectionHookSpigot
      Check if this compatibility hook allows a player to break blocks at a given location.
      Specified by:
      canBreakBlock in interface IProtectionHookSpigot
      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: IProtectionHookSpigot
      Check if this compatibility hook allows a player to break blocks in a given cuboid.
      Specified by:
      canBreakBlocksInCuboid in interface IProtectionHookSpigot
      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

      public ProtectionHookContext getContext()
      Description copied from interface: IProtectionHookSpigot
      Get the ProtectionHookContext that is being used.
      Specified by:
      getContext in interface IProtectionHookSpigot
      Returns:
      The ProtectionHookContext that is being used.