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
Modifier and TypeFieldDescriptionstatic 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
ConstructorDescriptionDeprecated.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 TypeMethodDescriptionvoid
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 ofItemStack
inside this inventory.int
Deprecated.int[]
getSlotsForFace
(net.minecraft.core.Direction side) Deprecated.int
getState()
Deprecated.int
hashCode()
Deprecated.boolean
isEmpty()
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
Deprecated. -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleInventory> STREAM_CODECDeprecated. -
contents
protected final net.minecraft.world.item.ItemStack[] contentsDeprecated.
-
-
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
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 interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slotId) Deprecated.- Specified by:
getItem
in interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slotId, int count) Deprecated.- Specified by:
removeItem
in interfacenet.minecraft.world.Container
-
setItem
public void setItem(int slotId, net.minecraft.world.item.ItemStack itemstack) Deprecated.- Specified by:
setItem
in interfacenet.minecraft.world.Container
-
getMaxStackSize
public int getMaxStackSize()Deprecated.- Specified by:
getMaxStackSize
in interfacenet.minecraft.world.Container
-
onInventoryChanged
protected void onInventoryChanged()Deprecated. -
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player entityplayer) Deprecated.- Specified by:
stillValid
in interfacenet.minecraft.world.Container
-
startOpen
public void startOpen(net.minecraft.world.entity.player.Player playerIn) Deprecated.- Specified by:
startOpen
in interfacenet.minecraft.world.Container
-
stopOpen
public void stopOpen(net.minecraft.world.entity.player.Player playerIn) Deprecated.- Specified by:
stopOpen
in interfacenet.minecraft.world.Container
-
read
public void read(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag data) Deprecated.- Specified by:
read
in interfaceorg.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 interfaceorg.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 interfacenet.minecraft.world.Container
-
getItemStacks
public net.minecraft.world.item.ItemStack[] getItemStacks()Deprecated.Get the array ofItemStack
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 interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()Deprecated.- Specified by:
clearContent
in interfacenet.minecraft.world.Clearable
-
setChanged
public void setChanged()Deprecated.- Specified by:
setChanged
in interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()Deprecated.- Specified by:
isEmpty
in interfacenet.minecraft.world.Container
- Specified by:
isEmpty
in interfaceorg.cyclops.cyclopscore.inventory.INBTInventory
-
toNBT
public net.minecraft.nbt.CompoundTag toNBT(net.minecraft.core.HolderLookup.Provider provider) Deprecated.- Specified by:
toNBT
in interfaceorg.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 interfaceorg.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 interfacenet.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 interfacenet.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 interfacenet.minecraft.world.WorldlyContainer
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-