浏览代码

Fixed stuff being in wrong package. Start of cleanup to m.java.

GJ 13 年之前
父节点
当前提交
9f3e7ba11c

+ 132 - 7
src/main/java/com/gmail/nossr50/Combat.java

@@ -68,13 +68,13 @@ public class Combat {
 
 
             combatAbilityChecks(attacker);
             combatAbilityChecks(attacker);
             
             
-            if (m.isSwords(itemInHand) && mcPermissions.getInstance().swords(attacker)) {
+            if (ItemChecks.isSword(itemInHand) && mcPermissions.getInstance().swords(attacker)) {
                 if (!pluginx.misc.bleedTracker.contains(target)) {
                 if (!pluginx.misc.bleedTracker.contains(target)) {
                     Swords.bleedCheck(attacker, target, pluginx);
                     Swords.bleedCheck(attacker, target, pluginx);
                 }
                 }
 
 
                 if (PPa.getSerratedStrikesMode()) {
                 if (PPa.getSerratedStrikesMode()) {
-                    Swords.applySerratedStrikes(attacker, event, pluginx);
+                    applyAbilityAoE(attacker, target, damage, pluginx, SkillType.SWORDS);
                 }
                 }
 
 
                 if (targetType.equals(EntityType.PLAYER)) {
                 if (targetType.equals(EntityType.PLAYER)) {
@@ -84,13 +84,13 @@ public class Combat {
                     PvEExperienceGain(attacker, PPa, target, damage, SkillType.SWORDS);
                     PvEExperienceGain(attacker, PPa, target, damage, SkillType.SWORDS);
                 }
                 }
             }
             }
-            else if (m.isAxes(itemInHand) && mcPermissions.getInstance().axes(attacker)) {
+            else if (ItemChecks.isAxe(itemInHand) && mcPermissions.getInstance().axes(attacker)) {
                 Axes.axesBonus(attacker, event);
                 Axes.axesBonus(attacker, event);
-                Axes.axeCriticalCheck(attacker, event, pluginx);
+                Axes.axeCriticalCheck(attacker, event);
                 Axes.impact(attacker, target, event);
                 Axes.impact(attacker, target, event);
 
 
                 if (PPa.getSkullSplitterMode()) {
                 if (PPa.getSkullSplitterMode()) {
-                    Axes.applyAoeDamage(attacker, event, pluginx);
+                    applyAbilityAoE(attacker, target, damage, pluginx, SkillType.AXES);
                 }
                 }
                 
                 
                 if (targetType.equals(EntityType.PLAYER)) {
                 if (targetType.equals(EntityType.PLAYER)) {
@@ -270,7 +270,6 @@ public class Combat {
     public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
     public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
         if (LoadProperties.eventCallback) {
         if (LoadProperties.eventCallback) {
             EntityDamageEvent ede = (EntityDamageEvent) new FakeEntityDamageEvent(target, cause, dmg);
             EntityDamageEvent ede = (EntityDamageEvent) new FakeEntityDamageEvent(target, cause, dmg);
-
             Bukkit.getPluginManager().callEvent(ede);
             Bukkit.getPluginManager().callEvent(ede);
 
 
             if (ede.isCancelled()) {
             if (ede.isCancelled()) {
@@ -294,7 +293,6 @@ public class Combat {
     public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
     public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
         if (LoadProperties.eventCallback) {
         if (LoadProperties.eventCallback) {
             EntityDamageEvent ede = (EntityDamageByEntityEvent) new FakeEntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
             EntityDamageEvent ede = (EntityDamageByEntityEvent) new FakeEntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
-
             Bukkit.getPluginManager().callEvent(ede);
             Bukkit.getPluginManager().callEvent(ede);
 
 
             if (ede.isCancelled()) {
             if (ede.isCancelled()) {
@@ -308,6 +306,15 @@ public class Combat {
         }
         }
     }
     }
 
 
+    /**
+     * Process PVP experience gain.
+     *
+     * @param attacker The attacking player
+     * @param PPa The profile of the attacking player
+     * @param defender The defending player
+     * @param damage The initial damage amount
+     * @param skillType The skill being used
+     */
     private static void PvPExperienceGain(Player attacker, PlayerProfile PPa, Player defender, int damage, SkillType skillType) {
     private static void PvPExperienceGain(Player attacker, PlayerProfile PPa, Player defender, int damage, SkillType skillType) {
         if (!LoadProperties.pvpxp) {
         if (!LoadProperties.pvpxp) {
             return;
             return;
@@ -325,6 +332,15 @@ public class Combat {
           }
           }
     }
     }
 
 
+    /**
+     * Process PVE experience gain.
+     *
+     * @param attacker The attacking player
+     * @param PPa The profile of the attacking player
+     * @param target The defending entity
+     * @param damage The initial damage amount
+     * @param skillType The skill being used
+     */
     private static void PvEExperienceGain(Player attacker, PlayerProfile PPa, LivingEntity target, int damage, SkillType skillType) {
     private static void PvEExperienceGain(Player attacker, PlayerProfile PPa, LivingEntity target, int damage, SkillType skillType) {
         int xp = getXp(target, damage);
         int xp = getXp(target, damage);
 
 
@@ -332,6 +348,13 @@ public class Combat {
         Skills.XpCheckSkill(skillType, attacker);
         Skills.XpCheckSkill(skillType, attacker);
     }
     }
 
 
+    /**
+     * Cap the XP based on the remaining health of an entity.
+     *
+     * @param hpLeft Amount of HP remaining
+     * @param damage Amount of damage being dealt
+     * @return the modified XP amount
+     */
     private static int capXP(int hpLeft, int damage) {
     private static int capXP(int hpLeft, int damage) {
         int xp;
         int xp;
 
 
@@ -425,4 +448,106 @@ public class Combat {
         }
         }
         return xp;
         return xp;
     }
     }
+
+    /**
+     * Apply Area-of-Effect ability actions.
+     *
+     * @param attacker The attacking player
+     * @param target The defending entity
+     * @param damage The initial damage amount
+     * @param plugin mcMMO plugin instance
+     * @param type The type of skill being used
+     */
+    private static void applyAbilityAoE(Player attacker, LivingEntity target, int damage, mcMMO plugin, SkillType type) {
+        int numberOfTargets = m.getTier(attacker.getItemInHand()); //The higher the weapon tier, the more targets you hit
+        int damageAmount = 0;
+
+        if (type.equals(SkillType.AXES)) {
+            damageAmount = damage / 2;
+        }
+        else if (type.equals(SkillType.SWORDS)) {
+            damageAmount = damage / 4;
+        }
+
+        if (damageAmount < 1) {
+            damageAmount = 1;
+        }
+
+        for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
+            EntityType entityType = entity.getType();
+
+            if (entityType.equals(EntityType.WOLF)) {
+                Wolf wolf = (Wolf) entity;
+                AnimalTamer tamer = wolf.getOwner();
+
+                if (tamer instanceof Player) {
+                    Player owner = (Player) tamer;
+
+                    //Reasons why the target shouldn't be hit
+                    if (owner.equals(attacker)) {
+                        continue;
+                    }
+
+                    if (Party.getInstance().inSameParty(attacker, owner)) {
+                        continue;
+                    }
+                }
+            }
+
+            if (entity instanceof LivingEntity && numberOfTargets >= 1) {
+                if (entityType.equals(EntityType.PLAYER)) {
+                    Player defender = (Player) entity;
+                    PlayerProfile PP = Users.getProfile(defender);
+
+                    //Reasons why the target shouldn't be hit
+                    if (PP.getGodMode()) {
+                        continue;
+                    }
+
+                    if (defender.getName().equals(attacker.getName())) { //Is this even possible?
+                        continue;
+                    }
+
+                    if (Party.getInstance().inSameParty(attacker, defender)) {
+                        continue;
+                    }
+
+                    if (defender.isDead()) {
+                        continue;
+                    }
+
+                    //Apply effect to players only if PVP is enabled
+                    if (target.getWorld().getPVP()) {
+                        String message = "";
+
+                        if (type.equals(SkillType.AXES)) {
+                            message = mcLocale.getString("Axes.HitByCleave");
+                        }
+                        else if (type.equals(SkillType.SWORDS)) {
+                            message = mcLocale.getString("Swords.HitBySerratedStrikes");
+                        }
+
+                        dealDamage(defender, damageAmount, attacker);
+                        defender.sendMessage(message);
+
+                        if (type.equals(SkillType.SWORDS)) {
+                            PP.addBleedTicks(5);
+                        }
+
+                        numberOfTargets--;
+                    }
+                }
+                else {
+                    LivingEntity livingEntity = (LivingEntity) entity;
+
+                    if (type.equals(SkillType.SWORDS) && !plugin.misc.bleedTracker.contains(entity)) {
+                        plugin.misc.addToBleedQue(livingEntity);
+                    }
+
+                    dealDamage(livingEntity, damageAmount, attacker);
+                    numberOfTargets--;
+                }
+            }
+        }
+    }
 }
 }

+ 1 - 2
src/main/java/com/gmail/nossr50/Database.java

@@ -28,8 +28,7 @@ import java.util.ArrayList;
 import java.util.Properties;
 import java.util.Properties;
 
 
 import com.gmail.nossr50.config.LoadProperties;
 import com.gmail.nossr50.config.LoadProperties;
-
-import datatypes.DatabaseUpdate;
+import com.gmail.nossr50.datatypes.DatabaseUpdate;
 
 
 public class Database {
 public class Database {
 
 

+ 200 - 0
src/main/java/com/gmail/nossr50/ItemChecks.java

@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2012 Matt 'The Yeti' Burnett & mcMMO Development
+ * Copyright (C) 2010-2011 'nossr50'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.gmail.nossr50;
+
+import org.bukkit.inventory.ItemStack;
+
+public class ItemChecks {
+
+    /**
+     * Checks if the item is a sword.
+     *
+     * @param is Item to check
+     * @return true if the item is a sword, false otherwise
+     */
+    public static boolean isSword(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_SWORD:
+        case GOLD_SWORD:
+        case IRON_SWORD:
+        case STONE_SWORD:
+        case WOOD_SWORD:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a hoe.
+     *
+     * @param is Item to check
+     * @return true if the item is a hoe, false otherwise
+     */
+    public static boolean isHoe(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_HOE:
+        case GOLD_HOE:
+        case IRON_HOE:
+        case STONE_HOE:
+        case WOOD_HOE:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a shovel.
+     *
+     * @param is Item to check
+     * @return true if the item is a shovel, false otherwise
+     */
+    public static boolean isShovel(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_SPADE:
+        case GOLD_SPADE:
+        case IRON_SPADE:
+        case STONE_SPADE:
+        case WOOD_SPADE:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is an axe.
+     *
+     * @param is Item to check
+     * @return true if the item is an axe, false otherwise
+     */
+    public static boolean isAxe(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_AXE:
+        case GOLD_AXE:
+        case IRON_AXE:
+        case STONE_AXE:
+        case WOOD_AXE:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a pickaxe.
+     *
+     * @param is Item to check
+     * @return true if the item is a pickaxe, false otherwise
+     */
+    public static boolean isMiningPick(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_PICKAXE:
+        case GOLD_PICKAXE:
+        case IRON_PICKAXE:
+        case STONE_PICKAXE:
+        case WOOD_PICKAXE:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a helmet.
+     *
+     * @param is Item to check
+     * @return true if the item is a helmet, false otherwise
+     */
+    public static boolean isHelmet(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_HELMET:
+        case GOLD_HELMET:
+        case IRON_HELMET:
+        case LEATHER_HELMET:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a chestplate.
+     *
+     * @param is Item to check
+     * @return true if the item is a chestplate, false otherwise
+     */
+    public static boolean isChestplate(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_CHESTPLATE:
+        case GOLD_CHESTPLATE:
+        case IRON_CHESTPLATE:
+        case LEATHER_CHESTPLATE:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a pair of pants.
+     *
+     * @param is Item to check
+     * @return true if the item is a pair of pants, false otherwise
+     */
+    public static boolean isPants(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_LEGGINGS:
+        case GOLD_LEGGINGS:
+        case IRON_LEGGINGS:
+        case LEATHER_LEGGINGS:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the item is a pair of boots.
+     *
+     * @param is Item to check
+     * @return true if the item is a pair of boots, false otherwise
+     */
+    public static boolean isBoots(ItemStack is) {
+        switch (is.getType()) {
+        case DIAMOND_BOOTS:
+        case GOLD_BOOTS:
+        case IRON_BOOTS:
+        case LEATHER_BOOTS:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+}

+ 1 - 1
src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java

@@ -84,7 +84,7 @@ public class InspectCommand implements CommandExecutor {
             if (mcPermissions.getInstance().repair(target))
             if (mcPermissions.getInstance().repair(target))
                 sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
                 sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
 
 
-            sender.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(target)));
+            sender.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(target, PPt)));
         } else {
         } else {
             if(sender instanceof Player && !player.isOp())
             if(sender instanceof Player && !player.isOp())
             {
             {

+ 1 - 1
src/main/java/com/gmail/nossr50/commands/general/McstatsCommand.java

@@ -71,7 +71,7 @@ public class McstatsCommand implements CommandExecutor {
 			if (mcPermissions.getInstance().repair(player))
 			if (mcPermissions.getInstance().repair(player))
 				player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR)));
 				player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR)));
 		}
 		}
-		player.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(player)));
+		player.sendMessage(mcLocale.getString("mcPlayerListener.PowerLevel") + ChatColor.GREEN + (m.getPowerLevel(player, PP)));
 
 
 		return true;
 		return true;
 	}
 	}

+ 1 - 1
src/main/java/datatypes/DatabaseUpdate.java → src/main/java/com/gmail/nossr50/datatypes/DatabaseUpdate.java

@@ -16,7 +16,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 */
 
 
-package datatypes;
+package com.gmail.nossr50.datatypes;
 
 
 public enum DatabaseUpdate {
 public enum DatabaseUpdate {
     FISHING,
     FISHING,

+ 6 - 6
src/main/java/com/gmail/nossr50/datatypes/ToolType.java

@@ -3,7 +3,7 @@ package com.gmail.nossr50.datatypes;
 import org.bukkit.Material;
 import org.bukkit.Material;
 import org.bukkit.inventory.ItemStack;
 import org.bukkit.inventory.ItemStack;
 
 
-import com.gmail.nossr50.m;
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.locale.mcLocale;
 import com.gmail.nossr50.locale.mcLocale;
 
 
 public enum ToolType
 public enum ToolType
@@ -129,17 +129,17 @@ public enum ToolType
 		switch(this)
 		switch(this)
 		{
 		{
 		case AXE:
 		case AXE:
-			return m.isAxes(is);
+			return ItemChecks.isAxe(is);
 		case FISTS:
 		case FISTS:
 			return is.getType().equals(Material.AIR);
 			return is.getType().equals(Material.AIR);
 		case HOE:
 		case HOE:
-			return m.isHoe(is);
+			return ItemChecks.isHoe(is);
 		case PICKAXE:
 		case PICKAXE:
-			return m.isMiningPick(is);
+			return ItemChecks.isMiningPick(is);
 		case SHOVEL:
 		case SHOVEL:
-			return m.isShovel(is);
+			return ItemChecks.isShovel(is);
 		case SWORD:
 		case SWORD:
-			return m.isSwords(is);
+			return ItemChecks.isSword(is);
 		}
 		}
 		return false;
 		return false;
 	}
 	}

+ 8 - 7
src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java

@@ -16,6 +16,7 @@
 */
 */
 package com.gmail.nossr50.listeners;
 package com.gmail.nossr50.listeners;
 
 
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.m;
 import com.gmail.nossr50.m;
 import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.mcMMO;
@@ -153,7 +154,7 @@ public class mcBlockListener implements Listener
     	 */
     	 */
     	if(mcPermissions.getInstance().mining(player))
     	if(mcPermissions.getInstance().mining(player))
     	{
     	{
-    		if(LoadProperties.miningrequirespickaxe && m.isMiningPick(inhand))
+    		if(LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand))
     			Mining.miningBlockCheck(player, block, plugin);
     			Mining.miningBlockCheck(player, block, plugin);
     		else if(!LoadProperties.miningrequirespickaxe)
     		else if(!LoadProperties.miningrequirespickaxe)
     			Mining.miningBlockCheck(player, block, plugin);
     			Mining.miningBlockCheck(player, block, plugin);
@@ -165,7 +166,7 @@ public class mcBlockListener implements Listener
     	
     	
    		if(mcPermissions.getInstance().woodcutting(player) && id == 17)
    		if(mcPermissions.getInstance().woodcutting(player) && id == 17)
    		{
    		{
-   			if(LoadProperties.woodcuttingrequiresaxe && m.isAxes(inhand))
+   			if(LoadProperties.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand))
 				WoodCutting.woodcuttingBlockCheck(player, block, plugin);
 				WoodCutting.woodcuttingBlockCheck(player, block, plugin);
    			else if(!LoadProperties.woodcuttingrequiresaxe)
    			else if(!LoadProperties.woodcuttingrequiresaxe)
     			WoodCutting.woodcuttingBlockCheck(player, block, plugin);
     			WoodCutting.woodcuttingBlockCheck(player, block, plugin);
@@ -179,7 +180,7 @@ public class mcBlockListener implements Listener
     	 */
     	 */
     	if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
     	if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
     	{
     	{
-    		if(LoadProperties.excavationRequiresShovel && m.isShovel(inhand))
+    		if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand))
     			Excavation.excavationProcCheck(block, player);
     			Excavation.excavationProcCheck(block, player);
     		else if(!LoadProperties.excavationRequiresShovel)
     		else if(!LoadProperties.excavationRequiresShovel)
     			Excavation.excavationProcCheck(block, player);
     			Excavation.excavationProcCheck(block, player);
@@ -207,7 +208,7 @@ public class mcBlockListener implements Listener
     	/*
     	/*
     	 * ABILITY PREPARATION CHECKS
     	 * ABILITY PREPARATION CHECKS
     	 */
     	 */
-    	if(m.abilityBlockCheck(block))
+    	if(m.abilityBlockCheck(mat))
     	{
     	{
 	   		if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
 	   		if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
 	   			Skills.abilityCheck(player, SkillType.HERBALISM);
 	   			Skills.abilityCheck(player, SkillType.HERBALISM);
@@ -239,7 +240,7 @@ public class mcBlockListener implements Listener
     	 */
     	 */
     	if(PP.getGigaDrillBreakerMode() && Excavation.canBeGigaDrillBroken(block) && m.blockBreakSimulate(block, player, true) && mcPermissions.getInstance().excavationAbility(player))
     	if(PP.getGigaDrillBreakerMode() && Excavation.canBeGigaDrillBroken(block) && m.blockBreakSimulate(block, player, true) && mcPermissions.getInstance().excavationAbility(player))
     	{	
     	{	
-    		if(LoadProperties.excavationRequiresShovel && m.isShovel(inhand))
+    		if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand))
     		{
     		{
     			event.setInstaBreak(true);
     			event.setInstaBreak(true);
     			Excavation.gigaDrillBreaker(player, block);
     			Excavation.gigaDrillBreaker(player, block);
@@ -275,7 +276,7 @@ public class mcBlockListener implements Listener
     	{
     	{
     		if(LoadProperties.miningrequirespickaxe)
     		if(LoadProperties.miningrequirespickaxe)
     		{
     		{
-    			if(m.isMiningPick(inhand)){
+    			if(ItemChecks.isMiningPick(inhand)){
     			    
     			    
     				event.setInstaBreak(true);
     				event.setInstaBreak(true);
     				Mining.SuperBreakerBlockCheck(player, block, plugin);
     				Mining.SuperBreakerBlockCheck(player, block, plugin);
@@ -296,7 +297,7 @@ public class mcBlockListener implements Listener
     	{	
     	{	
     		if(LoadProperties.woodcuttingrequiresaxe)
     		if(LoadProperties.woodcuttingrequiresaxe)
     		{
     		{
-    			if(m.isAxes(inhand)){
+    			if(ItemChecks.isAxe(inhand)){
     				event.setInstaBreak(true);
     				event.setInstaBreak(true);
     				WoodCutting.leafBlower(player, block);
     				WoodCutting.leafBlower(player, block);
     			}
     			}

+ 5 - 4
src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java

@@ -46,6 +46,7 @@ import org.bukkit.inventory.ItemStack;
 
 
 import com.gmail.nossr50.Combat;
 import com.gmail.nossr50.Combat;
 import com.gmail.nossr50.Item;
 import com.gmail.nossr50.Item;
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.m;
 import com.gmail.nossr50.m;
 import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.mcMMO;
@@ -171,13 +172,13 @@ public class mcPlayerListener implements Listener
 		Action action = event.getAction();
 		Action action = event.getAction();
 		Block block = event.getClickedBlock();
 		Block block = event.getClickedBlock();
 		ItemStack is = player.getItemInHand();
 		ItemStack is = player.getItemInHand();
+		Material mat = block.getType();
 		
 		
 		/*
 		/*
 		 * Ability checks
 		 * Ability checks
 		 */
 		 */
 		if(action == Action.RIGHT_CLICK_BLOCK)
 		if(action == Action.RIGHT_CLICK_BLOCK)
 		{
 		{
-			Material mat = block.getType();
 
 
 			if(block != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == LoadProperties.anvilID && (Repair.isTools(is) || Repair.isArmor(is)))
 			if(block != null && mcPermissions.getInstance().repair(player) && block.getTypeId() == LoadProperties.anvilID && (Repair.isTools(is) || Repair.isArmor(is)))
 			{
 			{
@@ -186,9 +187,9 @@ public class mcPlayerListener implements Listener
 				player.updateInventory();
 				player.updateInventory();
 			}
 			}
 
 
-			if(LoadProperties.enableAbilities && m.abilityBlockCheck(block))
+			if(LoadProperties.enableAbilities && m.abilityBlockCheck(mat))
 			{
 			{
-				if(block != null && m.isHoe(is) && !mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL))
+				if(block != null && ItemChecks.isHoe(is) && !mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL))
 					Skills.activationCheck(player, SkillType.HERBALISM);
 					Skills.activationCheck(player, SkillType.HERBALISM);
 				
 				
 				Skills.activationCheck(player, SkillType.AXES);
 				Skills.activationCheck(player, SkillType.AXES);
@@ -256,7 +257,7 @@ public class mcPlayerListener implements Listener
 		 */
 		 */
 		if(action == Action.RIGHT_CLICK_AIR)
 		if(action == Action.RIGHT_CLICK_AIR)
 			Item.itemchecks(player);
 			Item.itemchecks(player);
-		if(action == Action.RIGHT_CLICK_BLOCK && m.abilityBlockCheck(block))
+		if(action == Action.RIGHT_CLICK_BLOCK && m.abilityBlockCheck(mat))
 			Item.itemchecks(player);
 			Item.itemchecks(player);
 		
 		
 		if(player.isSneaking() && mcPermissions.getInstance().taming(player) && (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK))
 		if(player.isSneaking() && mcPermissions.getInstance().taming(player) && (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK))

+ 480 - 587
src/main/java/com/gmail/nossr50/m.java

@@ -1,19 +1,21 @@
 /*
 /*
-	This file is part of mcMMO.
-
-    mcMMO is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mcMMO is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mcMMO.  If not, see <http://www.gnu.org/licenses/>.
+ * Copyright (C) 2012 Matt 'The Yeti' Burnett & mcMMO Development
+ * Copyright (C) 2010-2011 'nossr50'
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 */
+
 package com.gmail.nossr50;
 package com.gmail.nossr50;
 
 
 import java.io.BufferedReader;
 import java.io.BufferedReader;
@@ -36,583 +38,474 @@ import com.gmail.nossr50.events.FakeBlockBreakEvent;
 import com.gmail.nossr50.events.McMMOItemSpawnEvent;
 import com.gmail.nossr50.events.McMMOItemSpawnEvent;
 import com.gmail.nossr50.skills.Repair;
 import com.gmail.nossr50.skills.Repair;
 
 
-public class m 
-{
-	public static final Logger log = Logger.getLogger("Minecraft"); 
-	/*
-	 * I'm storing my misc functions/methods in here in an unorganized manner. Spheal with it.
-	 * This is probably the most embarrassing part of my code for mcMMO
-	 * I really should find an organized place for these things!
-	 */
-	
-	public static String getCapitalized(String target)
-	{
-		String firstLetter = target.substring(0,1);
-		String remainder   = target.substring(1);
-		String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase();
-		
-		return capitalized;
-	}
-	public static int getInt(String string)
-	{
-		if(isInt(string))
-			return Integer.parseInt(string);
-		else
-			return 0;
-	}
-	
-	public static boolean isInvincible(LivingEntity le, EntityDamageEvent event)
-	{
-	    //So apparently if you do more damage to a LivingEntity than its last damage int you bypass the invincibility
-	    //So yeah, this is for that
-	    if(le.getNoDamageTicks() > le.getMaximumNoDamageTicks() / 2.0F && event.getDamage() <= le.getLastDamage())
-	        return true;
-	    else
-	        return false;
-	}
-	
-	public static boolean isDouble(String string)
-	{
-		try 
-		{
-			Double.parseDouble(string);
-		}
-		catch(NumberFormatException nFE) {
-			return false;
-		}
-		return true;
-	}
-	
-	/**
-	 * Checks to see if a block type awards XP.
-	 * 
-	 * @param material Block type to check
-	 * @return true if the block type awards XP, false otherwise
-	 */
-	public static boolean shouldBeWatched(Material material)
-	{
-		switch(material){
-		case BROWN_MUSHROOM:
-		case CACTUS:
-		case CLAY:
-		case COAL_ORE:
-		case DIAMOND_ORE:
-		case DIRT:
-		case ENDER_STONE:
-		case GLOWING_REDSTONE_ORE:
-		case GLOWSTONE:
-		case GOLD_ORE:
-		case GRASS:
-		case GRAVEL:
-		case IRON_ORE:
-		case JACK_O_LANTERN:
-		case LAPIS_ORE:
-		case LOG:
-		case MELON_BLOCK:
-		case MOSSY_COBBLESTONE:
-		case MYCEL:
-		case NETHERRACK:
-		case OBSIDIAN:
-		case PUMPKIN:
-		case RED_MUSHROOM:
-		case RED_ROSE:
-		case REDSTONE_ORE:
-		case SAND:
-		case SANDSTONE:
-		case SOUL_SAND:
-		case STONE:
-		case SUGAR_CANE_BLOCK:
-		case VINE:
-		case WATER_LILY:
-		case YELLOW_FLOWER:
-			return true;
-		}
-		return false;
-	}
-	
-	public static int getPowerLevel(Player player)
-	{
-		PlayerProfile PP = Users.getProfile(player);
-		int x = 0;
-		if(mcPermissions.getInstance().taming(player))
-			x+=PP.getSkillLevel(SkillType.TAMING);
-		if(mcPermissions.getInstance().mining(player))
-			x+=PP.getSkillLevel(SkillType.MINING);
-		if(mcPermissions.getInstance().woodcutting(player))
-			x+=PP.getSkillLevel(SkillType.WOODCUTTING);
-		if(mcPermissions.getInstance().unarmed(player))
-			x+=PP.getSkillLevel(SkillType.UNARMED);
-		if(mcPermissions.getInstance().herbalism(player))
-			x+=PP.getSkillLevel(SkillType.HERBALISM);
-		if(mcPermissions.getInstance().excavation(player))
-			x+=PP.getSkillLevel(SkillType.EXCAVATION);
-		if(mcPermissions.getInstance().archery(player))
-			x+=PP.getSkillLevel(SkillType.ARCHERY);
-		if(mcPermissions.getInstance().swords(player))
-			x+=PP.getSkillLevel(SkillType.SWORDS);
-		if(mcPermissions.getInstance().axes(player))
-			x+=PP.getSkillLevel(SkillType.AXES);
-		if(mcPermissions.getInstance().acrobatics(player))
-			x+=PP.getSkillLevel(SkillType.ACROBATICS);
-		if(mcPermissions.getInstance().repair(player))
-			x+=PP.getSkillLevel(SkillType.REPAIR);
-		if(mcPermissions.getInstance().fishing(player))
-			x+=PP.getSkillLevel(SkillType.FISHING);
-		return x;
-	}
+public class m {
+    public static final Logger log = Logger.getLogger("Minecraft");
+
+    /**
+     * Gets a capitalized version of the target string.
+     *
+     * @param target String to capitalize
+     * @return the capitalized string
+     */
+    public static String getCapitalized(String target) {
+        String firstLetter = target.substring(0,1);
+        String remainder = target.substring(1);
+        String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase();
+
+        return capitalized;
+    }
+
+    /**
+     * Gets the int represented by this string.
+     *
+     * @param string The string to parse
+     * @return the int represented by this string
+     */
+    public static int getInt(String string) {
+        if (isInt(string)) {
+            return Integer.parseInt(string);
+        }
+        else {
+            return 0;
+        }
+    }
+
+    /**
+     * Checks to see if an entity is currently invincible.
+     *
+     * @param le The LivingEntity to check
+     * @param event The event the entity is involved in
+     * @return true if the entity is invincible, false otherwise
+     */
+    public static boolean isInvincible(LivingEntity le, EntityDamageEvent event) {
+
+        /*
+         * So apparently if you do more damage to a LivingEntity than its last damage int you bypass the invincibility.
+         * So yeah, this is for that.
+         */
+        if (le.getNoDamageTicks() > le.getMaximumNoDamageTicks() / 2.0F && event.getDamage() <= le.getLastDamage()) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
 
 
-	public static boolean blockBreakSimulate(Block block, Player player, Boolean shouldArmSwing)
-	{
-	    //Support for NoCheat
-	    if(shouldArmSwing)
-	    {
-	        PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
+    /**
+     * Checks to see if a block type awards XP.
+     *
+     * @param material Block type to check
+     * @return true if the block type awards XP, false otherwise
+     */
+    public static boolean shouldBeWatched(Material material) {
+        switch (material) {
+        case BROWN_MUSHROOM:
+        case CACTUS:
+        case CLAY:
+        case COAL_ORE:
+        case DIAMOND_ORE:
+        case DIRT:
+        case ENDER_STONE:
+        case GLOWING_REDSTONE_ORE:
+        case GLOWSTONE:
+        case GOLD_ORE:
+        case GRASS:
+        case GRAVEL:
+        case IRON_ORE:
+        case JACK_O_LANTERN:
+        case LAPIS_ORE:
+        case LOG:
+        case MELON_BLOCK:
+        case MOSSY_COBBLESTONE:
+        case MYCEL:
+        case NETHERRACK:
+        case OBSIDIAN:
+        case PUMPKIN:
+        case RED_MUSHROOM:
+        case RED_ROSE:
+        case REDSTONE_ORE:
+        case SAND:
+        case SANDSTONE:
+        case SOUL_SAND:
+        case STONE:
+        case SUGAR_CANE_BLOCK:
+        case VINE:
+        case WATER_LILY:
+        case YELLOW_FLOWER:
+            return true;
+
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Gets the power level of a player.
+     *
+     * @param player The player to get the power level of
+     * @param PP The profile of the player
+     * @return the power level of the player
+     */
+    public static int getPowerLevel(Player player, PlayerProfile PP) {
+        int powerLevel = 0;
+
+        for (SkillType type : SkillType.values()) {
+            if (type.getPermissions(player)) {
+                powerLevel += PP.getSkillLevel(type);
+            }
+        }
+
+        return powerLevel;
+    }
+
+    /**
+     * Simulate a block break event.
+     *
+     * @param block The block to break
+     * @param player The player breaking the block
+     * @param shouldArmSwing true if an armswing event should be fired, false otherwise
+     * @return true if the event wasn't cancelled, false otherwise
+     */
+    public static boolean blockBreakSimulate(Block block, Player player, Boolean shouldArmSwing) {
+
+        //Support for NoCheat
+        if (shouldArmSwing) {
+            PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
             Bukkit.getPluginManager().callEvent(armswing);
             Bukkit.getPluginManager().callEvent(armswing);
-	    }
-	    
-		FakeBlockBreakEvent event = new FakeBlockBreakEvent(block, player);
-		if(block != null && player != null){
-			Bukkit.getServer().getPluginManager().callEvent(event);
-			if(!event.isCancelled())
-			{
-				return true; //Return true if not cancelled
-			} else {
-				return false; //Return false if cancelled
-			}
-		} else {
-			return false; //Return false if something went wrong
-		}
-	}
-	
-	public static Integer getTier(Player player)
-	{
-		ItemStack is = player.getItemInHand();
-		if(Repair.isWoodTools(is))
-			return 1;
-		if(Repair.isStoneTools(is))
-			return 2;
-		if(Repair.isIronTools(is))
-			return 3;
-		if(Repair.isGoldTools(is))
-			return 1;
-		if(Repair.isDiamondTools(is))
-			return 4;
-		
-		return 1;
-	}
-	
-	public static boolean isNear(Location first, Location second, int maxDistance) {
-		double relX = first.getX() - second.getX();
-		double relY = first.getY() - second.getY();
-		double relZ = first.getZ() - second.getZ();
-		double dist = relX * relX + relY * relY + relZ * relZ;
-		
-		if (dist < maxDistance * maxDistance)
-			return true;
-		
-		return false;
-	}
-	
-	public static boolean abilityBlockCheck(Block block)
-	{
-		switch(block.getType()){
-		case BED_BLOCK:
-		case BREWING_STAND:
-		case BOOKSHELF:
-		case BURNING_FURNACE:
-		case CAKE_BLOCK:
-		case CHEST:
-		case DISPENSER:
-		case ENCHANTMENT_TABLE:
-		case FENCE_GATE:
-		case FURNACE:
-		case IRON_DOOR_BLOCK:
-		case JUKEBOX:
-		case LEVER:
-		case NOTE_BLOCK:
-		case STONE_BUTTON:
-		case TRAP_DOOR:
-		case WALL_SIGN:
-		case WOODEN_DOOR:
-		case WORKBENCH:
-			return false;
-		}
-		
-		if(block.getTypeId() == LoadProperties.anvilID)
-			return false;
-		
-		return true;
-	}
-	
-	public static boolean isInt(String string)
-	{
-		try 
-		{
-			Integer.parseInt(string);
-		}
-		catch(NumberFormatException nFE) 
-		{
-			return false;
-		}
-		return true;
-	}
-	
-	public static void mcDropItems(Location location, ItemStack is, int quantity)
-	{
-		for(int i = 0; i < quantity; i++)
-			mcDropItem(location, is);
-	}
-	
-	public static void mcRandomDropItem(Location location, ItemStack is, int chance)
-	{
-		if(Math.random() * 100 < chance)
-			mcDropItem(location, is);
-	}
-	
-	public static void mcRandomDropItems(Location location, ItemStack is, int chance, int quantity)
-	{
-		for(int i = 0; i < quantity; i++)
-			mcRandomDropItem(location, is, chance);
-	}
-	
-	public static void mcDropItem(Location location, ItemStack itemStack) {
-		// We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
-		McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
-		Bukkit.getPluginManager().callEvent(event);
-		if(event.isCancelled()) return;
-		
-		location.getWorld().dropItemNaturally(location, itemStack);
-	}
+        }
+
+        FakeBlockBreakEvent event = new FakeBlockBreakEvent(block, player);
+        Bukkit.getPluginManager().callEvent(event);
+
+        if (!event.isCancelled()) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * Get the upgrade tier of the item in hand.
+     *
+     * @param inHand The item to check the tier of
+     * @return the tier of the item
+     */
+    public static Integer getTier(ItemStack inHand)
+    {
+        if(Repair.isWoodTools(inHand))
+            return 1;
+        if(Repair.isStoneTools(inHand))
+            return 2;
+        if(Repair.isIronTools(inHand))
+            return 3;
+        if(Repair.isGoldTools(inHand))
+            return 1;
+        if(Repair.isDiamondTools(inHand))
+            return 4;
+        
+        return 1;
+    }
+    
+    public static boolean isNear(Location first, Location second, int maxDistance) {
+        double relX = first.getX() - second.getX();
+        double relY = first.getY() - second.getY();
+        double relZ = first.getZ() - second.getZ();
+        double dist = relX * relX + relY * relY + relZ * relZ;
+        
+        if (dist < maxDistance * maxDistance)
+            return true;
+        
+        return false;
+    }
+    
+    public static boolean abilityBlockCheck(Material material)
+    {
+        switch(material){
+        case BED_BLOCK:
+        case BREWING_STAND:
+        case BOOKSHELF:
+        case BURNING_FURNACE:
+        case CAKE_BLOCK:
+        case CHEST:
+        case DISPENSER:
+        case ENCHANTMENT_TABLE:
+        case FENCE_GATE:
+        case FURNACE:
+        case IRON_DOOR_BLOCK:
+        case JUKEBOX:
+        case LEVER:
+        case NOTE_BLOCK:
+        case STONE_BUTTON:
+        case TRAP_DOOR:
+        case WALL_SIGN:
+        case WOODEN_DOOR:
+        case WORKBENCH:
+            return false;
+        }
+        
+        if(Material.getMaterial(LoadProperties.anvilID).equals(material))
+            return false;
+        
+        return true;
+    }
+    
+    public static boolean isInt(String string)
+    {
+        try 
+        {
+            Integer.parseInt(string);
+        }
+        catch(NumberFormatException nFE) 
+        {
+            return false;
+        }
+        return true;
+    }
+    
+    public static void mcDropItems(Location location, ItemStack is, int quantity)
+    {
+        for(int i = 0; i < quantity; i++)
+            mcDropItem(location, is);
+    }
+    
+    public static void mcRandomDropItem(Location location, ItemStack is, int chance)
+    {
+        if(Math.random() * 100 < chance)
+            mcDropItem(location, is);
+    }
+    
+    public static void mcRandomDropItems(Location location, ItemStack is, int chance, int quantity)
+    {
+        for(int i = 0; i < quantity; i++)
+            mcRandomDropItem(location, is, chance);
+    }
+    
+    public static void mcDropItem(Location location, ItemStack itemStack) {
+        // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
+        McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
+        Bukkit.getPluginManager().callEvent(event);
+        if(event.isCancelled()) return;
+        
+        location.getWorld().dropItemNaturally(location, itemStack);
+    }
 
 
-	public static boolean isSwords(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_SWORD:
-		case GOLD_SWORD:
-		case IRON_SWORD:
-		case STONE_SWORD:
-		case WOOD_SWORD:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isHoe(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_HOE:
-		case GOLD_HOE:
-		case IRON_HOE:
-		case STONE_HOE:
-		case WOOD_HOE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isShovel(ItemStack is)
-	{	
-		switch(is.getType()){
-		case DIAMOND_SPADE:
-		case GOLD_SPADE:
-		case IRON_SPADE:
-		case STONE_SPADE:
-		case WOOD_SPADE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isAxes(ItemStack is)
-	{	
-		switch(is.getType()){
-		case DIAMOND_AXE:
-		case GOLD_AXE:
-		case IRON_AXE:
-		case STONE_AXE:
-		case WOOD_AXE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isMiningPick(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_PICKAXE:
-		case GOLD_PICKAXE:
-		case IRON_PICKAXE:
-		case STONE_PICKAXE:
-		case WOOD_PICKAXE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isHelmet(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_HELMET:
-		case GOLD_HELMET:
-		case IRON_HELMET:
-		case LEATHER_HELMET:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isChestplate(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_CHESTPLATE:
-		case GOLD_CHESTPLATE:
-		case IRON_CHESTPLATE:
-		case LEATHER_CHESTPLATE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isPants(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_LEGGINGS:
-		case GOLD_LEGGINGS:
-		case IRON_LEGGINGS:
-		case LEATHER_LEGGINGS:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isBoots(ItemStack is)
-	{
-		switch(is.getType()){
-		case DIAMOND_BOOTS:
-		case GOLD_BOOTS:
-		case IRON_BOOTS:
-		case LEATHER_BOOTS:
-			return true;
-		}
-		return false;
-	}
-	
-	public static boolean isOre(Block block)
-	{
-		switch (block.getType()) {
-		case COAL_ORE:
-		case DIAMOND_ORE:
-		case GLOWING_REDSTONE_ORE:
-		case GOLD_ORE:
-		case IRON_ORE:
-		case LAPIS_ORE:
-		case REDSTONE_ORE:
-			return true;
-		}
-		return false;
-	}
-	
-	public static void convertToMySQL()
-	{
-		if(!LoadProperties.useMySQL)
-			return;
-		
-		Bukkit.getScheduler().scheduleAsyncDelayedTask(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), new Runnable(){
-			public void run() {
-				String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
-				try {
-					//Open the user file
-					FileReader file = new FileReader(location);
-					BufferedReader in = new BufferedReader(file);
-					String line = "";
-					String playerName = null, mining = null, party = null, miningXP = null, woodcutting = null, woodCuttingXP = null, repair = null, unarmed = null, herbalism = null, excavation = null, archery = null, swords = null, axes = null, acrobatics = null, repairXP = null, unarmedXP = null, herbalismXP = null, excavationXP = null, archeryXP = null, swordsXP = null, axesXP = null, acrobaticsXP = null, taming = null, tamingXP = null, fishing = null, fishingXP = null;
-					int id = 0, theCount = 0;
-					while ((line = in.readLine()) != null) {
-						//Find if the line contains the player we want.
-						String[] character = line.split(":");
-						playerName = character[0];
-						//Check for things we don't want put in the DB
-						if (playerName == null
-								|| playerName.equals("null")
-								|| playerName
-										.equals("#Storage place for user information"))
-							continue;
+    public static boolean isOre(Block block)
+    {
+        switch (block.getType()) {
+        case COAL_ORE:
+        case DIAMOND_ORE:
+        case GLOWING_REDSTONE_ORE:
+        case GOLD_ORE:
+        case IRON_ORE:
+        case LAPIS_ORE:
+        case REDSTONE_ORE:
+            return true;
+        }
+        return false;
+    }
+    
+    public static void convertToMySQL()
+    {
+        if(!LoadProperties.useMySQL)
+            return;
+        
+        Bukkit.getScheduler().scheduleAsyncDelayedTask(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), new Runnable(){
+            public void run() {
+                String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
+                try {
+                    //Open the user file
+                    FileReader file = new FileReader(location);
+                    BufferedReader in = new BufferedReader(file);
+                    String line = "";
+                    String playerName = null, mining = null, party = null, miningXP = null, woodcutting = null, woodCuttingXP = null, repair = null, unarmed = null, herbalism = null, excavation = null, archery = null, swords = null, axes = null, acrobatics = null, repairXP = null, unarmedXP = null, herbalismXP = null, excavationXP = null, archeryXP = null, swordsXP = null, axesXP = null, acrobaticsXP = null, taming = null, tamingXP = null, fishing = null, fishingXP = null;
+                    int id = 0, theCount = 0;
+                    while ((line = in.readLine()) != null) {
+                        //Find if the line contains the player we want.
+                        String[] character = line.split(":");
+                        playerName = character[0];
+                        //Check for things we don't want put in the DB
+                        if (playerName == null
+                                || playerName.equals("null")
+                                || playerName
+                                        .equals("#Storage place for user information"))
+                            continue;
 
 
-						//Get Mining
-						if (character.length > 1)
-							mining = character[1];
-						//Party
-						if (character.length > 3)
-							party = character[3];
-						//Mining XP
-						if (character.length > 4)
-							miningXP = character[4];
-						if (character.length > 5)
-							woodcutting = character[5];
-						if (character.length > 6)
-							woodCuttingXP = character[6];
-						if (character.length > 7)
-							repair = character[7];
-						if (character.length > 8)
-							unarmed = character[8];
-						if (character.length > 9)
-							herbalism = character[9];
-						if (character.length > 10)
-							excavation = character[10];
-						if (character.length > 11)
-							archery = character[11];
-						if (character.length > 12)
-							swords = character[12];
-						if (character.length > 13)
-							axes = character[13];
-						if (character.length > 14)
-							acrobatics = character[14];
-						if (character.length > 15)
-							repairXP = character[15];
-						if (character.length > 16)
-							unarmedXP = character[16];
-						if (character.length > 17)
-							herbalismXP = character[17];
-						if (character.length > 18)
-							excavationXP = character[18];
-						if (character.length > 19)
-							archeryXP = character[19];
-						if (character.length > 20)
-							swordsXP = character[20];
-						if (character.length > 21)
-							axesXP = character[21];
-						if (character.length > 22)
-							acrobaticsXP = character[22];
-						if (character.length > 24)
-							taming = character[24];
-						if (character.length > 25)
-							tamingXP = character[25];
-						if (character.length > 34)
-							fishing = character[34];
-						if (character.length > 35)
-							fishingXP = character[35];
+                        //Get Mining
+                        if (character.length > 1)
+                            mining = character[1];
+                        //Party
+                        if (character.length > 3)
+                            party = character[3];
+                        //Mining XP
+                        if (character.length > 4)
+                            miningXP = character[4];
+                        if (character.length > 5)
+                            woodcutting = character[5];
+                        if (character.length > 6)
+                            woodCuttingXP = character[6];
+                        if (character.length > 7)
+                            repair = character[7];
+                        if (character.length > 8)
+                            unarmed = character[8];
+                        if (character.length > 9)
+                            herbalism = character[9];
+                        if (character.length > 10)
+                            excavation = character[10];
+                        if (character.length > 11)
+                            archery = character[11];
+                        if (character.length > 12)
+                            swords = character[12];
+                        if (character.length > 13)
+                            axes = character[13];
+                        if (character.length > 14)
+                            acrobatics = character[14];
+                        if (character.length > 15)
+                            repairXP = character[15];
+                        if (character.length > 16)
+                            unarmedXP = character[16];
+                        if (character.length > 17)
+                            herbalismXP = character[17];
+                        if (character.length > 18)
+                            excavationXP = character[18];
+                        if (character.length > 19)
+                            archeryXP = character[19];
+                        if (character.length > 20)
+                            swordsXP = character[20];
+                        if (character.length > 21)
+                            axesXP = character[21];
+                        if (character.length > 22)
+                            acrobaticsXP = character[22];
+                        if (character.length > 24)
+                            taming = character[24];
+                        if (character.length > 25)
+                            tamingXP = character[25];
+                        if (character.length > 34)
+                            fishing = character[34];
+                        if (character.length > 35)
+                            fishingXP = character[35];
 
 
-						//Check to see if the user is in the DB
-						id = mcMMO.database.getInt("SELECT id FROM "
-								+ LoadProperties.MySQLtablePrefix
-								+ "users WHERE user = '" + playerName + "'");
+                        //Check to see if the user is in the DB
+                        id = mcMMO.database.getInt("SELECT id FROM "
+                                + LoadProperties.MySQLtablePrefix
+                                + "users WHERE user = '" + playerName + "'");
 
 
-						if (id > 0) {
-							theCount++;
-							//Update the skill values
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "users SET lastlogin = " + 0
-									+ " WHERE id = " + id);
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "skills SET " + "  taming = taming+"
-									+ getInt(taming) + ", mining = mining+"
-									+ getInt(mining) + ", repair = repair+"
-									+ getInt(repair)
-									+ ", woodcutting = woodcutting+"
-									+ getInt(woodcutting)
-									+ ", unarmed = unarmed+" + getInt(unarmed)
-									+ ", herbalism = herbalism+"
-									+ getInt(herbalism)
-									+ ", excavation = excavation+"
-									+ getInt(excavation)
-									+ ", archery = archery+" + getInt(archery)
-									+ ", swords = swords+" + getInt(swords)
-									+ ", axes = axes+" + getInt(axes)
-									+ ", acrobatics = acrobatics+"
-									+ getInt(acrobatics)
-									+ ", fishing = fishing+" + getInt(fishing)
-									+ " WHERE user_id = " + id);
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "experience SET " + "  taming = "
-									+ getInt(tamingXP) + ", mining = "
-									+ getInt(miningXP) + ", repair = "
-									+ getInt(repairXP) + ", woodcutting = "
-									+ getInt(woodCuttingXP) + ", unarmed = "
-									+ getInt(unarmedXP) + ", herbalism = "
-									+ getInt(herbalismXP) + ", excavation = "
-									+ getInt(excavationXP) + ", archery = "
-									+ getInt(archeryXP) + ", swords = "
-									+ getInt(swordsXP) + ", axes = "
-									+ getInt(axesXP) + ", acrobatics = "
-									+ getInt(acrobaticsXP) + ", fishing = "
-									+ getInt(fishingXP) + " WHERE user_id = "
-									+ id);
-						} else {
-							theCount++;
-							//Create the user in the DB
-							mcMMO.database.write("INSERT INTO "
-									+ LoadProperties.MySQLtablePrefix
-									+ "users (user, lastlogin) VALUES ('"
-									+ playerName + "',"
-									+ System.currentTimeMillis() / 1000 + ")");
-							id = mcMMO.database
-									.getInt("SELECT id FROM "
-											+ LoadProperties.MySQLtablePrefix
-											+ "users WHERE user = '"
-											+ playerName + "'");
-							mcMMO.database.write("INSERT INTO "
-									+ LoadProperties.MySQLtablePrefix
-									+ "skills (user_id) VALUES (" + id + ")");
-							mcMMO.database.write("INSERT INTO "
-									+ LoadProperties.MySQLtablePrefix
-									+ "experience (user_id) VALUES (" + id
-									+ ")");
-							//Update the skill values
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "users SET lastlogin = " + 0
-									+ " WHERE id = " + id);
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "users SET party = '" + party
-									+ "' WHERE id = " + id);
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "skills SET " + "  taming = "
-									+ getInt(taming) + ", mining = "
-									+ getInt(mining) + ", repair = "
-									+ getInt(repair) + ", woodcutting = "
-									+ getInt(woodcutting) + ", unarmed = "
-									+ getInt(unarmed) + ", herbalism = "
-									+ getInt(herbalism) + ", excavation = "
-									+ getInt(excavation) + ", archery = "
-									+ getInt(archery) + ", swords = "
-									+ getInt(swords) + ", axes = "
-									+ getInt(axes) + ", acrobatics = "
-									+ getInt(acrobatics) + ", fishing = "
-									+ getInt(fishing) + " WHERE user_id = "
-									+ id);
-							mcMMO.database.write("UPDATE "
-									+ LoadProperties.MySQLtablePrefix
-									+ "experience SET " + "  taming = "
-									+ getInt(tamingXP) + ", mining = "
-									+ getInt(miningXP) + ", repair = "
-									+ getInt(repairXP) + ", woodcutting = "
-									+ getInt(woodCuttingXP) + ", unarmed = "
-									+ getInt(unarmedXP) + ", herbalism = "
-									+ getInt(herbalismXP) + ", excavation = "
-									+ getInt(excavationXP) + ", archery = "
-									+ getInt(archeryXP) + ", swords = "
-									+ getInt(swordsXP) + ", axes = "
-									+ getInt(axesXP) + ", acrobatics = "
-									+ getInt(acrobaticsXP) + ", fishing = "
-									+ getInt(fishingXP) + " WHERE user_id = "
-									+ id);
-						}
-					}
-					System.out
-							.println("[mcMMO] MySQL Updated from users file, "
-									+ theCount
-									+ " items added/updated to MySQL DB");
-					in.close();
-				} catch (Exception e) {
-					log.log(Level.SEVERE, "Exception while reading " + location
-							+ " (Are you sure you formatted it correctly?)", e);
-				}
-			}
-		}, 1);
-	}
+                        if (id > 0) {
+                            theCount++;
+                            //Update the skill values
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "users SET lastlogin = " + 0
+                                    + " WHERE id = " + id);
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "skills SET " + "  taming = taming+"
+                                    + getInt(taming) + ", mining = mining+"
+                                    + getInt(mining) + ", repair = repair+"
+                                    + getInt(repair)
+                                    + ", woodcutting = woodcutting+"
+                                    + getInt(woodcutting)
+                                    + ", unarmed = unarmed+" + getInt(unarmed)
+                                    + ", herbalism = herbalism+"
+                                    + getInt(herbalism)
+                                    + ", excavation = excavation+"
+                                    + getInt(excavation)
+                                    + ", archery = archery+" + getInt(archery)
+                                    + ", swords = swords+" + getInt(swords)
+                                    + ", axes = axes+" + getInt(axes)
+                                    + ", acrobatics = acrobatics+"
+                                    + getInt(acrobatics)
+                                    + ", fishing = fishing+" + getInt(fishing)
+                                    + " WHERE user_id = " + id);
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "experience SET " + "  taming = "
+                                    + getInt(tamingXP) + ", mining = "
+                                    + getInt(miningXP) + ", repair = "
+                                    + getInt(repairXP) + ", woodcutting = "
+                                    + getInt(woodCuttingXP) + ", unarmed = "
+                                    + getInt(unarmedXP) + ", herbalism = "
+                                    + getInt(herbalismXP) + ", excavation = "
+                                    + getInt(excavationXP) + ", archery = "
+                                    + getInt(archeryXP) + ", swords = "
+                                    + getInt(swordsXP) + ", axes = "
+                                    + getInt(axesXP) + ", acrobatics = "
+                                    + getInt(acrobaticsXP) + ", fishing = "
+                                    + getInt(fishingXP) + " WHERE user_id = "
+                                    + id);
+                        } else {
+                            theCount++;
+                            //Create the user in the DB
+                            mcMMO.database.write("INSERT INTO "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "users (user, lastlogin) VALUES ('"
+                                    + playerName + "',"
+                                    + System.currentTimeMillis() / 1000 + ")");
+                            id = mcMMO.database
+                                    .getInt("SELECT id FROM "
+                                            + LoadProperties.MySQLtablePrefix
+                                            + "users WHERE user = '"
+                                            + playerName + "'");
+                            mcMMO.database.write("INSERT INTO "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "skills (user_id) VALUES (" + id + ")");
+                            mcMMO.database.write("INSERT INTO "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "experience (user_id) VALUES (" + id
+                                    + ")");
+                            //Update the skill values
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "users SET lastlogin = " + 0
+                                    + " WHERE id = " + id);
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "users SET party = '" + party
+                                    + "' WHERE id = " + id);
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "skills SET " + "  taming = "
+                                    + getInt(taming) + ", mining = "
+                                    + getInt(mining) + ", repair = "
+                                    + getInt(repair) + ", woodcutting = "
+                                    + getInt(woodcutting) + ", unarmed = "
+                                    + getInt(unarmed) + ", herbalism = "
+                                    + getInt(herbalism) + ", excavation = "
+                                    + getInt(excavation) + ", archery = "
+                                    + getInt(archery) + ", swords = "
+                                    + getInt(swords) + ", axes = "
+                                    + getInt(axes) + ", acrobatics = "
+                                    + getInt(acrobatics) + ", fishing = "
+                                    + getInt(fishing) + " WHERE user_id = "
+                                    + id);
+                            mcMMO.database.write("UPDATE "
+                                    + LoadProperties.MySQLtablePrefix
+                                    + "experience SET " + "  taming = "
+                                    + getInt(tamingXP) + ", mining = "
+                                    + getInt(miningXP) + ", repair = "
+                                    + getInt(repairXP) + ", woodcutting = "
+                                    + getInt(woodCuttingXP) + ", unarmed = "
+                                    + getInt(unarmedXP) + ", herbalism = "
+                                    + getInt(herbalismXP) + ", excavation = "
+                                    + getInt(excavationXP) + ", archery = "
+                                    + getInt(archeryXP) + ", swords = "
+                                    + getInt(swordsXP) + ", axes = "
+                                    + getInt(axesXP) + ", acrobatics = "
+                                    + getInt(acrobaticsXP) + ", fishing = "
+                                    + getInt(fishingXP) + " WHERE user_id = "
+                                    + id);
+                        }
+                    }
+                    System.out
+                            .println("[mcMMO] MySQL Updated from users file, "
+                                    + theCount
+                                    + " items added/updated to MySQL DB");
+                    in.close();
+                } catch (Exception e) {
+                    log.log(Level.SEVERE, "Exception while reading " + location
+                            + " (Are you sure you formatted it correctly?)", e);
+                }
+            }
+        }, 1);
+    }
 }
 }

+ 4 - 73
src/main/java/com/gmail/nossr50/skills/Axes.java

@@ -23,10 +23,9 @@ import org.bukkit.entity.Player;
 import org.bukkit.entity.Wolf;
 import org.bukkit.entity.Wolf;
 import org.bukkit.event.entity.EntityDamageByEntityEvent;
 import org.bukkit.event.entity.EntityDamageByEntityEvent;
 import org.bukkit.inventory.ItemStack;
 import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.Plugin;
-import com.gmail.nossr50.Combat;
+
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.Users;
-import com.gmail.nossr50.m;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.datatypes.SkillType;
 import com.gmail.nossr50.datatypes.SkillType;
@@ -46,7 +45,7 @@ public class Axes {
         
         
         event.setDamage(event.getDamage() + bonus);
         event.setDamage(event.getDamage() + bonus);
     }
     }
-	public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
+	public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event)
 	{
 	{
     	Entity x = event.getEntity();
     	Entity x = event.getEntity();
     	
     	
@@ -62,7 +61,7 @@ public class Axes {
     		}
     		}
     	}
     	}
     	PlayerProfile PPa = Users.getProfile(attacker);
     	PlayerProfile PPa = Users.getProfile(attacker);
-    	if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
+    	if(ItemChecks.isAxe(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
     		if(PPa.getSkillLevel(SkillType.AXES) >= 750){
     		if(PPa.getSkillLevel(SkillType.AXES) >= 750){
     			if(Math.random() * 2000 <= 750 && !x.isDead()){
     			if(Math.random() * 2000 <= 750 && !x.isDead()){
     				if(x instanceof Player){
     				if(x instanceof Player){
@@ -132,72 +131,4 @@ public class Axes {
         }
         }
 	}
 	}
 	
 	
-	public static void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
-	{
-		int targets = 0;
-		
-		int dmgAmount = (event.getDamage()/2);
-        
-        //Setup minimum damage
-        if(dmgAmount < 1)
-            dmgAmount = 1;
-    	
-    	if(event.getEntity() instanceof LivingEntity)
-    	{
-    		LivingEntity x = (LivingEntity) event.getEntity();
-	    	targets = m.getTier(attacker);
-	    	
-    	for(Entity derp : x.getNearbyEntities(2.5, 2.5, 2.5))
-    	{
-    			//Make sure the Wolf is not friendly
-    			if(derp instanceof Wolf)
-    			{
-					Wolf hurrDurr = (Wolf)derp;
-					if(hurrDurr.getOwner() instanceof Player)
-		    		{
-		    			Player owner = (Player) hurrDurr.getOwner();
-			    		if(owner == attacker)
-			    			return;
-			    		if(Party.getInstance().inSameParty(attacker, owner))
-			    			return;
-		    		}
-				}
-    			
-    			//Damage nearby LivingEntities
-    			if(derp instanceof LivingEntity && targets >= 1)
-    			{
-    				if(derp instanceof Player)
-	    			{
-	    				Player target = (Player)derp;
-	    				
-	    				if(Users.getProfile(target).getGodMode())
-	    					continue;
-
-	    				if(target.getName().equals(attacker.getName()))
-	    					continue;
-	    				
-	    				if(Party.getInstance().inSameParty(attacker, target))
-	    					continue;
-	    				
-	    				if(target.isDead())
-	    					continue;
-	    				
-	    				if(targets >= 1 && derp.getWorld().getPVP())
-	    				{
-	    				    Combat.dealDamage(target, dmgAmount, attacker);
-	    					target.sendMessage(mcLocale.getString("Axes.HitByCleave"));
-	    					targets--;
-	    					continue;
-	    				}
-	    			}
-    				else
-	    			{			
-	    				LivingEntity target = (LivingEntity)derp;
-    					Combat.dealDamage(target, dmgAmount, attacker);
-	    				targets--;
-	    			}
-    			}
-    		}
-    	}
-	}
 }
 }

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/Mining.java

@@ -188,7 +188,7 @@ public class Mining
     public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin)
     public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin)
     {
     {
     	Material type = block.getType();
     	Material type = block.getType();
-    	int tier = m.getTier(player);
+    	int tier = m.getTier(player.getItemInHand());
     	int durabilityLoss = LoadProperties.abilityDurabilityLoss;
     	int durabilityLoss = LoadProperties.abilityDurabilityLoss;
     	PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
     	PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
 		
 		

+ 11 - 11
src/main/java/com/gmail/nossr50/skills/Repair.java

@@ -27,8 +27,8 @@ import org.bukkit.entity.Player;
 import org.bukkit.inventory.ItemStack;
 import org.bukkit.inventory.ItemStack;
 import org.bukkit.inventory.PlayerInventory;
 import org.bukkit.inventory.PlayerInventory;
 
 
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.Users;
-import com.gmail.nossr50.m;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.config.LoadProperties;
 import com.gmail.nossr50.config.LoadProperties;
 import com.gmail.nossr50.spout.SpoutStuff;
 import com.gmail.nossr50.spout.SpoutStuff;
@@ -181,11 +181,11 @@ public class Repair {
 			dif = (short) (dif * modify);
 			dif = (short) (dif * modify);
 		if(!boost)
 		if(!boost)
 			dif = (short) (dif / modify);
 			dif = (short) (dif / modify);
-		if(m.isShovel(is))
+		if(ItemChecks.isShovel(is))
 			dif = (short) (dif / 3);
 			dif = (short) (dif / 3);
-		if(m.isSwords(is))
+		if(ItemChecks.isSword(is))
 			dif = (short) (dif / 2);
 			dif = (short) (dif / 2);
-		if(m.isHoe(is))
+		if(ItemChecks.isHoe(is))
 			dif = (short) (dif / 2);
 			dif = (short) (dif / 2);
 		
 		
 		PP.addXP(SkillType.REPAIR, dif*10, player);
 		PP.addXP(SkillType.REPAIR, dif*10, player);
@@ -452,19 +452,19 @@ public class Repair {
 		short maxDurability = is.getType().getMaxDurability();
 		short maxDurability = is.getType().getMaxDurability();
 		int ramt = 0;
 		int ramt = 0;
 		
 		
-		if(m.isShovel(is))
+		if(ItemChecks.isShovel(is))
 			ramt = maxDurability;
 			ramt = maxDurability;
-		else if(m.isHoe(is) || m.isSwords(is) || is.getTypeId() == 359)
+		else if(ItemChecks.isHoe(is) || ItemChecks.isSword(is) || is.getTypeId() == 359)
 			ramt = maxDurability / 2;
 			ramt = maxDurability / 2;
-		else if(m.isAxes(is) || m.isMiningPick(is) || isBow(is))
+		else if(ItemChecks.isAxe(is) || ItemChecks.isMiningPick(is) || isBow(is))
 			ramt = maxDurability / 3;
 			ramt = maxDurability / 3;
-		else if(m.isBoots(is))
+		else if(ItemChecks.isBoots(is))
 			ramt = maxDurability / 4;
 			ramt = maxDurability / 4;
-		else if(m.isHelmet(is))
+		else if(ItemChecks.isHelmet(is))
 			ramt = maxDurability / 5;
 			ramt = maxDurability / 5;
-		else if(m.isPants(is))
+		else if(ItemChecks.isPants(is))
 			ramt = maxDurability / 7;
 			ramt = maxDurability / 7;
-		else if(m.isChestplate(is))
+		else if(ItemChecks.isChestplate(is))
 			ramt = maxDurability / 8;
 			ramt = maxDurability / 8;
 				
 				
 		return repairCalculate(player, durability, ramt);
 		return repairCalculate(player, durability, ramt);

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/Skills.java

@@ -141,7 +141,7 @@ public class Skills
 		if(skillType != SkillType.ALL)
 		if(skillType != SkillType.ALL)
 			ps.statVal = PP.getSkillLevel(skillType);
 			ps.statVal = PP.getSkillLevel(skillType);
 		else
 		else
-			ps.statVal = m.getPowerLevel(player);
+			ps.statVal = m.getPowerLevel(player, PP);
 		ps.name = player.getName();
 		ps.name = player.getName();
 		Leaderboard.updateLeaderboard(ps, skillType);
 		Leaderboard.updateLeaderboard(ps, skillType);
 	}
 	}

+ 3 - 70
src/main/java/com/gmail/nossr50/skills/Swords.java

@@ -22,8 +22,8 @@ import org.bukkit.entity.Player;
 import org.bukkit.entity.Wolf;
 import org.bukkit.entity.Wolf;
 import org.bukkit.event.entity.EntityDamageByEntityEvent;
 import org.bukkit.event.entity.EntityDamageByEntityEvent;
 import com.gmail.nossr50.Combat;
 import com.gmail.nossr50.Combat;
+import com.gmail.nossr50.ItemChecks;
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.Users;
-import com.gmail.nossr50.m;
 import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.mcPermissions;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.datatypes.PlayerProfile;
@@ -49,7 +49,7 @@ public class Swords
 	    			return;
 	    			return;
     		}
     		}
     	}
     	}
-    	if(mcPermissions.getInstance().swords(attacker) && m.isSwords(attacker.getItemInHand())){
+    	if(mcPermissions.getInstance().swords(attacker) && ItemChecks.isSword(attacker.getItemInHand())){
 			if(PPa.getSkillLevel(SkillType.SWORDS) >= 750)
 			if(PPa.getSkillLevel(SkillType.SWORDS) >= 750)
 			{
 			{
 				if(Math.random() * 1000 <= 750)
 				if(Math.random() * 1000 <= 750)
@@ -77,73 +77,6 @@ public class Swords
 			}
 			}
 		}
 		}
     }
     }
-    public static void applySerratedStrikes(Player attacker, EntityDamageByEntityEvent event, mcMMO pluginx)
-    {
-    	int targets = 0;
-    	
-    	int dmgAmount = (event.getDamage()/4);
-        
-        //Setup minimum damage
-        if(dmgAmount < 1)
-            dmgAmount = 1;
-    	
-    	if(event.getEntity() instanceof LivingEntity)
-    	{
-    		LivingEntity x = (LivingEntity) event.getEntity();
-	    	targets = m.getTier(attacker);
-	    	
-	    	for(Entity derp : x.getNearbyEntities(2.5, 2.5, 2.5))
-	    	{
-    			//Make sure the Wolf is not friendly
-    			if(derp instanceof Wolf)
-    			{
-					Wolf hurrDurr = (Wolf)derp;
-					if(hurrDurr.getOwner() instanceof Player)
-		    		{
-		    			Player owner = (Player) hurrDurr.getOwner();
-			    		if(owner == attacker)
-			    			return;
-			    		if(Party.getInstance().inSameParty(attacker, owner))
-			    			return;
-		    		}
-				}
-    			//Damage nearby LivingEntities
-    			if(derp instanceof LivingEntity && targets >= 1)
-    			{
-    				if(derp instanceof Player)
-	    			{
-	    				Player target = (Player)derp;
-	    				
-	    				if(target.getName().equals(attacker.getName()))
-	    					continue;
-	    				
-	    				if(Users.getProfile(target).getGodMode())
-	    					continue;
-	    				
-	    				if(Party.getInstance().inSameParty(attacker, target))
-	    					continue;
-	    				if(targets >= 1 && derp.getWorld().getPVP())
-	    				{
-	    					Combat.dealDamage(target, dmgAmount, attacker);
-	    					target.sendMessage(mcLocale.getString("Swords.HitBySerratedStrikes"));
-	        				Users.getProfile(target).addBleedTicks(5);
-	    					targets--;
-	    					continue;
-	    				}
-	    			} 
-    				else
-	    			{
-	    				if(!pluginx.misc.bleedTracker.contains(derp))
-	    					pluginx.misc.addToBleedQue((LivingEntity)derp);
-	    				
-	    				LivingEntity target = (LivingEntity)derp;
-    					Combat.dealDamage(target, dmgAmount, attacker);
-	    				targets--;
-	    			}
-    			}
-    		}
-    	}
-	}
     
     
     public static void counterAttackChecks(EntityDamageByEntityEvent event)
     public static void counterAttackChecks(EntityDamageByEntityEvent event)
     {
     {
@@ -159,7 +92,7 @@ public class Swords
 		   	{
 		   	{
 		   		Player defender = (Player)event.getEntity();
 		   		Player defender = (Player)event.getEntity();
 		   		PlayerProfile PPd = Users.getProfile(defender);
 		   		PlayerProfile PPd = Users.getProfile(defender);
-		   		if(m.isSwords(defender.getItemInHand()) && mcPermissions.getInstance().swords(defender))
+		   		if(ItemChecks.isSword(defender.getItemInHand()) && mcPermissions.getInstance().swords(defender))
 		   		{
 		   		{
 		    		if(PPd.getSkillLevel(SkillType.SWORDS) >= 600)
 		    		if(PPd.getSkillLevel(SkillType.SWORDS) >= 600)
 		    		{
 		    		{