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
BlockEntityArchetype
s.-
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.Builder
blockEntity
(Supplier<? extends BlockEntityType> type) blockEntity
(BlockEntity blockEntity) Copies the incomingBlockEntity
for 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 theDataView
to be used to copy data onto the createdBlockEntity
whenArchetype.apply(ServerLocation)
is called.build()
Creates a newBlockEntityArchetype
from 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 theBlockState
of the archetype.Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
Method Details
-
reset
BlockEntityArchetype.Builder reset()Description copied from interface:Builder
Resets 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:
reset
in interfaceBuilder<BlockEntityArchetype,
BlockEntityArchetype.Builder> - Specified by:
reset
in interfaceDataHolderBuilder<BlockEntityArchetype,
BlockEntityArchetype.Builder> - Specified by:
reset
in interfaceResettableBuilder<BlockEntityArchetype,
BlockEntityArchetype.Builder> - Returns:
- This builder, for chaining
-
from
Description copied from interface:DataHolderBuilder
Copies all knownDataManipulator
s from the givenDataHolder
of typeDataHolderBuilder
. This is a defensive copy asDataManipulator
is mutable.- Specified by:
from
in interfaceCopyableBuilder<BlockEntityArchetype,
BlockEntityArchetype.Builder> - Specified by:
from
in interfaceDataHolderBuilder<BlockEntityArchetype,
BlockEntityArchetype.Builder> - Parameters:
value
- TheDataHolder
to copy from- Returns:
- This builder for chaining
-
from
-
state
Sets theBlockState
of the archetype.- Parameters:
state
- The new block state- Returns:
- This builder, for chaining
-
blockEntity
-
blockEntity
-
blockEntity
Copies the incomingBlockEntity
for 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 theDataView
to be used to copy data onto the createdBlockEntity
whenArchetype.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 newBlockEntityArchetype
from this builder.- Specified by:
build
in interfaceAbstractBuilder<BlockEntityArchetype>
- Returns:
- The new instance
-