Class BlockHandlerResolver

java.lang.Object
org.sgrewritten.stargate.api.BlockHandlerResolver

public class BlockHandlerResolver extends Object
  • Constructor Details

    • BlockHandlerResolver

      public BlockHandlerResolver(@NotNull @NotNull StorageAPI storageAPI)
  • Method Details

    • addBlockHandlerInterface

      public void addBlockHandlerInterface(@NotNull @NotNull BlockHandlerInterface blockHandlerInterface)
      Add a listener for block placement next by a portal
      Parameters:
      blockHandlerInterface - A listener for block placement next by a portal
      Throws:
      IllegalStateException -

      If the flag of the BlockHandlerInterface has not been registered

    • removeBlockHandlerInterface

      public void removeBlockHandlerInterface(BlockHandlerInterface blockHandlerInterface)
      Remove a listener for block placement next by a portal
      Parameters:
      blockHandlerInterface - listener for block placement next by a portal
    • removeBlockHandlerInterfaces

      public void removeBlockHandlerInterfaces(org.bukkit.plugin.Plugin plugin)
      Remove all listeners for block placement next by a portal
      Parameters:
      plugin - The plugin to remove listeners from
    • registerPlacement

      public void registerPlacement(@NotNull @NotNull RegistryAPI registry, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull List<RealPortal> portals, @NotNull @NotNull org.bukkit.Material material, org.bukkit.OfflinePlayer player)
      Parameters:
      location - The location of the block that is being placed
      portals - The portal to try registration on
      material - The material of the block
      player - The player that placed the block
    • registerRemoval

      public void registerRemoval(RegistryAPI registry, org.bukkit.Location location, RealPortal portal)
      Parameters:
      location - The location of the block that is being removed
      portal - The portal to try removal on
    • hasRegisteredBlockHandler

      public boolean hasRegisteredBlockHandler(org.bukkit.Material material)
      Method used for performance
      Parameters:
      material - The material
      Returns:
      Whether there exists a BlockHandlerInterface that has registered for the material
    • registerCustomFlag

      public void registerCustomFlag(char flagCharacter) throws IllegalArgumentException
      Register a custom flag to stargate.
      Parameters:
      flagCharacter -

      The character of the custom flag

      Throws:
      IllegalArgumentException
    • hasRegisteredCustomFlag

      public boolean hasRegisteredCustomFlag(PortalFlag portalFlag)
      Parameters:
      portalFlag -

      The flag to check for

      Returns:

      True if the specified flag has been re