Class LegacyRecipeWrapper

java.lang.Object
com.simibubi.create.foundation.blockEntity.LegacyRecipeWrapper
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.item.crafting.RecipeInput
Direct Known Subclasses:
SmartInventory, StorageInteractionWrapper

public class LegacyRecipeWrapper extends Object implements net.minecraft.world.Container, net.minecraft.world.item.crafting.RecipeInput
  • Field Summary

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

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary

    Constructors
    Constructor
    Description
    LegacyRecipeWrapper(net.neoforged.neoforge.items.IItemHandlerModifiable inv)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack)
     
    void
     
    int
    Returns the size of this inventory.
    net.minecraft.world.item.ItemStack
    getItem(int slot)
    Returns the stack in this slot.
    int
     
    boolean
     
    net.minecraft.world.item.ItemStack
    removeItem(int slot, int count)
    Attempts to remove n items from the specified slot.
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int index)
    Removes the stack contained in this slot from the underlying handler, and returns it.
    void
     
    void
    setItem(int slot, net.minecraft.world.item.ItemStack stack)
    Sets the contents of this slot to the provided stack.
    int
     
    void
    startOpen(net.minecraft.world.entity.player.Player player)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     
    void
    stopOpen(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.world.Container

    canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf
  • Field Details

    • inv

      protected final net.neoforged.neoforge.items.IItemHandlerModifiable inv
  • Constructor Details

    • LegacyRecipeWrapper

      public LegacyRecipeWrapper(net.neoforged.neoforge.items.IItemHandlerModifiable inv)
  • Method Details

    • size

      @NonExtendable @Internal public int size()
      Specified by:
      size in interface net.minecraft.world.item.crafting.RecipeInput
    • getContainerSize

      public int getContainerSize()
      Returns the size of this inventory.
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int slot)
      Returns the stack in this slot. This stack should be a modifiable reference, not a copy of a stack in your inventory.
      Specified by:
      getItem in interface net.minecraft.world.Container
      Specified by:
      getItem in interface net.minecraft.world.item.crafting.RecipeInput
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int slot, int count)
      Attempts to remove n items from the specified slot. Returns the split stack that was removed. Modifies the inventory.
      Specified by:
      removeItem in interface net.minecraft.world.Container
    • setItem

      public void setItem(int slot, net.minecraft.world.item.ItemStack stack)
      Sets the contents of this slot to the provided stack.
      Specified by:
      setItem in interface net.minecraft.world.Container
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index)
      Removes the stack contained in this slot from the underlying handler, and returns it.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Specified by:
      isEmpty in interface net.minecraft.world.item.crafting.RecipeInput
    • canPlaceItem

      public boolean canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack)
      Specified by:
      canPlaceItem in interface net.minecraft.world.Container
    • clearContent

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

      public int getMaxStackSize()
      Specified by:
      getMaxStackSize in interface net.minecraft.world.Container
    • setChanged

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

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in interface net.minecraft.world.Container
    • startOpen

      public void startOpen(net.minecraft.world.entity.player.Player player)
      Specified by:
      startOpen in interface net.minecraft.world.Container
    • stopOpen

      public void stopOpen(net.minecraft.world.entity.player.Player player)
      Specified by:
      stopOpen in interface net.minecraft.world.Container