JEI transfer for pattern grid

This commit is contained in:
Raoul Van den Berge
2016-05-04 22:00:54 +02:00
parent 3f5c902086
commit f5376c657c
2 changed files with 10 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ public class MessageGridCraftingTransfer extends MessageHandlerPlayerToServer<Me
if (player.openContainer instanceof ContainerGrid) {
TileGrid grid = ((ContainerGrid) player.openContainer).getGrid();
if (grid.getType() == EnumGridType.CRAFTING) {
if (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) {
ItemStack[][] actualRecipe = new ItemStack[9][];
for (int x = 0; x < actualRecipe.length; x++) {

View File

@@ -209,14 +209,18 @@ public class TileGrid extends TileMachine implements IGrid {
if (recipe[i] != null) {
ItemStack[] possibilities = recipe[i];
for (ItemStack possibility : possibilities) {
ItemStack took = controller.take(possibility);
if (getType() == EnumGridType.CRAFTING) {
for (ItemStack possibility : possibilities) {
ItemStack took = controller.take(possibility);
if (took != null) {
craftingInventory.setInventorySlotContents(i, possibility);
if (took != null) {
craftingInventory.setInventorySlotContents(i, possibility);
break;
break;
}
}
} else if (getType() == EnumGridType.PATTERN) {
craftingInventory.setInventorySlotContents(i, possibilities[0]);
}
}
}