mirror of
https://github.com/songoda/UltimateTimber.git
synced 2025-01-25 08:51:21 +01:00
Bug fixes
This commit is contained in:
parent
e2593d3422
commit
14753fab86
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user