+64 in crafting start GUI now gives 64 from the first time instead of 65, fixes #334

This commit is contained in:
Raoul Van den Berge
2016-09-14 19:30:45 +02:00
parent a2144ef4fd
commit e85f0e7a7d
3 changed files with 5 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ import refinedstorage.network.MessageGridCraftingStart;
import java.io.IOException;
public class GuiCraftingSettings extends GuiBase {
public class GuiCraftingStart extends GuiBase {
private static final int DEFAULT_AMOUNT = 1;
private GuiTextField amountField;
@@ -24,7 +24,7 @@ public class GuiCraftingSettings extends GuiBase {
private GuiButton cancelButton;
private GuiButton[] incrementButtons = new GuiButton[6];
public GuiCraftingSettings(GuiGrid gui, EntityPlayer player, ClientStackItem stack) {
public GuiCraftingStart(GuiGrid gui, EntityPlayer player, ClientStackItem stack) {
super(new ContainerCraftingSettings(player, stack.getStack()), 172, 99);
this.gui = gui;
@@ -110,7 +110,7 @@ public class GuiCraftingSettings extends GuiBase {
int newAmount = Integer.parseInt(incrementButton.displayString);
newAmount = Math.max(DEFAULT_AMOUNT, oldAmount + newAmount);
newAmount = Math.max(DEFAULT_AMOUNT, ((oldAmount == 1 && newAmount != 1) ? 0 : oldAmount) + newAmount);
amountField.setText(String.valueOf(newAmount));

View File

@@ -373,7 +373,7 @@ public class GuiGrid extends GuiBase {
ClientStackItem stack = (ClientStackItem) STACKS.get(slotNumber);
if (stack.isCraftable() && (stack.getQuantity() == 0 || (GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown()))) {
FMLCommonHandler.instance().showGuiScreen(new GuiCraftingSettings(this, container.getPlayer(), stack));
FMLCommonHandler.instance().showGuiScreen(new GuiCraftingStart(this, container.getPlayer(), stack));
} else {
int flags = 0;