From d5ec6a18a42ae44a683b2258ebc60c8a1ac36029 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Sat, 26 Jul 2025 12:31:24 +0200 Subject: [PATCH] fix loot not being applied --- .../java/com/volmit/iris/engine/framework/Engine.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java index cbdefe4e1..38fc6e824 100644 --- a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java +++ b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java @@ -540,8 +540,9 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat if (IrisLootEvent.callLootEvent(items, inv, world, x, y, z)) return; - if (getWorld().hasRealWorld()) { - Iris.platform.getChunkAtAsync(getWorld().realWorld(), x >> 4, z >> 4, true, false).thenAccept((c) -> { + if (world != null) { + final int cX = x >> 4, cZ = z >> 4; + Iris.platform.getChunkAtAsync(world, cX, cZ, true, false).thenAccept((c) -> { Runnable r = () -> { for (ItemStack i : items) { inv.addItem(i); @@ -550,10 +551,10 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat scramble(inv, rng); }; - if (Bukkit.isPrimaryThread()) { + if (Iris.platform.isOwnedByCurrentRegion(world, cX, cZ)) { r.run(); } else { - J.s(r); + Iris.platform.getRegionScheduler().run(world, cX, cZ, r); } }); } else {