@@ -528,13 +528,17 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
remainder = storage.insertItem(remainder, size, simulate);
|
remainder = storage.insertItem(remainder, size, simulate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storage instanceof ItemStorageExternal && !simulate) {
|
|
||||||
((ItemStorageExternal) storage).updateCacheForcefully();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (remainder == null || remainder.stackSize < 0) {
|
if (remainder == null || remainder.stackSize < 0) {
|
||||||
|
if (storage instanceof ItemStorageExternal && !simulate) {
|
||||||
|
((ItemStorageExternal) storage).updateCacheForcefully();
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
if (size != remainder.stackSize && storage instanceof ItemStorageExternal && !simulate) {
|
||||||
|
((ItemStorageExternal) storage).updateCacheForcefully();
|
||||||
|
}
|
||||||
|
|
||||||
size = remainder.stackSize;
|
size = remainder.stackSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,16 +14,16 @@ public abstract class ItemStorageExternal implements IItemStorage {
|
|||||||
public boolean updateCache() {
|
public boolean updateCache() {
|
||||||
List<ItemStack> items = getStacks();
|
List<ItemStack> items = getStacks();
|
||||||
|
|
||||||
if (cache == null) {
|
if (this.cache == null) {
|
||||||
cache = items;
|
this.cache = items;
|
||||||
} else if (items.size() != cache.size()) {
|
} else if (items.size() != cache.size()) {
|
||||||
cache = items;
|
this.cache = items;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < items.size(); ++i) {
|
for (int i = 0; i < items.size(); ++i) {
|
||||||
if (!API.instance().getComparer().isEqual(items.get(i), cache.get(i))) {
|
if (!API.instance().getComparer().isEqual(items.get(i), cache.get(i))) {
|
||||||
cache = items;
|
this.cache = items;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,6 @@ public abstract class ItemStorageExternal implements IItemStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateCacheForcefully() {
|
public void updateCacheForcefully() {
|
||||||
cache = getStacks();
|
this.cache = getStacks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user