Fixed usage of client side only class in ContainerBase, fixes #223
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
- Fixed rendering crash with Disk Drive
|
- Fixed rendering crash with Disk Drive
|
||||||
- Fixed crash when quickly toggling sorting direction in Grid
|
- Fixed crash when quickly toggling sorting direction in Grid
|
||||||
|
- Fixed not being able to clear configurations in GUIs
|
||||||
|
|
||||||
### 0.8.12
|
### 0.8.12
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package refinedstorage.container;
|
package refinedstorage.container;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.ClickType;
|
import net.minecraft.inventory.ClickType;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
@@ -48,23 +47,15 @@ public abstract class ContainerBase extends Container {
|
|||||||
if (slot instanceof SlotSpecimen) {
|
if (slot instanceof SlotSpecimen) {
|
||||||
if (((SlotSpecimen) slot).isWithSize()) {
|
if (((SlotSpecimen) slot).isWithSize()) {
|
||||||
if (slot.getStack() != null) {
|
if (slot.getStack() != null) {
|
||||||
if (GuiScreen.isShiftKeyDown()) {
|
if (clickType == ClickType.QUICK_MOVE) {
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
} else {
|
} else {
|
||||||
int amount = slot.getStack().stackSize;
|
int amount = slot.getStack().stackSize;
|
||||||
|
|
||||||
if (clickedButton == 0) {
|
if (clickedButton == 0) {
|
||||||
amount--;
|
amount = Math.max(1, --amount);
|
||||||
|
|
||||||
if (amount < 1) {
|
|
||||||
amount = 1;
|
|
||||||
}
|
|
||||||
} else if (clickedButton == 1) {
|
} else if (clickedButton == 1) {
|
||||||
amount++;
|
amount = Math.min(64, ++amount);
|
||||||
|
|
||||||
if (amount > 64) {
|
|
||||||
amount = 64;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.getStack().stackSize = amount;
|
slot.getStack().stackSize = amount;
|
||||||
@@ -72,14 +63,7 @@ public abstract class ContainerBase extends Container {
|
|||||||
} else if (player.inventory.getItemStack() != null) {
|
} else if (player.inventory.getItemStack() != null) {
|
||||||
int amount = player.inventory.getItemStack().stackSize;
|
int amount = player.inventory.getItemStack().stackSize;
|
||||||
|
|
||||||
if (clickedButton == 1) {
|
slot.putStack(ItemHandlerHelper.copyStackWithSize(player.inventory.getItemStack(), clickedButton == 1 ? 1 : amount));
|
||||||
amount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack toPut = player.inventory.getItemStack().copy();
|
|
||||||
toPut.stackSize = amount;
|
|
||||||
|
|
||||||
slot.putStack(toPut);
|
|
||||||
}
|
}
|
||||||
} else if (player.inventory.getItemStack() == null) {
|
} else if (player.inventory.getItemStack() == null) {
|
||||||
slot.putStack(null);
|
slot.putStack(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user