Bug fixes

This commit is contained in:
Brian 2018-12-17 15:53:20 +02:00
parent e2593d3422
commit 14753fab86
5 changed files with 14 additions and 10 deletions

View File

@ -108,11 +108,11 @@ public class TreeChecker {
int radMin, radMax;
if (i > 5) {
radMin = -3; //-2
radMax = 4; //3
radMin = -2;
radMax = 3;
} else {
radMin = -2; //-1
radMax = 3; //2
radMin = -1;
radMax = 2;
}
for (int x = radMin; x < radMax; x++)
@ -141,11 +141,11 @@ public class TreeChecker {
int radMin, radMax;
if (i > 5) {
radMin = -4;
radMax = 5;
radMin = -5;
radMax = 7;
} else {
radMin = -3;
radMax = 4;
radMin = -4;
radMax = 6;
}

View File

@ -131,6 +131,7 @@ public class TreeFallAnimation implements Listener {
FallingBlock fallingBlock = block.getWorld().spawnFallingBlock(block.getLocation().clone().add(0.5,0,0.5), block.getBlockData());
fallingBlock.setDropItem(false);
registerFallingBlock(fallingBlock);
/*
@ -138,7 +139,7 @@ public class TreeFallAnimation implements Listener {
*/
if (block.getType().equals(Material.AIR)) continue;
/*
/*
Remove original block
*/
TreeReplant.replaceOriginalBlock(block);

View File

@ -27,8 +27,9 @@ public class TreeFallEvent implements Listener {
if (event.getBlock() != null && event.getBlock().getType().name().contains("SAPLING") &&
fileConfiguration.getBoolean(DefaultConfig.TIMEOUT_BREAK) && TreeReplant.isTimeout(event.getBlock()))
event.setCancelled(true);
if (!EventFilter.eventIsValid(event)) return;
if(fileConfiguration.getBoolean(DefaultConfig.SNEAK_ONLY) && !event.getPlayer().isSneaking()) return;
TreeChecker treeChecker = new TreeChecker();
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());

View File

@ -4,6 +4,7 @@ import com.songoda.ultimatetimber.utils.LeafToSaplingConverter;
import org.bukkit.Material;
import org.bukkit.entity.FallingBlock;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import java.util.concurrent.ThreadLocalRandom;

View File

@ -20,6 +20,7 @@ public class TreeReplant {
public static void replaceOriginalBlock(Block block) {
boolean isTimeout = UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.TIMEOUT_BREAK);
if (!UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.REPLANT_SAPLING)) {