Small refactoring & dependency updates

This commit is contained in:
flogic 2020-11-01 11:33:03 -07:00
parent 05096f0492
commit 6a39205ac6
No known key found for this signature in database
GPG Key ID: AD25E4DF29DECD31
4 changed files with 11 additions and 10 deletions

View File

@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
minecraft_version=1.16.3 minecraft_version=1.16.3
yarn_mappings=1.16.3+build.47 yarn_mappings=1.16.3+build.47
loader_version=0.10.3+build.211 loader_version=0.10.6+build.214
# Mod Properties # Mod Properties
mod_version=1.0.0 mod_version=1.0.0
maven_group=cc.flogi.dev maven_group=cc.flogi.dev
archives_base_name=smooth-chunks archives_base_name=smooth-chunks
# Dependencies # Dependencies
fabric_version=0.24.1+build.412-1.16 fabric_version=0.25.0+build.415-1.16

View File

@ -31,16 +31,16 @@ public final class ChunkAnimationHandler {
if (SmoothChunksClient.get().getConfig().getLoadAnimation() == LoadAnimation.INWARD if (SmoothChunksClient.get().getConfig().getLoadAnimation() == LoadAnimation.INWARD
&& MinecraftClient.getInstance().getCameraEntity() != null) { && MinecraftClient.getInstance().getCameraEntity() != null) {
BlockPos dif = chunk.getOrigin().subtract(MinecraftClient.getInstance().getCameraEntity().getBlockPos()); BlockPos delta = chunk.getOrigin().subtract(MinecraftClient.getInstance().getCameraEntity().getBlockPos());
int difX = Math.abs(dif.getX()); int dX = Math.abs(delta.getX());
int difZ = Math.abs(dif.getZ()); int dZ = Math.abs(delta.getZ());
if (difX > difZ) { if (dX > dZ) {
if (dif.getX() > 0) direction = Direction.WEST; if (delta.getX() > 0) direction = Direction.WEST;
else direction = Direction.EAST; else direction = Direction.EAST;
} else { } else {
if (dif.getZ() > 0) direction = Direction.NORTH; if (delta.getZ() > 0) direction = Direction.NORTH;
else direction = Direction.SOUTH; else direction = Direction.SOUTH;
} }
} }
@ -81,6 +81,7 @@ public final class ChunkAnimationHandler {
stack.translate(dirVec.getX() * mod, 0, dirVec.getZ() * mod); stack.translate(dirVec.getX() * mod, 0, dirVec.getZ() * mod);
break; break;
case SCALE: case SCALE:
//TODO Find a way to scale centered at the middle of the chunk rather than the origin.
stack.scale((float) completion, (float) completion, (float) completion); stack.scale((float) completion, (float) completion, (float) completion);
break; break;
} }

View File

@ -28,7 +28,7 @@ public abstract class ChunkBuilderMixin {
target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V" target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V"
) )
) )
public void onSetOrigin(BlockBufferBuilderStorage buffers, CallbackInfoReturnable<CompletableFuture> cir) { public void onChunkUploads(BlockBufferBuilderStorage buffers, CallbackInfoReturnable<CompletableFuture> cir) {
ChunkAnimationHandler.get().addChunk(field_20839); ChunkAnimationHandler.get().addChunk(field_20839);
} }
} }

View File

@ -5,7 +5,7 @@ package cc.flogi.dev.smoothchunks.util;
* *
* Created on 10/24/2020 * Created on 10/24/2020
*/ */
public class UtilEasing { public final class UtilEasing {
private static final double PI = Math.PI; private static final double PI = Math.PI;
public static double easeInOutSine(double completion) { public static double easeInOutSine(double completion) {