Interface BlockEntityArchetype.Builder
- All Superinterfaces:
AbstractBuilder<BlockEntityArchetype>,Builder<BlockEntityArchetype,,BlockEntityArchetype.Builder> CopyableBuilder<BlockEntityArchetype,,BlockEntityArchetype.Builder> DataBuilder<BlockEntityArchetype>,DataHolderBuilder<BlockEntityArchetype,,BlockEntityArchetype.Builder> DataHolderBuilder.Mutable<BlockEntityArchetype,,BlockEntityArchetype.Builder> ResettableBuilder<BlockEntityArchetype,,BlockEntityArchetype.Builder> SerializableDataHolderBuilder<BlockEntityArchetype,,BlockEntityArchetype.Builder> SerializableDataHolderBuilder.Mutable<BlockEntityArchetype,BlockEntityArchetype.Builder>
- Enclosing interface:
BlockEntityArchetype
public static interface BlockEntityArchetype.Builder
extends SerializableDataHolderBuilder.Mutable<BlockEntityArchetype,BlockEntityArchetype.Builder>
A builder for
BlockEntityArchetypes.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolderBuilder
DataHolderBuilder.Immutable<H extends DataHolder.Immutable<H>,B extends DataHolderBuilder.Immutable<H, B>>, DataHolderBuilder.Mutable<H extends DataHolder.Mutable, B extends DataHolderBuilder.Mutable<H, B>> Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolderBuilder
SerializableDataHolderBuilder.Immutable<H extends SerializableDataHolder.Immutable<H>,B extends SerializableDataHolderBuilder.Immutable<H, B>>, SerializableDataHolderBuilder.Mutable<H extends SerializableDataHolder.Mutable, B extends SerializableDataHolderBuilder.Mutable<H, B>> -
Method Summary
Modifier and TypeMethodDescriptiondefault BlockEntityArchetype.BuilderblockEntity(Supplier<? extends BlockEntityType> type) blockEntity(BlockEntity blockEntity) Copies the incomingBlockEntityfor it's current state of information, such asBlockState,BlockEntityType, and all relatedcontained data, except the position and potentially any Sponge-added tracking information, such as owner or notifier.blockEntity(BlockEntityType type) blockEntityData(DataView dataView) Sets theDataViewto be used to copy data onto the createdBlockEntitywhenArchetype.apply(ServerLocation)is called.build()Creates a newBlockEntityArchetypefrom this builder.from(BlockEntityArchetype value) from(ServerLocation location) reset()Resets this builder to a "default" state such that there is no remaining data to set.state(BlockState state) Sets theBlockStateof the archetype.Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
Method Details
-
reset
BlockEntityArchetype.Builder 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<BlockEntityArchetype,BlockEntityArchetype.Builder> - Specified by:
resetin interfaceDataHolderBuilder<BlockEntityArchetype,BlockEntityArchetype.Builder> - Specified by:
resetin interfaceResettableBuilder<BlockEntityArchetype,BlockEntityArchetype.Builder> - Returns:
- This builder, for chaining
-
from
Description copied from interface:DataHolderBuilderCopies all knownDataManipulators from the givenDataHolderof typeDataHolderBuilder. This is a defensive copy asDataManipulatoris mutable.- Specified by:
fromin interfaceCopyableBuilder<BlockEntityArchetype,BlockEntityArchetype.Builder> - Specified by:
fromin interfaceDataHolderBuilder<BlockEntityArchetype,BlockEntityArchetype.Builder> - Parameters:
value- TheDataHolderto copy from- Returns:
- This builder for chaining
-
from
-
state
Sets theBlockStateof the archetype.- Parameters:
state- The new block state- Returns:
- This builder, for chaining
-
blockEntity
-
blockEntity
-
blockEntity
Copies the incomingBlockEntityfor it's current state of information, such asBlockState,BlockEntityType, and all relatedcontained data, except the position and potentially any Sponge-added tracking information, such as owner or notifier.Note that this overwrites data set from the following methods:
- Parameters:
blockEntity- The block entity to absorb all data- Returns:
- This builder, for chaining
-
blockEntityData
Sets theDataViewto be used to copy data onto the createdBlockEntitywhenArchetype.apply(ServerLocation)is called.The format used for this container follows the Mojang ChunkFormat for BlockEntities., and can be customized based on the origination of the
BlockEntity. If the block entity originates from a content-adding mod, the format could vary based on it's implementation and may change at any time.- Parameters:
dataView- The data view containing data pertinent to theBlockEntity- Returns:
- This builder, for chaining
-
build
BlockEntityArchetype build()Creates a newBlockEntityArchetypefrom this builder.- Specified by:
buildin interfaceAbstractBuilder<BlockEntityArchetype>- Returns:
- The new instance
-