Skip to content

Commit

Permalink
Allow overwriting of Sodium's max render distance
Browse files Browse the repository at this point in the history
To do so, add `-Dbobby.sodium-max-distance-overwrite=96` to the JVM arguments.
  • Loading branch information
Johni0702 committed Jan 1, 2021
1 parent 40d1e40 commit ebad94e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.johni0702.minecraft.bobby.mixin.sodium;

import me.jellysquid.mods.sodium.client.gui.SodiumGameOptionPages;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(value = SodiumGameOptionPages.class, remap = false)
public abstract class SodiumGameOptionPagesMixin {
@ModifyConstant(method = "lambda$general$0", constant = @Constant(intValue = 32))
private static int bobbyMaxRenderDistance(int oldValue) {
return Integer.parseInt(System.getProperty("bobby.sodium-max-distance-overwrite", "" + oldValue));
}
}
3 changes: 2 additions & 1 deletion src/main/resources/bobby.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ClientPlayNetworkHandlerMixin",
"MinecraftClientMixin",
"sodium.SodiumChunkManagerAccessor",
"sodium.SodiumChunkManagerMixin"
"sodium.SodiumChunkManagerMixin",
"sodium.SodiumGameOptionPagesMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit ebad94e

Please sign in to comment.