Interface CustomBlock
- All Superinterfaces:
Metadatable
,PersistentStorage.Holder
,SpecialBlock
A type created for devs being able to create custom blocks with custom handler
Use
SpecialBlockAddEvent
if you're looking to remove it when you think that the conditions aren't met
(like when e.g. the material of the block isn't the needed one)-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The handler for custom SpecialBlocks (CustomBlock
) -
Method Summary
Modifier and TypeMethodDescriptionReturns the handler of this CustomBlock.getId()
Returns the type id of this custom block.
A plugin might have custom blocks but it's also important to be able to distinguish themdefault boolean
Returns if a handler has been set for this block withsetHandler(Handler)
void
setHandler
(CustomBlock.Handler handler) Set the handler of this CustomBlock.void
Set the type id of this custom block.
A plugin might have custom blocks but it's also important to be able to distinguish themMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface de.marcely.bedwars.tools.PersistentStorage.Holder
getPersistentStorage
Methods inherited from interface de.marcely.bedwars.api.world.block.SpecialBlock
asBukkit, asBukkitAsync, exists, getType, getWorld, getX, getY, getZ, onInteract, remove, update
-
Method Details
-
getId
String getId()Returns the type id of this custom block.
A plugin might have custom blocks but it's also important to be able to distinguish them- Returns:
- The type id of this custom block
-
setId
Set the type id of this custom block.
A plugin might have custom blocks but it's also important to be able to distinguish them- Parameters:
id
- The new type id
-
getHandler
Returns the handler of this CustomBlock. The handler is responsible for adding live to the block- Returns:
- The set handler.
null
whenhasHandler()
returns false
-
setHandler
Set the handler of this CustomBlock. The handler is responsible for adding live to the block- Parameters:
handler
- The new handler.null
to remove the handler
-
hasHandler
default boolean hasHandler()Returns if a handler has been set for this block withsetHandler(Handler)
- Returns:
- If a handler has been set
-