2018-08-26 20:11:49 +02:00
|
|
|
From 6c5de5033565d877fb7e926a50a5ee6f75d66105 Mon Sep 17 00:00:00 2001
|
2017-06-18 02:53:31 +02:00
|
|
|
From: Sweepyoface <github@sweepy.pw>
|
|
|
|
Date: Sat, 17 Jun 2017 18:48:21 -0400
|
|
|
|
Subject: [PATCH] Add UnknownCommandEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2018-08-26 20:11:49 +02:00
|
|
|
index 10cbe8c6a1..5c48430313 100644
|
2017-06-18 02:53:31 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2018-07-18 02:08:13 +02:00
|
|
|
@@ -79,6 +79,7 @@ import org.bukkit.craftbukkit.util.Versioning;
|
2017-06-18 02:53:31 +02:00
|
|
|
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
|
|
|
|
import org.bukkit.entity.Entity;
|
|
|
|
import org.bukkit.entity.Player;
|
2017-07-28 15:45:16 +02:00
|
|
|
+import org.bukkit.event.command.UnknownCommandEvent; // Paper
|
2017-06-18 02:53:31 +02:00
|
|
|
import org.bukkit.event.inventory.InventoryType;
|
|
|
|
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
2017-07-28 15:45:16 +02:00
|
|
|
import org.bukkit.event.server.BroadcastMessageEvent;
|
2018-08-26 20:11:49 +02:00
|
|
|
@@ -723,7 +724,13 @@ public final class CraftServer implements Server {
|
2017-06-18 02:53:31 +02:00
|
|
|
|
|
|
|
// Spigot start
|
2018-07-18 02:08:13 +02:00
|
|
|
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
|
2017-06-18 02:53:31 +02:00
|
|
|
- sender.sendMessage(org.spigotmc.SpigotConfig.unknownCommandMessage);
|
|
|
|
+ // Paper start
|
|
|
|
+ UnknownCommandEvent event = new UnknownCommandEvent(sender, commandLine, org.spigotmc.SpigotConfig.unknownCommandMessage);
|
|
|
|
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
|
|
|
+ if (StringUtils.isNotEmpty(event.getMessage())) {
|
|
|
|
+ sender.sendMessage(event.getMessage());
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
// Spigot end
|
|
|
|
|
|
|
|
--
|
2018-07-04 09:55:24 +02:00
|
|
|
2.18.0
|
2017-06-17 23:15:25 +02:00
|
|
|
|