Package org.sgrewritten.stargate.api
Class BlockHandlerResolver
java.lang.Object
org.sgrewritten.stargate.api.BlockHandlerResolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlockHandlerInterface
(@NotNull BlockHandlerInterface blockHandlerInterface) Add a listener for block placement next by a portalboolean
hasRegisteredBlockHandler
(org.bukkit.Material material) Method used for performanceboolean
hasRegisteredCustomFlag
(PortalFlag portalFlag) void
registerCustomFlag
(char flagCharacter) Register a custom flag to stargate.void
registerPlacement
(@NotNull RegistryAPI registry, @NotNull org.bukkit.Location location, @NotNull List<RealPortal> portals, @NotNull org.bukkit.Material material, org.bukkit.OfflinePlayer player) void
registerRemoval
(RegistryAPI registry, org.bukkit.Location location, RealPortal portal) void
removeBlockHandlerInterface
(BlockHandlerInterface blockHandlerInterface) Remove a listener for block placement next by a portalvoid
removeBlockHandlerInterfaces
(org.bukkit.plugin.Plugin plugin) Remove all listeners for block placement next by a portal
-
Constructor Details
-
BlockHandlerResolver
-
-
Method Details
-
addBlockHandlerInterface
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
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 placedportals
- The portal to try registration onmaterial
- The material of the blockplayer
- The player that placed the block
-
registerRemoval
- Parameters:
location
- The location of the block that is being removedportal
- 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
Register a custom flag to stargate.- Parameters:
flagCharacter
-The character of the custom flag
- Throws:
IllegalArgumentException
-
hasRegisteredCustomFlag
- Parameters:
portalFlag
-The flag to check for
- Returns:
True if the specified flag has been re
-