Class TileEntityColonyBuilding
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.minecolonies.api.tileentities.AbstractTileEntityRack
com.minecolonies.core.tileentities.TileEntityRack
com.minecolonies.api.tileentities.AbstractTileEntityColonyBuilding
com.minecolonies.core.tileentities.TileEntityColonyBuilding
- All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity,com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE,ITickable,IItemHandlerCapProvider,net.minecraft.world.Clearable,net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.MenuProvider,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.client.extensions.IMenuProviderExtension,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
- Direct Known Subclasses:
AbstractTileEntityWareHouse,TileEntityEnchanter,TileEntityStash
Class which handles the tileEntity of our colonyBuildings.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack
AbstractTileEntityRack.RackInventoryNested 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
FieldsModifier and TypeFieldDescriptionnet.minecraft.resources.ResourceLocationThe name of the building location.Fields inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack
buildingPos, inventory, inWarehouseFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
TAG_BLUEPRINTDATA, TAG_CORNER_ONE, TAG_CORNER_TWO, TAG_POS_TAG_MAP, TAG_SCHEMATIC_NAME, TAG_TAG_NAME, TAG_TAG_NAME_LIST, TAG_TAG_POS -
Constructor Summary
ConstructorsConstructorDescriptionTileEntityColonyBuilding(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Default constructor used to create a new TileEntity via reflection.TileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Alternative overriden constructor. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull net.minecraft.world.entity.player.Player player) Get the blueprint path of the tileEntity.Returns the building associated with the tile entity.net.minecraft.resources.ResourceLocationGet the building name that thisAbstractTileEntityColonyBuildingbelongs to.Returns the view of the building associated with the tile entity.Returns the colony of the tile entity.intReturns the colony ID.@NotNull net.minecraft.network.chat.Componentnet.neoforged.neoforge.items.IItemHandlergetItemHandlerCap(net.minecraft.core.Direction side) net.minecraft.core.BlockPosReturns the position of the tile entity.@Nullable net.minecraft.core.BlockPosgetPositionOfChestWithItemStack(@NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Check for a certain item and return the position of the chest containing it.com.ldtteam.structurize.api.RotationMirrorcom.ldtteam.structurize.storage.StructurePackMetaGetter for the style.net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket@NotNull net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider provider) voidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) booleanhasAccessPermission(net.minecraft.world.entity.player.Player player) Checks if the player has permission to access the hut.booleanisUsableByPlayer(@NotNull net.minecraft.world.entity.player.Player player) 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) voidonLoad()voidReactivate the hut of this tileEntity.voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider provider) voidsetBlueprintPath(String path) Set the blueprint path of the tileEntity.voidSets the building associated with the tile entity.voidvoidSets the colony of the tile entity.voidsetPackName(String packName) voidsetRotationMirror(com.ldtteam.structurize.api.RotationMirror rotationMirror) voidsetStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style) Set the style of the tileEntity.voidtick()Default parameterless ticking implementation.voidUpdate the blockState of the rack.voidwriteColonyToItemStack(net.minecraft.world.item.ItemStack stack) Write the colony id to the itemstack.Methods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityColonyBuilding
getCachedWorldTagNamePosMap, getPositionedTags, getSchematicCorners, getSchematicName, getTilePos, getWorldTagNamePosMap, isInTileEntity, isOutdated, readSchematicDataFromNBT, setPositionedTags, setSchematicCorners, setSchematicNameMethods inherited from class com.minecolonies.core.tileentities.TileEntityRack
clearContent, createInventory, getAllContent, getCount, getCount, getFreeSlots, getItemCount, getModelData, getOtherChest, getTextureData, getUpgradeSize, hasItemStack, hasItemStack, hasItemStorage, hasSimilarStack, isEmpty, setInWarehouse, setRemoved, updateItemStorage, updateTextureDataWith, upgradeRackSizeMethods inherited from class com.minecolonies.api.tileentities.AbstractTileEntityRack
getInventory, setBuildingPos, updateWarehouseIfAvailableMethods 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, 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
hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, requestModelDataUpdateMethods inherited from interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
addTag, getInWorldCorners, getRealWorldPos, getWorldTagPosMap, removeTag, writeSchematicDataToNBTMethods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider
getItemHandlerCap, getItemHandlerCapMethods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen
-
Field Details
-
registryName
public net.minecraft.resources.ResourceLocation registryNameThe name of the building location.
-
-
Constructor Details
-
TileEntityColonyBuilding
public TileEntityColonyBuilding(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Default constructor used to create a new TileEntity via reflection. Do not use. -
TileEntityColonyBuilding
public TileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Alternative overriden constructor.- Parameters:
type- the entity type.
-
-
Method Details
-
getColonyId
public int getColonyId()Returns the colony ID.- Specified by:
getColonyIdin classAbstractTileEntityColonyBuilding- Returns:
- ID of the colony.
-
getColony
Returns the colony of the tile entity.- Specified by:
getColonyin classAbstractTileEntityColonyBuilding- Returns:
- Colony of the tile entity.
-
getPosition
public net.minecraft.core.BlockPos getPosition()Returns the position of the tile entity.- Specified by:
getPositionin classAbstractTileEntityColonyBuilding- Returns:
- Block Coordinates of the tile entity.
-
getPositionOfChestWithItemStack
@Nullable public @Nullable net.minecraft.core.BlockPos getPositionOfChestWithItemStack(@NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Check for a certain item and return the position of the chest containing it.- Specified by:
getPositionOfChestWithItemStackin classAbstractTileEntityColonyBuilding- Parameters:
itemStackSelectionPredicate- the stack to search for.- Returns:
- the position or null.
-
setColony
Sets the colony of the tile entity.- Specified by:
setColonyin classAbstractTileEntityColonyBuilding- Parameters:
c- Colony to set in references.
-
setChanged
public void setChanged()- Overrides:
setChangedin classTileEntityRack
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Specified by:
getUpdatePacketin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE- Overrides:
getUpdatePacketin classTileEntityRack
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
getUpdateTagin classTileEntityRack
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
handleUpdateTagin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension- Overrides:
handleUpdateTagin classTileEntityRack
-
onDataPacket
public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
onDataPacketin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension- Overrides:
onDataPacketin classTileEntityRack
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacenet.neoforged.neoforge.common.extensions.IBlockEntityExtension
-
getBuilding
Returns the building associated with the tile entity.- Specified by:
getBuildingin classAbstractTileEntityColonyBuilding- Returns:
IBuildingContainerassociated with the tile entity.
-
setBuilding
Sets the building associated with the tile entity.- Specified by:
setBuildingin classAbstractTileEntityColonyBuilding- Parameters:
b-IBuildingto associate with the tile entity.
-
getDisplayName
@NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider- Overrides:
getDisplayNamein classTileEntityRack
-
getBuildingView
Returns the view of the building associated with the tile entity.- Specified by:
getBuildingViewin classAbstractTileEntityColonyBuilding- Returns:
IBuildingViewthe tile entity is associated with.
-
loadAdditional
public void loadAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
loadAdditionalin classAbstractTileEntityColonyBuilding
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, @NotNull net.minecraft.core.HolderLookup.Provider provider) - Overrides:
saveAdditionalin classAbstractTileEntityColonyBuilding
-
tick
public void tick()Description copied from interface:ITickableDefault parameterless ticking implementation. -
isUsableByPlayer
public boolean isUsableByPlayer(@NotNull @NotNull net.minecraft.world.entity.player.Player player) -
hasAccessPermission
public boolean hasAccessPermission(net.minecraft.world.entity.player.Player player) Checks if the player has permission to access the hut.- Specified by:
hasAccessPermissionin classAbstractTileEntityColonyBuilding- Parameters:
player- Player to check permission of.- Returns:
- True when player has access, or building doesn't exist, otherwise false.
-
setRotationMirror
public void setRotationMirror(com.ldtteam.structurize.api.RotationMirror rotationMirror) - Specified by:
setRotationMirrorin classAbstractTileEntityColonyBuilding- Parameters:
rotationMirror- rotation and mirror of the entity.
-
getRotationMirror
public com.ldtteam.structurize.api.RotationMirror getRotationMirror()- Specified by:
getRotationMirrorin classAbstractTileEntityColonyBuilding- Returns:
- rotation and mirror of the entity.
-
getStructurePack
public com.ldtteam.structurize.storage.StructurePackMeta getStructurePack()Getter for the style.- Specified by:
getStructurePackin classAbstractTileEntityColonyBuilding- Returns:
- the string of it.
-
setStructurePack
public void setStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style) Set the style of the tileEntity.- Specified by:
setStructurePackin classAbstractTileEntityColonyBuilding- Parameters:
style- the style to set.
-
setBlueprintPath
Description copied from class:AbstractTileEntityColonyBuildingSet the blueprint path of the tileEntity.- Specified by:
setBlueprintPathin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE- Specified by:
setBlueprintPathin classAbstractTileEntityColonyBuilding- Parameters:
path- the path to set.
-
setPackName
- Specified by:
setPackNamein interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getPackName
- Specified by:
getPackNamein interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getBlueprintPath
Description copied from class:AbstractTileEntityColonyBuildingGet the blueprint path of the tileEntity.- Specified by:
getBlueprintPathin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE- Specified by:
getBlueprintPathin classAbstractTileEntityColonyBuilding- Returns:
- path the path to get.
-
getBuildingName
public net.minecraft.resources.ResourceLocation getBuildingName()Description copied from class:AbstractTileEntityColonyBuildingGet the building name that thisAbstractTileEntityColonyBuildingbelongs to.- Specified by:
getBuildingNamein classAbstractTileEntityColonyBuilding- Returns:
- The buildings name.
-
updateBlockState
public void updateBlockState()Description copied from class:AbstractTileEntityRackUpdate the blockState of the rack. Switch between connected, single, full and empty texture.- Overrides:
updateBlockStatein classTileEntityRack
-
getItemHandlerCap
public net.neoforged.neoforge.items.IItemHandler getItemHandlerCap(net.minecraft.core.Direction side) - Specified by:
getItemHandlerCapin interfaceIItemHandlerCapProvider- Overrides:
getItemHandlerCapin classTileEntityRack- Returns:
- direction-aware itemHandler
-
createMenu
@Nullable public @Nullable net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull @NotNull net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor- Overrides:
createMenuin classTileEntityRack
-
reactivate
public void reactivate()Reactivate the hut of this tileEntity. Load the schematic data and set the style correctly. -
writeColonyToItemStack
public void writeColonyToItemStack(net.minecraft.world.item.ItemStack stack) Write the colony id to the itemstack.- Parameters:
stack- the stack to write it to.
-