Package org.geysermc.geyser.level.block
Class BlockStateValues
java.lang.Object
org.geysermc.geyser.level.block.BlockStateValues
Used for block entities if the Java block state contains Bedrock block information.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanPistonDestroyBlock(BlockState state) static booleancanPistonMoveBlock(BlockState state, boolean isPushing) static FluidgetFluid(int state) Get the type of fluid from the block state, including waterlogged blocks.static doublegetLavaHeight(int state) Get the height of lava from the block statestatic intgetLavaLevel(int state) Get the level of lava from the block state.static floatgetSlipperiness(BlockState state) Get the slipperiness of a block.static doublegetWaterHeight(int state) Get the height of water from the block state This is used in FishingHookEntity to create splash sounds when the hook hits the water.static intgetWaterLevel(int state) Get the level of water from the block state.static booleanisBlockAttached(BlockState stateA, BlockState stateB) Check if two blocks are attached to each other.static booleanisBlockSticky(BlockState state) Checks if a block sticks to other blocks (Slime and honey blocks)
-
Field Details
-
NUM_FLUID_LEVELS
public static final int NUM_FLUID_LEVELS- See Also:
-
-
Method Details
-
isBlockSticky
Checks if a block sticks to other blocks (Slime and honey blocks)- Parameters:
state- The block state- Returns:
- True if the block sticks to adjacent blocks
-
isBlockAttached
Check if two blocks are attached to each other.- Parameters:
stateA- The block state of block astateB- The block state of block b- Returns:
- True if the blocks are attached to each other
-
canPistonDestroyBlock
- Parameters:
state- The block state of the block- Returns:
- true if a piston can break the block
-
canPistonMoveBlock
-
getFluid
Get the type of fluid from the block state, including waterlogged blocks.- Parameters:
state- BlockState of the block- Returns:
- The type of fluid
-
getWaterLevel
public static int getWaterLevel(int state) Get the level of water from the block state.- Parameters:
state- BlockState of the block- Returns:
- The water level or -1 if the block isn't water
-
getWaterHeight
public static double getWaterHeight(int state) Get the height of water from the block state This is used in FishingHookEntity to create splash sounds when the hook hits the water. In addition, CollisionManager uses this to determine if the player's eyes are in water.- Parameters:
state- BlockState of the block- Returns:
- The water height or -1 if the block does not contain water
-
getLavaLevel
public static int getLavaLevel(int state) Get the level of lava from the block state.- Parameters:
state- BlockState of the block- Returns:
- The lava level or -1 if the block isn't lava
-
getLavaHeight
public static double getLavaHeight(int state) Get the height of lava from the block state- Parameters:
state- BlockState of the block- Returns:
- The lava height or -1 if the block does not contain lava
-
getSlipperiness
Get the slipperiness of a block. This is used in ItemEntity to calculate the friction on an item as it slides across the ground- Parameters:
state- BlockState of the block- Returns:
- The block's slipperiness
-