Class WorldBorder
java.lang.Object
org.geysermc.geyser.session.cache.WorldBorder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawWall()
Draws a wall of particles where the world border residesboolean
boolean
isPassingIntoBorderBoundaries(com.nukkitx.math.vector.Vector3f newEntityPosition)
boolean
isPassingIntoBorderBoundaries(com.nukkitx.math.vector.Vector3f newPosition, boolean adjustPosition)
Confirms that the entity is within world border boundaries when they move.boolean
boolean
Same asisInsideBorderBoundaries()
but using the warning boundaries.static void
removeFog(GeyserSession session)
Clear any additional fog sent to the clientvoid
resize()
static void
sendFog(GeyserSession session, String... fogNameSpaces)
Send the following fog IDs to the clientvoid
setAbsoluteMaxSize(int absoluteMaxSize)
The world border cannot go beyond this number, positive or negative, in world coordinatesvoid
setCenter(com.nukkitx.math.vector.Vector2d center)
void
setNewDiameter(double newDiameter)
The diameter in blocks of the new world border.void
setOldDiameter(double oldDiameter)
The diameter in blocks of the world border before it got changed or similar to newDiameter if not changed.void
setResizing(boolean resizing)
void
setSpeed(long speed)
The speed to apply an expansion/shrinking of the world border.void
setWarningBlocks(int warningBlocks)
Block length before you reach the border to show warning particles.void
setWarningDelay(int warningDelay)
The time in seconds before a shrinking world border would hit a not moving player.void
setWorldCoordinateScale(double worldCoordinateScale)
void
update()
Updates the world border's minimum and maximum properties
-
Constructor Details
-
WorldBorder
-
-
Method Details
-
setWorldCoordinateScale
public void setWorldCoordinateScale(double worldCoordinateScale) -
isInsideBorderBoundaries
public boolean isInsideBorderBoundaries()- Returns:
- true as long the entity is within the world limits.
-
isPassingIntoBorderBoundaries
public boolean isPassingIntoBorderBoundaries(com.nukkitx.math.vector.Vector3f newPosition, boolean adjustPosition)Confirms that the entity is within world border boundaries when they move. Otherwise, ifadjustPosition
is true, this function will push the player back.- Returns:
- if this player was indeed against the world border. Will return false if no world border was defined for us.
-
isPassingIntoBorderBoundaries
public boolean isPassingIntoBorderBoundaries(com.nukkitx.math.vector.Vector3f newEntityPosition) -
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.
-
update
public void update()Updates the world border's minimum and maximum properties -
resize
public void resize() -
setResizing
public void setResizing(boolean resizing) -
drawWall
public void drawWall()Draws a wall of particles where the world border resides -
sendFog
Send the following fog IDs to the client -
removeFog
Clear any additional fog sent to the client -
setCenter
public void setCenter(@Nonnull com.nukkitx.math.vector.Vector2d center) -
setOldDiameter
public void setOldDiameter(double oldDiameter)The diameter in blocks of the world border before it got changed or similar to newDiameter if not changed. -
setNewDiameter
public void setNewDiameter(double newDiameter)The diameter in blocks of the new world border. -
setSpeed
public void setSpeed(long speed)The speed to apply an expansion/shrinking of the world border. When a client joins they get the actual border oldDiameter and the time left to reach the newDiameter. -
setWarningDelay
public void setWarningDelay(int warningDelay)The time in seconds before a shrinking world border would hit a not moving player. Creates the same visual warning effect as warningBlocks. -
setWarningBlocks
public void setWarningBlocks(int warningBlocks)Block length before you reach the border to show warning particles. -
setAbsoluteMaxSize
public void setAbsoluteMaxSize(int absoluteMaxSize)The world border cannot go beyond this number, positive or negative, in world coordinates -
isResizing
public boolean isResizing()
-