mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 01:27:37 +01:00
Forge 1.18
This commit is contained in:
parent
1f352e0b11
commit
d434b33cfb
@ -2,8 +2,11 @@ package org.dynmap.forge_1_18;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||
import org.dynmap.DynmapChunk;
|
||||
import org.dynmap.Log;
|
||||
import org.dynmap.common.BiomeMap;
|
||||
import org.dynmap.common.chunk.GenericChunk;
|
||||
import org.dynmap.common.chunk.GenericChunkCache;
|
||||
import org.dynmap.common.chunk.GenericMapChunkCache;
|
||||
@ -86,4 +89,17 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getFoliageColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
return bm.<Biome>getBiomeObject().map(Biome::getSpecialEffects)
|
||||
.flatMap(BiomeSpecialEffects::getFoliageColorOverride)
|
||||
.orElse(colormap[bm.biomeLookup()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGrassColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
BiomeSpecialEffects effects = bm.<Biome>getBiomeObject().map(Biome::getSpecialEffects).orElse(null);
|
||||
if (effects == null) return colormap[bm.biomeLookup()];
|
||||
return effects.getGrassColorModifier().modifyColor(x, z, effects.getGrassColorOverride().orElse(colormap[bm.biomeLookup()]));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user