fix: some rendering issues due to refactoring
This commit is contained in:
parent
40dbb1f8d6
commit
0e0e8f0e0f
@ -160,7 +160,7 @@ public final class Animator {
|
||||
float _progress = EASES.getValue().ease(progress);
|
||||
ANIMATIONS.getValue().animate(
|
||||
_progress, matrices,
|
||||
chunkPos.getX() * 16, 0, chunkPos.getZ() * 16,
|
||||
chunkPos.getX() * 16, chunkPos.getY() * 16, chunkPos.getZ() * 16,
|
||||
(float)playerPos.x, (float)playerPos.y, (float)playerPos.z
|
||||
);
|
||||
// matrices.translate(0, 0, 16);
|
||||
|
@ -162,14 +162,17 @@ public class ChunkPreview extends DrawableHelper implements Drawable, Element, S
|
||||
}
|
||||
private void renderChunk(MatrixStack matrices, int x, int y, int n, float delta) {
|
||||
duration = animator.getDuration();
|
||||
|
||||
float progress = globalProgress / duration - (float)Math.sqrt(x * x + y * y) / (float)n / 2;
|
||||
if (progress > 1) progress = 1;
|
||||
if (progress <= 0) return;
|
||||
|
||||
matrices.push();
|
||||
matrices.translate(x * 16 - 8, 0, y * 16 - 8);
|
||||
|
||||
// x += n;
|
||||
// y += n;
|
||||
|
||||
float progress = globalProgress / duration - (float)Math.sqrt(x * x + y * y) / (float)n / 2;
|
||||
|
||||
animator.animate(matrices, progress, new BlockPos(x * 16, 0, y * 16));
|
||||
|
||||
// if (progress < 0) progress = 0;
|
||||
|
@ -12,6 +12,7 @@ import net.minecraft.client.render.WorldRenderer.ChunkInfo;
|
||||
import net.minecraft.client.render.chunk.ChunkBuilder.BuiltChunk;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3d;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@ -55,7 +56,7 @@ public abstract class WorldRendererMixin {
|
||||
|
||||
matrices.push();
|
||||
|
||||
AnimatedChunks.getInstance().animator.animate(matrices, chunk.getOrigin(), new Vector3d(playerX, playerY, playerZ));
|
||||
AnimatedChunks.getInstance().animator.animate(matrices, new BlockPos(chunk.getOrigin().getX(), 0, chunk.getOrigin().getZ()), new Vector3d(playerX, playerY, playerZ));
|
||||
|
||||
// if (getProgressManager().isChunkLoaded(x, 0, z)) {
|
||||
// float progress = getProgressManager().getChunkProgress(x, 0, z);
|
||||
|
Loading…
Reference in New Issue
Block a user