fix racecondition with Itemstack.EMPTY

This commit is contained in:
Darkere
2023-02-06 22:43:14 +01:00
committed by Raoul
parent 0706726b30
commit 2a5c4e77e2

View File

@@ -62,6 +62,10 @@ public class ItemExternalStorageCache {
ItemStack cached = cache.get(i);
//ItemStack.EMPTY can be accidentally modified by other mods on any thread. This makes sure we ignore that.
if (actual == ItemStack.EMPTY && actual == cached)
continue;
if (!cached.isEmpty() && actual.isEmpty()) { // REMOVED
network.getItemStorageCache().remove(cached, cached.getCount(), true);