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

    Fields
    Modifier and Type
    Field
    Description
    protected org.cyclops.cyclopscore.inventory.ItemLocation
     
    protected net.minecraft.world.entity.player.Player
     

    Fields inherited from interface net.minecraft.world.Container

    LARGE_MAX_STACK_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    NBTCraftingGrid(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 Type
    Method
    Description
    protected void
    readFromNBT(net.minecraft.nbt.CompoundTag data, String tagName)
     
    void
    Save the grid state to NBT.
    protected void
    writeToNBT(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, stillValid

    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

    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

      protected void readFromNBT(net.minecraft.nbt.CompoundTag data, String tagName)
    • writeToNBT

      protected void writeToNBT(net.minecraft.nbt.CompoundTag data, String tagName)