Class VanillaWrapper
java.lang.Object
org.moddingx.libx.inventory.VanillaWrapper
- All Implemented Interfaces:
Iterable<net.minecraft.world.item.ItemStack>, net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.entity.SlotProvider, net.neoforged.neoforge.common.extensions.ContainerExtension
Wraps an
IAdvancedItemHandlerModifiable to a vanilla Container.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
net.minecraft.world.Container.ContainerIterator -
Field Summary
FieldsFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionVanillaWrapper(IAdvancedItemHandlerModifiable handler, Runnable changed) Wraps the givenIAdvancedItemHandlerModifiableto a vanillaContainer. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int index, net.minecraft.world.item.ItemStack stack) voidintnet.minecraft.world.item.ItemStackgetItem(int index) booleanisEmpty()net.minecraft.world.item.ItemStackremoveItem(int index, int count) net.minecraft.world.item.ItemStackremoveItemNoUpdate(int index) voidvoidsetItem(int index, net.minecraft.world.item.ItemStack stack) booleanstillValid(net.minecraft.world.entity.player.Player player) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpenMethods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension
onTransfer, setItemMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.world.entity.SlotProvider
getSlotsFromRange
-
Field Details
-
handler
-
changed
-
-
Constructor Details
-
VanillaWrapper
Wraps the givenIAdvancedItemHandlerModifiableto a vanillaContainer.- Parameters:
changed- A runnable which is always called whenContainer.setChanged()is called on the vanilla container.
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
getItem
- Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
- Specified by:
removeItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
setItem
- Specified by:
setItemin interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container
-
stillValid
- Specified by:
stillValidin interfacenet.minecraft.world.Container
-
canPlaceItem
- Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-