Class TileEntityColonySign

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.minecolonies.core.tileentities.TileEntityColonySign
All Implemented Interfaces:
ITickable, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension

public class TileEntityColonySign extends net.minecraft.world.level.block.entity.BlockEntity implements ITickable
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

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

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    TileEntityColonySign(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get colony of sign above (cached).
    int
    Get distance to colony.
    int
    Get colony id from sign, like to copy it on another sign.
    Obtain the colony name.
    @NotNull net.minecraft.core.BlockPos
    Get next node pos.
    @NotNull net.minecraft.core.BlockPos
    Get previous node pos.
    float
    Get the relative rotation to the colony.
    int
    Get target colony distance.
    int
    + Get target colony id from sign, -1 if not set.
    Obtain the target colony name.
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    @NotNull net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    void
    loadAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    saveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
     
    void
     
    void
    setColonyAndAnchor(IColony colony, net.minecraft.core.BlockPos anchor)
    Set the colony meta data.
    void
    Update method to be called by Minecraft every tick

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

    addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setComponents, setData, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate

    Methods inherited from interface com.minecolonies.api.tileentities.ITickable

    tick
  • Constructor Details

    • TileEntityColonySign

      public TileEntityColonySign(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • setChanged

      public void setChanged()
      Overrides:
      setChanged in class net.minecraft.world.level.block.entity.BlockEntity
    • loadAdditional

      public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • saveAdditional

      public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdatePacket

      @Nullable public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()
      Overrides:
      getUpdatePacket in class net.minecraft.world.level.block.entity.BlockEntity
    • getUpdateTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • onDataPacket

      public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      onDataPacket in interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
    • tick

      public void tick()
      Update method to be called by Minecraft every tick
      Specified by:
      tick in interface ITickable
    • setColonyAndAnchor

      public void setColonyAndAnchor(IColony colony, @Nullable net.minecraft.core.BlockPos anchor)
      Set the colony meta data.
      Parameters:
      colony - the colony.
      anchor - the anchor position it points to.
    • getColonyName

      public String getColonyName()
      Obtain the colony name. Cached for efficiency.
      Returns:
      string name.
    • getRelativeRotation

      public float getRelativeRotation()
      Get the relative rotation to the colony. Cached for efficiency.
      Returns:
      the value.
    • getColonyDistance

      public int getColonyDistance()
      Get distance to colony.
      Returns:
      the distance in blocks.
    • getColonyId

      public int getColonyId()
      Get colony id from sign, like to copy it on another sign.
      Returns:
      the colony id.
    • getTargetColonyId

      public int getTargetColonyId()
      + Get target colony id from sign, -1 if not set.
      Returns:
      the target colony id.
    • getTargetColonyName

      public String getTargetColonyName()
      Obtain the target colony name. Cached for efficiency.
      Returns:
      string name.
    • getTargetColonyDistance

      public int getTargetColonyDistance()
      Get target colony distance.
      Returns:
      the distance in blocks.
    • getCachedSignAboveColony

      public int getCachedSignAboveColony()
      Get colony of sign above (cached).
      Returns:
      the colony id (-1 default).
    • getPreviousPos

      @NotNull public @NotNull net.minecraft.core.BlockPos getPreviousPos()
      Get previous node pos.
      Returns:
      the pos.
    • getNextPosition

      @NotNull public @NotNull net.minecraft.core.BlockPos getNextPosition()
      Get next node pos.
      Returns:
      the pos.