From 8a0b7fbc471a38ad2c4d05f50ae5049a92824fc1 Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Sun, 18 Jul 2021 18:41:39 -0400 Subject: [PATCH] Patch goto in headless mode --- .../volmit/iris/engine/framework/IrisAccess.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java b/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java index 8c68ce12a..8c6e692f7 100644 --- a/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java +++ b/src/main/java/com/volmit/iris/engine/framework/IrisAccess.java @@ -86,6 +86,12 @@ public interface IrisAccess extends Hotloadable, DataProvider { boolean isStudio(); default Location lookForBiome(IrisBiome biome, long timeout, Consumer triesc) { + if(!getCompound().getWorld().hasRealWorld()) + { + Iris.error("Cannot GOTO without a bound world (headless mode)"); + return null; + } + IrisComplex.cacheLock.set(true); ChronoLatch cl = new ChronoLatch(250, false); long s = M.ms(); @@ -129,7 +135,7 @@ public interface IrisAccess extends Hotloadable, DataProvider { if (b != null && b.getLoadKey().equals(biome.getLoadKey())) { found.lazySet(true); - location.lazySet(new Location(e.getWorld(), x, e.getHeight(x, z), z)); + location.lazySet(new Location(e.getWorld().realWorld(), x, e.getHeight(x, z), z)); } tries.getAndIncrement(); @@ -166,6 +172,12 @@ public interface IrisAccess extends Hotloadable, DataProvider { } default Location lookForRegion(IrisRegion reg, long timeout, Consumer triesc) { + if(!getCompound().getWorld().hasRealWorld()) + { + Iris.error("Cannot GOTO without a bound world (headless mode)"); + return null; + } + IrisComplex.cacheLock.set(true); ChronoLatch cl = new ChronoLatch(3000, false); long s = M.ms(); @@ -203,7 +215,7 @@ public interface IrisAccess extends Hotloadable, DataProvider { if (b != null && b.getLoadKey() != null && b.getLoadKey().equals(reg.getLoadKey())) { found.lazySet(true); - location.lazySet(new Location(e.getWorld(), x, e.getHeight(x, z) + e.getMinHeight(), z)); + location.lazySet(new Location(e.getWorld().realWorld(), x, e.getHeight(x, z) + e.getMinHeight(), z)); } tries.getAndIncrement();