From a8c5858c6d80689cab6b1e69eca3c8a5091accd3 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:44:30 -0400 Subject: [PATCH] fix: use dimension type from constructor instead of calling `getDimension` --- .../lithium/mixin/world/inline_height/WorldMixin.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/jellysquid/mods/lithium/mixin/world/inline_height/WorldMixin.java b/src/main/java/me/jellysquid/mods/lithium/mixin/world/inline_height/WorldMixin.java index 4be2462ec..0d5d7b2a2 100644 --- a/src/main/java/me/jellysquid/mods/lithium/mixin/world/inline_height/WorldMixin.java +++ b/src/main/java/me/jellysquid/mods/lithium/mixin/world/inline_height/WorldMixin.java @@ -9,7 +9,6 @@ import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -21,9 +20,6 @@ */ @Mixin(World.class) public abstract class WorldMixin implements HeightLimitView { - @Shadow - public abstract DimensionType getDimension(); - private int bottomY; private int height; private int topYInclusive; @@ -32,9 +28,9 @@ public abstract class WorldMixin implements HeightLimitView { method = "", at = @At("RETURN") ) - private void initHeightCache(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates, CallbackInfo ci) { - this.height = this.getDimension().height(); - this.bottomY = this.getDimension().minY(); + private void initHeightCache(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates, CallbackInfo ci) { + this.height = dimensionEntry.value().height(); + this.bottomY = dimensionEntry.value().minY(); this.topYInclusive = this.bottomY + this.height - 1; }