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 forBlockEntityArchetype
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BlockEntityArchetype.Builder
blockEntity(java.util.function.Supplier<? extends BlockEntityType> type)
BlockEntityArchetype.Builder
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.BlockEntityArchetype.Builder
blockEntity(BlockEntityType type)
BlockEntityArchetype.Builder
blockEntityData(DataView dataView)
Sets theDataView
to be used to copy data onto the createdBlockEntity
whenArchetype.apply(ServerLocation)
is called.BlockEntityArchetype
build()
Creates a newBlockEntityArchetype
from this builder.BlockEntityArchetype.Builder
from(BlockEntityArchetype value)
BlockEntityArchetype.Builder
from(ServerLocation location)
BlockEntityArchetype.Builder
reset()
Resets this builder to a "default" state such that there is no remaining data to set.BlockEntityArchetype.Builder
state(BlockState state)
Sets theBlockState
of the archetype.-
Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
-
-
-
Method Detail
-
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
BlockEntityArchetype.Builder from(BlockEntityArchetype value)
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
BlockEntityArchetype.Builder from(ServerLocation location)
-
state
BlockEntityArchetype.Builder state(BlockState state)
Sets theBlockState
of 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 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
BlockEntityArchetype.Builder blockEntityData(DataView dataView)
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>
- Specified by:
build
in interfaceBuildable.Builder<BlockEntityArchetype>
- Returns:
- The new instance
-
-