Package org.spongepowered.api.util
Class RespawnLocation
java.lang.Object
org.spongepowered.api.util.RespawnLocation
- All Implemented Interfaces:
DataSerializable
Represents a position for a player to respawn in in a particular world.
Instances can be obtained using
Keys.RESPAWN_LOCATIONS or by using the
builder().-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionGets this spawn position as aServerLocationobject, if the world is available.static RespawnLocation.Builderbuilder()Creates a newRespawnLocation.Builderto build aRespawnLocation.intGets the content version of thisDataSerializable.booleaninthashCode()booleanisForced()Gets whether the spawn position is forced in the given world, if available.position()Gets the position within the world of this spawn point.Serializes this object into a comprehensibleDataContainer.toString()worldKey()Gets thekeyof the world.
-
Method Details
-
builder
Creates a newRespawnLocation.Builderto build aRespawnLocation.- Returns:
- A new builder
-
worldKey
Gets thekeyof the world.- Returns:
- The key
-
position
Gets the position within the world of this spawn point.- Returns:
- The spawn position
-
isForced
public boolean isForced()Gets whether the spawn position is forced in the given world, if available. A forced position will spawn the player there even if a bed is missing or obstructed.- Returns:
- Whether the position is forced in the world
-
asLocation
Gets this spawn position as aServerLocationobject, if the world is available.- Returns:
- The position object, if available.
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializableGets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromDataSerializable.toContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Specified by:
contentVersionin interfaceDataSerializable- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
toContainerin interfaceDataSerializable- Returns:
- A newly created DataContainer
-
equals
-
hashCode
public int hashCode() -
toString
-