public class BlockCollision extends Object
| Modifier and Type | Field and Description |
|---|---|
protected BoundingBox[] |
boundingBoxes |
protected ThreadLocal<com.nukkitx.math.vector.Vector3i> |
position |
protected double |
pushAwayTolerance
This is used to control the maximum distance a face of a bounding box can push the player away
|
protected double |
pushUpTolerance
This is used for the step up logic.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BlockCollision(BoundingBox[] boxes) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeCorrectPosition(BoundingBox playerCollision)
Overridden in classes like SnowCollision and GrassPathCollision when correction code needs to be run before the
main correction
|
boolean |
checkIntersection(BoundingBox playerCollision) |
boolean |
correctPosition(GeyserSession session,
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
|
void |
setPosition(com.nukkitx.math.vector.Vector3i newPosition) |
protected final BoundingBox[] boundingBoxes
protected final ThreadLocal<com.nukkitx.math.vector.Vector3i> position
protected double pushUpTolerance
protected double pushAwayTolerance
protected BlockCollision(BoundingBox[] boxes)
public void setPosition(com.nukkitx.math.vector.Vector3i newPosition)
public void beforeCorrectPosition(BoundingBox playerCollision)
public boolean correctPosition(GeyserSession session, BoundingBox playerCollision)
public boolean checkIntersection(BoundingBox playerCollision)
Copyright © 2021 GeyserMC. All rights reserved.