1
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:
TheBusyBiscuit 2019-03-30 11:29:26 +01:00 committed by GitHub
commit b44cce7a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);