|
3 | 3 | import com.lambda.client.gui.mc.LambdaGuiAntiDisconnect;
|
4 | 4 | import com.lambda.client.module.modules.misc.AntiDisconnect;
|
5 | 5 | import com.lambda.client.util.Wrapper;
|
6 |
| -import net.minecraft.client.gui.GuiButton; |
7 |
| -import net.minecraft.client.gui.GuiIngameMenu; |
8 |
| -import net.minecraft.client.gui.GuiScreen; |
| 6 | +import net.minecraft.client.gui.*; |
9 | 7 | import org.spongepowered.asm.mixin.Mixin;
|
10 | 8 | import org.spongepowered.asm.mixin.injection.At;
|
11 | 9 | import org.spongepowered.asm.mixin.injection.Inject;
|
|
15 | 13 | public class MixinGuiIngameMenu extends GuiScreen {
|
16 | 14 | @Inject(method = "actionPerformed", at = @At("HEAD"), cancellable = true)
|
17 | 15 | public void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
|
18 |
| - if (button.id == 1) { |
19 |
| - if (AntiDisconnect.INSTANCE.isEnabled()) { |
20 |
| - Wrapper.getMinecraft().displayGuiScreen(new LambdaGuiAntiDisconnect()); |
21 |
| - callbackInfo.cancel(); |
22 |
| - } |
| 16 | + switch (button.id) { |
| 17 | + case 1: |
| 18 | + if (AntiDisconnect.INSTANCE.isEnabled()) { |
| 19 | + Wrapper.getMinecraft().displayGuiScreen(new LambdaGuiAntiDisconnect()); |
| 20 | + callbackInfo.cancel(); |
| 21 | + } |
| 22 | + break; |
| 23 | + case Integer.MIN_VALUE: |
| 24 | + Wrapper.getMinecraft().displayGuiScreen(new GuiMultiplayer(this)); |
| 25 | + break; |
| 26 | + default: |
| 27 | + break; |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + @Inject(method = "initGui", at = @At("RETURN")) |
| 32 | + public void initGui(CallbackInfo ci) { |
| 33 | + if (!mc.isSingleplayer()) { |
| 34 | + GuiButton openToLanButton = buttonList.remove(4); |
| 35 | + buttonList.add(new GuiButton(Integer.MIN_VALUE, openToLanButton.x, openToLanButton.y, openToLanButton.width, openToLanButton.height, "Server List")); |
23 | 36 | }
|
24 | 37 | }
|
25 | 38 | }
|
0 commit comments