Instead of ticking the world once (which updated entities and such), simply set the EntityRenderer's lightmapUpdateNeeded to true when updating Ambient Lighting
Properly handle manual Gamma changes in LightingHandler not to confuse users why their Brightness setting is being reset constantly
This commit is contained in:
@@ -11,26 +11,21 @@ public class LightingHandler {
|
||||
private static float initialGamma = 0;
|
||||
|
||||
private static boolean enabled = false;
|
||||
|
||||
|
||||
public static void setLighting(boolean lighting) {
|
||||
if(lighting) {
|
||||
if(!enabled) {
|
||||
initialGamma = Minecraft.getMinecraft().gameSettings.getOptionFloatValue(Options.GAMMA);
|
||||
}
|
||||
Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.GAMMA, 1000);
|
||||
} else Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.GAMMA, initialGamma);
|
||||
|
||||
float gamma = mc.gameSettings.getOptionFloatValue(Options.GAMMA);
|
||||
if(gamma < 1000) {
|
||||
initialGamma = gamma;
|
||||
}
|
||||
|
||||
if(lighting) mc.gameSettings.setOptionFloatValue(Options.GAMMA, 1000);
|
||||
else mc.gameSettings.setOptionFloatValue(Options.GAMMA, initialGamma);
|
||||
|
||||
enabled = lighting;
|
||||
|
||||
try {
|
||||
if(ReplayMod.replaySender.paused()) {
|
||||
mc.timer.elapsedPartialTicks += 1;
|
||||
mc.timer.renderPartialTicks += 1;
|
||||
} else {
|
||||
Minecraft.getMinecraft().entityRenderer.updateCameraAndRender(0);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
if(ReplayMod.replaySender.paused()) {
|
||||
mc.entityRenderer.lightmapUpdateNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user