diff --git a/src/main/java/cc/flogi/dev/smoothchunks/client/config/SmoothChunksConfig.java b/src/main/java/cc/flogi/dev/smoothchunks/client/config/SmoothChunksConfig.java index 1e7495e..28a98a7 100644 --- a/src/main/java/cc/flogi/dev/smoothchunks/client/config/SmoothChunksConfig.java +++ b/src/main/java/cc/flogi/dev/smoothchunks/client/config/SmoothChunksConfig.java @@ -37,7 +37,7 @@ public class SmoothChunksConfig implements ConfigData { * * @return The translation amount as an int 1 to 10 where higher = more translation. */ - public int getTranslationAmount() { - return translationAmount / 5; + public double getTranslationAmount() { + return (double) translationAmount / 5d; } } \ No newline at end of file diff --git a/src/main/java/cc/flogi/dev/smoothchunks/client/handler/ChunkAnimationHandler.java b/src/main/java/cc/flogi/dev/smoothchunks/client/handler/ChunkAnimationHandler.java index 7d9bebd..9650135 100644 --- a/src/main/java/cc/flogi/dev/smoothchunks/client/handler/ChunkAnimationHandler.java +++ b/src/main/java/cc/flogi/dev/smoothchunks/client/handler/ChunkAnimationHandler.java @@ -62,9 +62,11 @@ public final class ChunkAnimationHandler { AnimationController controller = animations.get(chunk); if (controller == null || MinecraftClient.getInstance().getCameraEntity() == null) return; + BlockPos finalPos = controller.getFinalPos(); + if (config.isDisableNearby()) { - BlockPos cameraPos = MinecraftClient.getInstance().getCameraEntity().getBlockPos(); - BlockPos chunkPos = chunk.getOrigin(); + Vec3i cameraPos = MinecraftClient.getInstance().getCameraEntity().getBlockPos(); + Vec3i chunkPos = new Vec3i(finalPos.getX() + 8, cameraPos.getY(), finalPos.getZ() + 8); if (chunkPos.isWithinDistance(cameraPos, 32)) return; } @@ -72,8 +74,6 @@ public final class ChunkAnimationHandler { double completion = (double) (System.currentTimeMillis() - controller.getStartTime()) / config.getDuration() / 1000d; completion = UtilEasing.easeOutSine(Math.min(completion, 1.0)); - BlockPos finalPos = controller.getFinalPos(); - switch (config.getLoadAnimation()) { default: case DOWNWARD: