use of mcjty.rftools.craftinggrid.CraftingRecipe in project RFTools by McJty.
the class GuiCrafter method selectRecipe.
private void selectRecipe() {
int selected = recipeList.getSelected();
lastSelected = selected;
if (selected == -1) {
for (int i = 0; i < 10; i++) {
inventorySlots.getSlot(i).putStack(ItemStack.EMPTY);
}
keepItem.setChoice("All");
internalRecipe.setChoice("Ext");
return;
}
CraftingRecipe craftingRecipe = tileEntity.getRecipe(selected);
InventoryCrafting inv = craftingRecipe.getInventory();
for (int i = 0; i < 9; i++) {
inventorySlots.getSlot(i).putStack(inv.getStackInSlot(i));
}
inventorySlots.getSlot(9).putStack(craftingRecipe.getResult());
keepItem.setChoice(craftingRecipe.isKeepOne() ? "Keep" : "All");
internalRecipe.setChoice(craftingRecipe.getCraftMode().getDescription());
}
use of mcjty.rftools.craftinggrid.CraftingRecipe in project RFTools by McJty.
the class GuiCrafter method updateRecipe.
private void updateRecipe() {
int selected = recipeList.getSelected();
if (selected == -1) {
return;
}
CraftingRecipe craftingRecipe = tileEntity.getRecipe(selected);
boolean keepOne = "Keep".equals(keepItem.getCurrentChoice());
CraftingRecipe.CraftMode mode;
if ("Int".equals(internalRecipe.getCurrentChoice())) {
mode = CraftingRecipe.CraftMode.INT;
} else if ("Ext".equals(internalRecipe.getCurrentChoice())) {
mode = CraftingRecipe.CraftMode.EXT;
} else {
mode = CraftingRecipe.CraftMode.EXTC;
}
craftingRecipe.setKeepOne(keepOne);
craftingRecipe.setCraftMode(mode);
sendChangeToServer(selected, craftingRecipe.getInventory(), craftingRecipe.getResult(), keepOne, mode);
}
Aggregations