From da3549da0ea9db30583e3c091e64990d365a734e Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Mon, 29 Dec 2014 23:03:13 +0100 Subject: [PATCH] Hacky command support Some plugins (PerWorldPlugins) use a hacky command structure like MassiveCore does. Their command strcuture aims to limit commands per world. This will make it a tiny bit easier, so they don't need, special support system for MassiveCore, and don't have to update it. Other plugins might also use this, but atleast it doesn't hurt us. --- .../massivecore/cmd/MassiveCoreBukkitCommand.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/massivecore/cmd/MassiveCoreBukkitCommand.java b/src/main/java/com/massivecraft/massivecore/cmd/MassiveCoreBukkitCommand.java index 5d8fa4b2..0477c0d1 100644 --- a/src/main/java/com/massivecraft/massivecore/cmd/MassiveCoreBukkitCommand.java +++ b/src/main/java/com/massivecraft/massivecore/cmd/MassiveCoreBukkitCommand.java @@ -8,12 +8,14 @@ import java.util.TreeSet; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.command.PluginIdentifiableCommand; +import org.bukkit.plugin.Plugin; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.Txt; -public class MassiveCoreBukkitCommand extends Command +public class MassiveCoreBukkitCommand extends Command implements PluginIdentifiableCommand { // -------------------------------------------- // // FIELDS @@ -95,4 +97,14 @@ public class MassiveCoreBukkitCommand extends Command return new ArrayList(ret); } + // -------------------------------------------- // + // OVERRIDE: PLUGIN IDENTIFIABLE COMMAND + // -------------------------------------------- // + + @Override + public Plugin getPlugin() + { + return massiveCommand.getRegisteredPlugin(); + } + }