Class CitizenInventoryHandler
java.lang.Object
com.minecolonies.core.entity.citizen.citizenhandlers.CitizenInventoryHandler
- All Implemented Interfaces:
ICitizenInventoryHandler
Handles the inventory of the citizen.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the experience handler. -
Method Summary
Modifier and TypeMethodDescriptionintfindFirstSlotInInventoryWith(net.minecraft.world.item.Item targetItem) Returns the first slot in the inventory with a specific item.intfindFirstSlotInInventoryWith(net.minecraft.world.level.block.Block block) Returns the first slot in the inventory with a specific block.intgetItemCountInInventory(net.minecraft.world.item.Item targetItem) Returns the amount of a certain item in the inventory.intgetItemCountInInventory(net.minecraft.world.level.block.Block block) Returns the amount of a certain block in the inventory.booleanhasItemInInventory(net.minecraft.world.item.Item item) Checks if citizen has a certain item in the inventory.booleanhasItemInInventory(net.minecraft.world.level.block.Block block) Checks if citizen has a certain block in the inventory.booleanChecks whether or not the inventory is full
-
Constructor Details
-
CitizenInventoryHandler
Constructor for the experience handler.- Parameters:
citizen- the citizen owning the handler.
-
-
Method Details
-
findFirstSlotInInventoryWith
public int findFirstSlotInInventoryWith(net.minecraft.world.item.Item targetItem) Returns the first slot in the inventory with a specific item.- Specified by:
findFirstSlotInInventoryWithin interfaceICitizenInventoryHandler- Parameters:
targetItem- the item.- Returns:
- the slot.
-
findFirstSlotInInventoryWith
public int findFirstSlotInInventoryWith(net.minecraft.world.level.block.Block block) Returns the first slot in the inventory with a specific block.- Specified by:
findFirstSlotInInventoryWithin interfaceICitizenInventoryHandler- Parameters:
block- the block.- Returns:
- the slot.
-
getItemCountInInventory
public int getItemCountInInventory(net.minecraft.world.level.block.Block block) Returns the amount of a certain block in the inventory.- Specified by:
getItemCountInInventoryin interfaceICitizenInventoryHandler- Parameters:
block- the block.- Returns:
- the quantity.
-
getItemCountInInventory
public int getItemCountInInventory(net.minecraft.world.item.Item targetItem) Returns the amount of a certain item in the inventory.- Specified by:
getItemCountInInventoryin interfaceICitizenInventoryHandler- Parameters:
targetItem- the block.- Returns:
- the quantity.
-
hasItemInInventory
public boolean hasItemInInventory(net.minecraft.world.level.block.Block block) Checks if citizen has a certain block in the inventory.- Specified by:
hasItemInInventoryin interfaceICitizenInventoryHandler- Parameters:
block- the block.- Returns:
- true if so.
-
hasItemInInventory
public boolean hasItemInInventory(net.minecraft.world.item.Item item) Checks if citizen has a certain item in the inventory.- Specified by:
hasItemInInventoryin interfaceICitizenInventoryHandler- Parameters:
item- the item.- Returns:
- true if so.
-
isInventoryFull
public boolean isInventoryFull()Description copied from interface:ICitizenInventoryHandlerChecks whether or not the inventory is full- Specified by:
isInventoryFullin interfaceICitizenInventoryHandler- Returns:
- true if the inventory is full
-