From aabbc2f238eb5c5dac075319ee8fd72d13c5beb7 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 23 Jan 2013 12:44:00 -0500 Subject: [PATCH] Is it a log? There's a function for that... Also fix leaves dropping logs instead of saplings. --- .../com/gmail/nossr50/skills/woodcutting/TreeFeller.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/TreeFeller.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/TreeFeller.java index 47eb876ff..ec155b0c2 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/TreeFeller.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/TreeFeller.java @@ -71,8 +71,8 @@ public abstract class TreeFeller { */ private static void processRecursively(Block block, List treeFellerBlocks) { List futureCenterBlocks = new ArrayList(); - boolean centerIsLog = (block.getType() == Material.LOG || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLogBlock(block))); - Block nextBlock = block.getRelative(BlockFace.UP);; + boolean centerIsLog = BlockChecks.isLog(block); + Block nextBlock = block.getRelative(BlockFace.UP); // Handle the block above 'block' if (addBlock(nextBlock, treeFellerBlocks)) { @@ -147,11 +147,10 @@ public abstract class TreeFeller { Material inHandMaterial = inHand.getType(); if (inHandMaterial != Material.AIR) { - boolean blockModsEnabled = Config.getInstance().getBlockModsEnabled(); short durabilityLoss = 0; for (Block block : treeFellerBlocks) { - if (block.getType() == Material.LOG || (blockModsEnabled && ModChecks.isCustomLogBlock(block))) { + if (BlockChecks.isLog(block)) { durabilityLoss += Misc.toolDurabilityLoss; } } @@ -200,7 +199,7 @@ public abstract class TreeFeller { Misc.dropItem(block.getLocation(), new ItemStack(Material.LOG, 1, block.getData())); break; case LEAVES: - Misc.randomDropItem(block.getLocation(), new ItemStack(Material.LOG, 1, (short) (block.getData() & 3)), 10); + Misc.randomDropItem(block.getLocation(), new ItemStack(Material.SAPLING, 1, (short) (block.getData() & 3)), 10); break; default: if (ModChecks.isCustomLogBlock(block)) {