Skip to content

Commit

Permalink
Hide latency icons in the tab (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureAaron authored Dec 21, 2024
1 parent a624674 commit 07d6d24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/de/hysky/skyblocker/mixins/PlayerListHudMixin.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
1 change: 1 addition & 0 deletions src/main/resources/skyblocker.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"MushroomPlantBlockMixin",
"PingMeasurerMixin",
"PlayerInventoryMixin",
"PlayerListHudMixin",
"PlayerSkinProviderMixin",
"PlayerSkinTextureDownloaderMixin",
"RenderFishMixin",
Expand Down

0 comments on commit 07d6d24

Please sign in to comment.