Improve error handling and logging in Techhider and TinyProtocol

Refined logging messages for clarity by replacing "Techhider" with "PacketInterceptor" where appropriate. Adjusted error handling in `TechhiderbugCommand` by removing redundant `flush` calls and properly logging exceptions during bug report generation. These changes aim to enhance maintainability and debugging.
This commit is contained in:
2025-04-29 18:04:58 +02:00
parent d6a5caf95d
commit 15bb92fbba
2 changed files with 3 additions and 6 deletions
@@ -95,7 +95,7 @@ public class TinyProtocol implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerLogin(PlayerLoginEvent e) {
plugin.getLogger().info("Creating Techhider for: " + e.getPlayer().getName() + " (" + closed + ")");
plugin.getLogger().info("Creating PacketInterceptor for: " + e.getPlayer().getName() + " (" + closed + ")");
if(closed)
return;
new PacketInterceptor(e.getPlayer());
@@ -130,7 +130,7 @@ public class TinyProtocol implements Listener {
}
public final void close() {
plugin.getLogger().log(Level.INFO, "Closing Techhider", new Exception("Stacktrace"));
plugin.getLogger().log(Level.INFO, "Closing PacketInterceptor", new Exception("Stacktrace"));
if(closed)
return;
@@ -169,9 +169,9 @@ public class TinyProtocol implements Listener {
return;
synchronized (playerInterceptors) {
plugin.getLogger().info("Adding Techhider for: " + player.getName());
playerInterceptors.put(player, this);
}
plugin.getLogger().info("Adding Techhider for: " + player.getName());
try {
channel.pipeline().addBefore("packet_handler", HANDLER_NAME, this);