Package com.nexomc.nexo.utils
Object BlockHelpers
-
- All Implemented Interfaces:
public class BlockHelpers
-
-
Field Summary
Fields Modifier and Type Field Description private final PersistentDataContainer
persistentDataContainer
public final static ObjectOpenHashSet<Material>
REPLACEABLE_BLOCKS
private final Boolean
isLoaded
public final static BlockHelpers
INSTANCE
-
Method Summary
Modifier and Type Method Description 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 final static Unit
playCustomBlockSound(Location location, String sound, Float volume, Float pitch)
final static Unit
playCustomBlockSound(Location location, String sound, SoundCategory category, Float volume, Float pitch)
final static Location
toCenterBlockLocation(Location location)
final static Boolean
isStandingInside(Player player, Block block)
final static Boolean
isReplaceable(Block block, UUID excludeUUID)
final static Boolean
isReplaceable(Position position, World world, UUID excludeUUID)
final static Boolean
isReplaceable(Material material)
final static Boolean
isInteractable(Block placedAgainst, Player player)
Improved version of Material.isInteractable intended for replicating vanilla behavior. final PersistentDataContainer
getPersistentDataContainer(Block $self)
final Boolean
isLoaded(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)
-
-
-
-