Fix shift-click deleting pre-existing stack

This commit is contained in:
Ourten 2017-01-06 22:57:40 +01:00
parent 728e956d69
commit b688fe72e4

View file

@ -52,16 +52,16 @@ final class BuiltContainer extends Container {
for (final Range<Integer> range : this.playerSlotRanges)
if (range.contains(index)) {
this.shiftToTile(stackInSlot);
shifted = true;
if (this.shiftToTile(stackInSlot))
shifted = true;
break;
}
if (!shifted)
for (final Range<Integer> range : this.tileSlotRanges)
if (range.contains(index)) {
this.shiftToPlayer(stackInSlot);
shifted = true;
if (this.shiftToPlayer(stackInSlot))
shifted = true;
break;
}
@ -93,7 +93,7 @@ final class BuiltContainer extends Container {
slot.onSlotChanged();
changed = true;
} else if (stackInSlot.getCount() < max) {
stackToShift.setCount(-(max - stackInSlot.getCount()));
stackToShift.shrink(max - stackInSlot.getCount());
stackInSlot.setCount(max);
slot.onSlotChanged();
changed = true;