T - The type of the inventory (e.g. IInventory)I - The type of the item (e.g. Integer)S - The type of the item stack (e.g. LegacyItemStack)public class InventoryHolder<T extends IInventory<I,S>,I,S extends net.lenni0451.mcstructs.items.AItemStack<I,S>>
extends java.lang.Object
| Constructor and Description |
|---|
InventoryHolder(T playerInventory,
AContainer<T,I,S> playerContainer)
Create a new inventory holder.
|
InventoryHolder(T playerInventory,
R recipeRegistry,
java.util.function.BiFunction<T,R,AContainer<T,I,S>> playerContainerProvider)
Create a new inventory holder.
|
| Modifier and Type | Method and Description |
|---|---|
AContainer<T,I,S> |
getOpenContainer() |
T |
getPlayerInventory() |
AContainer<T,I,S> |
getPlayerInventoryContainer() |
int |
getXpLevel() |
boolean |
isCreativeMode() |
void |
setCreativeMode(boolean creativeMode)
Set the creative mode state.
|
void |
setOpenContainer(AContainer<T,I,S> openContainer)
Set the currently open container.
|
void |
setXpLevel(int xpLevel)
Set the xp level of the inventory holder.
|
public InventoryHolder(T playerInventory, R recipeRegistry, java.util.function.BiFunction<T,R,AContainer<T,I,S>> playerContainerProvider)
R - The type of the recipe registry (e.g. RecipeRegistry)playerInventory - The player inventoryrecipeRegistry - The recipe registryplayerContainerProvider - The player container providerpublic InventoryHolder(T playerInventory, AContainer<T,I,S> playerContainer)
playerInventory - The player inventoryplayerContainer - The player containerpublic T getPlayerInventory()
public AContainer<T,I,S> getPlayerInventoryContainer()
public AContainer<T,I,S> getOpenContainer()
public void setOpenContainer(@Nullable
AContainer<T,I,S> openContainer)
openContainer - The new open containerpublic boolean isCreativeMode()
public void setCreativeMode(boolean creativeMode)
creativeMode - The new creative mode statepublic int getXpLevel()
public void setXpLevel(int xpLevel)
xpLevel - The new xp level