diff --git a/resources/patches-deobfuscated.xml b/resources/patches-deobfuscated.xml index 4bf855f9..284662be 100644 --- a/resources/patches-deobfuscated.xml +++ b/resources/patches-deobfuscated.xml @@ -1531,63 +1531,69 @@ } 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; - ArrayList toAdd = new ArrayList(); - - 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; + ArrayList toAdd = new ArrayList(); - 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; - if (x.a <= y.a) + found = true; + + if (x.a != y.a) + { + this.freq = 0; + if (x.a <= y.a) + break; + ur j = x.l(); + j.a -= y.a; + toAdd.add(j); break; - ur j = x.l(); - j.a -= y.a; - toAdd.add(j); - break; + } + } } - } - - if (!found) - { - this.freq = 0; - toAdd.add(x); + if (!found) + { + this.freq = 0; + toAdd.add(x); + } } } - } - if (!toAdd.isEmpty()) { - gi.onInventoryChange(); - Iterator iterator = toAdd.iterator(); - while (iterator.hasNext()) { - gi.signalInput(null, (ur) iterator.next()); + if (!toAdd.isEmpty()) { + gi.onInventoryChange(); + Iterator iterator = toAdd.iterator(); + while (iterator.hasNext()) { + gi.signalInput(null, (ur) iterator.next()); + } } } }