Class WorldBorder
java.lang.Object
org.geysermc.geyser.session.cache.WorldBorder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoved the X collision and Z collision entity from cache if needed.org.cloudburstmc.math.vector.Vector3dcorrectMovement(BoundingBox boundingBox, org.cloudburstmc.math.vector.Vector3d movement) Adjusts the movement of an entity so that it does not cross the world border.voidcreateMoving(double from, double to, long lerpDuration) voidcreateStatic(double size) voiddrawWall()Draws a wall of particles where the world border residesbooleanbooleanbooleanisInsideBorderBoundaries(org.cloudburstmc.math.vector.Vector3f position) booleanbooleanisPassingIntoBorderBoundaries(org.cloudburstmc.math.vector.Vector3f newEntityPosition) Check if the player is passing into the border, mostly meant for vehicles where the collision hacks don't work.booleanbooleanSame asisInsideBorderBoundaries()but using the warning boundaries.voidsetAbsoluteMaxSize(int absoluteMaxSize) The world border cannot go beyond this number, positive or negative, in world coordinatesvoidsetCenter(@NonNull org.cloudburstmc.math.vector.Vector2d center) voidsetFrom(double from) The diameter the current moving target came fromvoidsetResizing(boolean resizing) voidsetTo(double to) The target diametervoidsetWarningBlocks(int warningBlocks) Block length before you reach the border to show warning particles.voidsetWarningDelay(int warningDelay) voidspawnOrMoveBorderCollision(org.cloudburstmc.math.vector.Vector3f playerPosition) Spawn and move the border (entity) according the player position so that the player able to collide with it.voidstopResize(double newSize) voidtick()voidupdate()Updates the world border's minimum and maximum properties
-
Constructor Details
-
WorldBorder
-
-
Method Details
-
isInsideBorderBoundaries
public boolean isInsideBorderBoundaries()- Returns:
- true as long as the player entity is within the world limits.
-
isInsideBorderBoundaries
public boolean isInsideBorderBoundaries(org.cloudburstmc.math.vector.Vector3f position) -
isInsideBorderZone
public boolean isInsideBorderZone()- Returns:
- if the player is inside or close to the border, but not beyond it, use to determine whether the player should be able to collide with the border.
-
isCloseToBorderBoundaries
public boolean isCloseToBorderBoundaries()- Returns:
- if the player is close to the border boundaries. Used to always indicate a border even if there is no warning blocks set and spawn collision entities.
-
isWithinWarningBoundaries
public boolean isWithinWarningBoundaries()Same asisInsideBorderBoundaries()but using the warning boundaries.- Returns:
- true as long the entity is within the world limits and not in the warning zone at the edge to the border.
-
isPassingIntoBorderBoundaries
public boolean isPassingIntoBorderBoundaries(org.cloudburstmc.math.vector.Vector3f newEntityPosition) Check if the player is passing into the border, mostly meant for vehicles where the collision hacks don't work. -
correctMovement
public org.cloudburstmc.math.vector.Vector3d correctMovement(BoundingBox boundingBox, org.cloudburstmc.math.vector.Vector3d movement) Adjusts the movement of an entity so that it does not cross the world border.- Parameters:
boundingBox- bounding box of the entitymovement- movement of the entity- Returns:
- the corrected movement
-
update
public void update()Updates the world border's minimum and maximum properties -
tick
public void tick() -
createStatic
public void createStatic(double size) -
stopResize
public void stopResize(double newSize) -
createMoving
public void createMoving(double from, double to, long lerpDuration) -
drawWall
public void drawWall()Draws a wall of particles where the world border resides -
clearCollision
public void clearCollision()Removed the X collision and Z collision entity from cache if needed. -
spawnOrMoveBorderCollision
public void spawnOrMoveBorderCollision(org.cloudburstmc.math.vector.Vector3f playerPosition) Spawn and move the border (entity) according the player position so that the player able to collide with it. -
setCenter
public void setCenter(@NonNull org.cloudburstmc.math.vector.Vector2d center) -
setTo
public void setTo(double to) The target diameter -
setFrom
public void setFrom(double from) The diameter the current moving target came from -
setWarningBlocks
public void setWarningBlocks(int warningBlocks) Block length before you reach the border to show warning particles. -
setWarningDelay
public void setWarningDelay(int warningDelay) -
setAbsoluteMaxSize
public void setAbsoluteMaxSize(int absoluteMaxSize) The world border cannot go beyond this number, positive or negative, in world coordinates -
setResizing
public void setResizing(boolean resizing) -
isResizing
public boolean isResizing()
-