mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-14 22:35:46 +01:00
Add 'waterbiomeshaded' option to control water biome shading
This commit is contained in:
parent
e0752eba5b
commit
ded2fa815c
@ -84,6 +84,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
public Events events = new Events();
|
||||
public String deftemplatesuffix = "";
|
||||
boolean swampshading = false;
|
||||
boolean waterbiomeshading = false;
|
||||
boolean fencejoin = false;
|
||||
|
||||
/* Flag to let code know that we're doing reload - make sure we don't double-register event handlers */
|
||||
@ -253,6 +254,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
deftemplatesuffix = configuration.getString("deftemplatesuffix", "");
|
||||
/* Default swamp shading off for 1.8, on after */
|
||||
swampshading = configuration.getBoolean("swampshaded", !getServer().getVersion().contains("(MC: 1.8"));
|
||||
/* Default water biome shading off for 1.8, on after */
|
||||
waterbiomeshading = configuration.getBoolean("waterbiomeshaded", !getServer().getVersion().contains("(MC: 1.8"));
|
||||
/* Default fence-to-block-join off for 1.8, on after */
|
||||
fencejoin = configuration.getBoolean("fence-to-block-join", !getServer().getVersion().contains("(MC: 1.8"));
|
||||
|
||||
|
@ -1145,6 +1145,10 @@ public class MapManager {
|
||||
return plug_in.swampshading;
|
||||
}
|
||||
|
||||
public boolean getWaterBiomeShading() {
|
||||
return plug_in.waterbiomeshading;
|
||||
}
|
||||
|
||||
public boolean getFenceJoin() {
|
||||
return plug_in.fencejoin;
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ public class TexturePack {
|
||||
* Read color for given subblock coordinate, with given block id and data and face
|
||||
*/
|
||||
public final void readColor(final HDPerspectiveState ps, final MapIterator mapiter, final Color rslt, final int blkid, final int lastblocktype,
|
||||
final boolean biome_shaded, final boolean swamp_shaded) {
|
||||
final boolean biome_shaded, final boolean swamp_shaded, final boolean water_shaded) {
|
||||
int blkdata = ps.getBlockData();
|
||||
HDTextureMap map = HDTextureMap.getMap(blkid, blkdata, ps.getBlockRenderData());
|
||||
BlockStep laststep = ps.getLastBlockStep();
|
||||
@ -1014,7 +1014,8 @@ public class TexturePack {
|
||||
li = imgs[IMG_FOLIAGECOLOR];
|
||||
break;
|
||||
case COLORMOD_WATERTONED:
|
||||
li = imgs[IMG_WATERCOLOR];
|
||||
if(water_shaded)
|
||||
li = imgs[IMG_WATERCOLOR];
|
||||
break;
|
||||
}
|
||||
if(li != null) {
|
||||
|
@ -17,6 +17,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
private TexturePack tp;
|
||||
private boolean biome_shaded;
|
||||
private boolean swamp_shaded;
|
||||
private boolean waterbiomeshaded;
|
||||
|
||||
public TexturePackHDShader(ConfigurationNode configuration) {
|
||||
tpname = configuration.getString("texturepack", "minecraft");
|
||||
@ -24,6 +25,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
tp = TexturePack.getTexturePack(tpname);
|
||||
biome_shaded = configuration.getBoolean("biomeshaded", true);
|
||||
swamp_shaded = configuration.getBoolean("swampshaded", MapManager.mapman.getSwampShading());
|
||||
waterbiomeshaded = configuration.getBoolean("waterbiomeshaded", MapManager.mapman.getWaterBiomeShading());
|
||||
if(tp == null) {
|
||||
Log.severe("Error: shader '" + name + "' cannot load texture pack '" + tpname + "'");
|
||||
}
|
||||
@ -75,6 +77,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
private int lastblkid;
|
||||
private boolean do_biome_shading;
|
||||
private boolean do_swamp_shading;
|
||||
private boolean do_water_shading;
|
||||
|
||||
private OurShaderState(MapIterator mapiter, HDMap map, MapChunkCache cache) {
|
||||
this.mapiter = mapiter;
|
||||
@ -93,6 +96,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
/* Biome raw data only works on normal worlds at this point */
|
||||
do_biome_shading = biome_shaded && (cache.getWorld().getEnvironment() == Environment.NORMAL);
|
||||
do_swamp_shading = do_biome_shading && swamp_shaded;
|
||||
do_water_shading = do_biome_shading && waterbiomeshaded;
|
||||
}
|
||||
/**
|
||||
* Get our shader
|
||||
@ -138,7 +142,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
}
|
||||
|
||||
/* Get color from textures */
|
||||
scaledtp.readColor(ps, mapiter, c, blocktype, lastblocktype, do_biome_shading, do_swamp_shading);
|
||||
scaledtp.readColor(ps, mapiter, c, blocktype, lastblocktype, do_biome_shading, do_swamp_shading, do_water_shading);
|
||||
|
||||
if (c.getAlpha() > 0) {
|
||||
int subalpha = ps.getSubmodelAlpha();
|
||||
|
@ -251,6 +251,8 @@ enabletilehash: true
|
||||
|
||||
# Optional - control darkening of biome-shaded colors in swamp biomes (1.9+) - default is true for 1.9+, false for 1.8.x
|
||||
#swampshaded: false
|
||||
# Optional - control biome shading of water (1.9+) - default is true for 1.9+, false for 1.8.x
|
||||
#waterbiomeshaded: false
|
||||
|
||||
# Optional - hide ores: render as normal stone (so that they aren't revealed by maps)
|
||||
#hideores: true
|
||||
|
Loading…
Reference in New Issue
Block a user