Add use-brightness-table setting, and support for world-specific brightness tables

This commit is contained in:
Mike Primm 2014-01-04 21:16:29 -06:00
parent f7d2dac826
commit 76863aeb71
2 changed files with 18 additions and 0 deletions

View File

@ -36,6 +36,20 @@ public class BukkitWorld extends DynmapWorld {
this.env = env; this.env = env;
skylight = (env == World.Environment.NORMAL); skylight = (env == World.Environment.NORMAL);
new Permission("dynmap.world." + getName(), "Dynmap access for world " + getName(), PermissionDefault.OP); new Permission("dynmap.world." + getName(), "Dynmap access for world " + getName(), PermissionDefault.OP);
// Generate non-default environment lighting table
switch (env) {
case NETHER:
{
float f = 0.1F;
for (int i = 0; i <= 15; ++i) {
float f1 = 1.0F - (float)i / 15.0F;
this.setBrightnessTableEntry(i, (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f);
}
}
break;
default:
break;
}
} }
/** /**
* Set world online * Set world online

View File

@ -219,6 +219,10 @@ enabletilehash: true
# Optional - enable smooth lighting by default on all maps supporting it (can be set per map as lighting option) # Optional - enable smooth lighting by default on all maps supporting it (can be set per map as lighting option)
smooth-lighting: true smooth-lighting: true
# Optional - use world provider lighting table (good for custom worlds with custom lighting curves, like nether)
# false=classic Dynmap lighting curve
use-brightness-table: true
# Optional - render specific block IDs using the texures and models of another block ID: can be used to hide/disguise specific # Optional - render specific block IDs using the texures and models of another block ID: can be used to hide/disguise specific
# blocks (e.g. make ores look like stone, hide chests) or to provide simple support for rendering unsupported custom blocks # blocks (e.g. make ores look like stone, hide chests) or to provide simple support for rendering unsupported custom blocks
block-id-alias: block-id-alias: