From ed546123db82631453c57d64cca2ee64a6a783dc Mon Sep 17 00:00:00 2001 From: DuchLord Date: Tue, 1 Nov 2016 17:59:40 +0100 Subject: [PATCH] Some tweaks --- .../treechopper/common/handler/TreeHandler.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/treechopper/common/handler/TreeHandler.java b/src/main/java/treechopper/common/handler/TreeHandler.java index 39a00d1..83d3205 100644 --- a/src/main/java/treechopper/common/handler/TreeHandler.java +++ b/src/main/java/treechopper/common/handler/TreeHandler.java @@ -183,17 +183,26 @@ public boolean destroyBlockOverr(BlockPos pos, boolean dropBlock, World world) { public int treeDestroy(BlockEvent.BreakEvent event) { int logCount = tree.size(); + int soundMuter = 0; boolean destruction; Map leafVariantCount = new HashMap(); for (BlockPos blockPos : tree) { if (blockPos.getX() != event.getPos().getX() || blockPos.getY() != event.getPos().getY() || blockPos.getZ() != event.getPos().getZ()) { - destruction = event.getWorld().destroyBlock(blockPos, true); + + // DESTROY WOOD + if (soundMuter <= 2) + destruction = event.getWorld().destroyBlock(blockPos, true); + else + destruction = destroyBlockOverr(blockPos, true, event.getWorld()); if (!destruction) System.out.println("Problem with block.. " + blockPos); event.getWorld().setBlockToAir(blockPos); + // } + + soundMuter++; } if (!ConfigHandler.decayLeaves) { @@ -234,7 +243,7 @@ public int treeDestroy(BlockEvent.BreakEvent event) { leaves.add(blockPos); } - int soundMuter = 0; + soundMuter = 0; for (BlockPos blockPos : leaves) { if (event.getWorld().getBlockState(blockPos).getPropertyNames().toString().contains("variant")) leafVariant = event.getWorld().getBlockState(blockPos).getValue(event.getWorld().getBlockState(blockPos).getBlock().getBlockState().getProperty("variant")).toString().toUpperCase();