diff --git a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/DynmapPlugin.java b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/DynmapPlugin.java index af9a14e1..309229e3 100644 --- a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/DynmapPlugin.java +++ b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/DynmapPlugin.java @@ -363,6 +363,7 @@ public class DynmapPlugin { bmap.setWaterColorMultiplier(watermult); Log.verboseinfo("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult)); } + bmap.setBiomeObject(bb); } } if (cnt > 0) diff --git a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricMapChunkCache.java b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricMapChunkCache.java index 08aa2d70..37743fb1 100644 --- a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricMapChunkCache.java +++ b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricMapChunkCache.java @@ -11,6 +11,7 @@ import net.minecraft.util.math.WordPackedArray; import net.minecraft.world.ChunkSerializer; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.BiomeEffects; import net.minecraft.world.chunk.ChunkManager; import net.minecraft.world.chunk.ChunkStatus; @@ -100,4 +101,16 @@ public class FabricMapChunkCache extends GenericMapChunkCache { } return gc; } + + @Override + public int getFoliageColor(BiomeMap bm, int[] colormap, int x, int z) { + return bm.getBiomeObject().map(Biome::getEffects).flatMap(BiomeEffects::getFoliageColor).orElse(colormap[bm.biomeLookup()]); + } + + @Override + public int getGrassColor(BiomeMap bm, int[] colormap, int x, int z) { + BiomeEffects effects = bm.getBiomeObject().map(Biome::getEffects).orElse(null); + if (effects == null) return colormap[bm.biomeLookup()]; + return effects.getGrassColorModifier().getModifiedGrassColor(x, z, effects.getGrassColor().orElse(colormap[bm.biomeLookup()])); + } }