nofog mod
you can customise if you want to be able to see through liquids, but only lava and powdered snow work (not water)
This commit is contained in:
@@ -17,7 +17,8 @@ public class ModManager {
|
|||||||
new Coordinates(),
|
new Coordinates(),
|
||||||
new Freelook(),
|
new Freelook(),
|
||||||
new Keystrokes(),
|
new Keystrokes(),
|
||||||
new Fullbright()
|
new Fullbright(),
|
||||||
|
new NoFog()
|
||||||
};
|
};
|
||||||
|
|
||||||
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 NoFog extends Module {
|
||||||
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
private static Property<Boolean> liquids = Property.bool(false);
|
||||||
|
|
||||||
|
public NoFog() {
|
||||||
|
super(
|
||||||
|
new ModuleDetails("No Fog", "nofog")
|
||||||
|
.description("Stops fog from rendering")
|
||||||
|
.tags("Camera")
|
||||||
|
.version("v0.1.0"),
|
||||||
|
enabled.named("Enabled"),
|
||||||
|
liquids.named("See through liquids"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnabled(boolean e) {
|
||||||
|
enabled.value = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static for the mixin
|
||||||
|
public static boolean isActive() {
|
||||||
|
return enabled.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean liquids() {
|
||||||
|
return liquids.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package org.saturnclient.modules.mods.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.render.BackgroundRenderer;
|
||||||
|
|
||||||
|
import org.saturnclient.modules.mods.NoFog;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(BackgroundRenderer.class)
|
||||||
|
public class BackgroundRendererMixin {
|
||||||
|
|
||||||
|
@ModifyVariable(method = "applyFog", at = @At("HEAD"), ordinal = 0, argsOnly = true)
|
||||||
|
private static float modifyFogStart(float viewDistance) {
|
||||||
|
if (NoFog.isActive()) {
|
||||||
|
return Float.MAX_VALUE;
|
||||||
|
}
|
||||||
|
return viewDistance;
|
||||||
|
}
|
||||||
|
// liquids
|
||||||
|
@Redirect(
|
||||||
|
method = "applyFog",
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isSpectator()Z")
|
||||||
|
)
|
||||||
|
private static boolean redirectIsSpectator(Entity entity) {
|
||||||
|
if (NoFog.isActive() && NoFog.liquids()) {
|
||||||
|
return true; // pretend to be spectator
|
||||||
|
}
|
||||||
|
return entity.isSpectator();
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 282 B |
@@ -7,7 +7,8 @@
|
|||||||
"CameraMixin",
|
"CameraMixin",
|
||||||
"EntityMixin",
|
"EntityMixin",
|
||||||
"RenderMixin",
|
"RenderMixin",
|
||||||
"LightmapTextureManagerMixin"
|
"LightmapTextureManagerMixin",
|
||||||
|
"BackgroundRendererMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
Reference in New Issue
Block a user