Skip to content

Commit

Permalink
Should fix #823
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jun 30, 2013
1 parent d975133 commit b66dbc7
Showing 1 changed file with 52 additions and 46 deletions.
98 changes: 52 additions & 46 deletions resources/patches-deobfuscated.xml
Expand Up @@ -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 &lt;= y.a)
found = true;
if (x.a != y.a)
{
this.freq = 0;
if (x.a &lt;= 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());
}
}
}
}
Expand Down

0 comments on commit b66dbc7

Please sign in to comment.