public class CollisionManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
COLLISION_TOLERANCE
Additional space where blocks are checked, which is helpful for fixing NoCheatPlus's Passable check.
|
| Constructor and Description |
|---|
CollisionManager(GeyserSession session) |
| Modifier and Type | Method and Description |
|---|---|
com.nukkitx.math.vector.Vector3d |
adjustBedrockPosition(com.nukkitx.math.vector.Vector3f bedrockPosition,
boolean onGround)
Adjust the Bedrock position before sending to the Java server to account for inaccuracies in movement between
the two versions.
|
boolean |
correctPlayerPosition()
Returns false if the movement is invalid, and in this case it shouldn't be sent to the server and should be
cancelled
See
BlockCollision.correctPosition(GeyserSession, BoundingBox) for more info |
List<com.nukkitx.math.vector.Vector3i> |
getCollidableBlocks(BoundingBox box) |
List<com.nukkitx.math.vector.Vector3i> |
getPlayerCollidableBlocks() |
boolean |
isPlayerInWater() |
boolean |
isUnderSlab() |
void |
recalculatePosition() |
void |
updatePlayerBoundingBox()
Updates the stored bounding box without passing a position, which currently just changes the height depending on if the player is sneaking.
|
void |
updatePlayerBoundingBox(com.nukkitx.math.vector.Vector3d position)
Updates the stored bounding box
|
void |
updatePlayerBoundingBox(com.nukkitx.math.vector.Vector3f position)
Updates the stored bounding box
|
void |
updateScaffoldingFlags(boolean updateMetadata)
Updates scaffolding entity flags
Scaffolding needs to be checked per-move since it's a flag in Bedrock but Java does it client-side
|
public static final double COLLISION_TOLERANCE
public CollisionManager(GeyserSession session)
public void updatePlayerBoundingBox(com.nukkitx.math.vector.Vector3f position)
position - The new position of the playerpublic void updatePlayerBoundingBox(com.nukkitx.math.vector.Vector3d position)
position - The new position of the playerpublic void updatePlayerBoundingBox()
public com.nukkitx.math.vector.Vector3d adjustBedrockPosition(com.nukkitx.math.vector.Vector3f bedrockPosition,
boolean onGround)
bedrockPosition - the current Bedrock position of the clientonGround - whether the Bedrock player is on the groundpublic void recalculatePosition()
public List<com.nukkitx.math.vector.Vector3i> getCollidableBlocks(BoundingBox box)
public List<com.nukkitx.math.vector.Vector3i> getPlayerCollidableBlocks()
public boolean correctPlayerPosition()
BlockCollision.correctPosition(GeyserSession, BoundingBox) for more infopublic boolean isUnderSlab()
public boolean isPlayerInWater()
public void updateScaffoldingFlags(boolean updateMetadata)
updateMetadata - whether we should update metadata if something changedCopyright © 2021 GeyserMC. All rights reserved.