Fixed 3 false positives in water, one with beds and returned to old "getGoodLocation"

This commit is contained in:
Rammelkast committed 2020-07-21 13:19:35 +02:00
1 parent 168c25e5d2
commit 6966582e4c
8 files changed
+42 -14

No files matched your search

@@ -424,9 +424,16 @@ public final class Utilities {
public static boolean isInWater(Player player) {
return player.getLocation().getBlock().isLiquid()
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid()
|| player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
|| player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid()
|| (!VersionUtil.isBountifulUpdate()
&& (player.getLocation().getBlock().getType() == XMaterial.KELP_PLANT.parseMaterial()
|| player.getLocation().getBlock().getRelative(BlockFace.UP)
.getType() == XMaterial.KELP_PLANT.parseMaterial()
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN)
.getType() == XMaterial.KELP_PLANT.parseMaterial())
&& isNearWater(player));
}
/**
* Determine whether a player is near a liquid block
*