mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 10:37:57 +01:00
Is it a log? There's a function for that...
Also fix leaves dropping logs instead of saplings.
This commit is contained in:
parent
fb31cef68b
commit
aabbc2f238
@ -71,8 +71,8 @@ public abstract class TreeFeller {
|
|||||||
*/
|
*/
|
||||||
private static void processRecursively(Block block, List<Block> treeFellerBlocks) {
|
private static void processRecursively(Block block, List<Block> treeFellerBlocks) {
|
||||||
List<Block> futureCenterBlocks = new ArrayList<Block>();
|
List<Block> futureCenterBlocks = new ArrayList<Block>();
|
||||||
boolean centerIsLog = (block.getType() == Material.LOG || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLogBlock(block)));
|
boolean centerIsLog = BlockChecks.isLog(block);
|
||||||
Block nextBlock = block.getRelative(BlockFace.UP);;
|
Block nextBlock = block.getRelative(BlockFace.UP);
|
||||||
|
|
||||||
// Handle the block above 'block'
|
// Handle the block above 'block'
|
||||||
if (addBlock(nextBlock, treeFellerBlocks)) {
|
if (addBlock(nextBlock, treeFellerBlocks)) {
|
||||||
@ -147,11 +147,10 @@ public abstract class TreeFeller {
|
|||||||
Material inHandMaterial = inHand.getType();
|
Material inHandMaterial = inHand.getType();
|
||||||
|
|
||||||
if (inHandMaterial != Material.AIR) {
|
if (inHandMaterial != Material.AIR) {
|
||||||
boolean blockModsEnabled = Config.getInstance().getBlockModsEnabled();
|
|
||||||
short durabilityLoss = 0;
|
short durabilityLoss = 0;
|
||||||
|
|
||||||
for (Block block : treeFellerBlocks) {
|
for (Block block : treeFellerBlocks) {
|
||||||
if (block.getType() == Material.LOG || (blockModsEnabled && ModChecks.isCustomLogBlock(block))) {
|
if (BlockChecks.isLog(block)) {
|
||||||
durabilityLoss += Misc.toolDurabilityLoss;
|
durabilityLoss += Misc.toolDurabilityLoss;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,7 +199,7 @@ public abstract class TreeFeller {
|
|||||||
Misc.dropItem(block.getLocation(), new ItemStack(Material.LOG, 1, block.getData()));
|
Misc.dropItem(block.getLocation(), new ItemStack(Material.LOG, 1, block.getData()));
|
||||||
break;
|
break;
|
||||||
case LEAVES:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
if (ModChecks.isCustomLogBlock(block)) {
|
if (ModChecks.isCustomLogBlock(block)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user