Class PistonCache
java.lang.Object
org.geysermc.geyser.session.cache.PistonCache
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkCollision(com.nukkitx.math.vector.Vector3i blockPos, BoundingBox boundingBox)
void
clear()
double
computeCollisionOffset(com.nukkitx.math.vector.Vector3i blockPos, BoundingBox boundingBox, Axis axis, double offset)
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 tickMap<com.nukkitx.math.vector.Vector3i,PistonBlockEntity>
Maps the position of a moving block to the piston moving it Positions in this map represent the starting position of the blockMap<com.nukkitx.math.vector.Vector3i,PistonBlockEntity>
Maps the position of a piston to its block entitycom.nukkitx.math.vector.Vector3d
com.nukkitx.math.vector.Vector3f
boolean
Stores whether a player is standing on a honey block.boolean
Stores whether a player has/will collide with any moving blocks.boolean
Stores whether a player has/will collide with any slime blocks.void
setPlayerAttachedToHoney(boolean playerAttachedToHoney)
Stores whether a player is standing on a honey block.void
setPlayerCollided(boolean playerCollided)
Stores whether a player has/will collide with any moving blocks.void
setPlayerMotion(com.nukkitx.math.vector.Vector3f playerMotion)
void
setPlayerSlimeCollision(boolean playerSlimeCollision)
Stores whether a player has/will collide with any slime blocks.void
tick()
-
Constructor Details
-
PistonCache
-
-
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 testboundingBox
- The bounding box that movesaxis
- The axis to apply the offsetoffset
- 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
-
clear
public void clear() -
getPistons
Maps the position of a piston to its block entity -
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.
-