From efd9a5a51b4649b30ac0255c3ea50c46c3509fc4 Mon Sep 17 00:00:00 2001 From: cola98765 Date: Sun, 10 Oct 2021 08:36:45 +0200 Subject: [PATCH] merge all 1 block gaps for better look o trees --- .../com/seibel/lod/util/DataPointUtil.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/seibel/lod/util/DataPointUtil.java b/src/main/java/com/seibel/lod/util/DataPointUtil.java index 53c982794..4b58c3ab7 100644 --- a/src/main/java/com/seibel/lod/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/util/DataPointUtil.java @@ -1,12 +1,8 @@ package com.seibel.lod.util; import com.seibel.lod.enums.DistanceGenerationMode; - import net.minecraft.client.renderer.texture.NativeImage; -import javax.xml.crypto.Data; -import java.util.Arrays; - public class DataPointUtil { /* @@ -474,8 +470,24 @@ public class DataPointUtil return dataPoint; } + //we cut the 1 block gaps + int j; + for (i = 0; i < count - 1; i++) + { + if (heightAndDepth[i * 2 + 1] - heightAndDepth[(i + 1) * 2] == 1) + { + heightAndDepth[i * 2 + 1] = heightAndDepth[(i + 1) * 2 + 1]; + for (j = i + 1; j < count - 1; j++) + { + heightAndDepth[j * 2] = heightAndDepth[(j + 1) * 2]; + heightAndDepth[j * 2 + 1] = heightAndDepth[(j + 1) * 2 + 1]; + } + count--; + } + } + //we limit the vertical portion to maxVerticalData - int j = 0; + j = 0; while (count > maxVerticalData) { ii = worldHeight;