diff --git a/shared/java/top/fpsmaster/features/impl/utility/Protocol.kt b/shared/java/top/fpsmaster/features/impl/utility/Protocol.kt deleted file mode 100644 index 23411ea..0000000 --- a/shared/java/top/fpsmaster/features/impl/utility/Protocol.kt +++ /dev/null @@ -1,60 +0,0 @@ -package top.fpsmaster.features.impl.utility - -import net.minecraft.network.NetworkManager -import top.fpsmaster.event.Subscribe -import top.fpsmaster.event.events.EventCustomPacket -import top.fpsmaster.event.events.EventSendChatMessage -import top.fpsmaster.features.manager.Category -import top.fpsmaster.features.manager.Module -import top.fpsmaster.features.settings.impl.BooleanSetting -import top.fpsmaster.modules.logger.Logger.info -import top.fpsmaster.wrapper.HYTProvider - -class Protocol : Module("Protocol", Category.Utility) { - init { - addSettings(bypass, chestfix) - } - - override fun onEnable() { - super.onEnable() - using = true - } - - override fun onDisable() { - super.onDisable() - using = false - } - - @Subscribe - fun onPacket(e: EventCustomPacket?) { - // check server ip - HYTProvider.onPacket(e) - } - - @Subscribe - fun onChat(e: EventSendChatMessage) { - if (e.msg.contains("/kh")) { - info("打开组队页面") - HYTProvider.sendOpenParty() - e.cancel() - } - } - - companion object { - @JvmStatic - fun sendBypass(netManager: NetworkManager) { - if (!bypass.value) - return - HYTProvider.sendBypass(netManager) - } - - @JvmField - var bypass = BooleanSetting("Bypass", true) - - @JvmField - var chestfix = BooleanSetting("ChestFix", true) - - @JvmField - var using = false - } -} diff --git a/shared/java/top/fpsmaster/features/manager/ModuleManager.kt b/shared/java/top/fpsmaster/features/manager/ModuleManager.kt index 5e90abe..cd83277 100644 --- a/shared/java/top/fpsmaster/features/manager/ModuleManager.kt +++ b/shared/java/top/fpsmaster/features/manager/ModuleManager.kt @@ -38,16 +38,6 @@ class ModuleManager { module.toggle() } } - - // 提醒一下lowiq怎么组队 - if (ProviderManager.mcProvider.getPlayer() != null && ProviderManager.mcProvider.getServerAddress()?.contains("hytpc") == true) { - if (e.key == Keyboard.KEY_K) { - Utility.sendClientMessage("花雨庭组队提示:") - Utility.sendClientMessage("创建队伍并邀请玩家:/组队 玩家名") - Utility.sendClientMessage("接受组队邀请:/组队 邀请你的玩家名 【如果接受方是网易版请忽略该步骤】") - Utility.sendClientMessage("解散队伍:/组队 解散") - } - } } fun init() { diff --git a/shared/java/top/fpsmaster/modules/client/HytApi.kt b/shared/java/top/fpsmaster/modules/client/HytApi.kt deleted file mode 100644 index c650e5b..0000000 --- a/shared/java/top/fpsmaster/modules/client/HytApi.kt +++ /dev/null @@ -1,36 +0,0 @@ -package top.fpsmaster.modules.client - -import com.google.gson.Gson -import com.google.gson.JsonObject -import top.fpsmaster.features.impl.utility.LevelTag -import top.fpsmaster.utils.os.HttpRequest - -class HytApi { - fun getRank(id: String): String { - try { - var json: String? = null - when (LevelTag.levelMode.mode) { - 1 -> { - json = HttpRequest["https://mc-api.16163.com/search/bedwars.html?uid=$id"] - } - 2 -> { - json = HttpRequest["https://mc-api.16163.com/search/bedwarsxp.html?uid=$id"] - } - 3 -> { - json = HttpRequest["https://mc-api.16163.com/search/skywars.html?uid=$id"] - } - 4 -> { - json = HttpRequest["https://mc-api.16163.com/search/kitbattle.html?uid=$id"] - } - } - return try { - val data = Gson().fromJson(json, JsonObject::class.java) - data["rank"].asString - } catch (e: Exception) { - "无" - } - }catch (e: Exception){ - return "无" - } - } -} diff --git a/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinNetHandlerLoginClient.java b/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinNetHandlerLoginClient.java index a5696f0..a8b7120 100644 --- a/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinNetHandlerLoginClient.java +++ b/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinNetHandlerLoginClient.java @@ -12,7 +12,6 @@ import net.minecraft.network.login.server.SPacketEncryptionRequest; import net.minecraft.util.CryptManager; import net.minecraft.util.text.TextComponentTranslation; -import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.spongepowered.asm.mixin.*; import top.fpsmaster.event.EventDispatcher; @@ -33,55 +32,8 @@ public abstract class MixinNetHandlerLoginClient { @Final @Shadow private static Logger LOGGER; - @Unique - private boolean isHyt = false; @Shadow protected abstract MinecraftSessionService getSessionService(); - - - /** - * @author SuperSkidder - * @reason for plugin - */ - @Overwrite - public void handleEncryptionRequest(SPacketEncryptionRequest packetIn) { - final SecretKey secretkey = CryptManager.createNewSharedKey(); - String s = packetIn.getServerId(); - PublicKey publickey = packetIn.getPublicKey(); - String s1 = (new BigInteger(CryptManager.getServerIdHash(s, publickey, secretkey))).toString(16); - EventJoinServer eventJoinServer = new EventJoinServer(s1); - EventDispatcher.dispatchEvent(eventJoinServer); - isHyt = eventJoinServer.getCancel(); - System.out.println("isHyt: " + isHyt); - if (mc.getCurrentServerData() != null && mc.getCurrentServerData().isOnLAN()) { - try { - this.getSessionService().joinServer(mc.getSession().getProfile(), mc.getSession().getToken(), s1); - } catch (AuthenticationException var10) { - LOGGER.warn("Couldn't connect to auth servers but will continue to join LAN"); - } - } else { - if (!isHyt) { - try { - this.getSessionService().joinServer(mc.getSession().getProfile(), mc.getSession().getToken(), s1); - } catch (AuthenticationUnavailableException var7) { - this.networkManager.closeChannel(new TextComponentTranslation("disconnect.loginFailedInfo", new TextComponentTranslation("disconnect.loginFailedInfo.serversUnavailable"))); - return; - } catch (InvalidCredentialsException var8) { - this.networkManager.closeChannel(new TextComponentTranslation("disconnect.loginFailedInfo", new TextComponentTranslation("disconnect.loginFailedInfo.invalidSession"))); - return; - } catch (AuthenticationException var9) { - this.networkManager.closeChannel(new TextComponentTranslation("disconnect.loginFailedInfo", var9.getMessage())); - return; - } - } - } - isHyt = false; - this.networkManager.sendPacket(new CPacketEncryptionResponse(secretkey, publickey, packetIn.getVerifyToken()), new GenericFutureListener>() { - public void operationComplete(Future p_operationComplete_1_) throws Exception { - networkManager.enableEncryption(secretkey); - } - }); - } } diff --git a/v1.12.2/src/main/java/top/fpsmaster/wrapper/HYTProvider.java b/v1.12.2/src/main/java/top/fpsmaster/wrapper/HYTProvider.java deleted file mode 100644 index 979e88e..0000000 --- a/v1.12.2/src/main/java/top/fpsmaster/wrapper/HYTProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package top.fpsmaster.wrapper; - -import io.netty.buffer.ByteBuf; -import net.minecraft.network.NetworkManager; -import org.jetbrains.annotations.NotNull; -import top.fpsmaster.event.events.EventCustomPacket; - - -public class HYTProvider { - public static void openUI() { - } - - public static void onPacket(EventCustomPacket e) { - - } - - public static void worldProcess(ByteBuf var1) { - - } - - public static void sendOpenParty() { - } - - public static void setJoin() { - } - - - public static void sendBypass(@NotNull NetworkManager netManager) { - } -}