Package org.sgrewritten.stargate.api
Interface BlockHandlerInterface
public interface BlockHandlerInterface
-
Method Summary
Modifier and TypeMethodDescription@Nullable PortalFlag
getFlag()
@NotNull org.bukkit.Material
@NotNull PositionType
@NotNull org.bukkit.plugin.Plugin
@NotNull Priority
boolean
registerBlock
(org.bukkit.Location blockLocation, @Nullable org.bukkit.OfflinePlayer player, Portal portal, Metadata metaData) Called if a Stargate is created or a block is placed, and the result of getHandledMaterial matches with the detected locationvoid
unRegisterBlock
(org.bukkit.Location blockLocation, Portal portal) Called if a Stargate is removed, and the add-on has registered this location
-
Method Details
-
getInterfaceType
- Returns:
- The type of interface handled
-
getHandledMaterial
@NotNull @NotNull org.bukkit.Material getHandledMaterial()- Returns:
- The material relevant to this handler
-
getPlugin
@NotNull @NotNull org.bukkit.plugin.Plugin getPlugin()- Returns:
- The plugin linked to this blockHandlerInterface
-
getPriority
- Returns:
- The priority of this handler relative to other handlers
-
getFlag
- Returns:
- The flag related to this type of block interface
-
registerBlock
boolean registerBlock(org.bukkit.Location blockLocation, @Nullable @Nullable org.bukkit.OfflinePlayer player, Portal portal, Metadata metaData) Called if a Stargate is created or a block is placed, and the result of getHandledMaterial matches with the detected location
- Parameters:
blockLocation
- The location of the block that is placedplayer
- The player that placed the blockportal
- The affected portal- Returns:
- Whether to claim the block
-
unRegisterBlock
Called if a Stargate is removed, and the add-on has registered this location- Parameters:
blockLocation
- The location of the block that is removedportal
- The affected portal
-