Skip to content

Commit

Permalink
Fix antidisconnect (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
huddy987 authored Jan 2, 2022
1 parent 0459298 commit e84e63e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.lambda.client.mixin.client.gui;

import com.lambda.client.gui.mc.LambdaGuiAntiDisconnect;
import com.lambda.client.module.modules.misc.AntiDisconnect;
import com.lambda.client.util.Wrapper;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiIngameMenu;
import net.minecraft.client.gui.GuiScreen;
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;

@Mixin(GuiIngameMenu.class)
public class MixinGuiIngameMenu extends GuiScreen {
@Inject(method = "actionPerformed", at = @At("HEAD"), cancellable = true)
public void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
if (button.id == 1) {
if (AntiDisconnect.INSTANCE.isEnabled()) {
Wrapper.getMinecraft().displayGuiScreen(new LambdaGuiAntiDisconnect());
callbackInfo.cancel();
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/mixins.lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"gui.MixinGuiChest",
"gui.MixinGuiContainer",
"gui.MixinGuiIngameForge",
"gui.MixinGuiIngameMenu",
"gui.MixinGuiInventory",
"gui.MixinGuiMainMenu",
"gui.MixinGuiNewChat",
Expand Down

0 comments on commit e84e63e

Please sign in to comment.