浏览代码

getExperienceFromLog cleanup

bm01 12 年之前
父节点
当前提交
f3e823997b
共有 1 个文件被更改,包括 10 次插入13 次删除
  1. 10 13
      src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java

+ 10 - 13
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?)