summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/CommandBlockListenerAbstract.patch17
1 files changed, 13 insertions, 4 deletions
diff --git a/nms-patches/CommandBlockListenerAbstract.patch b/nms-patches/CommandBlockListenerAbstract.patch
index ba41673f..5f6ef041 100644
--- a/nms-patches/CommandBlockListenerAbstract.patch
+++ b/nms-patches/CommandBlockListenerAbstract.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
-@@ -4,6 +4,14 @@
+@@ -4,6 +4,15 @@
import java.util.Date;
import javax.annotation.Nullable;
@@ -10,12 +10,13 @@
+import com.google.common.base.Joiner;
+import java.util.logging.Level;
+import org.bukkit.command.CommandSender;
++import org.bukkit.event.server.ServerCommandEvent;
+// CraftBukkit end
+
public abstract class CommandBlockListenerAbstract implements ICommandListener {
private static final SimpleDateFormat a = new SimpleDateFormat("HH:mm:ss");
-@@ -15,6 +23,7 @@
+@@ -15,6 +24,7 @@
private String g = "";
private String h = "@";
private final CommandObjectiveExecutor i = new CommandObjectiveExecutor();
@@ -23,7 +24,7 @@
public CommandBlockListenerAbstract() {}
-@@ -107,7 +116,9 @@
+@@ -107,7 +117,9 @@
if (minecraftserver != null && minecraftserver.M() && minecraftserver.getEnableCommandBlock()) {
try {
this.f = null;
@@ -34,7 +35,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
-@@ -149,6 +160,163 @@
+@@ -149,6 +161,171 @@
}
}
@@ -58,6 +59,14 @@
+ if (command.startsWith("/")) {
+ command = command.substring(1);
+ }
++
++ ServerCommandEvent event = new ServerCommandEvent(bSender, command);
++ org.bukkit.Bukkit.getPluginManager().callEvent(event);
++ if (event.isCancelled()) {
++ return 0;
++ }
++ command = event.getCommand();
++
+ String[] args = command.split(" ");
+ ArrayList<String[]> commands = new ArrayList<String[]>();
+