Package org.geysermc.geyser.util
Class BlockUtils
java.lang.Object
org.geysermc.geyser.util.BlockUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatgetBlockMiningProgressPerTick(GeyserSession session, Block block, GeyserItemStack itemInHand) Returns the total mining progress added by mining the block in a single tickstatic org.cloudburstmc.math.vector.Vector3igetBlockPosition(org.cloudburstmc.math.vector.Vector3i blockPos, int face) Given a position, return the position if a block were located on the specified block face.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, org.cloudburstmc.math.vector.Vector3i blockPos) static doublegetSessionBreakTimeTicks(GeyserSession session, Block block)
-
Method Details
-
getBlockMiningProgressPerTick
public static float getBlockMiningProgressPerTick(GeyserSession session, Block block, GeyserItemStack itemInHand) Returns the total mining progress added by mining the block in a single tick- Returns:
- the mining progress added by this tick.
-
getSessionBreakTimeTicks
-
getBlockPosition
public static org.cloudburstmc.math.vector.Vector3i getBlockPosition(org.cloudburstmc.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 positionface- the face of the block - seeDirection- Returns:
- the block position with the block face accounted for
-
getCleanIdentifier
Taking 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
-
getCollisionAt
public static BlockCollision getCollisionAt(GeyserSession session, org.cloudburstmc.math.vector.Vector3i blockPos)
-