From 75b92dafb6c8bae73fdbccc0e1738d0a2156787e Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Wed, 17 May 2017 14:26:11 +0200 Subject: [PATCH] Fixed #1223 - "Crash while trying to autocraft" --- CHANGELOG.md | 1 + .../raoulvdberge/refinedstorage/gui/grid/GuiGrid.java | 9 --------- .../refinedstorage/tile/grid/portable/PortableGrid.java | 5 +++++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b29dcb400..49b197ba3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Performance improvement to network scanning (raoulvdberge) - Removed debug output from 1.4.5 (raoulvdberge) - Fixed Wrench opening GUIs while performing action (raoulvdberge) +- Fixed client Grid GUI clearing and causing crashes after starting an autocrafting request (raoulvdberge) ### 1.4.5 - Updated Forge to 2296 (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java index 40155bb69..5dff3a446 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java @@ -680,13 +680,4 @@ public class GuiGrid extends GuiBase implements IGridDisplay { oredictPattern.setIsChecked(checked); } } - - @Override - public void onGuiClosed() { - super.onGuiClosed(); - - ITEMS.clear(); - FLUIDS.clear(); - STACKS.clear(); - } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java index 7646d4163..015a043f1 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java @@ -125,6 +125,11 @@ public class PortableGrid implements IGrid, IPortableGrid { RSUtils.readItems(disk, 4, stack.getTagCompound()); drainEnergy(RS.INSTANCE.config.portableGridOpenUsage); + + // If there is no disk onContentsChanged isn't called and the update isn't sent + if (!player.getEntityWorld().isRemote && disk.getStackInSlot(0).isEmpty()) { + cache.invalidate(); + } } public ItemStack getStack() {