} else {
return;
}
ItemStack[] stack = new ItemStack[9];
NEISetCraftingRecipe packet = PacketHandler.getPacket(NEISetCraftingRecipe.class);
for(PositionedStack ps : recipe.getIngredientStacks(recipeIndex)) {
int x = (ps.relx - 25) / 18;
int y = (ps.rely - 6) / 18;
int slot = x + y * 3;
if(x < 0 || x > 2 || y < 0 || y > 2 || slot < 0 || slot > 8) {
FMLClientHandler.instance().getClient().thePlayer.sendChatMessage("Internal Error. This button is broken.");
return;
}
if(slot < 9) {
stack[slot] = ps.items[0];
}
}
MainProxy.sendPacketToServer(packet.setContent(stack).setPosX(tile.xCoord).setPosY(tile.yCoord).setPosZ(tile.zCoord));
}