fullbright
new mod
This commit is contained in:
@@ -16,7 +16,8 @@ public class ModManager {
|
|||||||
new PotionDisplay(),
|
new PotionDisplay(),
|
||||||
new Coordinates(),
|
new Coordinates(),
|
||||||
new Freelook(),
|
new Freelook(),
|
||||||
new Keystrokes()
|
new Keystrokes(),
|
||||||
|
new Fullbright()
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package org.saturnclient.modules.mods;
|
||||||
|
|
||||||
|
import org.saturnclient.modules.Module;
|
||||||
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
|
import org.saturnclient.saturnclient.config.Property;
|
||||||
|
|
||||||
|
public class Fullbright extends Module {
|
||||||
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
private static Property<Integer> brightness = Property.integer(100);
|
||||||
|
|
||||||
|
public Fullbright() {
|
||||||
|
super(
|
||||||
|
new ModuleDetails("Fullbright", "fullbright")
|
||||||
|
.description("Allows you to see in the dark")
|
||||||
|
.tags("Camera")
|
||||||
|
.version("v0.1.0"),
|
||||||
|
enabled.named("Enabled"),
|
||||||
|
brightness.named("Brightness %"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnabled(boolean e) {
|
||||||
|
enabled.value = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean shouldOverrideBrightness() {
|
||||||
|
return enabled.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getBrightnessValue() {
|
||||||
|
return brightness.value / 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// code modified from Gamma utils: https://github.com/Sjouwer/gamma-utils
|
||||||
|
package org.saturnclient.modules.mods.mixins;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import net.minecraft.client.render.LightmapTextureManager;
|
||||||
|
import org.saturnclient.modules.mods.Fullbright;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(LightmapTextureManager.class)
|
||||||
|
public class LightmapTextureManagerMixin {
|
||||||
|
|
||||||
|
@ModifyExpressionValue(
|
||||||
|
method = "update",
|
||||||
|
at = @At(value = "INVOKE", target = "Ljava/lang/Math;max(FF)F", ordinal = 0)
|
||||||
|
)
|
||||||
|
private float modifyGamma(float original) {
|
||||||
|
if (Fullbright.shouldOverrideBrightness()) {
|
||||||
|
return Fullbright.getBrightnessValue();
|
||||||
|
}
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 697 B |
@@ -6,7 +6,8 @@
|
|||||||
"client": [
|
"client": [
|
||||||
"CameraMixin",
|
"CameraMixin",
|
||||||
"EntityMixin",
|
"EntityMixin",
|
||||||
"RenderMixin"
|
"RenderMixin",
|
||||||
|
"LightmapTextureManagerMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
Reference in New Issue
Block a user