Fix /bigtree command on versions 1.12 and prior (#3569)

Fixes #3549.

Replaces the `Block#isPassable` check with `Material#isSolid`, which is compatible with all versions through 1.8 to 1.16.
This commit is contained in:
pop4959 2020-08-22 09:01:50 -07:00 committed by GitHub
parent 5fa65b42ae
commit 68cd509d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public class Commandbigtree extends EssentialsCommand {
}
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
if (!user.getWorld().getBlockAt(loc).isPassable()) {
if (loc.getBlock().getType().isSolid()) {
throw new Exception(tl("bigTreeFailure"));
}
final boolean success = user.getWorld().generateTree(loc, tree);

View File

@ -43,7 +43,7 @@ public class Commandtree extends EssentialsCommand {
}
final Location loc = LocationUtil.getTarget(user.getBase()).add(0, 1, 0);
if (!user.getWorld().getBlockAt(loc).isPassable()) {
if (loc.getBlock().getType().isSolid()) {
throw new Exception(tl("treeFailure"));
}