Package org.geysermc.geyser.util
Class BlockUtils
java.lang.Object
org.geysermc.geyser.util.BlockUtils
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic com.github.steveice10.mc.protocol.data.game.entity.metadata.PositionA static constant ofPositionwith all values being zero.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic com.nukkitx.math.vector.Vector3igetBlockPosition(com.nukkitx.math.vector.Vector3i blockPos, int face)Given a position, return the position if a block were located on the specified block face.static doublegetBreakTime(GeyserSession session, BlockMapping blockMapping, ItemMapping item, com.github.steveice10.opennbt.tag.builtin.CompoundTag nbtData, boolean isSessionPlayer)static StringgetCleanIdentifier(String fullJavaIdentifier)Taking in a complete Java block state identifier, output just the block ID of this block state without the states.static BlockCollisiongetCollision(int blockId)static BlockCollisiongetCollisionAt(GeyserSession session, int x, int y, int z)static BlockCollisiongetCollisionAt(GeyserSession session, com.nukkitx.math.vector.Vector3i blockPos)static doublegetSessionBreakTime(GeyserSession session, BlockMapping blockMapping)
- 
Field Details- 
POSITION_ZEROpublic static final com.github.steveice10.mc.protocol.data.game.entity.metadata.Position POSITION_ZEROA static constant ofPositionwith all values being zero.
 
- 
- 
Constructor Details- 
BlockUtilspublic BlockUtils()
 
- 
- 
Method Details- 
getBreakTimepublic static double getBreakTime(GeyserSession session, BlockMapping blockMapping, ItemMapping item, com.github.steveice10.opennbt.tag.builtin.CompoundTag nbtData, boolean isSessionPlayer)
- 
getSessionBreakTime
- 
getBlockPositionpublic static com.nukkitx.math.vector.Vector3i getBlockPosition(com.nukkitx.math.vector.Vector3i blockPos, int face)Given a position, return the position if a block were located on the specified block face.- Parameters:
- blockPos- the block position
- face- the face of the block - see- Direction
- Returns:
- the block position with the block face accounted for
 
- 
getCleanIdentifierTaking in a complete Java block state identifier, output just the block ID of this block state without the states. Examples: minecraft:oak_log[axis=x] = minecraft:oak_log minecraft:stone_brick_wall[east=low,north=tall,south=none,up=true,waterlogged=false,west=tall] = minecraft:stone_brick_wall minecraft:stone = minecraft:stone- Parameters:
- fullJavaIdentifier- a full Java block identifier, with possible block states.
- Returns:
- a clean identifier in the format of minecraft:block
 
- 
getCollision
- 
getCollisionAtpublic static BlockCollision getCollisionAt(GeyserSession session, com.nukkitx.math.vector.Vector3i blockPos)
- 
getCollisionAt
 
-