aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch
diff options
context:
space:
mode:
authorAikar <[email protected]>2020-06-28 04:35:41 -0400
committerAikar <[email protected]>2020-06-28 04:35:41 -0400
commitb6925c36afa7565cac8f9fe9d3432fe658ca1f77 (patch)
treed64424c2e64e933af075b26c6888e526d7633b69 /Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch
parent5e9cc3a2281589ee6e0ca736712432ba4a0935cd (diff)
downloadPaper-b6925c36afa7565cac8f9fe9d3432fe658ca1f77.tar.gz
Paper-b6925c36afa7565cac8f9fe9d3432fe658ca1f77.zip
Remove no longer needed undead horse leash patch
This is now default vanilla behavior Fixes #3644
Diffstat (limited to 'Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch')
-rw-r--r--Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch
new file mode 100644
index 0000000000..695119894b
--- /dev/null
+++ b/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch
@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Sweepyoface <[email protected]>
+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 9105049e37c955dfab036dcf3703603ea67026d4..3836938a64f37f18bb3d809bd6e4ccf5fb4e8a72 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -105,6 +105,7 @@ import net.minecraft.server.WorldNBTStorage;
+ import net.minecraft.server.WorldServer;
+ import net.minecraft.server.WorldSettings;
+ import org.apache.commons.lang.Validate;
++import org.apache.commons.lang3.StringUtils;
+ import org.bukkit.BanList;
+ import org.bukkit.Bukkit;
+ import org.bukkit.ChatColor;
+@@ -176,6 +177,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; // Paper
+ import org.bukkit.event.inventory.InventoryType;
+ import org.bukkit.event.player.PlayerChatTabCompleteEvent;
+ import org.bukkit.event.server.BroadcastMessageEvent;
+@@ -783,7 +785,13 @@ public final class CraftServer implements Server {
+
+ // Spigot start
+ if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
+- 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
+