Fix nearby chunks & translation amount config options
This commit is contained in:
parent
762df55c1d
commit
b313e8ba0d
@ -37,7 +37,7 @@ public class SmoothChunksConfig implements ConfigData {
|
|||||||
*
|
*
|
||||||
* @return The translation amount as an int 1 to 10 where higher = more translation.
|
* @return The translation amount as an int 1 to 10 where higher = more translation.
|
||||||
*/
|
*/
|
||||||
public int getTranslationAmount() {
|
public double getTranslationAmount() {
|
||||||
return translationAmount / 5;
|
return (double) translationAmount / 5d;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -62,9 +62,11 @@ public final class ChunkAnimationHandler {
|
|||||||
AnimationController controller = animations.get(chunk);
|
AnimationController controller = animations.get(chunk);
|
||||||
if (controller == null || MinecraftClient.getInstance().getCameraEntity() == null) return;
|
if (controller == null || MinecraftClient.getInstance().getCameraEntity() == null) return;
|
||||||
|
|
||||||
|
BlockPos finalPos = controller.getFinalPos();
|
||||||
|
|
||||||
if (config.isDisableNearby()) {
|
if (config.isDisableNearby()) {
|
||||||
BlockPos cameraPos = MinecraftClient.getInstance().getCameraEntity().getBlockPos();
|
Vec3i cameraPos = MinecraftClient.getInstance().getCameraEntity().getBlockPos();
|
||||||
BlockPos chunkPos = chunk.getOrigin();
|
Vec3i chunkPos = new Vec3i(finalPos.getX() + 8, cameraPos.getY(), finalPos.getZ() + 8);
|
||||||
|
|
||||||
if (chunkPos.isWithinDistance(cameraPos, 32)) return;
|
if (chunkPos.isWithinDistance(cameraPos, 32)) return;
|
||||||
}
|
}
|
||||||
@ -72,8 +74,6 @@ public final class ChunkAnimationHandler {
|
|||||||
double completion = (double) (System.currentTimeMillis() - controller.getStartTime()) / config.getDuration() / 1000d;
|
double completion = (double) (System.currentTimeMillis() - controller.getStartTime()) / config.getDuration() / 1000d;
|
||||||
completion = UtilEasing.easeOutSine(Math.min(completion, 1.0));
|
completion = UtilEasing.easeOutSine(Math.min(completion, 1.0));
|
||||||
|
|
||||||
BlockPos finalPos = controller.getFinalPos();
|
|
||||||
|
|
||||||
switch (config.getLoadAnimation()) {
|
switch (config.getLoadAnimation()) {
|
||||||
default:
|
default:
|
||||||
case DOWNWARD:
|
case DOWNWARD:
|
||||||
|
Loading…
Reference in New Issue
Block a user