mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Merge pull request #874 from SoSeDiK/AEA
Prevent "Asynchronous entity add!"
This commit is contained in:
commit
b44cce7a5e
@ -597,7 +597,10 @@ public class BlockStorage {
|
|||||||
BlockMenu menu = getInventory(l);
|
BlockMenu menu = getInventory(l);
|
||||||
|
|
||||||
for (HumanEntity human : new ArrayList<>(menu.toInventory().getViewers())) {
|
for (HumanEntity human : new ArrayList<>(menu.toInventory().getViewers())) {
|
||||||
|
// Prevents "java.lang.IllegalStateException: Asynchronous entity add!" when closing inventory while holding an item
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, () -> {
|
||||||
human.closeInventory();
|
human.closeInventory();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
inventories.get(l).delete(l);
|
inventories.get(l).delete(l);
|
||||||
|
Loading…
Reference in New Issue
Block a user