Add: 全局代码格式化

This commit is contained in:
SerendipityR 2024-02-03 01:02:11 +08:00 committed by GitHub
parent 851601f37d
commit 0605c8f355
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 119 additions and 106 deletions

View File

@ -40,7 +40,8 @@ public class CatAntiCheat {
out.writeBytes(new byte[]{sendPacketID, 0, clientVersion, salt}); out.writeBytes(new byte[]{sendPacketID, 0, clientVersion, salt});
// LogUtil.doLog(0,"发送PluginMessage: " + "CatAntiCheat" + " | " + Arrays.toString(buf.toByteArray()), "CatAntiCheat"); // LogUtil.doLog(0,"发送PluginMessage: " + "CatAntiCheat" + " | " + Arrays.toString(buf.toByteArray()), "CatAntiCheat");
session.send(new ClientPluginMessagePacket("CatAntiCheat", buf.toByteArray())); session.send(new ClientPluginMessagePacket("CatAntiCheat", buf.toByteArray()));
} catch (IOException ignored) {} } catch (IOException ignored) {
}
break; break;
case 1: case 1:
// File Check packet reply // File Check packet reply
@ -168,7 +169,8 @@ public class CatAntiCheat {
try (InputStream in = Files.newInputStream(file.toPath())) { try (InputStream in = Files.newInputStream(file.toPath())) {
return calcHash(in) + "\0" + file.getName(); return calcHash(in) + "\0" + file.getName();
} }
} catch (IOException ignored) { } } catch (IOException ignored) {
}
return null; return null;
} }
@ -214,7 +216,8 @@ public class CatAntiCheat {
ImageIO.write(bufferedImage, "png", gzipOutputStream); ImageIO.write(bufferedImage, "png", gzipOutputStream);
gzipOutputStream.flush(); gzipOutputStream.flush();
gzipOutputStream.close(); gzipOutputStream.close();
} catch (Exception ignored) {} } catch (Exception ignored) {
}
return out.toByteArray(); return out.toByteArray();
} }

View File

@ -10,5 +10,6 @@ public abstract class MCForgeHandShake {
} }
public abstract void handle(Packet recvPacket); public abstract void handle(Packet recvPacket);
public abstract String getFMLVersion(); public abstract String getFMLVersion();
} }

View File

@ -124,7 +124,9 @@ public class MCForgeHandShakeV2 extends MCForgeHandShake {
private String targetNetworkReceiver; private String targetNetworkReceiver;
private byte[] payload; private byte[] payload;
public LoginWrapper() {} public LoginWrapper() {
}
public LoginWrapper(String targetNetworkReceiver, byte[] payload) { public LoginWrapper(String targetNetworkReceiver, byte[] payload) {
this.targetNetworkReceiver = targetNetworkReceiver; this.targetNetworkReceiver = targetNetworkReceiver;
this.payload = payload; this.payload = payload;

View File

@ -62,7 +62,8 @@ public class MCForgeMOTD {
try { try {
if (socket.isConnected()) if (socket.isConnected())
socket.close(); socket.close();
} catch (IOException ignored) {} } catch (IOException ignored) {
}
} }
return modList; return modList;
} }

View File

@ -391,7 +391,8 @@ public class ConfigUtil {
AttackPort = Integer.parseInt(re[2]); AttackPort = Integer.parseInt(re[2]);
} }
} }
} catch (Exception ignored) {} } catch (Exception ignored) {
}
} }
public static HashMap<String, String> readModInfo(String directoryPath) { public static HashMap<String, String> readModInfo(String directoryPath) {

View File

@ -82,7 +82,8 @@ public class DataUtil {
try { try {
String[] aPwdData = PwdData.split("@"); String[] aPwdData = PwdData.split("@");
botRegPasswordsMap.put(aPwdData[0], aPwdData[1]); botRegPasswordsMap.put(aPwdData[0], aPwdData[1]);
} catch (Exception ignored) {} } catch (Exception ignored) {
}
} }
updateData(botRegPasswords); updateData(botRegPasswords);

View File

@ -6,5 +6,6 @@ import com.sun.jna.Platform;
public interface SetTitle extends Library { public interface SetTitle extends Library {
SetTitle INSTANCE = Native.loadLibrary((Platform.isWindows() ? "kernel32" : "c"), SetTitle.class); SetTitle INSTANCE = Native.loadLibrary((Platform.isWindows() ? "kernel32" : "c"), SetTitle.class);
boolean SetConsoleTitleA(String title); boolean SetConsoleTitleA(String title);
} }

View File

@ -20,6 +20,7 @@ public interface BotHandler {
boolean hasClientFlag(Object client, String flag); boolean hasClientFlag(Object client, String flag);
void setClientFlag(Object client, String flag, Object value); void setClientFlag(Object client, String flag, Object value);
Object getClientFlag(Object client, String flag); Object getClientFlag(Object client, String flag);
void setClientTimeout(Object client, int timeout); void setClientTimeout(Object client, int timeout);

View File

@ -356,7 +356,8 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
} }
@Override @Override
public void handleOtherPacket(Object packet) {} public void handleOtherPacket(Object packet) {
}
@Override @Override
public void sendChatPacket(Object client, String text) { public void sendChatPacket(Object client, String text) {

View File

@ -122,6 +122,7 @@ public class PacketHandler implements cn.serendipityr.EndMinecraftPlusV2.Multipl
Session session = ((Client) client).getSession(); Session session = ((Client) client).getSession();
ServerPlayerPositionRotationPacket positionRotationPacket = (ServerPlayerPositionRotationPacket) recvPacket; ServerPlayerPositionRotationPacket positionRotationPacket = (ServerPlayerPositionRotationPacket) recvPacket;
session.setFlag("location", new double[]{positionRotationPacket.getX(), positionRotationPacket.getY(), positionRotationPacket.getZ(), positionRotationPacket.getYaw(), positionRotationPacket.getPitch()}); session.setFlag("location", new double[]{positionRotationPacket.getX(), positionRotationPacket.getY(), positionRotationPacket.getZ(), positionRotationPacket.getYaw(), positionRotationPacket.getPitch()});
if (ConfigUtil.PacketHandlerMove) { if (ConfigUtil.PacketHandlerMove) {
sendClientPlayerMovementPacket(session, true); sendClientPlayerMovementPacket(session, true);
ClientTeleportConfirmPacket teleportConfirmPacket = new ClientTeleportConfirmPacket(positionRotationPacket.getTeleportId()); ClientTeleportConfirmPacket teleportConfirmPacket = new ClientTeleportConfirmPacket(positionRotationPacket.getTeleportId());