Merge pull request #3862 from mastermc05/colorful-biomes
Colorful biomes
This commit is contained in:
commit
7d1a273e6d
34 changed files with 347 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package org.dynmap.common;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.dynmap.hdmap.HDBlockModels;
|
||||
|
||||
|
|
@ -44,6 +45,7 @@ public class BiomeMap {
|
|||
private int watercolormult;
|
||||
private int grassmult;
|
||||
private int foliagemult;
|
||||
private Optional<?> biomeObj = Optional.empty();
|
||||
private final String id;
|
||||
private final String resourcelocation;
|
||||
private final int index;
|
||||
|
|
@ -308,4 +310,10 @@ public class BiomeMap {
|
|||
public String toString() {
|
||||
return String.format("%s(%s)", id, resourcelocation);
|
||||
}
|
||||
public @SuppressWarnings("unchecked") <T> Optional<T> getBiomeObject() {
|
||||
return (Optional<T>) biomeObj;
|
||||
}
|
||||
public void setBiomeObject(Object biomeObj) {
|
||||
this.biomeObj = Optional.of(biomeObj);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ public abstract class GenericMapChunkCache extends MapChunkCache {
|
|||
for (int dz = -1; dz <= 1; dz++) {
|
||||
BiomeMap bm = getBiomeRel(dx, dz);
|
||||
if (bm == BiomeMap.NULL) continue;
|
||||
int rmult = bm.getModifiedGrassMultiplier(colormap[bm.biomeLookup()]);
|
||||
int rmult = getGrassColor(bm, colormap, getX() + dx, getZ() + dz);
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
|
|
@ -212,7 +212,7 @@ public abstract class GenericMapChunkCache extends MapChunkCache {
|
|||
for (int dz = -1; dz <= 1; dz++) {
|
||||
BiomeMap bm = getBiomeRel(dx, dz);
|
||||
if (bm == BiomeMap.NULL) continue;
|
||||
int rmult = bm.getModifiedFoliageMultiplier(colormap[bm.biomeLookup()]);
|
||||
int rmult = getFoliageColor(bm, colormap, getX() + dx, getZ() + dz);
|
||||
raccum += (rmult >> 16) & 0xFF;
|
||||
gaccum += (rmult >> 8) & 0xFF;
|
||||
baccum += rmult & 0xFF;
|
||||
|
|
@ -546,6 +546,14 @@ public abstract class GenericMapChunkCache extends MapChunkCache {
|
|||
}
|
||||
}
|
||||
|
||||
public int getGrassColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
return bm.getModifiedGrassMultiplier(colormap[bm.biomeLookup()]);
|
||||
}
|
||||
|
||||
public int getFoliageColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
return bm.getModifiedFoliageMultiplier(colormap[bm.biomeLookup()]);
|
||||
}
|
||||
|
||||
private class OurEndMapIterator extends OurMapIterator {
|
||||
OurEndMapIterator(int x0, int y0, int z0) {
|
||||
super(x0, y0, z0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue