Class BlockCollision
java.lang.Object
org.geysermc.geyser.translator.collision.BlockCollision
- Direct Known Subclasses:
DirtPathCollision
,DoorCollision
,OtherCollision
,ScaffoldingCollision
,SnowCollision
,SolidCollision
,TrapdoorCollision
-
Field Summary
Modifier and TypeFieldDescriptionprotected BoundingBox[]
protected double
This is used to control the maximum distance a face of a bounding box can push the player awayprotected double
This is used for the step up logic. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeCorrectPosition(int x, int y, int z, BoundingBox playerCollision)
Overridden in classes like SnowCollision and GrassPathCollision when correction code needs to be run before the main correctionprotected boolean
boolean
checkIntersection(double x, double y, double z, BoundingBox playerCollision)
boolean
checkIntersection(com.nukkitx.math.vector.Vector3i position, BoundingBox playerCollision)
double
computeCollisionOffset(double x, double y, double z, BoundingBox boundingBox, Axis axis, double offset)
boolean
correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision)
Returns false if the movement is invalid, and in this case it shouldn't be sent to the server and should be cancelled While the Java server should do this, it could result in false flags by anticheat This functionality is currently only used in 6 or 7 layer snowboolean
int
hashCode()
-
Field Details
-
boundingBoxes
-
pushUpTolerance
protected double pushUpToleranceThis is used for the step up logic. Usually, the player can only step up a block if they are on the same Y level as its bottom face or higher For snow layers, due to its beforeCorrectPosition method the player can be slightly below (0.125 blocks) and still need to step up This used to be 0 but for now this has been set to 1 as it fixes bed collision I didn't just set it for beds because other collision may also be slightly raised off the ground. If this causes any problems, change this back to 0 and add an exception for beds. -
pushAwayTolerance
protected double pushAwayToleranceThis is used to control the maximum distance a face of a bounding box can push the player away
-
-
Constructor Details
-
BlockCollision
-
-
Method Details
-
beforeCorrectPosition
Overridden in classes like SnowCollision and GrassPathCollision when correction code needs to be run before the main correction -
correctPosition
public boolean correctPosition(GeyserSession session, int x, int y, int z, BoundingBox playerCollision)Returns false if the movement is invalid, and in this case it shouldn't be sent to the server and should be cancelled While the Java server should do this, it could result in false flags by anticheat This functionality is currently only used in 6 or 7 layer snow -
checkIntersection
-
checkIntersection
public boolean checkIntersection(com.nukkitx.math.vector.Vector3i position, BoundingBox playerCollision) -
computeCollisionOffset
public double computeCollisionOffset(double x, double y, double z, BoundingBox boundingBox, Axis axis, double offset) -
equals
-
canEqual
-
hashCode
public int hashCode() -
getBoundingBoxes
-