Class BlockStateValues

java.lang.Object
org.geysermc.geyser.level.block.BlockStateValues

public final class BlockStateValues extends Object
Used for block entities if the Java block state contains Bedrock block information.
  • Field Details

  • Method Details

    • isBlockSticky

      public static boolean isBlockSticky(BlockState state)
      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

      public static boolean isBlockAttached(BlockState stateA, BlockState stateB)
      Check if two blocks are attached to each other.
      Parameters:
      stateA - The block state of block a
      stateB - The block state of block b
      Returns:
      True if the blocks are attached to each other
    • canPistonDestroyBlock

      public static boolean canPistonDestroyBlock(BlockState state)
      Parameters:
      state - The block state of the block
      Returns:
      true if a piston can break the block
    • canPistonMoveBlock

      public static boolean canPistonMoveBlock(BlockState state, boolean isPushing)
    • 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
    • getSlipperiness

      public static float getSlipperiness(BlockState state)
      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