Interface WorldBorder.Builder
-
- All Superinterfaces:
AbstractBuilder<WorldBorder>,Buildable.Builder<WorldBorder>,Builder<WorldBorder,WorldBorder.Builder>,CopyableBuilder<WorldBorder,WorldBorder.Builder>,ResettableBuilder<WorldBorder,WorldBorder.Builder>
- Enclosing interface:
- WorldBorder
public static interface WorldBorder.Builder extends CopyableBuilder<WorldBorder,WorldBorder.Builder>, Builder<WorldBorder,WorldBorder.Builder>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorldBorderbuild()Builds the world border from the information given.WorldBorder.Buildercenter(double x, double z)Sets the center of this world border.WorldBorder.BuilderdamagePerBlock(double damagePerBlock)Sets the damage caused by being out of the world border.WorldBorder.Builderfrom(WorldBorder border)Copies the required data from the passedWorldBorder.WorldBorder.BuilderinitialDiameter(double size)Sets the initial diameter of this world border.WorldBorder.BuilderoverworldDefaults()Sets all values in this builder to the default border for a standard Minecraft overworld.WorldBorder.BuildersafeZone(double safeZone)Sets the distance beyond this world border that an entity may travel before incurring damage.WorldBorder.BuildertargetDiameter(double size)Sets the final diameter of this world border.WorldBorder.BuildertimeToTargetDiameter(java.time.Duration time)Sets how long this border will take to contract or expand fromthe initial diametertoits target diameter.WorldBorder.BuilderwarningDistance(double warningDistance)Sets the warning distance of this world border.WorldBorder.BuilderwarningTime(java.time.Duration warningTime)Sets the warning time of this world border.
-
-
-
Method Detail
-
from
WorldBorder.Builder from(WorldBorder border)
Copies the required data from the passedWorldBorder.- Specified by:
fromin 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
WorldBorder.Builder center(double x, double z)
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
WorldBorder.Builder initialDiameter(double size)
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 thisWorldBorderis set.- Returns:
- The builder, for chaining.
-
targetDiameter
WorldBorder.Builder targetDiameter(double size)
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
WorldBorder.Builder timeToTargetDiameter(java.time.Duration time)
Sets how long this border will take to contract or expand fromthe initial diametertoits target diameter.- Parameters:
time- The time, as aDuration- Returns:
- The builder, for chaining.
-
safeZone
WorldBorder.Builder safeZone(double 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
WorldBorder.Builder damagePerBlock(double damagePerBlock)
Sets the damage caused by being out of the world border.- Parameters:
damagePerBlock- The damage amount- Returns:
- The builder, for chaining
-
warningTime
WorldBorder.Builder warningTime(java.time.Duration warningTime)
Sets the warning time of this world border.- Parameters:
warningTime- The warning time- Returns:
- The builder, for chaining
-
warningDistance
WorldBorder.Builder warningDistance(double 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:
buildin interfaceAbstractBuilder<WorldBorder>- Specified by:
buildin interfaceBuildable.Builder<WorldBorder>- Returns:
- The built world border
-
-