From f3e823997bffd5ca13d6b3f6a470d16170e0eda0 Mon Sep 17 00:00:00 2001 From: bm01 Date: Sat, 16 Feb 2013 21:22:41 +0100 Subject: [PATCH] getExperienceFromLog cleanup --- .../skills/woodcutting/Woodcutting.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index ec26bc39e..58e221ba1 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -93,19 +93,16 @@ public final class Woodcutting { * @throws IllegalArgumentException if 'log' is invalid */ protected static int getExperienceFromLog(Block log, ExperienceGainMethod experienceGainMethod) { - - //Mushrooms aren't trees so we could never get species data from them - if(log.getType() == Material.HUGE_MUSHROOM_1 || log.getType() == Material.HUGE_MUSHROOM_2) { - switch(log.getType()) { - case HUGE_MUSHROOM_1: - return Config.getInstance().getWoodcuttingXPHugeBrownMushroom(); - case HUGE_MUSHROOM_2: - return Config.getInstance().getWoodcuttingXPHugeRedMushroom(); - default: - throw new IllegalArgumentException(); - } - } - + // Mushrooms aren't trees so we could never get species data from them + switch (log.getType()) { + case HUGE_MUSHROOM_1: + return Config.getInstance().getWoodcuttingXPHugeBrownMushroom(); + case HUGE_MUSHROOM_2: + return Config.getInstance().getWoodcuttingXPHugeRedMushroom(); + default: + break; + } + TreeSpecies logType = TreeSpecies.getByData(extractLogItemData(log.getData())); // Apparently species can be null in certain cases (custom server mods?)