Interface BlockEntityArchetype.Builder
-
- All Superinterfaces:
AbstractBuilder<BlockEntityArchetype>,Buildable.Builder<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 forBlockEntityArchetypes.
-
-
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BlockEntityArchetype.BuilderblockEntity(java.util.function.Supplier<? extends BlockEntityType> type)BlockEntityArchetype.BuilderblockEntity(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.BlockEntityArchetype.BuilderblockEntity(BlockEntityType type)BlockEntityArchetype.BuilderblockEntityData(DataView dataView)Sets theDataViewto be used to copy data onto the createdBlockEntitywhenArchetype.apply(ServerLocation)is called.BlockEntityArchetypebuild()Creates a newBlockEntityArchetypefrom this builder.BlockEntityArchetype.Builderfrom(BlockEntityArchetype value)BlockEntityArchetype.Builderfrom(ServerLocation location)BlockEntityArchetype.Builderreset()Resets this builder to a "default" state such that there is no remaining data to set.BlockEntityArchetype.Builderstate(BlockState state)Sets theBlockStateof the archetype.-
Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
-
-
-
Method Detail
-
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
BlockEntityArchetype.Builder from(BlockEntityArchetype value)
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
BlockEntityArchetype.Builder from(ServerLocation location)
-
state
BlockEntityArchetype.Builder state(BlockState state)
Sets theBlockStateof the archetype.- Parameters:
state- The new block state- Returns:
- This builder, for chaining
-
blockEntity
default BlockEntityArchetype.Builder blockEntity(java.util.function.Supplier<? extends BlockEntityType> type)
-
blockEntity
BlockEntityArchetype.Builder blockEntity(BlockEntityType type)
-
blockEntity
BlockEntityArchetype.Builder 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
BlockEntityArchetype.Builder blockEntityData(DataView dataView)
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>- Specified by:
buildin interfaceBuildable.Builder<BlockEntityArchetype>- Returns:
- The new instance
-
-