diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2014-02-07 18:40:59 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-02-08 03:17:14 -0600 |
commit | 553acdf0cdde1abe59399a83af5cc3deb78c188f (patch) | |
tree | 4d20a9a3fbb5fde08fbc359bd3bec62d7a15f47e /src/main/java/net/minecraft | |
parent | b18bedd848be2a1396087e768601c85c791e00aa (diff) | |
download | craftbukkit-553acdf0cdde1abe59399a83af5cc3deb78c188f.tar craftbukkit-553acdf0cdde1abe59399a83af5cc3deb78c188f.tar.gz craftbukkit-553acdf0cdde1abe59399a83af5cc3deb78c188f.tar.lz craftbukkit-553acdf0cdde1abe59399a83af5cc3deb78c188f.tar.xz craftbukkit-553acdf0cdde1abe59399a83af5cc3deb78c188f.zip |
[Bleeding] Implement Mojang command fallback system. Adds BUKKIT-5385
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java index 52712728..2f5ee944 100644 --- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java @@ -6,6 +6,7 @@ import java.util.Date; // CraftBukkit start import java.util.ArrayList; import org.apache.logging.log4j.Level; +import org.bukkit.craftbukkit.command.VanillaCommandWrapper; import com.google.common.base.Joiner; // CraftBukkit end @@ -94,14 +95,23 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { return; } - // Make sure this is a valid command - if (commandMap.getCommand(args[0]) == null) { + // If the world has no players don't run + if (this.getWorld().players.isEmpty()) { this.b = 0; return; } - // If the world has no players don't run - if (this.getWorld().players.isEmpty()) { + // Handle vanilla commands; + if (minecraftserver.server.getCommandBlockOverride(args[0])) { + org.bukkit.command.Command commandBlockCommand = commandMap.getCommand("minecraft:" + args[0]); + if (commandBlockCommand instanceof VanillaCommandWrapper) { + this.b = ((VanillaCommandWrapper) commandBlockCommand).dispatchVanillaCommandBlock(this, this.e); + return; + } + } + + // Make sure this is a valid command + if (commandMap.getCommand(args[0]) == null) { this.b = 0; return; } |