geforkt von Mirrors/Paper
ab347c4c96
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 42d5a714 SPIGOT-5899: Hoglins API similar to Piglins 2c1ee10e SPIGOT-5887: ClickType doesn't include off hand swaps 5ff7c7ce SPIGOT-5886: Missing BlockData CraftBukkit Changes:7560f5f5
SPIGOT-5905: Fix hex colours not being allowed in MOTDd47c47ee
SPIGOT-5889: Villager using composter should call EntityChangeBlockEvent2fe6b4a3
SPIGOT-5899: Hoglins API similar to Piglinse09dbeca
SPIGOT-5887: ClickType doesn't include off hand swaps23aac2a5
SPIGOT-5903: EntityDismountEvent cannot be triggered asynchronously92cbf656
SPIGOT-5884: Tab completions lost on reloadData / minecraft:reloadfb4e54ad
SPIGOT-5902: PlayerRespawnEvent places player at spawn before event is calledaa8f3d5a
SPIGOT-5901: Structures are generated in all worlds based on the setting for the main worlda0c35937
SPIGOT-5895: PlayerChangedWorldEvent#getFrom is incorrect89c0a5c3
SPIGOT-5886: Missing BlockData Spigot Changes: 0287a20d SPIGOT-5903: EntityDismountEvent cannot be triggered asynchronously
42 Zeilen
1.9 KiB
Diff
42 Zeilen
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 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 1294df20d8f958103a3e207ecca80c102fa91b56..9c7667d042e01dc4d614564770bc59fa7daba598 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
|
|
|