From a12708b3369eb4353fb2fed096c303c2cd828d09 Mon Sep 17 00:00:00 2001 From: Aeiou <3160746+AeiouEnigma@users.noreply.github.com> Date: Thu, 30 Dec 2021 13:51:48 -0500 Subject: [PATCH 1/2] big brain fix c: --- .../components/structureMovement/ContraptionWorld.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java index 8e48ab7cd..6f8991549 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java @@ -55,6 +55,6 @@ public class ContraptionWorld extends WrappedWorld { @Override public int getMinBuildHeight() { - return - (int) contraption.bounds.getYsize() + 1; + return - (int) contraption.bounds.getYsize(); } } From 345b83ee905d8c1b6513fff565ef1f89f1c3e00e Mon Sep 17 00:00:00 2001 From: Aeiou <3160746+AeiouEnigma@users.noreply.github.com> Date: Thu, 30 Dec 2021 15:32:55 -0500 Subject: [PATCH 2/2] Improve comment clarity on height-related methods in ContraptionWorld and WrappedWorld --- .../components/structureMovement/ContraptionWorld.java | 3 ++- .../foundation/utility/worldWrappers/WrappedWorld.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java index 6f8991549..592b0a538 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionWorld.java @@ -46,7 +46,8 @@ public class ContraptionWorld extends WrappedWorld { world.playLocalSound(x, y, z, p_184134_7_, p_184134_8_, p_184134_9_, p_184134_10_, p_184134_11_); } - // Calculate lazily to avoid issues on load when the bounds are yet to be determined. + // Ensure that we provide accurate information about ContraptionWorld height to mods (such as Starlight) which + // expect Levels to only have blocks located in chunks within their height range. @Override public int getHeight() { diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java index f9dfd055e..e27910d2e 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java @@ -200,7 +200,10 @@ public class WrappedWorld extends Level { return entityGetter; } - // Intentionally copied from LevelHeightAccessor. Lithium overrides these methods so we need to, too. + // Intentionally copied from LevelHeightAccessor. Workaround for issues caused when other mods (such as Lithium) + // override the vanilla implementations in ways which cause WrappedWorlds to return incorrect, default height info. + // WrappedWorld subclasses should implement their own getMinBuildHeight and getHeight overrides where they deviate + // from the defaults for their dimension. @Override public int getMaxBuildHeight() {