mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +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();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Location loc = LocationUtil.getTarget(user.getBase());
|
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
|
||||||
final Location safeLocation = LocationUtil.getSafeDestination(loc);
|
if (!user.getWorld().getBlockAt(loc).isPassable()) {
|
||||||
final boolean success = user.getWorld().generateTree(safeLocation, tree);
|
throw new Exception(tl("bigTreeFailure"));
|
||||||
|
}
|
||||||
|
final boolean success = user.getWorld().generateTree(loc, tree);
|
||||||
if (success) {
|
if (success) {
|
||||||
user.sendMessage(tl("bigTreeSuccess"));
|
user.sendMessage(tl("bigTreeSuccess"));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -42,9 +42,11 @@ public class Commandtree extends EssentialsCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Location loc = LocationUtil.getTarget(user.getBase());
|
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
|
||||||
final Location safeLocation = LocationUtil.getSafeDestination(loc);
|
if (!user.getWorld().getBlockAt(loc).isPassable()) {
|
||||||
final boolean success = user.getWorld().generateTree(safeLocation, tree);
|
throw new Exception(tl("treeFailure"));
|
||||||
|
}
|
||||||
|
final boolean success = user.getWorld().generateTree(loc, tree);
|
||||||
if (success) {
|
if (success) {
|
||||||
user.sendMessage(tl("treeSpawned"));
|
user.sendMessage(tl("treeSpawned"));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue