Interface CustomBlock.Handler

Enclosing interface:
CustomBlock

public static interface CustomBlock.Handler
The handler for custom SpecialBlocks (CustomBlock)
  • Method Summary

    Modifier and Type
    Method
    Description
    The plugin that created this handler
    void
    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 block
    void
    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 JsonObject
    void
    Apply stuff to the real world.
  • Method Details

    • getPlugin

      Plugin getPlugin()
      The plugin that created this handler
      Returns:
      The plugin that created it
    • update

      void update(CustomBlock block)
      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

      void onInteract(CustomBlock block, Player player, PlayerInteractEvent parentEvent)
      A player may interact with the block. This is getting called at the same moment as Bukkit calls PlayerInteractEvent
      Parameters:
      block - The block that's getting interacted
      player - The player who interacts with the block
      parentEvent - The event that was used to detect it
    • load

      void 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 block
      Parameters:
      block - The block to which you shall load the data
      object - The data that was stored
    • save

      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 JsonObject
      Parameters:
      block - The block from which you shall obtain the data
      object - The data that will be stored