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 97ccce03..b42d2a00 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 @@ -271,7 +271,10 @@ public class DynmapPlugin } statename += p.getName() + "=" + bs.get(p).toString(); } - int lightAtten = bs.isOpaqueCube(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockReader.INSTANCE, BlockPos.ZERO) ? 0 : 1); + 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) {} //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 aa5fb344..ab6174a0 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 @@ -248,7 +248,10 @@ public class DynmapPlugin } statename += p.getName() + "=" + bs.getValue(p).toString(); } - int lightAtten = bs.isSolidRender(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 0 : 1); + 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) {} //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 613bd943..943c3a3a 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 @@ -248,7 +248,11 @@ public class DynmapPlugin } statename += p.getName() + "=" + bs.getValue(p).toString(); } - int lightAtten = bs.isSolidRender(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 15 : (bs.propagatesSkylightDown(EmptyBlockGetter.INSTANCE, BlockPos.ZERO) ? 0 : 1); + 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) { + } //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);