JEI transfer for pattern grid
This commit is contained in:
@@ -37,7 +37,7 @@ public class MessageGridCraftingTransfer extends MessageHandlerPlayerToServer<Me
|
|||||||
if (player.openContainer instanceof ContainerGrid) {
|
if (player.openContainer instanceof ContainerGrid) {
|
||||||
TileGrid grid = ((ContainerGrid) player.openContainer).getGrid();
|
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][];
|
ItemStack[][] actualRecipe = new ItemStack[9][];
|
||||||
|
|
||||||
for (int x = 0; x < actualRecipe.length; x++) {
|
for (int x = 0; x < actualRecipe.length; x++) {
|
||||||
|
|||||||
@@ -209,14 +209,18 @@ public class TileGrid extends TileMachine implements IGrid {
|
|||||||
if (recipe[i] != null) {
|
if (recipe[i] != null) {
|
||||||
ItemStack[] possibilities = recipe[i];
|
ItemStack[] possibilities = recipe[i];
|
||||||
|
|
||||||
for (ItemStack possibility : possibilities) {
|
if (getType() == EnumGridType.CRAFTING) {
|
||||||
ItemStack took = controller.take(possibility);
|
for (ItemStack possibility : possibilities) {
|
||||||
|
ItemStack took = controller.take(possibility);
|
||||||
|
|
||||||
if (took != null) {
|
if (took != null) {
|
||||||
craftingInventory.setInventorySlotContents(i, possibility);
|
craftingInventory.setInventorySlotContents(i, possibility);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if (getType() == EnumGridType.PATTERN) {
|
||||||
|
craftingInventory.setInventorySlotContents(i, possibilities[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user