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

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.core.BlockPos
     
    boolean
     
     

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractMultiBlockEntity(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 Type
    Method
    Description
    net.minecraft.core.BlockPos
     
     
    net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>
     
    net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider registries)
     
    boolean
    True once the whole placing logic runs (to prevent updateShape from breaking it early)
    protected void
    loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
     
    protected void
    saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
     
    void
    setBlockState(net.minecraft.world.level.block.state.BlockState blockState)
    Certain mods let you change the location of the multiblock (like Carry on)
    void
    setCenter(net.minecraft.core.BlockPos pos)
     
    void
    setPlaced(boolean placed)
     
    void
     

    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, triggerEvent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.nikdo53.tinymultiblocklib.blockentities.IMultiBlockEntity

    getBlockEntity, isCenter
  • Field Details

    • center

      public net.minecraft.core.BlockPos center
    • isPlaced

      public boolean isPlaced
    • previewMode

      public PreviewMode 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:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdateTag

      public net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • loadAdditional

      protected void loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdatePacket

      public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
    • getCenter

      public net.minecraft.core.BlockPos getCenter()
      Specified by:
      getCenter in interface IMultiBlockEntity
    • setCenter

      public void setCenter(net.minecraft.core.BlockPos pos)
      Specified by:
      setCenter in interface IMultiBlockEntity
    • isPlaced

      public boolean isPlaced()
      Description copied from interface: IMultiBlockEntity
      True once the whole placing logic runs (to prevent updateShape from breaking it early)
      Specified by:
      isPlaced in interface IMultiBlockEntity
    • setPlaced

      public void setPlaced(boolean placed)
      Specified by:
      setPlaced in interface IMultiBlockEntity
    • getPreviewMode

      public PreviewMode getPreviewMode()
      Specified by:
      getPreviewMode in interface IMultiBlockEntity
    • setPreviewMode

      public void setPreviewMode(PreviewMode mode)
      Specified by:
      setPreviewMode in interface IMultiBlockEntity
    • 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 center won't update. This should trick it into updating

      Overrides:
      setBlockState in class net.minecraft.world.level.block.entity.BlockEntity