Class BlockController

java.lang.Object
dev.piglin.piglinworldapi.block.BlockController
All Implemented Interfaces:
org.bukkit.event.Listener

public class BlockController extends Object implements org.bukkit.event.Listener
  • Constructor Details

    • BlockController

      @Deprecated public BlockController()
      Deprecated.
      Should be refactored to be private or package-private
  • Method Details

    • registerBlock

      public static void registerBlock(CustomBlock block)
      Parameters:
      block - The block to register
    • getBlocks

      public static List<org.bukkit.block.Block> getBlocks(Class<? extends CustomBlock> clazz)
      Parameters:
      clazz - Block type of blocks to return
      Returns:
      The blocks
    • clearBlocks

      public static void clearBlocks()
      Clears blocks cache (don't do this unless you really know what you're doing)
    • getAllBlocks

      public static com.google.common.collect.ImmutableMap<Class<? extends CustomBlock>,​List<org.bukkit.block.Block>> getAllBlocks()
      Returns:
      Map of all block types and corresponding mushroom blocks that are in loaded chunks
    • getMushroom

      public static Mushroom getMushroom(org.bukkit.block.Block block)
      Parameters:
      block - The block
      Returns:
      The block's Mushroom
    • getMushroom

      public static Mushroom getMushroom(org.bukkit.block.BlockState block)
      Parameters:
      block - The blockState
      Returns:
      The blockState's Mushroom
    • getCustomBlock

      public Optional<? extends CustomBlock> getCustomBlock(org.bukkit.block.Block block)
      Parameters:
      block - The block
      Returns:
      CustomBlock of this block, or empty if it's not a registered mushroom or not a mushroom at all
    • getCustomBlock

      public Optional<? extends CustomBlock> getCustomBlock(Mushroom mushroom)
      Parameters:
      mushroom - The mushroom
      Returns:
      CustomBlock of this mushroom, or empty if it's not a registered mushroom
    • onBreak

      public void onBreak(org.bukkit.event.block.BlockExplodeEvent event)
    • onBlockDrop

      public void onBlockDrop(org.bukkit.event.block.BlockDropItemEvent event)
    • onBlockDrop

      public void onBlockDrop(org.bukkit.event.block.BlockBreakEvent event)
    • onBlockPlace

      public void onBlockPlace(org.bukkit.event.block.BlockPlaceEvent event)
    • onInteract

      public void onInteract(org.bukkit.event.player.PlayerInteractEvent event)
    • onMiddleClickBlock

      public void onMiddleClickBlock(org.bukkit.event.inventory.InventoryCreativeEvent event)
    • onPhysics

      public void onPhysics(org.bukkit.event.block.BlockPhysicsEvent event)
    • loadChunk

      public void loadChunk(org.bukkit.ChunkSnapshot snapshot, int minHeight, int maxHeight)
    • unloadChunk

      public void unloadChunk(org.bukkit.Chunk chunk)
    • onChunkLoad

      public void onChunkLoad(org.bukkit.event.world.ChunkLoadEvent event)
    • onChunkUnload

      public void onChunkUnload(org.bukkit.event.world.ChunkUnloadEvent event)
    • onPistonMove

      public void onPistonMove(org.bukkit.event.block.BlockPistonExtendEvent event)
    • onPistonMove

      public void onPistonMove(org.bukkit.event.block.BlockPistonRetractEvent event)