diff --git a/src/main/java/de/hysky/skyblocker/mixins/PlayerListHudMixin.java b/src/main/java/de/hysky/skyblocker/mixins/PlayerListHudMixin.java new file mode 100644 index 0000000000..a4b0282c66 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/mixins/PlayerListHudMixin.java @@ -0,0 +1,18 @@ +package de.hysky.skyblocker.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import de.hysky.skyblocker.utils.Utils; +import net.minecraft.client.gui.hud.PlayerListHud; + +@Mixin(PlayerListHud.class) +public class PlayerListHudMixin { + + @Inject(method = "renderLatencyIcon", at = @At("HEAD"), cancellable = true) + private void skyblocker$hideLatencyIcon(CallbackInfo ci) { + if (Utils.isOnSkyblock()) ci.cancel(); + } +} diff --git a/src/main/resources/skyblocker.mixins.json b/src/main/resources/skyblocker.mixins.json index 238c7df4d9..ac9624f6c6 100644 --- a/src/main/resources/skyblocker.mixins.json +++ b/src/main/resources/skyblocker.mixins.json @@ -31,6 +31,7 @@ "MushroomPlantBlockMixin", "PingMeasurerMixin", "PlayerInventoryMixin", + "PlayerListHudMixin", "PlayerSkinProviderMixin", "PlayerSkinTextureDownloaderMixin", "RenderFishMixin",