36 Zeilen
1.6 KiB
Diff
36 Zeilen
1.6 KiB
Diff
|
From 32caa989fcdb514b6a23096fc52a6a45b3b126d6 Mon Sep 17 00:00:00 2001
|
||
|
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
|
||
|
index df6a75b05..2a5107f66 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||
|
@@ -78,6 +78,7 @@ import org.bukkit.craftbukkit.util.Versioning;
|
||
|
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
|
||
|
import org.bukkit.entity.Entity;
|
||
|
import org.bukkit.entity.Player;
|
||
|
+import org.bukkit.event.command.UnknownCommandEvent;
|
||
|
import org.bukkit.event.inventory.InventoryType;
|
||
|
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
||
|
import org.bukkit.event.world.WorldInitEvent;
|
||
|
@@ -671,7 +672,13 @@ public final class CraftServer implements Server {
|
||
|
|
||
|
// Spigot start
|
||
|
if (StringUtils.isNotEmpty(org.spigotmc.SpigotConfig.unknownCommandMessage)) {
|
||
|
- 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
|
||
|
|
||
|
--
|
||
|
2.13.1
|