Skip to content

Commit

Permalink
hack to fix voxelmap trees
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjum committed Jun 2, 2022
1 parent b0498b7 commit 8fa24f4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 8fa24f4

Please sign in to comment.