9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

添加屏蔽部分包的功能

This commit is contained in:
XiaoMoMi
2025-12-12 02:21:01 +08:00
parent 5f4b13ea4f
commit 4a0ab88e72
5 changed files with 63 additions and 22 deletions

View File

@@ -899,7 +899,12 @@ public class BukkitNetworkManager implements NetworkManager, Listener, PluginMes
}
private void onNMSPacketReceive(NetWorkUser user, NMSPacketEvent event, Object packet) {
Debugger.PACKET.debug(() -> "[C->S]" + packet.getClass());
Debugger.PACKET.debug(() -> {
if (Config.isPacketIgnored(packet.getClass())) {
return null;
}
return "[C->S]" + packet.getClass();
});
handleReceiveNMSPacket(user, event, packet);
}
@@ -910,7 +915,12 @@ public class BukkitNetworkManager implements NetworkManager, Listener, PluginMes
onNMSPacketSend(player, event, p);
}
} else {
Debugger.PACKET.debug(() -> "[S->C]" + packet.getClass());
Debugger.PACKET.debug(() -> {
if (Config.isPacketIgnored(packet.getClass())) {
return null;
}
return "[S->C]" + packet.getClass();
});
handleSendNMSPacket(player, event, packet);
}
}