Registered listener

This commit is contained in:
Finn
2025-12-13 14:44:45 +01:00
parent 5fec181a74
commit c7ca67176d
2 changed files with 3 additions and 2 deletions

View File

@@ -11,11 +11,11 @@ public class Listener extends EventListener {
public void onCommandNotFound(CommandNotFoundEvent event) {
StringBuilder argsBuilder = new StringBuilder();
for (String arg : event.getArgs()) argsBuilder.append(arg).append(" ");
ProtocolBridge.getInstance().getLogger().error("Command '" + event.getName() + argsBuilder.toString() + "' not found!");
Main.getProtocolBridge().getLogger().error("Command '" + event.getName() + argsBuilder.toString() + "' not found!");
}
@dev.unlegitdqrk.unlegitlibrary.event.Listener
public void onMissingCommandPermission(CommandExecutorMissingPermissionEvent event) {
ProtocolBridge.getInstance().getLogger().error("You do not have enough permissions to execute this command!");
Main.getProtocolBridge().getLogger().error("You do not have enough permissions to execute this command!");
}
}

View File

@@ -27,6 +27,7 @@ public class Main {
ProtocolSettings settings = new ProtocolSettings();
settings.packetHandler = new PacketHandler();
settings.eventManager = new EventManager();
settings.eventManager.registerListener(Listener.class);
settings.port = 1023;
protocolBridge = new ProtocolBridge(new DatabaseINSServer(), settings, ProtocolVersion.PV_1_0_0_BETA, new File("logs"));