Package org.spongepowered.api.world
Interface Archetype<S extends LocatableSnapshot<S>,E>
- All Superinterfaces:
CopyableDataHolder,DataHolder,DataHolder.Mutable,DataSerializable,SerializableDataHolder,SerializableDataHolder.Mutable,ValueContainer
- All Known Subinterfaces:
BlockEntityArchetype,EntityArchetype
A
DataHolder which has no attachment to any particular world allowing
it to be used as a blueprint to create multiple copies of its containing
data.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.MutableNested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionapply(ServerLocation location) Creates a new instance based on this archetype at the given location.copy()Creates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance.toSnapshot(ServerLocation location) Creates a new immutable snapshot based on this archetype.Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undoMethods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainerMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawDataMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
setRawData
-
Method Details
-
apply
Creates a new instance based on this archetype at the given location.- Parameters:
location- The location to create the new instance at- Returns:
- The created type, if successful
-
toSnapshot
Creates a new immutable snapshot based on this archetype.- Parameters:
location- The location for the snapshot to be specified as at- Returns:
- The snapshot
-
copy
Description copied from interface:CopyableDataHolderCreates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.- Specified by:
copyin interfaceCopyableDataHolder- Specified by:
copyin interfaceSerializableDataHolder- Specified by:
copyin interfaceSerializableDataHolder.Mutable- Returns:
- The new copy
-