basic crafting grid gui stuff (no functionality yet)

This commit is contained in:
Raoul Van den Berge
2015-12-22 13:31:00 +01:00
parent 2c65adaaee
commit 7a99d963b0
9 changed files with 107 additions and 8 deletions

View File

@@ -1,13 +1,36 @@
package storagecraft.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import storagecraft.tile.TileGrid;
public class ContainerGrid extends ContainerBase
{
public ContainerGrid(EntityPlayer player)
public ContainerGrid(EntityPlayer player, TileGrid grid)
{
super(player);
addPlayerInventory(8, 108);
if (grid.isCrafting())
{
int x = 44;
int y = 106;
for (int i = 0; i < 9; ++i)
{
addSlotToContainer(new Slot(grid.getCraftingInventory(), i, x, y));
x += 18;
if ((i + 1) % 3 == 0)
{
y += 18;
x = 44;
}
}
addSlotToContainer(new Slot(grid.getCraftingInventory(), 9, 125, 124));
}
addPlayerInventory(8, grid.isCrafting() ? 174 : 108);
}
}