From 8fa24f4d6420f0c70cb445bf0c76aec3a6257a11 Mon Sep 17 00:00:00 2001 From: Gjum Date: Thu, 2 Jun 2022 04:50:21 +0200 Subject: [PATCH] hack to fix voxelmap trees --- .../mapsync/common/integration/VoxelMapHelperReal.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mod/common/src/main/java/gjum/minecraft/mapsync/common/integration/VoxelMapHelperReal.java b/mod/common/src/main/java/gjum/minecraft/mapsync/common/integration/VoxelMapHelperReal.java index 35b6e95b..f8d1bf19 100644 --- a/mod/common/src/main/java/gjum/minecraft/mapsync/common/integration/VoxelMapHelperReal.java +++ b/mod/common/src/main/java/gjum/minecraft/mapsync/common/integration/VoxelMapHelperReal.java @@ -4,15 +4,16 @@ import com.mamiyaotaru.voxelmap.persistent.*; import gjum.minecraft.mapsync.common.data.BlockInfo; import gjum.minecraft.mapsync.common.data.ChunkTile; -import java.util.concurrent.locks.ReentrantLock; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.material.Material; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.lang.reflect.*; import java.util.List; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.ReentrantLock; import static gjum.minecraft.mapsync.common.Utils.getBiomeRegistry; @@ -134,6 +135,10 @@ private static void setLayerStates(CompressibleMapData mapData, int x, int z, Li // XXX if (layers.size() > 1) transparent = layers.get(0); surface = layers.get(layers.size() - 1); + // trees hack + if (layers.get(0).state().getMaterial() == Material.LEAVES) { + surface = layers.get(0); + } mapData.setTransparentHeight(x, z, transparent.y()); mapData.setTransparentBlockstate(x, z, transparent.state());