forked from Johni0702/bobby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sky rendering with render distance greater than 32 (fixes Johni07…
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/de/johni0702/minecraft/bobby/mixin/BackgroundRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.johni0702.minecraft.bobby.mixin; | ||
|
||
import net.minecraft.client.render.BackgroundRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(BackgroundRenderer.class) | ||
public abstract class BackgroundRendererMixin { | ||
@ModifyVariable(method = "render", at = @At("HEAD"), argsOnly = true) | ||
private static int clampMaxValue(int viewDistance) { | ||
return Math.min(viewDistance, 32); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/de/johni0702/minecraft/bobby/mixin/WorldRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.johni0702.minecraft.bobby.mixin; | ||
|
||
import net.minecraft.client.render.WorldRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArg; | ||
|
||
@Mixin(WorldRenderer.class) | ||
public abstract class WorldRendererMixin { | ||
@ModifyArg(method = "method_37365", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/BackgroundRenderer;applyFog(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/BackgroundRenderer$FogType;FZF)V"), index = 2) | ||
private static float clampMaxValue(float viewDistance) { | ||
return Math.min(viewDistance, 32 * 16); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters