Class TileEntityColonyBuilding
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
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,net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.MenuProvider,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>
- 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.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
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 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_POSFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
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.<T> @NotNull net.minecraftforge.common.util.LazyOptional<T>getCapability(@NotNull net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable net.minecraft.core.Direction side) Returns the colony of the tile entity.intReturns the colony ID.@NotNull net.minecraft.network.chat.Componentnet.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.storage.StructurePackMetaGetter for the style.net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket@NotNull net.minecraft.nbt.CompoundTagvoidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag) booleanhasAccessPermission(net.minecraft.world.entity.player.Player player) Checks if the player has permission to access the hut.booleanCheck if building is mirrored.booleanisUsableByPlayer(@NotNull net.minecraft.world.entity.player.Player player) voidload(@NotNull net.minecraft.nbt.CompoundTag compound) voidonDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet) voidonLoad()voidReactivate the hut of this tileEntity.voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound) 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.voidsetMirror(boolean mirror) Set if the entity is mirrored.voidsetPackName(String packName) voidsetStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style) Set the style of the tileEntity.voidtick()Default parameterless ticking implementation.voidUpdate the blockState of the rack.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
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, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setLevel, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
addTag, getInWorldCorners, getRealWorldPos, getWorldTagPosMap, removeTag, writeSchematicDataToNBTMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getRenderBoundingBox, hasCustomOutlineRendering, requestModelDataUpdate, serializeNBT
-
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()- Overrides:
getUpdateTagin classTileEntityRack
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag) - Specified by:
handleUpdateTagin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
handleUpdateTagin classTileEntityRack
-
onDataPacket
public void onDataPacket(net.minecraft.network.Connection net, net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket packet) - Specified by:
onDataPacketin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
onDataPacketin classTileEntityRack
-
onLoad
public void onLoad()- Specified by:
onLoadin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-
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.
-
load
public void load(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - Overrides:
loadin classAbstractTileEntityColonyBuilding
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - 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.
-
setMirror
public void setMirror(boolean mirror) Set if the entity is mirrored.- Specified by:
setMirrorin classAbstractTileEntityColonyBuilding- Parameters:
mirror- true if so.
-
isMirrored
public boolean isMirrored()Check if building is mirrored.- Specified by:
isMirroredin classAbstractTileEntityColonyBuilding- Returns:
- true if so.
-
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
-
getCapability
@NotNull public <T> @NotNull net.minecraftforge.common.util.LazyOptional<T> getCapability(@NotNull @NotNull net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable @Nullable net.minecraft.core.Direction side) - Specified by:
getCapabilityin interfacenet.minecraftforge.common.capabilities.ICapabilityProvider- Overrides:
getCapabilityin classTileEntityRack
-
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.
-