Class BlockCollision

java.lang.Object
org.geysermc.geyser.translator.collision.BlockCollision
Direct Known Subclasses:
BellCollision, ChestCollision, ConduitCollision, DoorCollision, EndPortalCollision, GlassPaneAndIronBarsCollision, LanternCollision, OtherCollision, ScaffoldingCollision, SeaPickleCollision, SolidCollision, TrapdoorCollision

public class BlockCollision extends Object
  • Field Details

    • boundingBoxes

      protected final BoundingBox[] boundingBoxes
    • pushAwayTolerance

      protected final double pushAwayTolerance
      This is used to control the maximum distance a face of a bounding box can push the player away
      See Also:
  • Constructor Details

    • BlockCollision

      protected BlockCollision(BoundingBox[] boxes)
  • Method Details

    • correctPosition

      public void correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision)
      Silently move player bounding box/position out of block when needed to.
    • correctPosition

      protected void correctPosition(GeyserSession session, int x, int y, int z, BoundingBox blockCollision, BoundingBox playerCollision, double ulpX, double ulpZ)
    • pushUpForTeleport

      public double pushUpForTeleport()
      Returns:
      the distance to push the player up by, if they are on this block on Java, but "in" the block on Bedrock
    • checkIntersection

      public boolean checkIntersection(double x, double y, double z, BoundingBox playerCollision)
    • checkIntersection

      public boolean checkIntersection(org.cloudburstmc.math.vector.Vector3i position, BoundingBox playerCollision)
    • computeCollisionOffset

      public double computeCollisionOffset(double x, double y, double z, BoundingBox boundingBox, Axis axis, double offset)
    • isBelow

      public boolean isBelow(int blockY, BoundingBox boundingBox)
      Checks if this block collision is below the given bounding box.
      Parameters:
      blockY - the y position of the block in the world
      boundingBox - the bounding box to compare
      Returns:
      true if this block collision is below the bounding box
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getBoundingBoxes

      public BoundingBox[] getBoundingBoxes()