mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 14:13:38 +01:00
Fabric 1.17.1
This commit is contained in:
parent
0043a1e4fb
commit
6245a18381
@ -7,10 +7,13 @@ import net.minecraft.server.world.ThreadedAnvilChunkStorage;
|
|||||||
import net.minecraft.util.math.ChunkPos;
|
import net.minecraft.util.math.ChunkPos;
|
||||||
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.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;
|
||||||
import org.dynmap.DynmapChunk;
|
import org.dynmap.DynmapChunk;
|
||||||
import org.dynmap.Log;
|
import org.dynmap.Log;
|
||||||
|
import org.dynmap.common.BiomeMap;
|
||||||
import org.dynmap.common.chunk.GenericChunk;
|
import org.dynmap.common.chunk.GenericChunk;
|
||||||
import org.dynmap.common.chunk.GenericMapChunkCache;
|
import org.dynmap.common.chunk.GenericMapChunkCache;
|
||||||
|
|
||||||
@ -83,4 +86,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()]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user