public interface WorldBorder
It can gradually grow or shrink to a radius over a period of time. A warning is displayed when a contracting world border will reach the player in a certain amount of time, or when the player is a certain number of blocks away.
In Minecraft, a warning is displayed in the form of a reddish tint.
Modifier and Type | Method and Description |
---|---|
com.flowpowered.math.vector.Vector3d |
getCenter()
Get the center of the world border.
|
double |
getDamageAmount()
Get the damage done to a player per block per tick when outside the
buffer.
|
double |
getDamageThreshold()
Get the distance a player may be outside the world border before
taking damage.
|
double |
getDiameter()
Get the diameter of the world border.
|
double |
getNewDiameter()
Get the diameter the world border is expanding or contracting to.
|
long |
getTimeRemaining()
Get the time remaining until the world border stops expanding or contracting.
|
int |
getWarningDistance()
Get the distance when a contracting world border will warn a player for whom
the world border is
distance blocks away. |
int |
getWarningTime()
Get the time when a contracting world border will warn a player for whom
the world border will reach in
time seconds. |
void |
setCenter(double x,
double z)
Set the center of the world border.
|
void |
setDamageAmount(double damage)
Set the damage done to a player per block per tick when outside the
buffer.
|
void |
setDamageThreshold(double distance)
Set the distance a player may be be outside the world border before
taking damage.
|
void |
setDiameter(double diameter)
Set the diameter of the world border.
|
void |
setDiameter(double startDiameter,
double endDiameter,
long time)
Set the starting diameter and the ending diameter of the world border, over the given period of time.
|
void |
setDiameter(double diameter,
long time)
Set the diameter of the world border, over the given period of time.
|
void |
setWarningDistance(int distance)
Set the distance when a contracting world border will warn a player for whom
the world border is
distance blocks away. |
void |
setWarningTime(int time)
Set the time when a contracting world border will warn a player for whom
the world border will reach in
time seconds. |
double getNewDiameter()
This will return the same value as getDiameter()
unless
getTimeRemaining()
is greater than 0.
double getDiameter()
The returned diameter applies to the x and z axis. The world border extends over the entire y-axis.
void setDiameter(double diameter)
The specified diameter applies to the x and z axis. The world border extends over the entire y-axis.
diameter
- The diametervoid setDiameter(double diameter, long time)
The world border diameter increases/decrease linearly over the specified time. The specified diameter applies to the x and z axis. The world border extends over the entire y-axis.
diameter
- The diameter where the border will expand/contract totime
- The time over which to change, in millisecondsvoid setDiameter(double startDiameter, double endDiameter, long time)
The world border diameter increases/diameter linearly over the specified time. The specified diameter applies to the x and z axis. The world border extends over the entire y-axis.
startDiameter
- The diameter where the border will startendDiameter
- The diameter where the border will endtime
- The time over which to change, in millisecondslong getTimeRemaining()
void setCenter(double x, double z)
x
- The x-axis center of the world borderz
- The z-axis center of the world bordercom.flowpowered.math.vector.Vector3d getCenter()
The returned position is three-dimensional. As the worldborder extends
over the entire y-axis, the returned position will always have
a y
set to 0.
int getWarningTime()
time
seconds.
In Minecraft, the warning is displayed in the form of a reddish tint.
void setWarningTime(int time)
time
seconds.
In Minecraft, the warning is displayed in the form of a reddish tint.
time
- The time, in secondsint getWarningDistance()
distance
blocks away.
In Minecraft, the warning is displayed in the form of a reddish tint.
void setWarningDistance(int distance)
distance
blocks away.
In Minecraft, the warning is displayed in the form of a reddish tint.
distance
- The distance, in blocksdouble getDamageThreshold()
void setDamageThreshold(double distance)
distance
- The distancedouble getDamageAmount()
void setDamageAmount(double damage)
damage
- The damage amount