From b0f4125568ce32c96cb06cc4d814cad3e6de9e35 Mon Sep 17 00:00:00 2001 From: Ross Allan Date: Sun, 30 Jun 2013 19:04:33 +0100 Subject: [PATCH] Should fix #823 Signed-off-by: Ross Allan --- resources/patches.xml | 88 +++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/resources/patches.xml b/resources/patches.xml index 319103db..fe8870f7 100644 --- a/resources/patches.xml +++ b/resources/patches.xml @@ -1391,57 +1391,63 @@ } List sList = new SynchronizedList(); - synchronized(sList) { - List newList = inv.getAvailableItems(sList); - if (newList != sList) { - sList.addAll(newList); - newList = sList; - } - if (newList == null) { - newList = new SynchronizedList(); - } - if (this.oldList == null) { - this.oldList = new SynchronizedList(); - } - oList = this.oldList; - this.oldList = newList; - - synchronized(oList) { - if (oList.size() != newList.size()) { - gi.onInventoryChange(); + Object o = getGrid(); + if (o == null) { + o = new Object(); + } + synchronized (o) { + synchronized(sList) { + List newList = inv.getAvailableItems(sList); + if (newList != sList) { + sList.addAll(newList); + newList = sList; } + if (newList == null) { + newList = new SynchronizedList(); + } + if (this.oldList == null) { + this.oldList = new SynchronizedList(); + } + oList = this.oldList; + this.oldList = newList; - for (Iterator i1 = newList.iterator(); i1.hasNext();) { - ur x = (ur) i1.next(); - boolean found = false; - for (Iterator i2 = oList.iterator(); i2.hasNext();) { - ur y = (ur) i2.next(); - if (appeng.util.Platform.isSameItem(x, y)) - { - found = true; + synchronized(oList) { + if (oList.size() != newList.size()) { + gi.onInventoryChange(); + } - if (x.a != y.a) + for (Iterator i1 = newList.iterator(); i1.hasNext();) { + ur x = (ur) i1.next(); + boolean found = false; + for (Iterator i2 = oList.iterator(); i2.hasNext();) { + ur y = (ur) i2.next(); + if (appeng.util.Platform.isSameItem(x, y)) { - this.freq = 0; - gi.onInventoryChange(); + found = true; + + if (x.a != y.a) + { + this.freq = 0; + gi.onInventoryChange(); - if (x.a <= y.a) + if (x.a <= y.a) + break; + ur j = x.l(); + j.a -= y.a; + gi.signalInput(null, j); break; - ur j = x.l(); - j.a -= y.a; - gi.signalInput(null, j); - break; + } + } } - } - - if (!found) - { - this.freq = 0; - gi.onInventoryChange(); - gi.signalInput(null, x); + if (!found) + { + this.freq = 0; + gi.onInventoryChange(); + gi.signalInput(null, x); + } } } }