Fabric 1.18.2

This commit is contained in:
mastermc05 2022-11-18 13:17:21 +02:00
parent ec3c0e998b
commit 0043a1e4fb

View File

@ -12,6 +12,7 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.world.ChunkSerializer; import net.minecraft.world.ChunkSerializer;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeEffects;
import net.minecraft.world.chunk.ChunkManager; import net.minecraft.world.chunk.ChunkManager;
import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.chunk.ChunkStatus;
@ -100,4 +101,15 @@ public class FabricMapChunkCache extends GenericMapChunkCache {
} }
return gc; return gc;
} }
@Override
public int getFoliageColor(BiomeMap bm, int[] colormap, int x, int z) {
return bm.<Biome>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.<Biome>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()]));
}
} }