Registered listener
This commit is contained in:
@@ -11,11 +11,11 @@ public class Listener extends EventListener {
|
|||||||
public void onCommandNotFound(CommandNotFoundEvent event) {
|
public void onCommandNotFound(CommandNotFoundEvent event) {
|
||||||
StringBuilder argsBuilder = new StringBuilder();
|
StringBuilder argsBuilder = new StringBuilder();
|
||||||
for (String arg : event.getArgs()) argsBuilder.append(arg).append(" ");
|
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
|
@dev.unlegitdqrk.unlegitlibrary.event.Listener
|
||||||
public void onMissingCommandPermission(CommandExecutorMissingPermissionEvent event) {
|
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!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class Main {
|
|||||||
ProtocolSettings settings = new ProtocolSettings();
|
ProtocolSettings settings = new ProtocolSettings();
|
||||||
settings.packetHandler = new PacketHandler();
|
settings.packetHandler = new PacketHandler();
|
||||||
settings.eventManager = new EventManager();
|
settings.eventManager = new EventManager();
|
||||||
|
settings.eventManager.registerListener(Listener.class);
|
||||||
settings.port = 1023;
|
settings.port = 1023;
|
||||||
|
|
||||||
protocolBridge = new ProtocolBridge(new DatabaseINSServer(), settings, ProtocolVersion.PV_1_0_0_BETA, new File("logs"));
|
protocolBridge = new ProtocolBridge(new DatabaseINSServer(), settings, ProtocolVersion.PV_1_0_0_BETA, new File("logs"));
|
||||||
|
|||||||
Reference in New Issue
Block a user