Avoid using mcMMO.p when we can

This commit is contained in:
GJ 2012-06-05 10:31:10 -04:00
parent fd1227b87e
commit c97be335ee
3 changed files with 15 additions and 4 deletions

View File

@ -12,6 +12,11 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
public class McmmoCommand implements CommandExecutor {
private final mcMMO plugin;
public McmmoCommand (mcMMO plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@ -20,7 +25,7 @@ public class McmmoCommand implements CommandExecutor {
sender.sendMessage(mcSplit);
if (Config.getInstance().getDonateMessageEnabled()) {
if (mcMMO.p.spoutEnabled && sender instanceof SpoutPlayer) {
if (plugin.spoutEnabled && sender instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) sender;
sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "mcmmodev@gmail.com", Material.DIAMOND);

View File

@ -20,6 +20,12 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users;
public class XplockCommand implements CommandExecutor {
private final mcMMO plugin;
public XplockCommand (mcMMO plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
String usage = ChatColor.RED + "Proper usage is /xplock [skill]";
@ -28,7 +34,7 @@ public class XplockCommand implements CommandExecutor {
return true;
}
if (!mcMMO.p.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
if (!plugin.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true;
}

View File

@ -351,7 +351,7 @@ public class mcMMO extends JavaPlugin {
}
if (configInstance.getCommandmcMMOEnabled()) {
getCommand("mcmmo").setExecutor(new McmmoCommand());
getCommand("mcmmo").setExecutor(new McmmoCommand(this));
}
if (configInstance.getCommandMCRefreshEnabled()) {
@ -416,7 +416,7 @@ public class mcMMO extends JavaPlugin {
//Spout commands
if (configInstance.getCommandXPLockEnabled()) {
getCommand("xplock").setExecutor(new XplockCommand());
getCommand("xplock").setExecutor(new XplockCommand(this));
}
getCommand("mchud").setExecutor(new MchudCommand(this));