Interface CustomBlock.Handler
- Enclosing interface:
CustomBlock
public static interface CustomBlock.Handler
The handler for custom SpecialBlocks (
CustomBlock
)-
Method Summary
Modifier and TypeMethodDescriptionThe plugin that created this handlervoid
load
(CustomBlock block, com.google.gson.JsonObject object) You may use the storage feature of the plugin.
This method is getting called when the data is getting loaded.
Load stuff from the JsonObject into the given blockvoid
onInteract
(CustomBlock block, Player player, PlayerInteractEvent parentEvent) A player may interact with the block.void
save
(CustomBlock block, com.google.gson.JsonObject object) You may use the storage feature of the plugin.
This method is getting called when the data is getting stored.
Load stuff from the given block into the JsonObjectvoid
update
(CustomBlock block) Apply stuff to the real world.
-
Method Details
-
getPlugin
Plugin getPlugin()The plugin that created this handler- Returns:
- The plugin that created it
-
update
Apply stuff to the real world.E.g. when you're displaying info stats on a sign then this method shall update the lines on the sign. The plugin does NOT automatically call this method automatically. Use
SpecialBlock.update()
to update it manually- Parameters:
block
- The block on which the update is being called
-
onInteract
A player may interact with the block. This is getting called at the same moment as Bukkit callsPlayerInteractEvent
- Parameters:
block
- The block that's getting interactedplayer
- The player who interacts with the blockparentEvent
- The event that was used to detect it
-
load
You may use the storage feature of the plugin.
This method is getting called when the data is getting loaded.
Load stuff from the JsonObject into the given block- Parameters:
block
- The block to which you shall load the dataobject
- The data that was stored
-
save
You may use the storage feature of the plugin.
This method is getting called when the data is getting stored.
Load stuff from the given block into the JsonObject- Parameters:
block
- The block from which you shall obtain the dataobject
- The data that will be stored
-