Add UnknownCommandEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@ -950,7 +950,13 @@ public final class CraftServer implements Server {
|
||||
|
||||
// Spigot start
|
||||
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
|
||||
sender.sendMessage(org.spigotmc.SpigotConfig.unknownCommandMessage);
|
||||
// Paper start
|
||||
org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(sender, commandLine, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.unknownCommandMessage));
|
||||
this.getPluginManager().callEvent(event);
|
||||
if (event.message() != null) {
|
||||
sender.sendMessage(event.message());
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user