java.lang.Object
com.github.imdabigboss.easydatapack.api.utils.BlockUtil

public class BlockUtil extends Object
Some utilities for blocks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static @NonNull List<org.bukkit.Material>
    A list of the blocks that shouldn't be broken by the player in survival mode.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    breakBlock​(@NonNull org.bukkit.Server server, @NonNull org.bukkit.entity.Player player, @NonNull org.bukkit.block.Block block, @NonNull org.bukkit.inventory.ItemStack item)
    Breaks a block as if a player broke it: correct drops & event firing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNBREAKABLE_BLOCKS

      public static final @NonNull List<org.bukkit.Material> UNBREAKABLE_BLOCKS
      A list of the blocks that shouldn't be broken by the player in survival mode.
  • Constructor Details

    • BlockUtil

      public BlockUtil()
  • Method Details

    • breakBlock

      public static boolean breakBlock(@NonNull org.bukkit.Server server, @NonNull org.bukkit.entity.Player player, @NonNull org.bukkit.block.Block block, @NonNull org.bukkit.inventory.ItemStack item)
      Breaks a block as if a player broke it: correct drops & event firing.
      Parameters:
      server - the server
      player - the player
      block - the block to break
      item - the item used to break the block
      Returns:
      true if the block was broken, false otherwise