Class AbstractMultiBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
net.nikdo53.tinymultiblocklib.blockentities.AbstractMultiBlockEntity
- All Implemented Interfaces:
IMultiBlockEntity
- Direct Known Subclasses:
TestBlockEntity
public class AbstractMultiBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
implements IMultiBlockEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput -
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.core.BlockPosbooleanFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMultiBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.BlockPosnet.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider registries) booleanisPlaced()True once the whole placing logic runs (to prevent updateShape from breaking it early)protected voidloadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) voidsetBlockState(net.minecraft.world.level.block.state.BlockState blockState) Certain mods let you change the location of the multiblock (like Carry on)voidsetCenter(net.minecraft.core.BlockPos pos) voidsetPlaced(boolean placed) voidsetPreviewMode(PreviewMode mode) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.nikdo53.tinymultiblocklib.blockentities.IMultiBlockEntity
getBlockEntity, isCenter
-
Field Details
-
center
public net.minecraft.core.BlockPos center -
isPlaced
public boolean isPlaced -
previewMode
-
-
Constructor Details
-
AbstractMultiBlockEntity
public AbstractMultiBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider registries) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
loadAdditional
protected void loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
getCenter
public net.minecraft.core.BlockPos getCenter()- Specified by:
getCenterin interfaceIMultiBlockEntity
-
setCenter
public void setCenter(net.minecraft.core.BlockPos pos) - Specified by:
setCenterin interfaceIMultiBlockEntity
-
isPlaced
public boolean isPlaced()Description copied from interface:IMultiBlockEntityTrue once the whole placing logic runs (to prevent updateShape from breaking it early)- Specified by:
isPlacedin interfaceIMultiBlockEntity
-
setPlaced
public void setPlaced(boolean placed) - Specified by:
setPlacedin interfaceIMultiBlockEntity
-
getPreviewMode
- Specified by:
getPreviewModein interfaceIMultiBlockEntity
-
setPreviewMode
- Specified by:
setPreviewModein interfaceIMultiBlockEntity
-
setBlockState
public void setBlockState(net.minecraft.world.level.block.state.BlockState blockState) Certain mods let you change the location of the multiblock (like Carry on)That's a problem because the
centerwon't update. This should trick it into updating- Overrides:
setBlockStatein classnet.minecraft.world.level.block.entity.BlockEntity
-