mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Fix improper target block handing in /tree & /bigtree (#3271)
This commit is contained in:
parent
302f0acbaa
commit
b960ee365a
2 changed files with 10 additions and 6 deletions
|
@ -33,9 +33,11 @@ public class Commandbigtree extends EssentialsCommand {
|
|||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final Location loc = LocationUtil.getTarget(user.getBase());
|
||||
final Location safeLocation = LocationUtil.getSafeDestination(loc);
|
||||
final boolean success = user.getWorld().generateTree(safeLocation, tree);
|
||||
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
|
||||
if (!user.getWorld().getBlockAt(loc).isPassable()) {
|
||||
throw new Exception(tl("bigTreeFailure"));
|
||||
}
|
||||
final boolean success = user.getWorld().generateTree(loc, tree);
|
||||
if (success) {
|
||||
user.sendMessage(tl("bigTreeSuccess"));
|
||||
} else {
|
||||
|
|
|
@ -42,9 +42,11 @@ public class Commandtree extends EssentialsCommand {
|
|||
}
|
||||
}
|
||||
|
||||
final Location loc = LocationUtil.getTarget(user.getBase());
|
||||
final Location safeLocation = LocationUtil.getSafeDestination(loc);
|
||||
final boolean success = user.getWorld().generateTree(safeLocation, tree);
|
||||
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
|
||||
if (!user.getWorld().getBlockAt(loc).isPassable()) {
|
||||
throw new Exception(tl("treeFailure"));
|
||||
}
|
||||
final boolean success = user.getWorld().generateTree(loc, tree);
|
||||
if (success) {
|
||||
user.sendMessage(tl("treeSpawned"));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue