Escaping out of the crafting gui goes back to the grid gui

This commit is contained in:
Raoul Van den Berge
2016-05-17 13:02:22 +02:00
parent 6325fbd4c0
commit cd5a1af0b9
2 changed files with 8 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ public class GuiCraftingSettings extends GuiBase {
private GuiGrid gridGui;
private int id;
private GuiButton startButton;
private boolean isClosed;
public GuiCraftingSettings(GuiGrid gridGui, int id) {
super(new ContainerDummy(), 143, 61);
@@ -60,6 +61,8 @@ public class GuiCraftingSettings extends GuiBase {
} else {
if (keyCode == Keyboard.KEY_RETURN) {
startRequest();
} else if (keyCode == Keyboard.KEY_ESCAPE) {
FMLClientHandler.instance().showGuiScreen(gridGui);
} else {
super.keyTyped(character, keyCode);
}

View File

@@ -68,6 +68,11 @@ public class BasicCraftingTask implements ICraftingTask {
satisfied[i] = true;
// This is needed because if we request 2 chests for example
// it will schedule 2 child tasks for wood the child tasks will then give 8 wood
// but the first chest task will take all the 8 wood for completion
// and then you end up with the second task not having anything anymore
// and is stuck because the child task is already created.
if (childTasks[i]) {
break;
}