Class TileEntityColonySign
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
com.minecolonies.core.tileentities.TileEntityColonySign
- All Implemented Interfaces:
ITickable,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.minecraftforge.common.extensions.IForgeBlockEntity,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
public class TileEntityColonySign
extends net.minecraft.world.level.block.entity.BlockEntity
implements ITickable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
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.CompoundTagvoidload(@NotNull net.minecraft.nbt.CompoundTag compound) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet) voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound) 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, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onLoad, requestModelDataUpdate, serializeNBT
-
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
-
load
public void load(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - 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()- 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) - Specified by:
onDataPacketin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
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.
-