mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +01:00
Handle custom water color shading (misc/watercolorX.png)
This commit is contained in:
parent
387844b9dc
commit
34fe8316c3
@ -271,6 +271,37 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||
}
|
||||
}
|
||||
|
||||
public final int getSmoothWaterColorMultiplier(int[] colormap, int width) {
|
||||
int mult = 0xFFFFFF;
|
||||
try {
|
||||
int rx = x - x_base;
|
||||
int rz = z - z_base;
|
||||
BiomeMap bm = biomemap[rx][rz];
|
||||
if(sameneighborbiomecnt[rx][rz] >= (byte)8) { /* All neighbors same? */
|
||||
mult = colormap[bm.biomeLookup(width)];
|
||||
}
|
||||
else {
|
||||
int raccum = 0;
|
||||
int gaccum = 0;
|
||||
int baccum = 0;
|
||||
for(int xoff = -1; xoff < 2; xoff++) {
|
||||
for(int zoff = -1; zoff < 2; zoff++) {
|
||||
bm = biomemap[rx+xoff][rz+zoff];
|
||||
int rmult = colormap[bm.biomeLookup(width)];
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
}
|
||||
}
|
||||
mult = ((raccum / 9) << 16) | ((gaccum / 9) << 8) | (baccum / 9);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
exceptions++;
|
||||
mult = 0xFFFFFF;
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
|
||||
public final double getRawBiomeTemperature() {
|
||||
return snap.getRawBiomeTemperature(bx, bz);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user