Class SimpleInventory

java.lang.Object
org.cyclops.cyclopscore.inventory.SimpleInventory
All Implemented Interfaces:
net.minecraft.world.Clearable, net.minecraft.world.Container, net.minecraft.world.WorldlyContainer, org.cyclops.cyclopscore.inventory.INBTInventory, org.cyclops.cyclopscore.persist.nbt.INBTSerializable
Direct Known Subclasses:
LargeInventory, NBTSimpleInventoryItemHeld, NBTSimpleInventoryItemStack

@Deprecated public class SimpleInventory extends Object implements org.cyclops.cyclopscore.inventory.INBTInventory, net.minecraft.world.WorldlyContainer
Deprecated.
A basic inventory implementation.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable

    org.cyclops.cyclopscore.persist.nbt.INBTSerializable.SelfNBTClassType
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<SimpleInventory>
    Deprecated.
     
    protected final net.minecraft.world.item.ItemStack[]
    Deprecated.
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleInventory>
    Deprecated.
     

    Fields inherited from interface net.minecraft.world.Container

    DEFAULT_DISTANCE_BUFFER
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Default constructor for NBT persistence, don't call this yourself.
    SimpleInventory(int size, int stackLimit)
    Deprecated.
    Make a new instance.
    SimpleInventory(int size, int stackLimit, List<net.minecraft.world.item.ItemStack> contents)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDirtyMarkListener(org.cyclops.cyclopscore.persist.IDirtyMarkListener dirtyMarkListener)
    Deprecated.
    Add a dirty marking listener.
    boolean
    canPlaceItem(int i, net.minecraft.world.item.ItemStack itemstack)
    Deprecated.
     
    boolean
    canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, net.minecraft.core.Direction direction)
    Deprecated.
     
    boolean
    canTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction direction)
    Deprecated.
     
    void
    Deprecated.
     
    boolean
    Deprecated.
     
    void
    fromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag tag)
    Deprecated.
     
    int
    Deprecated.
     
    net.minecraft.world.item.ItemStack
    getItem(int slotId)
    Deprecated.
     
    net.neoforged.neoforge.items.IItemHandler
    Deprecated.
     
    net.neoforged.neoforge.items.IItemHandler
    getItemHandlerSided(net.minecraft.core.Direction side)
    Deprecated.
     
    net.minecraft.world.item.ItemStack[]
    Deprecated.
    Get the array of ItemStack inside this inventory.
    int
    Deprecated.
     
    int[]
    getSlotsForFace(net.minecraft.core.Direction side)
    Deprecated.
     
    int
    Deprecated.
     
    int
    Deprecated.
     
    boolean
    Deprecated.
     
    protected void
    Deprecated.
     
    void
    read(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data)
    Deprecated.
     
    void
    readFromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tag)
    Deprecated.
     
    void
    removeDirtyMarkListener(org.cyclops.cyclopscore.persist.IDirtyMarkListener dirtyMarkListener)
    Deprecated.
    Remove a dirty marking listener.
    net.minecraft.world.item.ItemStack
    removeItem(int slotId, int count)
    Deprecated.
     
    net.minecraft.world.item.ItemStack
    removeItemNoUpdate(int slotId)
    Deprecated.
     
    void
    Deprecated.
     
    void
    setItem(int slotId, net.minecraft.world.item.ItemStack itemstack)
    Deprecated.
     
    void
    startOpen(net.minecraft.world.entity.player.Player playerIn)
    Deprecated.
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player entityplayer)
    Deprecated.
     
    void
    stopOpen(net.minecraft.world.entity.player.Player playerIn)
    Deprecated.
     
    net.minecraft.nbt.CompoundTag
    toNBT(net.minecraft.core.HolderLookup.Provider provider)
    Deprecated.
     
    void
    write(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data)
    Deprecated.
     
    void
    writeToNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tag)
    Deprecated.
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.world.Container

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

    • CODEC

      public static final com.mojang.serialization.Codec<SimpleInventory> CODEC
      Deprecated.
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleInventory> STREAM_CODEC
      Deprecated.
    • contents

      protected final net.minecraft.world.item.ItemStack[] contents
      Deprecated.
  • Constructor Details

    • SimpleInventory

      public SimpleInventory()
      Deprecated.
      Default constructor for NBT persistence, don't call this yourself.
    • SimpleInventory

      public SimpleInventory(int size, int stackLimit)
      Deprecated.
      Make a new instance.
      Parameters:
      size - The amount of slots in the inventory.
      stackLimit - The stack limit for each slot.
    • SimpleInventory

      public SimpleInventory(int size, int stackLimit, List<net.minecraft.world.item.ItemStack> contents)
      Deprecated.
  • Method Details

    • addDirtyMarkListener

      public void addDirtyMarkListener(org.cyclops.cyclopscore.persist.IDirtyMarkListener dirtyMarkListener)
      Deprecated.
      Add a dirty marking listener.
      Parameters:
      dirtyMarkListener - The dirty mark listener.
    • removeDirtyMarkListener

      public void removeDirtyMarkListener(org.cyclops.cyclopscore.persist.IDirtyMarkListener dirtyMarkListener)
      Deprecated.
      Remove a dirty marking listener.
      Parameters:
      dirtyMarkListener - The dirty mark listener.
    • getContainerSize

      public int getContainerSize()
      Deprecated.
      Specified by:
      getContainerSize in interface net.minecraft.world.Container
    • getItem

      public net.minecraft.world.item.ItemStack getItem(int slotId)
      Deprecated.
      Specified by:
      getItem in interface net.minecraft.world.Container
    • removeItem

      public net.minecraft.world.item.ItemStack removeItem(int slotId, int count)
      Deprecated.
      Specified by:
      removeItem in interface net.minecraft.world.Container
    • setItem

      public void setItem(int slotId, net.minecraft.world.item.ItemStack itemstack)
      Deprecated.
      Specified by:
      setItem in interface net.minecraft.world.Container
    • getMaxStackSize

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

      protected void onInventoryChanged()
      Deprecated.
    • stillValid

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

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

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

      public void read(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data)
      Deprecated.
      Specified by:
      read in interface org.cyclops.cyclopscore.inventory.INBTInventory
    • readFromNBT

      public void readFromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tag)
      Deprecated.
    • write

      public void write(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data)
      Deprecated.
      Specified by:
      write in interface org.cyclops.cyclopscore.inventory.INBTInventory
    • writeToNBT

      public void writeToNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data, String tag)
      Deprecated.
    • removeItemNoUpdate

      public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slotId)
      Deprecated.
      Specified by:
      removeItemNoUpdate in interface net.minecraft.world.Container
    • getItemStacks

      public net.minecraft.world.item.ItemStack[] getItemStacks()
      Deprecated.
      Get the array of ItemStack inside this inventory.
      Returns:
      The items in this inventory.
    • canPlaceItem

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

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

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

      public boolean isEmpty()
      Deprecated.
      Specified by:
      isEmpty in interface net.minecraft.world.Container
      Specified by:
      isEmpty in interface org.cyclops.cyclopscore.inventory.INBTInventory
    • toNBT

      public net.minecraft.nbt.CompoundTag toNBT(net.minecraft.core.HolderLookup.Provider provider)
      Deprecated.
      Specified by:
      toNBT in interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
    • fromNBT

      public void fromNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag tag)
      Deprecated.
      Specified by:
      fromNBT in interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
    • getItemHandler

      public net.neoforged.neoforge.items.IItemHandler getItemHandler()
      Deprecated.
    • getItemHandlerSided

      public net.neoforged.neoforge.items.IItemHandler getItemHandlerSided(net.minecraft.core.Direction side)
      Deprecated.
    • getState

      public int getState()
      Deprecated.
      Returns:
      The inventory state.
    • getSlotsForFace

      public int[] getSlotsForFace(net.minecraft.core.Direction side)
      Deprecated.
      Specified by:
      getSlotsForFace in interface net.minecraft.world.WorldlyContainer
    • canPlaceItemThroughFace

      public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack itemStackIn, @Nullable net.minecraft.core.Direction direction)
      Deprecated.
      Specified by:
      canPlaceItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • canTakeItemThroughFace

      public boolean canTakeItemThroughFace(int index, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction direction)
      Deprecated.
      Specified by:
      canTakeItemThroughFace in interface net.minecraft.world.WorldlyContainer
    • equals

      public boolean equals(Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object