Class TileEntityWareHouse
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
- 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
Class which handles the tileEntity of our colony warehouse.
-
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
Fields inherited from class com.minecolonies.core.tileentities.TileEntityColonyBuilding
registryNameFields 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
ConstructorsConstructorDescriptionTileEntityWareHouse(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoiddumpInventoryIntoWareHouse(@NotNull InventoryCitizen inventoryCitizen) Dump the inventory of a citizen into the warehouse.getMatchingItemStacksInWarehouse(@NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Method used to check if this warehouse holds any of the requested itemstacks.getRackForStack(net.minecraft.world.item.ItemStack stack) Get a rack for a stack.booleanhasMatchingItemStackInWarehouse(@NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate, int count) Method to get the first matching ItemStack in the Warehouse.booleanhasMatchingItemStackInWarehouse(@NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT) Method used to check if this warehouse holds any of the requested itemstacks.booleanhasMatchingItemStackInWarehouse(@NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT, boolean ignoreDamage, int leftOver) Method used to check if this warehouse holds any of the requested itemstacks.booleanhasMatchingItemStackInWarehouse(@NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT, int leftOver) Method used to check if this warehouse holds any of the requested itemstacks.Methods inherited from class com.minecolonies.core.tileentities.TileEntityColonyBuilding
createMenu, getBlueprintPath, getBuilding, getBuildingName, getBuildingView, getColony, getColonyId, getDisplayName, getItemHandlerCap, getPackName, getPosition, getPositionOfChestWithItemStack, getRotationMirror, getStructurePack, getUpdatePacket, getUpdateTag, handleUpdateTag, hasAccessPermission, isUsableByPlayer, loadAdditional, onDataPacket, onLoad, reactivate, saveAdditional, setBlueprintPath, setBuilding, setChanged, setColony, setPackName, setRotationMirror, setStructurePack, tick, updateBlockState, writeColonyToItemStackMethods 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
-
Constructor Details
-
TileEntityWareHouse
public TileEntityWareHouse(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
hasMatchingItemStackInWarehouse
public boolean hasMatchingItemStackInWarehouse(@NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate, int count) Description copied from class:AbstractTileEntityWareHouseMethod to get the first matching ItemStack in the Warehouse.- Specified by:
hasMatchingItemStackInWarehousein classAbstractTileEntityWareHouse- Parameters:
itemStackSelectionPredicate- The predicate to select the ItemStack with.- Returns:
- The first matching ItemStack.
-
hasMatchingItemStackInWarehouse
public boolean hasMatchingItemStackInWarehouse(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT) Description copied from class:AbstractTileEntityWareHouseMethod used to check if this warehouse holds any of the requested itemstacks.- Specified by:
hasMatchingItemStackInWarehousein classAbstractTileEntityWareHouse- Parameters:
itemStack- The stack to check with to check with.count- the min count.ignoreNBT- if the nbt value should be ignored.- Returns:
- True when the warehouse holds a stack, false when not.
-
hasMatchingItemStackInWarehouse
public boolean hasMatchingItemStackInWarehouse(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT, boolean ignoreDamage, int leftOver) Description copied from class:AbstractTileEntityWareHouseMethod used to check if this warehouse holds any of the requested itemstacks.- Specified by:
hasMatchingItemStackInWarehousein classAbstractTileEntityWareHouse- Parameters:
itemStack- The stack to check with to check with.count- the min count.ignoreNBT- if the nbt value should be ignored.ignoreDamage- the ignore damage.leftOver- the leftover to keep at the warehouse at all times.- Returns:
- True when the warehouse holds a stack, false when not.
-
hasMatchingItemStackInWarehouse
public boolean hasMatchingItemStackInWarehouse(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack, int count, boolean ignoreNBT, int leftOver) Description copied from class:AbstractTileEntityWareHouseMethod used to check if this warehouse holds any of the requested itemstacks.- Specified by:
hasMatchingItemStackInWarehousein classAbstractTileEntityWareHouse- Parameters:
itemStack- The stack to check with to check with.count- the min count.ignoreNBT- if the nbt value should be ignored.leftOver- the leftover to keep at the warehouse at all times.- Returns:
- True when the warehouse holds a stack, false when not.
-
getMatchingItemStacksInWarehouse
@NotNull public @NotNull List<Tuple<net.minecraft.world.item.ItemStack,net.minecraft.core.BlockPos>> getMatchingItemStacksInWarehouse(@NotNull @NotNull Predicate<net.minecraft.world.item.ItemStack> itemStackSelectionPredicate) Description copied from class:AbstractTileEntityWareHouseMethod used to check if this warehouse holds any of the requested itemstacks.- Specified by:
getMatchingItemStacksInWarehousein classAbstractTileEntityWareHouse- Parameters:
itemStackSelectionPredicate- The predicate to check with.- Returns:
- True when the warehouse holds a stack, false when not.
-
dumpInventoryIntoWareHouse
Description copied from class:AbstractTileEntityWareHouseDump the inventory of a citizen into the warehouse. Go through all items and search the right chest to dump it in.- Specified by:
dumpInventoryIntoWareHousein classAbstractTileEntityWareHouse- Parameters:
inventoryCitizen- the inventory of the citizen
-
getRackForStack
Get a rack for a stack.- Parameters:
stack- the stack to insert.- Returns:
- the matching rack.
-