From 0c5ea8e11250acc1b2cacc5a802883a5e5437496 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Fri, 26 Jan 2024 13:17:15 +0600 Subject: [PATCH] (feature) hide world borders in fps boost --- .../client/mixin/mixins/RenderGlobalMixin.java | 9 +++++++++ .../silentclient/client/mods/settings/FPSBoostMod.java | 1 + 2 files changed, 10 insertions(+) diff --git a/src/main/java/net/silentclient/client/mixin/mixins/RenderGlobalMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/RenderGlobalMixin.java index 65c3878..6c5b6cd 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/RenderGlobalMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/RenderGlobalMixin.java @@ -9,8 +9,10 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; +import net.silentclient.client.Client; import net.silentclient.client.event.impl.RenderTickEvent; import net.silentclient.client.mods.render.BlockOverlayMod; +import net.silentclient.client.mods.settings.FPSBoostMod; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -45,4 +47,11 @@ public abstract class RenderGlobalMixin { { BlockOverlayMod.drawSelectionBox(player, movingObjectPositionIn, p_72731_3_, partialTicks); } + + @Inject(method = "renderWorldBorder", at = @At("HEAD"), cancellable = true) + public void cancelRenderWorldBorder(Entity entityIn, float partialTicks, CallbackInfo ci) { + if(Client.getInstance().getSettingsManager().getSettingByClass(FPSBoostMod.class, "Hide World Border").getValBoolean()) { + ci.cancel(); + } + } } diff --git a/src/main/java/net/silentclient/client/mods/settings/FPSBoostMod.java b/src/main/java/net/silentclient/client/mods/settings/FPSBoostMod.java index 7209e04..dd25c7f 100644 --- a/src/main/java/net/silentclient/client/mods/settings/FPSBoostMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/FPSBoostMod.java @@ -76,6 +76,7 @@ public class FPSBoostMod extends Mod { this.addBooleanSetting("Hide Lava Particles", this, false); // ready this.addBooleanSetting("Hide Mob in Spawner", this, false); // ready this.addBooleanSetting("Hide Spawner Particles", this, false); // ready + this.addBooleanSetting("Hide World Border", this, false); // ready this.addSliderSetting("Player Render Distance", this, 64, 1, 64, true); // ready this.addSliderSetting("Passive Entity Render Distance", this, 64, 1, 64, true); // ready this.addSliderSetting("Hostile Entity Render Distance", this, 64, 1, 64, true); // ready