Package com.nexomc.nexo.utils
Object BlockHelpers
-
- All Implemented Interfaces:
public class BlockHelpers
-
-
Field Summary
Fields Modifier and Type Field Description private final PersistentDataContainerpersistentDataContainerpublic final static ObjectOpenHashSet<Material>REPLACEABLE_BLOCKSprivate final BooleanisLoadedpublic final static BlockHelpersINSTANCE
-
Method Summary
Modifier and Type Method Description final static BlockentityStandingOn(Entity entity)Returns the block the entity is standing on.<br></br> Mainly to handle cases where player is on the edge of a block, with AIR below them final static UnitplayCustomBlockSound(Location location, String sound, Float volume, Float pitch)final static UnitplayCustomBlockSound(Location location, String sound, SoundCategory category, Float volume, Float pitch)final static LocationtoCenterBlockLocation(Location location)final static BooleanisStandingInside(Player player, Block block)final static BooleanisReplaceable(Block block, UUID excludeUUID)final static BooleanisReplaceable(Position position, World world, UUID excludeUUID)final static BooleanisReplaceable(Material material)final static BooleanisInteractable(Block placedAgainst, Player player)Improved version of Material.isInteractable intended for replicating vanilla behavior. final PersistentDataContainergetPersistentDataContainer(Block $self)final BooleanisLoaded(Location $self)-
-
Method Detail
-
entityStandingOn
final static Block entityStandingOn(Entity entity)
Returns the block the entity is standing on.<br></br> Mainly to handle cases where player is on the edge of a block, with AIR below them
-
playCustomBlockSound
final static Unit playCustomBlockSound(Location location, String sound, Float volume, Float pitch)
-
playCustomBlockSound
final static Unit playCustomBlockSound(Location location, String sound, SoundCategory category, Float volume, Float pitch)
-
toCenterBlockLocation
final static Location toCenterBlockLocation(Location location)
-
isStandingInside
final static Boolean isStandingInside(Player player, Block block)
-
isReplaceable
final static Boolean isReplaceable(Block block, UUID excludeUUID)
-
isReplaceable
final static Boolean isReplaceable(Position position, World world, UUID excludeUUID)
-
isReplaceable
final static Boolean isReplaceable(Material material)
-
isInteractable
final static Boolean isInteractable(Block placedAgainst, Player player)
Improved version of Material.isInteractable intended for replicating vanilla behavior. Checks if the block one places against is interactable in the sense a chest is Also checks if the block is a Nexo block or not as NoteBlocks are Interacable
-
getPersistentDataContainer
final PersistentDataContainer getPersistentDataContainer(Block $self)
-
-
-
-