pattern item stuff, texture is broken
This commit is contained in:
@@ -2,6 +2,7 @@ package storagecraft.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import storagecraft.StorageCraftItems;
|
||||
import storagecraft.block.EnumGridType;
|
||||
import storagecraft.container.slot.SlotDisabled;
|
||||
@@ -13,10 +14,14 @@ import storagecraft.tile.TileGrid;
|
||||
|
||||
public class ContainerGrid extends ContainerBase
|
||||
{
|
||||
private TileGrid grid;
|
||||
|
||||
public ContainerGrid(EntityPlayer player, TileGrid grid)
|
||||
{
|
||||
super(player);
|
||||
|
||||
this.grid = grid;
|
||||
|
||||
addPlayerInventory(8, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 174 : 108);
|
||||
|
||||
if (grid.getType() == EnumGridType.CRAFTING)
|
||||
@@ -63,4 +68,15 @@ public class ContainerGrid extends ContainerBase
|
||||
addSlotToContainer(new SlotOutput(grid.getPatternInventory(), 1, 137, 150));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int id, int clickedButton, int mode, EntityPlayer player)
|
||||
{
|
||||
if (id >= 0 && getSlot(id) instanceof SlotDisabled)
|
||||
{
|
||||
grid.onPatternCreate();
|
||||
}
|
||||
|
||||
return super.slotClick(id, clickedButton, mode, player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user