From 828f5ad173ecaf1a2695b7b44a6074f26c8b065a Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 22 Feb 2012 10:27:16 -0500 Subject: [PATCH 1/2] Renamed StatsCommand.java to McstatsCommand.java to reflect change to command name. --- .../general/{StatsCommand.java => McstatsCommand.java} | 6 +++--- src/main/java/com/gmail/nossr50/config/LoadProperties.java | 4 ++-- src/main/java/com/gmail/nossr50/mcMMO.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/main/java/com/gmail/nossr50/commands/general/{StatsCommand.java => McstatsCommand.java} (95%) diff --git a/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java b/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java similarity index 95% rename from src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java rename to src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java index 6f9bfbddb..b88005503 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java @@ -16,16 +16,16 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.skills.Skills; -public class StatsCommand implements CommandExecutor { +public class McstatsCommand implements CommandExecutor { private final mcMMO plugin; - public StatsCommand(mcMMO instance) { + public McstatsCommand(mcMMO instance) { this.plugin = instance; } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!LoadProperties.statsEnable) { + if (!LoadProperties.mcstatsEnable) { sender.sendMessage("This command is not enabled."); return true; } diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index d6fc8e564..747708344 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -42,7 +42,7 @@ public class LoadProperties { xplockEnable, xpbar, xpicon, partybar, xprateEnable, spoutEnabled, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, - whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, + whoisEnable, mcstatsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, aEnable, pEnable, enableMotd, enableMySpawn, enableCobbleToMossy, useMySQL, toolsLoseDurabilityFromAbilities, @@ -402,7 +402,7 @@ public class LoadProperties { mcmmoEnable = readBoolean("Commands.mcmmo.Enabled", true); mccEnable = readBoolean("Commands.mcc.Enabled", true); mcgodEnable = readBoolean("Commands.mcgod.Enabled", true); - statsEnable = readBoolean("Commands.stats.Enabled", true); + mcstatsEnable = readBoolean("Commands.mcstats.Enabled", true); mmoeditEnable = readBoolean("Commands.mmoedit.Enabled", true); ptpEnable = readBoolean("Commands.ptp.Enabled", true); partyEnable = readBoolean("Commands.party.Enabled", true); diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 168260eb8..60014c549 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -317,7 +317,7 @@ public class mcMMO extends JavaPlugin if(LoadProperties.mmoeditEnable) getCommand("mmoedit").setExecutor(new MmoeditCommand(this)); getCommand("mmoupdate").setExecutor(new MmoupdateCommand()); if(LoadProperties.myspawnEnable) getCommand("myspawn").setExecutor(new MyspawnCommand()); - if(LoadProperties.statsEnable) getCommand("mcstats").setExecutor(new StatsCommand(this)); + if(LoadProperties.mcstatsEnable) getCommand("mcstats").setExecutor(new McstatsCommand(this)); if(LoadProperties.whoisEnable) getCommand("whois").setExecutor(new WhoisCommand(this)); if(LoadProperties.xprateEnable) getCommand("xprate").setExecutor(new XprateCommand()); From 182219f00d18d4ec6594d4f6ce8f0a0d256f0e87 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 22 Feb 2012 10:59:39 -0500 Subject: [PATCH 2/2] Added permissions node for Blast Mining - Addresses MCCORE-38 --- .../java/com/gmail/nossr50/listeners/mcBlockListener.java | 4 ++-- .../java/com/gmail/nossr50/listeners/mcEntityListener.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index e5fa4cd49..4af370214 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -79,7 +79,7 @@ public class mcBlockListener implements Listener } //TNT placement checks - needed for Blast Mining - if(block.getTypeId() == 46) + if(block.getTypeId() == 46 && mcPermissions.getInstance().blastmining(player)) { PlayerProfile PP = Users.getProfile(player); int skill = PP.getSkillLevel(SkillType.MINING); @@ -157,7 +157,7 @@ public class mcBlockListener implements Listener */ //TNT removal checks - needed for Blast Mining - if(block.getTypeId() == 46 && inhand.getTypeId() != 259) + if(block.getTypeId() == 46 && inhand.getTypeId() != 259 && mcPermissions.getInstance().blastmining(player)) { plugin.misc.tntTracker.remove(block); } diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index 91caf9dc0..6169abbea 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -93,7 +93,8 @@ public class mcEntityListener implements Listener if(event.getEntity() instanceof Player) { Player player = (Player)event.getEntity(); - BlastMining.demolitionsExpertise(player, event); + if(mcPermissions.getInstance().blastmining(player)) + BlastMining.demolitionsExpertise(player, event); } }