Class VanillaWrapper

java.lang.Object
org.moddingx.libx.inventory.VanillaWrapper
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container

public class VanillaWrapper extends Object implements net.minecraft.world.Container
Wraps an IItemHandlerModifiable to a vanilla Container.
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    final Runnable
     
    final net.neoforged.neoforge.items.IItemHandlerModifiable
     

    Fields inherited from interface net.minecraft.world.Container Link icon

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    VanillaWrapper(net.neoforged.neoforge.items.IItemHandlerModifiable handler, Runnable changed)
    Wraps the given IItemHandlerModifiable to a vanilla Container.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    canPlaceItem(int index, net.minecraft.world.item.ItemStack stack)
     
    void
     
    int
     
    net.minecraft.world.item.ItemStack
    getItem(int index)
     
    boolean
     
    net.minecraft.world.item.ItemStack
    removeItem(int index, int count)
     
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
     
    void
     
    void
    setItem(int index, net.minecraft.world.item.ItemStack stack)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.Container Link icon

    canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
  • Field Details Link icon

    • handler Link icon

      public final net.neoforged.neoforge.items.IItemHandlerModifiable handler
    • changed Link icon

      @Nullable public final Runnable changed
  • Constructor Details Link icon

    • VanillaWrapper Link icon

      public VanillaWrapper(net.neoforged.neoforge.items.IItemHandlerModifiable handler, @Nullable Runnable changed)
      Wraps the given IItemHandlerModifiable to a vanilla Container.
      Parameters:
      changed - A runnable which is always called when Container.setChanged() is called on the vanilla container.
  • Method Details Link icon

    • getContainerSize Link icon

      public int getContainerSize()
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • isEmpty Link icon

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
    • getItem Link icon

      @Nonnull public net.minecraft.world.item.ItemStack getItem(int index)
      Specified by:
      getItem in interface net.minecraft.world.Container
    • removeItem Link icon

      @Nonnull public net.minecraft.world.item.ItemStack removeItem(int index, int count)
      Specified by:
      removeItem in interface net.minecraft.world.Container
    • removeItemNoUpdate Link icon

      @Nonnull public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
    • setItem Link icon

      public void setItem(int index, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      setItem in interface net.minecraft.world.Container
    • setChanged Link icon

      public void setChanged()
      Specified by:
      setChanged in interface net.minecraft.world.Container
    • stillValid Link icon

      public boolean stillValid(@Nonnull net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in interface net.minecraft.world.Container
    • canPlaceItem Link icon

      public boolean canPlaceItem(int index, @Nonnull net.minecraft.world.item.ItemStack stack)
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
    • clearContent Link icon

      public void clearContent()
      Specified by:
      clearContent in interface net.minecraft.world.Clearable