Class TileEntityScarecrow

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

public class TileEntityScarecrow extends AbstractTileEntityScarecrow
The scarecrow tile entity to store extra data.
  • 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
    TileEntityScarecrow(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    Creates an instance of the tileEntity.
  • Method Summary

    Modifier and Type
    Method
    Description
    The colony this field is located in.
    int[]
    Field size.
    Returns the type of the scarecrow (Important for the rendering).
    net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
     
    @NotNull net.minecraft.nbt.CompoundTag
    getUpdateTag(net.minecraft.core.HolderLookup.Provider provider)
     
    void
    loadAdditional(net.minecraft.nbt.CompoundTag compoundTag, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag compoundTag, net.minecraft.core.HolderLookup.Provider provider)
     
    void
    setFieldSize(net.minecraft.core.Direction direction, int radius)
     

    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, 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, onDataPacket, onLoad, requestModelDataUpdate
  • Constructor Details

    • TileEntityScarecrow

      public TileEntityScarecrow(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Creates an instance of the tileEntity.
  • Method Details

    • getScarecrowType

      public ScareCrowType getScarecrowType()
      Description copied from class: AbstractTileEntityScarecrow
      Returns the type of the scarecrow (Important for the rendering).
      Specified by:
      getScarecrowType in class AbstractTileEntityScarecrow
      Returns:
      the enum type.
    • getCurrentColony

      public IColony getCurrentColony()
      Description copied from class: AbstractTileEntityScarecrow
      The colony this field is located in.
      Specified by:
      getCurrentColony in class AbstractTileEntityScarecrow
      Returns:
      the colony instance.
    • saveAdditional

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

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

      public void setFieldSize(net.minecraft.core.Direction direction, int radius)
      Parameters:
      direction - the direction for the radius
      radius - the number of blocks from the scarecrow that the farmer will work with
    • getUpdatePacket

      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(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Overrides:
      getUpdateTag in class net.minecraft.world.level.block.entity.BlockEntity
    • getFieldSize

      public int[] getFieldSize()
      Field size.
      Returns:
      the field size.