From 820bd3993e9072c4bd8dc3e2555fe51f546d17d4 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Thu, 13 Oct 2011 04:54:25 +0800 Subject: [PATCH] Add 'onlyiflit' setting for HD cave shader --- src/main/java/org/dynmap/hdmap/CaveHDShader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dynmap/hdmap/CaveHDShader.java b/src/main/java/org/dynmap/hdmap/CaveHDShader.java index 437a3b1d..27682859 100644 --- a/src/main/java/org/dynmap/hdmap/CaveHDShader.java +++ b/src/main/java/org/dynmap/hdmap/CaveHDShader.java @@ -11,10 +11,12 @@ import org.json.simple.JSONObject; public class CaveHDShader implements HDShader { private String name; + private boolean iflit; public CaveHDShader(ConfigurationNode configuration) { name = (String) configuration.get("name"); + iflit = configuration.getBoolean("onlyiflit", false); } @Override @@ -44,7 +46,7 @@ public class CaveHDShader implements HDShader { @Override public boolean isEmittedLightLevelNeeded() { - return false; + return iflit; } @Override @@ -111,6 +113,9 @@ public class CaveHDShader implements HDShader { return false; } if (!air) { + if(iflit && (ps.getEmittedLightLevel() == 0)) { + return false; + } int cr, cg, cb; int mult = 256;