Fix not being able to place lava near vanished players
This commit is contained in:
parent
9ecebc929d
commit
fe43443cde
|
|
@ -877,6 +877,7 @@ class PlayerEventHandler implements Listener
|
|||
List<Player> players = block.getWorld().getPlayers();
|
||||
for (Player otherPlayer : players)
|
||||
{
|
||||
if (isVanished(otherPlayer)) continue;
|
||||
Location location = otherPlayer.getLocation();
|
||||
if (!otherPlayer.equals(player) && otherPlayer.getGameMode() == GameMode.SURVIVAL && player.canSee(otherPlayer) && block.getY() >= location.getBlockY() - 1 && location.distanceSquared(block.getLocation()) < minLavaDistance * minLavaDistance)
|
||||
{
|
||||
|
|
@ -2010,4 +2011,10 @@ class PlayerEventHandler implements Listener
|
|||
return result;
|
||||
}
|
||||
|
||||
private boolean isVanished(Player player) {
|
||||
for (MetadataValue meta : player.getMetadata("vanished")) {
|
||||
if (meta.asBoolean()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user