public static final class RespawnLocation.Builder extends AbstractDataBuilder<RespawnLocation>
RespawnLocation
s.Constructor and Description |
---|
Builder()
Creates a new
RespawnLocation.Builder . |
Modifier and Type | Method and Description |
---|---|
RespawnLocation |
build()
Creates a new
RespawnLocation from this builder. |
protected Optional<RespawnLocation> |
buildContent(DataView container)
Builds the currently
AbstractDataBuilder.supportedVersion variant of the intended
DataSerializable , such that all content upgrades have already
been handled by AbstractDataBuilder.build(DataView) . |
RespawnLocation.Builder |
forceSpawn(boolean isForced)
Sets whether the position to respawn at is forced or can be varied
for safety.
|
RespawnLocation.Builder |
from(RespawnLocation value)
Resets this builder to the values of the given built object.
|
RespawnLocation.Builder |
location(Location<World> location)
|
RespawnLocation.Builder |
position(com.flowpowered.math.vector.Vector3d position)
Sets the
Vector3d position of where to respawn at. |
RespawnLocation.Builder |
reset()
Resets this builder to a "default" state such that there is no
remaining data to set.
|
RespawnLocation.Builder |
world(UUID worldId)
|
RespawnLocation.Builder |
world(World world)
|
build
public Builder()
RespawnLocation.Builder
.public RespawnLocation.Builder world(World world)
world
- The world to get the uuid frompublic RespawnLocation.Builder world(UUID worldId)
UUID
of the desired World
. There are no
validation checks to whether a world exists with the provided uuid,
mainly for reasons when multiple worlds are loaded and unloaded.worldId
- The world unique idpublic RespawnLocation.Builder location(Location<World> location)
location
- The location desiredIllegalStateException
- If the location's extent is nullpublic RespawnLocation.Builder position(com.flowpowered.math.vector.Vector3d position)
Vector3d
position of where to respawn at.position
- The position to respawn atpublic RespawnLocation.Builder forceSpawn(boolean isForced)
isForced
- If the respawn position is forcedprotected Optional<RespawnLocation> buildContent(DataView container) throws InvalidDataException
AbstractDataBuilder
AbstractDataBuilder.supportedVersion
variant of the intended
DataSerializable
, such that all content upgrades have already
been handled by AbstractDataBuilder.build(DataView)
. This otherwise follows the
same contract as DataBuilder.build(DataView)
.buildContent
in class AbstractDataBuilder<RespawnLocation>
container
- The container with data to build fromInvalidDataException
- If there's issues of invalid data formats
or invalid datapublic RespawnLocation.Builder reset()
ResettableBuilder
public RespawnLocation.Builder from(RespawnLocation value)
ResettableBuilder
value
- The built objectpublic RespawnLocation build()
RespawnLocation
from this builder.