Package org.spongepowered.api.util
Class RespawnLocation.Builder
java.lang.Object
org.spongepowered.api.data.persistence.AbstractDataBuilder<RespawnLocation>
org.spongepowered.api.util.RespawnLocation.Builder
- All Implemented Interfaces:
AbstractBuilder<RespawnLocation>,DataBuilder<RespawnLocation>,Builder<RespawnLocation,,RespawnLocation.Builder> CopyableBuilder<RespawnLocation,,RespawnLocation.Builder> ResettableBuilder<RespawnLocation,RespawnLocation.Builder>
- Enclosing class:
RespawnLocation
public static final class RespawnLocation.Builder
extends AbstractDataBuilder<RespawnLocation>
implements Builder<RespawnLocation,RespawnLocation.Builder>, CopyableBuilder<RespawnLocation,RespawnLocation.Builder>
A helper class to build
RespawnLocations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newRespawnLocationfrom this builder.protected Optional<RespawnLocation> buildContent(DataView container) Builds the currentlyAbstractDataBuilder.supportedVersionvariant of the intendedDataSerializable, such that all content upgrades have already been handled byAbstractDataBuilder.build(DataView).forceSpawn(boolean isForced) Sets whether the position to respawn at is forced or can be varied for safety.from(RespawnLocation value) Resets this builder to the values of the given built object.location(ServerLocation location) Sets theVector3dposition of where to respawn at.reset()Resets this builder to a "default" state such that there is no remaining data to set.world(ResourceKey key) Sets thekeytied to the desiredServerWorld.world(ServerWorld world) Sets thekeyof the providedServerWorldonto this builder.Methods inherited from class org.spongepowered.api.data.persistence.AbstractDataBuilder
build
-
Constructor Details
-
Builder
public Builder()Creates a newRespawnLocation.Builder.
-
-
Method Details
-
world
Sets thekeyof the providedServerWorldonto this builder.- Parameters:
world- The world- Returns:
- This builder, for chaining
-
world
Sets thekeytied to the desiredServerWorld.- Parameters:
key- The key- Returns:
- This builder, for chaining
-
location
- Parameters:
location- The location desired- Returns:
- This builder, for chaining
-
position
Sets theVector3dposition of where to respawn at.- Parameters:
position- The position to respawn at- Returns:
- This builder, for chaining
-
forceSpawn
Sets whether the position to respawn at is forced or can be varied for safety.- Parameters:
isForced- If the respawn position is forced- Returns:
- This builder, for chaining
-
buildContent
Description copied from class:AbstractDataBuilderBuilds the currentlyAbstractDataBuilder.supportedVersionvariant of the intendedDataSerializable, such that all content upgrades have already been handled byAbstractDataBuilder.build(DataView). This otherwise follows the same contract asDataBuilder.build(DataView).- Specified by:
buildContentin classAbstractDataBuilder<RespawnLocation>- Parameters:
container- The container with data to build from- Returns:
- The deserialized data serializable, if possible
- Throws:
InvalidDataException- If there's issues of invalid data formats or invalid data
-
reset
Description copied from interface:BuilderResets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.- Specified by:
resetin interfaceBuilder<RespawnLocation,RespawnLocation.Builder> - Specified by:
resetin interfaceResettableBuilder<RespawnLocation,RespawnLocation.Builder> - Returns:
- This builder, for chaining
-
from
Description copied from interface:CopyableBuilderResets this builder to the values of the given built object.- Specified by:
fromin interfaceCopyableBuilder<RespawnLocation,RespawnLocation.Builder> - Parameters:
value- The built object- Returns:
- This builder, for chaining
-
build
Creates a newRespawnLocationfrom this builder.- Specified by:
buildin interfaceAbstractBuilder<RespawnLocation>- Returns:
- The new respawn location
-