From 70cc38697e2a7cfdd9bcd6d836be961590e05a4b Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Sat, 11 Nov 2017 13:17:39 +0100 Subject: [PATCH] fix stacking logic in StatementParameterItemStackExact --- .../StatementParameterItemStackExact.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/buildcraft/core/statements/StatementParameterItemStackExact.java b/common/buildcraft/core/statements/StatementParameterItemStackExact.java index bba6f98f..3a0d172d 100644 --- a/common/buildcraft/core/statements/StatementParameterItemStackExact.java +++ b/common/buildcraft/core/statements/StatementParameterItemStackExact.java @@ -30,13 +30,13 @@ public class StatementParameterItemStackExact implements IStatementParameter { if (areItemsEqual(this.stack, stack)) { if (mouse.getButton() == 0) { this.stack.stackSize += (mouse.isShift()) ? 16 : 1; - if (this.stack.stackSize > 64) { - this.stack.stackSize = 64; + if (this.stack.stackSize > this.stack.getMaxStackSize()) { + this.stack.stackSize = this.stack.getMaxStackSize(); } } else { this.stack.stackSize -= (mouse.isShift()) ? 16 : 1; - if (this.stack.stackSize < 0) { - this.stack.stackSize = 0; + if (this.stack.stackSize <= 0) { + this.stack = null; } } } else { @@ -46,12 +46,12 @@ public class StatementParameterItemStackExact implements IStatementParameter { if (this.stack != null) { if (mouse.getButton() == 0) { this.stack.stackSize += (mouse.isShift()) ? 16 : 1; - if (this.stack.stackSize > 64) { - this.stack.stackSize = 64; + if (this.stack.stackSize > this.stack.getMaxStackSize()) { + this.stack.stackSize = this.stack.getMaxStackSize(); } } else { this.stack.stackSize -= (mouse.isShift()) ? 16 : 1; - if (this.stack.stackSize < 0) { + if (this.stack.stackSize <= 0) { this.stack = null; } }