Interface WorldBorder.Builder
- All Superinterfaces:
AbstractBuilder<WorldBorder>
,Builder<WorldBorder,
,WorldBorder.Builder> CopyableBuilder<WorldBorder,
,WorldBorder.Builder> ResettableBuilder<WorldBorder,
WorldBorder.Builder>
- Enclosing interface:
WorldBorder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the world border from the information given.center
(double x, double z) Sets the center of this world border.damagePerBlock
(double damagePerBlock) Sets the damage caused by being out of the world border.from
(WorldBorder border) Copies the required data from the passedWorldBorder
.initialDiameter
(double size) Sets the initial diameter of this world border.Sets all values in this builder to the default border for a standard Minecraft overworld.safeZone
(double safeZone) Sets the distance beyond this world border that an entity may travel before incurring damage.targetDiameter
(double size) Sets the final diameter of this world border.timeToTargetDiameter
(Duration time) Sets how long this border will take to contract or expand fromthe initial diameter
toits target diameter
.warningDistance
(double warningDistance) Sets the warning distance of this world border.warningTime
(Duration warningTime) Sets the warning time of this world border.
-
Method Details
-
from
Copies the required data from the passedWorldBorder
.- Specified by:
from
in interfaceCopyableBuilder<WorldBorder,
WorldBorder.Builder> - Parameters:
border
- The world border whose data is to be copied- Returns:
- The builder, for chaining
-
overworldDefaults
WorldBorder.Builder overworldDefaults()Sets all values in this builder to the default border for a standard Minecraft overworld.This is not the same as calling
Builder.reset()
, which unsets all values, requiring at atargetDiameter(double)
to be set befor this can be built.- Returns:
- This builder, for chaining.
-
center
Sets the center of this world border.- Parameters:
x
- The x-coordinate of the new centrez
- The z-coordinate of the new centre- Returns:
- The builder, for chaining
-
initialDiameter
Sets the initial diameter of this world border.If this differs from the the value supplied to
targetDiameter(double)
, then the border size starts at the diameter specified here, growing or shrinking at a constant speed for the time provided intimeToTargetDiameter(Duration)
where it will stop at the supplied target. If the supplied time is zero or not given, then this value is ignored and the target diameter is used.If this is set but
targetDiameter(double)
has not, then this also sets that target diameter.- Parameters:
size
- The diameter that this border will have when thisWorldBorder
is set.- Returns:
- The builder, for chaining.
-
targetDiameter
Sets the final diameter of this world border.If no
timeToTargetDiameter(Duration)
is set, or it is set toDuration.ZERO
, then theinitialDiameter(double)
is ignored and this is the only diameter used.If this is set but
initialDiameter(double)
has not, then this also sets that initial diameter.- Parameters:
size
- The diameter that this border will have.- Returns:
- The builder, for chaining.
-
timeToTargetDiameter
Sets how long this border will take to contract or expand fromthe initial diameter
toits target diameter
.- Parameters:
time
- The time, as aDuration
- Returns:
- The builder, for chaining.
-
safeZone
Sets the distance beyond this world border that an entity may travel before incurring damage.- Parameters:
safeZone
- The distance in blocks- Returns:
- The builder, for chaining.
-
damagePerBlock
Sets the damage caused by being out of the world border.- Parameters:
damagePerBlock
- The damage amount- Returns:
- The builder, for chaining
-
warningTime
Sets the warning time of this world border.- Parameters:
warningTime
- The warning time- Returns:
- The builder, for chaining
-
warningDistance
Sets the warning distance of this world border.- Parameters:
warningDistance
- The warning distance- Returns:
- The builder, for chaining
-
build
WorldBorder build()Builds the world border from the information given.- Specified by:
build
in interfaceAbstractBuilder<WorldBorder>
- Returns:
- The built world border
-