Class AbstractTileEntityColonyBuilding
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
- All Implemented Interfaces:
com.ldtteam.domumornamentum.entity.block.IMateriallyTexturedBlockEntity,com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE,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:
TileEntityColonyBuilding
public abstract class AbstractTileEntityColonyBuilding
extends TileEntityRack
implements com.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
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
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_PACK, TAG_PATH, 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
ConstructorsConstructorDescriptionAbstractTileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionabstract StringGet the blueprint path of the tileEntity.abstract IBuildingReturns the building associated with the tile entity.abstract net.minecraft.resources.ResourceLocationGet the building name that thisAbstractTileEntityColonyBuildingbelongs to.abstract IBuildingViewReturns the view of the building associated with the tile entity.Get a list version of the positioned tags, mapped from tag name to position.abstract IColonyReturns the colony of the tile entity.abstract intReturns the colony ID.abstract net.minecraft.core.BlockPosReturns the position of the tile entity.abstract @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.net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> abstract com.ldtteam.structurize.storage.StructurePackMetaGetter for the style.net.minecraft.core.BlockPosabstract booleanhasAccessPermission(net.minecraft.world.entity.player.Player player) Checks if the player has permission to access the hut.static booleanisInTileEntity(net.minecraftforge.common.capabilities.ICapabilityProvider entity, @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Finds the first @see ItemStack the type ofis.abstract booleanCheck if building is mirrored.booleanCheck if the TE is on an old data version.voidload(@NotNull net.minecraft.nbt.CompoundTag compound) voidreadSchematicDataFromNBT(net.minecraft.nbt.CompoundTag originalCompound) voidsaveAdditional(@NotNull net.minecraft.nbt.CompoundTag compound) abstract voidsetBlueprintPath(String path) Set the blueprint path of the tileEntity.abstract voidSets the building associated with the tile entity.abstract voidSets the colony of the tile entity.abstract voidsetMirror(boolean mirror) Set if the entity is mirrored.voidsetPositionedTags(Map<net.minecraft.core.BlockPos, List<String>> positionedTags) voidsetSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) voidsetSchematicName(String name) abstract voidsetStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style) Set the pack of the tileEntity.Methods inherited from class com.minecolonies.core.tileentities.TileEntityRack
createInventory, createMenu, getAllContent, getCapability, getCount, getCount, getDisplayName, getFreeSlots, getItemCount, getModelData, getOtherChest, getTextureData, getUpdatePacket, getUpdateTag, getUpgradeSize, handleUpdateTag, hasItemStack, hasItemStack, hasItemStorage, hasSimilarStack, isEmpty, onDataPacket, setChanged, setInWarehouse, setRemoved, updateBlockState, 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, getPackName, getRealWorldPos, getUpdatePacket, getWorldTagPosMap, removeTag, setPackName, writeSchematicDataToNBTMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getRenderBoundingBox, hasCustomOutlineRendering, onLoad, requestModelDataUpdate, serializeNBT
-
Constructor Details
-
AbstractTileEntityColonyBuilding
public AbstractTileEntityColonyBuilding(net.minecraft.world.level.block.entity.BlockEntityType<? extends AbstractTileEntityColonyBuilding> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
isInTileEntity
public static boolean isInTileEntity(net.minecraftforge.common.capabilities.ICapabilityProvider entity, @NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Finds the first @see ItemStack the type ofis. It will be taken from the chest and placed in the worker inventory. Make sure that the worker stands next the chest to not break immersion. Also make sure to have inventory space for the stack.- Parameters:
entity- the tileEntity chest or building.itemStackSelectionPredicate- the itemStack predicate.- Returns:
- true if found the stack.
-
getColonyId
public abstract int getColonyId()Returns the colony ID.- Returns:
- ID of the colony.
-
getColony
Returns the colony of the tile entity.- Returns:
- Colony of the tile entity.
-
setColony
Sets the colony of the tile entity.- Parameters:
c- Colony to set in references.
-
getPosition
public abstract net.minecraft.core.BlockPos getPosition()Returns the position of the tile entity.- Returns:
- Block Coordinates of the tile entity.
-
getPositionOfChestWithItemStack
@Nullable public abstract @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.- Parameters:
itemStackSelectionPredicate- the stack to search for.- Returns:
- the position or null.
-
getBuilding
Returns the building associated with the tile entity.- Returns:
IBuildingContainerassociated with the tile entity.
-
setBuilding
Sets the building associated with the tile entity.- Parameters:
b-IBuildingContainerto associate with the tile entity.
-
getBuildingView
Returns the view of the building associated with the tile entity.- Returns:
IBuildingViewthe tile entity is associated with.
-
hasAccessPermission
public abstract boolean hasAccessPermission(net.minecraft.world.entity.player.Player player) Checks if the player has permission to access the hut.- Parameters:
player- Player to check permission of.- Returns:
- True when player has access, or building doesn't exist, otherwise false.
-
setMirror
public abstract void setMirror(boolean mirror) Set if the entity is mirrored.- Parameters:
mirror- true if so.
-
isMirrored
public abstract boolean isMirrored()Check if building is mirrored.- Returns:
- true if so.
-
getStructurePack
public abstract com.ldtteam.structurize.storage.StructurePackMeta getStructurePack()Getter for the style.- Returns:
- the pack of it.
-
setStructurePack
public abstract void setStructurePack(com.ldtteam.structurize.storage.StructurePackMeta style) Set the pack of the tileEntity.- Parameters:
style- the pack to set.
-
setBlueprintPath
Set the blueprint path of the tileEntity.- Specified by:
setBlueprintPathin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE- Parameters:
path- the path to set.
-
getBlueprintPath
Get the blueprint path of the tileEntity.- Specified by:
getBlueprintPathin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE- Returns:
- path the path to get.
-
getBuildingName
public abstract net.minecraft.resources.ResourceLocation getBuildingName()Get the building name that thisAbstractTileEntityColonyBuildingbelongs to.- Returns:
- The buildings name.
-
getSchematicName
- Specified by:
getSchematicNamein interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
setSchematicName
- Specified by:
setSchematicNamein interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getPositionedTags
- Specified by:
getPositionedTagsin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getWorldTagNamePosMap
- Specified by:
getWorldTagNamePosMapin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getCachedWorldTagNamePosMap
Get a list version of the positioned tags, mapped from tag name to position.- Returns:
- the list version.
-
setPositionedTags
- Specified by:
setPositionedTagsin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
getSchematicCorners
public net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> getSchematicCorners()- Specified by:
getSchematicCornersin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
setSchematicCorners
public void setSchematicCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) - Specified by:
setSchematicCornersin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
load
public void load(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - Overrides:
loadin classTileEntityRack
-
readSchematicDataFromNBT
public void readSchematicDataFromNBT(net.minecraft.nbt.CompoundTag originalCompound) - Specified by:
readSchematicDataFromNBTin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
saveAdditional
public void saveAdditional(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) - Overrides:
saveAdditionalin classTileEntityRack
-
getTilePos
public net.minecraft.core.BlockPos getTilePos()- Specified by:
getTilePosin interfacecom.ldtteam.structurize.blockentities.interfaces.IBlueprintDataProviderBE
-
isOutdated
public boolean isOutdated()Check if the TE is on an old data version.- Returns:
- true if so.
-