Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
prevent light values overflowing
Browse files Browse the repository at this point in the history
  • Loading branch information
AnOpenSauceDev committed Feb 5, 2024
1 parent 4cff23d commit e86be9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ChunkRenderReigonMixin {
@Inject(method = "getBrightness", at = @At("HEAD"), cancellable = true)
public void MethaneSetCustomLightLevel(Direction direction, boolean shaded, CallbackInfoReturnable<Float> cir){
if(Methane.ModActive && Methane.settings.dynamicShading) {
cir.setReturnValue(BrightnessUtil.grabBaseGamma() * calculateBrightnessScale()); // only gets darker, never brighter. 1.0F = fully lit.
cir.setReturnValue(Math.min(BrightnessUtil.grabBaseGamma() * calculateBrightnessScale(),1)); // only gets darker, never brighter. 1.0F = fully lit.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ClientWorldMixin {
@Inject(method = "getBrightness", at = @At("HEAD"), cancellable = true)
public void MethaneSetCustomLightLevel(Direction direction, boolean shaded, CallbackInfoReturnable<Float> cir){
if(Methane.ModActive && Methane.settings.dynamicShading) {
cir.setReturnValue(BrightnessUtil.grabBaseGamma() * calculateBrightnessScale()); // only gets darker, never brighter. 1.0F = fully lit.
cir.setReturnValue(Math.min(BrightnessUtil.grabBaseGamma() * calculateBrightnessScale(),1)); // only gets darker, never brighter. 1.0F = fully lit.
}
}

Expand Down

0 comments on commit e86be9a

Please sign in to comment.