basic crafting grid gui stuff (no functionality yet)
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
package storagecraft.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import storagecraft.inventory.InventorySimple;
|
||||
import storagecraft.util.InventoryUtils;
|
||||
|
||||
public class TileGrid extends TileMachine
|
||||
{
|
||||
private InventorySimple craftingInventory = new InventorySimple("crafting", 10);
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage()
|
||||
{
|
||||
@@ -12,4 +18,35 @@ public class TileGrid extends TileMachine
|
||||
public void updateMachine()
|
||||
{
|
||||
}
|
||||
|
||||
public int getType()
|
||||
{
|
||||
return worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public boolean isCrafting()
|
||||
{
|
||||
return getType() == 1;
|
||||
}
|
||||
|
||||
public InventorySimple getCraftingInventory()
|
||||
{
|
||||
return craftingInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
InventoryUtils.restoreInventory(craftingInventory, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
InventoryUtils.saveInventory(craftingInventory, nbt);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user