mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-29 23:40:00 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0f9c045524
1 file changed
+13
-7
@@ -278,14 +278,20 @@ public class IrisEntity extends IrisRegistrant implements NativeEntityOptions {
|
|||||||
}
|
}
|
||||||
if (isSpawnEffectRiseOutOfGround()) {
|
if (isSpawnEffectRiseOutOfGround()) {
|
||||||
AtomicReference<Location> f = new AtomicReference<>(at);
|
AtomicReference<Location> f = new AtomicReference<>(at);
|
||||||
|
Runnable riseStart = () -> {
|
||||||
|
if (Chunks.hasPlayersNearby(f.get())) {
|
||||||
|
Location b = f.get().clone();
|
||||||
|
Location start = new Location(b.getWorld(), b.getX(), b.getY() - 5, b.getZ());
|
||||||
|
f.set(start);
|
||||||
|
}
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
J.sfut(() -> {
|
// J.sfut schedules onto the next main thread tick, so waiting on it from the main thread never returns.
|
||||||
if (Chunks.hasPlayersNearby(f.get())) {
|
if (Bukkit.isPrimaryThread()) {
|
||||||
Location b = f.get().clone();
|
riseStart.run();
|
||||||
Location start = new Location(b.getWorld(), b.getX(), b.getY() - 5, b.getZ());
|
} else {
|
||||||
f.set(start);
|
J.sfut(riseStart).get();
|
||||||
}
|
}
|
||||||
}).get();
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
IrisLogging.reportError("Iris entity spawn preparation was interrupted.", e);
|
IrisLogging.reportError("Iris entity spawn preparation was interrupted.", e);
|
||||||
|
|||||||
Reference in new issue
Block a user