Interface Archetype<S extends LocatableSnapshot<S>, E>
- All Superinterfaces:
CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, SerializableDataHolder, SerializableDataHolder.Mutable, ValueContainer
- All Known Subinterfaces:
BlockEntityArchetype, EntityArchetype
public interface Archetype<S extends LocatableSnapshot<S>, E>
extends SerializableDataHolder.Mutable
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 DataHolder
DataHolder.Immutable<I>, DataHolder.MutableNested classes/interfaces inherited from interface SerializableDataHolder
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 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 DataSerializable
contentVersion, toContainer, toViewMethods inherited from interface SerializableDataHolder
validateRawDataMethods inherited from interface SerializableDataHolder.Mutable
setRawDataMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supports
-
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
-