Class PistonCache

java.lang.Object
org.geysermc.geyser.session.cache.PistonCache

public class PistonCache extends Object
  • Constructor Details

  • Method Details

    • tick

      public void tick()
    • displacePlayer

      public void displacePlayer(com.nukkitx.math.vector.Vector3d displacement)
      Add to the player's displacement and move the player's bounding box The total displacement is capped to a range of -0.51 to 0.51 per tick
      Parameters:
      displacement - The displacement to apply to the player's bounding box
    • computeCollisionOffset

      public double computeCollisionOffset(com.nukkitx.math.vector.Vector3i blockPos, BoundingBox boundingBox, Axis axis, double offset)
      Parameters:
      blockPos - The block position to test
      boundingBox - The bounding box that moves
      axis - The axis to apply the offset
      offset - The current maximum distance the bounding box can travel
      Returns:
      The new maximum distance the bounding box can travel without colliding with the tested moving block
    • checkCollision

      public boolean checkCollision(com.nukkitx.math.vector.Vector3i blockPos, BoundingBox boundingBox)
    • clear

      public void clear()
    • getPistons

      public Map<com.nukkitx.math.vector.Vector3i,​PistonBlockEntity> getPistons()
      Maps the position of a piston to its block entity
    • getMovingBlocksMap

      public Map<com.nukkitx.math.vector.Vector3i,​PistonBlockEntity> getMovingBlocksMap()
      Maps the position of a moving block to the piston moving it Positions in this map represent the starting position of the block
    • getPlayerDisplacement

      public com.nukkitx.math.vector.Vector3d getPlayerDisplacement()
    • getPlayerMotion

      public com.nukkitx.math.vector.Vector3f getPlayerMotion()
    • isPlayerCollided

      public boolean isPlayerCollided()
      Stores whether a player has/will collide with any moving blocks.
    • isPlayerSlimeCollision

      public boolean isPlayerSlimeCollision()
      Stores whether a player has/will collide with any slime blocks. This is used to prevent movement from being corrected when players are about to hit a slime block.
    • isPlayerAttachedToHoney

      public boolean isPlayerAttachedToHoney()
      Stores whether a player is standing on a honey block. This is used to ignore movement from Bedrock to prevent them from falling off.
    • setPlayerMotion

      public void setPlayerMotion(com.nukkitx.math.vector.Vector3f playerMotion)
    • setPlayerCollided

      public void setPlayerCollided(boolean playerCollided)
      Stores whether a player has/will collide with any moving blocks.
    • setPlayerSlimeCollision

      public void setPlayerSlimeCollision(boolean playerSlimeCollision)
      Stores whether a player has/will collide with any slime blocks. This is used to prevent movement from being corrected when players are about to hit a slime block.
    • setPlayerAttachedToHoney

      public void setPlayerAttachedToHoney(boolean playerAttachedToHoney)
      Stores whether a player is standing on a honey block. This is used to ignore movement from Bedrock to prevent them from falling off.