summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-12-23 01:00:17 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-23 01:00:17 +0000
commit81ab957aa53278e8642b0b30ec6aacc9d42fcd4e (patch)
tree38e22ac3b312eda0d149d85cc7cff57186e59e03 /nms-patches
parent6dfcbc61ab48a214ff8c360905d59cf06677294b (diff)
downloadcraftbukkit-81ab957aa53278e8642b0b30ec6aacc9d42fcd4e.tar
craftbukkit-81ab957aa53278e8642b0b30ec6aacc9d42fcd4e.tar.gz
craftbukkit-81ab957aa53278e8642b0b30ec6aacc9d42fcd4e.tar.lz
craftbukkit-81ab957aa53278e8642b0b30ec6aacc9d42fcd4e.tar.xz
craftbukkit-81ab957aa53278e8642b0b30ec6aacc9d42fcd4e.zip
Update the command blacklist to handle the prefixed versions
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/CommandBlockListenerAbstract.patch16
1 files changed, 10 insertions, 6 deletions
diff --git a/nms-patches/CommandBlockListenerAbstract.patch b/nms-patches/CommandBlockListenerAbstract.patch
index 593e8ef2..51525923 100644
--- a/nms-patches/CommandBlockListenerAbstract.patch
+++ b/nms-patches/CommandBlockListenerAbstract.patch
@@ -1,5 +1,5 @@
---- ../work/decompile-8eb82bde/net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-11 20:04:50.493619968 +0000
-+++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-11 20:02:45.005621331 +0000
+--- ../work/decompile-8eb82bde/net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-23 01:00:07.818620695 +0000
++++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-23 01:00:07.818620695 +0000
@@ -4,6 +4,13 @@
import java.util.Date;
import java.util.concurrent.Callable;
@@ -34,7 +34,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
-@@ -91,8 +102,129 @@
+@@ -91,8 +102,133 @@
} else {
this.b = 0;
}
@@ -51,10 +51,14 @@
+ String[] args = command.split(" ");
+ ArrayList<String[]> commands = new ArrayList<String[]>();
+
++ String cmd = args[0];
++ if (cmd.startsWith("minecraft:")) cmd = cmd.substring("minecraft:".length());
++ if (cmd.startsWith("bukkit:")) cmd = cmd.substring("bukkit:".length());
++
+ // Block disallowed commands
-+ if (args[0].equalsIgnoreCase("stop") || args[0].equalsIgnoreCase("kick") || args[0].equalsIgnoreCase("op")
-+ || args[0].equalsIgnoreCase("deop") || args[0].equalsIgnoreCase("ban") || args[0].equalsIgnoreCase("ban-ip")
-+ || args[0].equalsIgnoreCase("pardon") || args[0].equalsIgnoreCase("pardon-ip") || args[0].equalsIgnoreCase("reload")) {
++ if (cmd.equalsIgnoreCase("stop") || cmd.equalsIgnoreCase("kick") || cmd.equalsIgnoreCase("op")
++ || cmd.equalsIgnoreCase("deop") || cmd.equalsIgnoreCase("ban") || cmd.equalsIgnoreCase("ban-ip")
++ || cmd.equalsIgnoreCase("pardon") || cmd.equalsIgnoreCase("pardon-ip") || cmd.equalsIgnoreCase("reload")) {
+ return 0;
+ }
+