fog off client command added

This commit is contained in:
gnembon committed 2020-04-30 00:44:46 -03:00
1 parent 95d97608c2
commit 2fe5ed615e
3 files changed
+32 -1

No files matched your search

+7
View File
@@ -573,4 +573,11 @@ public class CarpetSettings
category = CREATIVE
)
public static boolean extremeBehaviours = false;
@Rule(
desc = "Removes fog from client in the nether and the end",
extra = "Improves visibility, but looks weird",
category = CLIENT
)
public static boolean fogOff = false;
}
@@ -0,0 +1,23 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.world.dimension.Dimension;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = WorldRenderer.class, priority = 69420)
public class WorldRenderer_fogOffMixin
{
@Redirect(method = "render", require = 0, expect = 0, at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/dimension/Dimension;isFogThick(II)Z"
))
private boolean isReallyThick(Dimension dimension, int x, int z)
{
if (CarpetSettings.fogOff) return false;
return dimension.isFogThick(x, z);
}
}
+2 -1
View File
@@ -168,7 +168,8 @@
"PlayerListHudMixin",
"PistonBlockEntityRenderer_movableTEMixin",
"ClientPlayNetworkHandler_smoothClientAnimationsMixin",
"ClientPlayerEntity_clientCommandMixin"
"ClientPlayerEntity_clientCommandMixin",
"WorldRenderer_fogOffMixin"
],
"server": [
"MinecraftDedicatedServerMixin"