修复协议版本758后TeleportationPacket数据包回应

This commit is contained in:
SerendipityR 2022-08-21 00:16:31 +08:00 committed by GitHub
parent 6e2982a7d5
commit 904fc93515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 11 deletions

View File

@ -1,13 +1,12 @@
package cn.serendipityr.EndMinecraftPlusV2.VersionControl;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils.*;
import cn.serendipityr.EndMinecraftPlusV2.EndMinecraftPlusV2;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ForgeProtocol.MCForge;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ForgeProtocol.MCForgeMOTD;
import cn.serendipityr.EndMinecraftPlusV2.Tools.ConfigUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.DataUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.LogUtil;
import cn.serendipityr.EndMinecraftPlusV2.Tools.OtherUtils;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.AttackUtils.*;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ForgeProtocol.MCForge;
import cn.serendipityr.EndMinecraftPlusV2.VersionControl.OldVersion.ForgeProtocol.MCForgeMOTD;
import java.util.Arrays;
import java.util.HashMap;

View File

@ -16,6 +16,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.ServerJoinGamePack
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerPluginMessagePacket;
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.ServerPlayerPositionRotationPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundCustomPayloadPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundMovePlayerStatusOnlyPacket;
import com.github.steveice10.packetlib.ProxyInfo;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.*;
@ -87,9 +88,9 @@ public class NewBotAttack extends IAttack {
} else {
c.send(new ClientChatPacket(getRandMessage(clientName.get(c))));
}
}
OtherUtils.doSleep(ConfigUtil.ChatDelay);
}
} else if (c.hasFlag("join")) {
if (ConfigUtil.RegisterAndLogin) {
for (String cmd:ConfigUtil.RegisterCommands) {
@ -469,11 +470,10 @@ public class NewBotAttack extends IAttack {
VersionSupport758.sendClientPlayerChangeHeldItemPacket(session, 1);
} else if (recvPacket instanceof ClientboundPlayerPositionPacket) {
try {
// BUG: 稳定触发Unregistered packet错误
//ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
//VersionSupport758.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
//session.send(new ServerboundMovePlayerStatusOnlyPacket(true));
//VersionSupport758.sendClientTeleportConfirmPacket(session, packet);
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
VersionSupport758.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
session.send(new ServerboundMovePlayerStatusOnlyPacket(true));
VersionSupport758.sendClientTeleportConfirmPacket(session, packet);
} catch (Exception ignored) {}
} else if (ProtocolLibs.adaptAfter760 && VersionSupport760.checkServerChatPacket(recvPacket)) {
List<String> result = VersionSupport760.clickVerifiesHandle(recvPacket, session, ConfigUtil.ClickVerifiesDetect, null);