Class InventoryFixedWrapper
java.lang.Object
alexiil.mc.lib.attributes.item.compat.InventoryFixedWrapper
- All Implemented Interfaces:
OpenWrapper,net.minecraft.inventory.Inventory,net.minecraft.util.Clearable
- Direct Known Subclasses:
SidedInventoryFixedWrapper
public abstract class InventoryFixedWrapper
extends Object
implements net.minecraft.inventory.Inventory, OpenWrapper
An
Inventory that wraps an FixedItemInv.
One of the Inventory methods must be overridden by subclasses however:
Inventory.canPlayerUse(PlayerEntity).
-
Field Summary
FieldsFields inherited from interface net.minecraft.inventory.Inventory
MAX_COUNT_PER_STACK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()net.minecraft.item.ItemStackgetStack(int slot) booleanisEmpty()booleanisValid(int slot, net.minecraft.item.ItemStack stack) voidnet.minecraft.item.ItemStackremoveStack(int slot) net.minecraft.item.ItemStackremoveStack(int slot, int amount) voidsetStack(int slot, net.minecraft.item.ItemStack to) intsize()booleansoftSetInvStack(int slot, net.minecraft.item.ItemStack to) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, containsAny, containsAny, count, getMaxCountPerStack, onClose, onOpen
-
Field Details
-
inv
-
-
Constructor Details
-
InventoryFixedWrapper
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfacenet.minecraft.util.Clearable
-
size
public int size()- Specified by:
sizein interfacenet.minecraft.inventory.Inventory
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.inventory.Inventory
-
getStack
public net.minecraft.item.ItemStack getStack(int slot) - Specified by:
getStackin interfacenet.minecraft.inventory.Inventory
-
removeStack
public net.minecraft.item.ItemStack removeStack(int slot, int amount) - Specified by:
removeStackin interfacenet.minecraft.inventory.Inventory
-
removeStack
public net.minecraft.item.ItemStack removeStack(int slot) - Specified by:
removeStackin interfacenet.minecraft.inventory.Inventory
-
setStack
public void setStack(int slot, net.minecraft.item.ItemStack to) - Specified by:
setStackin interfacenet.minecraft.inventory.Inventory
-
softSetInvStack
public boolean softSetInvStack(int slot, net.minecraft.item.ItemStack to) -
isValid
public boolean isValid(int slot, net.minecraft.item.ItemStack stack) - Specified by:
isValidin interfacenet.minecraft.inventory.Inventory
-
markDirty
public void markDirty()- Specified by:
markDirtyin interfacenet.minecraft.inventory.Inventory
-
getWrapped
- Specified by:
getWrappedin interfaceOpenWrapper- Returns:
- The object that this wraps, or null if the wrapped object cannot be converted cleanly without exposing
additional details.
For example LBA's
InventorytoFixedItemInvViewwrapper (FixedInventoryViewVanillaWrapper) implements this to return theInventory, but theSidedInventoryvariant (FixedSidedInventoryVanillaWrapper) returns null, as it is not possible to cleanly open the original inventory without exposing additional slots.
-