From 37364d6c869e60cae1b16e10aa3e2f0346a152a4 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 23 Feb 2012 01:59:00 -0800 Subject: [PATCH] More tweaks to Tree Feller --- src/main/java/com/gmail/nossr50/skills/Herbalism.java | 1 + src/main/java/com/gmail/nossr50/skills/WoodCutting.java | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/Herbalism.java index 4a438e3dc..bd6f15c5a 100644 --- a/src/main/java/com/gmail/nossr50/skills/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/Herbalism.java @@ -143,6 +143,7 @@ public class Herbalism mat = Material.getMaterial(296); is = new ItemStack(mat, 1, (byte)0, (byte)0); PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player); + if(player != null) { if(herbLevel > 1000 || (Math.random() * 1000 <= herbLevel)) diff --git a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java index f000bea12..42f3f477a 100644 --- a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java @@ -60,7 +60,7 @@ public class WoodCutting private static void removeBlocks(ArrayList toBeFelled, Player player, PlayerProfile PP, mcMMO plugin) { - int durabilityLoss = 0; + int durabilityLoss = 0, xp = 0; for(Block x : toBeFelled) { @@ -78,7 +78,7 @@ public class WoodCutting if(!plugin.misc.blockWatchList.contains(x)) { WoodCutting.woodCuttingProcCheck(player, x); - int xp = 0; + switch(x.getData()) { @@ -92,8 +92,6 @@ public class WoodCutting xp += LoadProperties.mbirch; break; } - - PP.addXP(SkillType.WOODCUTTING, xp, player); } //Drop the block @@ -125,6 +123,9 @@ public class WoodCutting } } + PP.addXP(SkillType.WOODCUTTING, xp, player); + Skills.XpCheckSkill(SkillType.WOODCUTTING, player); + if(LoadProperties.toolsLoseDurabilityFromAbilities) { if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))