mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-08-16 16:26:12 +00:00
fix loot not being applied
This commit is contained in:
parent
2f16c0cfb7
commit
d5ec6a18a4
@ -540,8 +540,9 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
if (IrisLootEvent.callLootEvent(items, inv, world, x, y, z))
|
if (IrisLootEvent.callLootEvent(items, inv, world, x, y, z))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (getWorld().hasRealWorld()) {
|
if (world != null) {
|
||||||
Iris.platform.getChunkAtAsync(getWorld().realWorld(), x >> 4, z >> 4, true, false).thenAccept((c) -> {
|
final int cX = x >> 4, cZ = z >> 4;
|
||||||
|
Iris.platform.getChunkAtAsync(world, cX, cZ, true, false).thenAccept((c) -> {
|
||||||
Runnable r = () -> {
|
Runnable r = () -> {
|
||||||
for (ItemStack i : items) {
|
for (ItemStack i : items) {
|
||||||
inv.addItem(i);
|
inv.addItem(i);
|
||||||
@ -550,10 +551,10 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
|||||||
scramble(inv, rng);
|
scramble(inv, rng);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Bukkit.isPrimaryThread()) {
|
if (Iris.platform.isOwnedByCurrentRegion(world, cX, cZ)) {
|
||||||
r.run();
|
r.run();
|
||||||
} else {
|
} else {
|
||||||
J.s(r);
|
Iris.platform.getRegionScheduler().run(world, cX, cZ, r);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user