mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-01 15:36:45 +00:00
fix ticking engine players in the wrong dimension
This commit is contained in:
parent
8119207254
commit
0d103a934a
@ -47,9 +47,7 @@ public class EnginePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
sample();
|
if (sample() || !IrisSettings.get().getWorld().isEffectSystem())
|
||||||
|
|
||||||
if (!IrisSettings.get().getWorld().isEffectSystem())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
J.a(() -> {
|
J.a(() -> {
|
||||||
@ -81,22 +79,22 @@ public class EnginePlayer {
|
|||||||
return M.ms() - lastSample;
|
return M.ms() - lastSample;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sample() {
|
public boolean sample() {
|
||||||
|
Location current = player.getLocation().clone();
|
||||||
|
if (current.getWorld() != engine.getWorld().realWorld())
|
||||||
|
return true;
|
||||||
try {
|
try {
|
||||||
if (ticksSinceLastSample() > 55 && player.getLocation().distanceSquared(lastLocation) > 9 * 9) {
|
if (ticksSinceLastSample() > 55 && current.distanceSquared(lastLocation) > 9 * 9) {
|
||||||
lastLocation = player.getLocation().clone();
|
lastLocation = current;
|
||||||
lastSample = M.ms();
|
lastSample = M.ms();
|
||||||
sampleBiomeRegion();
|
biome = engine.getBiome(current);
|
||||||
|
region = engine.getRegion(current);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
Iris.reportError(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
|
|
||||||
private void sampleBiomeRegion() {
|
|
||||||
Location l = player.getLocation();
|
|
||||||
biome = engine.getBiome(l);
|
|
||||||
region = engine.getRegion(l);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user