Class NBTCraftingGrid
java.lang.Object
net.minecraft.world.inventory.CraftingContainer
org.cyclops.evilcraft.core.inventory.NBTCraftingGrid
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.inventory.StackedContentsCompatible
public class NBTCraftingGrid
extends net.minecraft.world.inventory.CraftingContainer
A simple implementation of a crafting grid that stores it's inventory in NBT.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.cyclops.cyclopscore.inventory.ItemLocationprotected net.minecraft.world.entity.player.PlayerFields inherited from interface net.minecraft.world.Container
LARGE_MAX_STACK_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionNBTCraftingGrid(net.minecraft.world.entity.player.Player player, org.cyclops.cyclopscore.inventory.ItemLocation itemLocation, net.minecraft.world.inventory.AbstractContainerMenu eventHandler) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidreadFromNBT(net.minecraft.nbt.CompoundTag data, String tagName) voidsave()Save the grid state to NBT.protected voidwriteToNBT(net.minecraft.nbt.CompoundTag data, String tagName) Methods inherited from class net.minecraft.world.inventory.CraftingContainer
clearContent, fillStackedContents, getContainerSize, getHeight, getItem, getWidth, isEmpty, removeItem, removeItemNoUpdate, setChanged, setItem, stillValidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, startOpen, stopOpen
-
Field Details
-
player
protected net.minecraft.world.entity.player.Player player -
itemLocation
protected org.cyclops.cyclopscore.inventory.ItemLocation itemLocation
-
-
Constructor Details
-
NBTCraftingGrid
public NBTCraftingGrid(net.minecraft.world.entity.player.Player player, org.cyclops.cyclopscore.inventory.ItemLocation itemLocation, net.minecraft.world.inventory.AbstractContainerMenu eventHandler) Make a new instance.- Parameters:
player- The player using the grid.itemLocation- The item location.eventHandler- The event handler if the grid changes.
-
-
Method Details
-
save
public void save()Save the grid state to NBT. -
readFromNBT
-
writeToNBT
-