From eb8a826419b3f76209b48404e1f3beb2b066f0a2 Mon Sep 17 00:00:00 2001 From: George Paton Date: Fri, 19 Apr 2024 22:58:33 +1000 Subject: [PATCH] Fix render distance being capped at 20 (#428) * Fix render distance being capped at 20 in singleplayer * Clean up imports --------- Co-authored-by: George Paton --- .../gtnewhorizons/angelica/mixins/Mixins.java | 1 + .../early/sodium/MixinPlayerManager.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/java/com/gtnewhorizons/angelica/mixins/early/sodium/MixinPlayerManager.java diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java b/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java index c03b9f2b6..47844b9de 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java @@ -113,6 +113,7 @@ public enum Mixins { ,"sodium.MixinLongHashMap" ,"sodium.MixinRender" ,"sodium.MixinRenderingRegistry" + ,"sodium.MixinPlayerManager" ) ), diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/early/sodium/MixinPlayerManager.java b/src/main/java/com/gtnewhorizons/angelica/mixins/early/sodium/MixinPlayerManager.java new file mode 100644 index 000000000..292add0f3 --- /dev/null +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/early/sodium/MixinPlayerManager.java @@ -0,0 +1,18 @@ +package com.gtnewhorizons.angelica.mixins.early.sodium; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArgs; +import org.spongepowered.asm.mixin.injection.invoke.arg.Args; + +import net.minecraft.server.management.PlayerManager; + +@Mixin(PlayerManager.class) +public class MixinPlayerManager { + + @ModifyArgs(method = "func_152622_a(I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MathHelper;clamp_int(III)I")) + public void clamp_int(Args args) { + args.set(2, 32); + } + +}