mirror of
https://github.com/songoda/UltimateTimber.git
synced 2025-01-27 01:41:25 +01:00
Bug fixes
This commit is contained in:
parent
e2593d3422
commit
14753fab86
@ -108,11 +108,11 @@ public class TreeChecker {
|
|||||||
int radMin, radMax;
|
int radMin, radMax;
|
||||||
|
|
||||||
if (i > 5) {
|
if (i > 5) {
|
||||||
radMin = -3; //-2
|
radMin = -2;
|
||||||
radMax = 4; //3
|
radMax = 3;
|
||||||
} else {
|
} else {
|
||||||
radMin = -2; //-1
|
radMin = -1;
|
||||||
radMax = 3; //2
|
radMax = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int x = radMin; x < radMax; x++)
|
for (int x = radMin; x < radMax; x++)
|
||||||
@ -141,11 +141,11 @@ public class TreeChecker {
|
|||||||
int radMin, radMax;
|
int radMin, radMax;
|
||||||
|
|
||||||
if (i > 5) {
|
if (i > 5) {
|
||||||
radMin = -4;
|
radMin = -5;
|
||||||
radMax = 5;
|
radMax = 7;
|
||||||
} else {
|
} else {
|
||||||
radMin = -3;
|
radMin = -4;
|
||||||
radMax = 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 fallingBlock = block.getWorld().spawnFallingBlock(block.getLocation().clone().add(0.5,0,0.5), block.getBlockData());
|
||||||
fallingBlock.setDropItem(false);
|
fallingBlock.setDropItem(false);
|
||||||
|
|
||||||
|
|
||||||
registerFallingBlock(fallingBlock);
|
registerFallingBlock(fallingBlock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,8 +27,9 @@ public class TreeFallEvent implements Listener {
|
|||||||
if (event.getBlock() != null && event.getBlock().getType().name().contains("SAPLING") &&
|
if (event.getBlock() != null && event.getBlock().getType().name().contains("SAPLING") &&
|
||||||
fileConfiguration.getBoolean(DefaultConfig.TIMEOUT_BREAK) && TreeReplant.isTimeout(event.getBlock()))
|
fileConfiguration.getBoolean(DefaultConfig.TIMEOUT_BREAK) && TreeReplant.isTimeout(event.getBlock()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (!EventFilter.eventIsValid(event)) return;
|
if (!EventFilter.eventIsValid(event)) return;
|
||||||
|
if(fileConfiguration.getBoolean(DefaultConfig.SNEAK_ONLY) && !event.getPlayer().isSneaking()) return;
|
||||||
|
|
||||||
TreeChecker treeChecker = new TreeChecker();
|
TreeChecker treeChecker = new TreeChecker();
|
||||||
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());
|
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.songoda.ultimatetimber.utils.LeafToSaplingConverter;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.FallingBlock;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ public class TreeReplant {
|
|||||||
|
|
||||||
public static void replaceOriginalBlock(Block block) {
|
public static void replaceOriginalBlock(Block block) {
|
||||||
|
|
||||||
|
|
||||||
boolean isTimeout = UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.TIMEOUT_BREAK);
|
boolean isTimeout = UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.TIMEOUT_BREAK);
|
||||||
|
|
||||||
if (!UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.REPLANT_SAPLING)) {
|
if (!UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.REPLANT_SAPLING)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user