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.DataComponentInputNested 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, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionTileEntityColonySign(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionintGet colony of sign above (cached).intGet distance to colony.intGet colony id from sign, like to copy it on another sign.Obtain the colony name.@NotNull net.minecraft.core.BlockPosGet next node pos.@NotNull net.minecraft.core.BlockPosGet previous node pos.floatGet the relative rotation to the colony.intGet 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.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) voidloadAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, net.minecraft.core.HolderLookup.Provider provider) voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) voidvoidsetColonyAndAnchor(IColony colony, net.minecraft.core.BlockPos anchor) Set the colony meta data.voidtick()Update method to be called by Minecraft every tickMethods 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, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate
-
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:
setChangedin classnet.minecraft.world.level.block.entity.BlockEntity
-
loadAdditional
public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
@Nullable public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classnet.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:
onDataPacketin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension
-
tick
public void tick()Update method to be called by Minecraft every tick -
setColonyAndAnchor
Set the colony meta data.- Parameters:
colony- the colony.anchor- the anchor position it points to.
-
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
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.
-