Skip to content

Commit

Permalink
Fixed ViaForge button position messing with other client buttons. (CC…
Browse files Browse the repository at this point in the history
  • Loading branch information
mems01 authored Jan 11, 2024
1 parent 995933e commit 558c4d3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import java.io.IOException;

@Mixin(GuiMultiplayer.class)
@Mixin(value = GuiMultiplayer.class, priority = 1001)
public abstract class MixinGuiMultiplayer extends MixinGuiScreen {

private GuiButton bungeeCordSpoofButton;
Expand All @@ -29,6 +29,15 @@ private void initGui(CallbackInfo callbackInfo) {
buttonList.add(new GuiButton(997, 5, 8, 45, 20, "Fixes"));
buttonList.add(bungeeCordSpoofButton = new GuiButton(998, 55, 8, 98, 20, "BungeeCord Spoof: " + (BungeeCordSpoof.INSTANCE.getEnabled() ? "On" : "Off")));
buttonList.add(new GuiButton(999, width - 104, 8, 98, 20, "Tools"));

// Detect ViaForge button
GuiButton button = buttonList.stream().filter(b -> b.displayString.equals("ViaForge")).findFirst().orElse(null);

if (button != null) {
// Set it next to the BungeeCord Spoof button
button.xPosition = 158;
button.yPosition = 8;
}
}

@Inject(method = "actionPerformed", at = @At("HEAD"))
Expand Down

0 comments on commit 558c4d3

Please sign in to comment.