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
-
Method Summary
Modifier and TypeMethodDescriptionGets this spawn position as aServerLocation
object, if the world is available.static RespawnLocation.Builder
builder()
Creates a newRespawnLocation.Builder
to build aRespawnLocation
.int
Gets the content version of thisDataSerializable
.boolean
int
hashCode()
boolean
isForced()
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 thekey
of the world.
-
Method Details
-
builder
Creates a newRespawnLocation.Builder
to build aRespawnLocation
.- Returns:
- A new builder
-
worldKey
Gets thekey
of 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 aServerLocation
object, if the world is available.- Returns:
- The position object, if available.
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializable
Gets the content version of thisDataSerializable
. The version may differ between instances of plugins and implementations such that theDataView
fromDataSerializable.toContainer()
may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdater
as it is required when there exists anyDataView
of thisDataSerializable
with an "older" version.- Specified by:
contentVersion
in interfaceDataSerializable
- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializable
Serializes this object into a comprehensibleDataContainer
.- Specified by:
toContainer
in interfaceDataSerializable
- Returns:
- A newly created DataContainer
-
equals
-
hashCode
public int hashCode() -
toString
-