File tree Expand file tree Collapse file tree
src/main/java/cam72cam/mod/render Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,14 +135,19 @@ public static boolean enabled() {
135135 try {
136136 //Some branch specific stuff
137137 //Need change once switch back to official LDL
138- //i.e. SodiumDynamicLights.get().config.getEntitiesLightSource().get()
138+ //i.e.
139+ // SodiumDynamicLights.get().config.getEntitiesLightSource().get()
140+ // SodiumDynamicLights.get().config.getDynamicLightsMode().isEnabled()
139141 Class <?> cls = Class .forName ("toni.sodiumdynamiclights.SodiumDynamicLights" );
140142 Method m1 = cls .getDeclaredMethod ("get" );
141143 Field f1 = cls .getDeclaredField ("config" );
142144 Class <?> config = Class .forName ("toni.sodiumdynamiclights.DynamicLightsConfig" );
143145 Object con = config .cast (f1 .get (m1 .invoke (null )));
144146 Method m2 = config .getDeclaredMethod ("getEntitiesLightSource" );
145- return ((ForgeConfigSpec .BooleanValue ) m2 .invoke (con )).get ();
147+ Method m3 = config .getDeclaredMethod ("getDynamicLightsMode" );
148+ Class <?> types = Class .forName ("toni.sodiumdynamiclights.DynamicLightsMode" );
149+ Method m4 = types .getDeclaredMethod ("isEnabled" );
150+ return ((ForgeConfigSpec .BooleanValue ) m2 .invoke (con )).get () && (boolean ) m4 .invoke (types .cast (m3 .invoke (con )));
146151 } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | InvocationTargetException |
147152 IllegalAccessException ignored ) {
148153 }
You can’t perform that action at this time.
0 commit comments