From 7df857e7f332328ea82d576a7800995b53cf5dd3 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 14 Jan 2022 18:32:28 -0600 Subject: [PATCH] Log warning for block states with lighting lookup error --- .../src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java | 4 +++- .../src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java | 4 +++- .../src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java index b42d2a00..8a8ce8c3 100644 --- a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java +++ b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java @@ -274,7 +274,9 @@ public class DynmapPlugin int lightAtten = 15; try { // Workaround for mods with broken block state logic... lightAtten = bs.isOpaqueCube(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 0 : 1); - } catch (Exception x) {} + } catch (Exception x) { + Log.warning(String.format("Exception while checking lighting data for block state: %s[%s]", bn, statename)); + } //Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten); // Fill in base attributes bld.setBaseState(basebs).setStateIndex(idx - baseidx).setBlockName(bn).setStateName(statename).setMaterial(mat.toString()).setLegacyBlockID(idx).setAttenuatesLight(lightAtten); diff --git a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java index ab6174a0..f75b1ca6 100644 --- a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java +++ b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java @@ -251,7 +251,9 @@ public class DynmapPlugin int lightAtten = 15; try { // Workaround for mods with broken block state logic... lightAtten = bs.isSolidRender(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 0 : 1); - } catch (Exception x) {} + } catch (Exception x) { + Log.warning(String.format("Exception while checking lighting data for block state: %s[%s]", bn, statename)); + } //Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten); // Fill in base attributes bld.setBaseState(basebs).setStateIndex(idx - baseidx).setBlockName(bn).setStateName(statename).setMaterial(mat.toString()).setLegacyBlockID(idx).setAttenuatesLight(lightAtten); diff --git a/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java b/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java index 943c3a3a..1d6dc8ef 100644 --- a/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java +++ b/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java @@ -252,6 +252,7 @@ public class DynmapPlugin try { // Workaround for mods with broken block state logic... lightAtten =bs.isSolidRender(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 0 : 1); } catch (Exception x) { + Log.warning(String.format("Exception while checking lighting data for block state: %s[%s]", bn, statename)); } //Log.info("statename=" + bn + "[" + statename + "], lightAtten=" + lightAtten); // Fill in base attributes