Fixed false positive with slow falling potion and upped default teleport protection

This commit is contained in:
Rammelkast committed 2020-04-24 18:54:15 +02:00
1 parent cc51e9307f
commit 50247f28c9
3 files changed
+10 -3

No files matched your search

@@ -285,8 +285,8 @@ public class Backend {
UUID uuid = player.getUniqueId();
if (player.getGameMode() != GameMode.CREATIVE && !player.isInsideVehicle() && !player.isSleeping()
&& !isMovingExempt(player) && !justPlaced(player) && !Utilities.isInWater(player)
&& !Utilities.isInWeb(player)
&& !player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")) {
&& !Utilities.isInWeb(player) && !player.getLocation().getBlock().getType().name().endsWith("TRAPDOOR")
&& !VersionUtil.isSlowFalling(player)) {
if (player.getFallDistance() == 0) {
if (nofallViolation.get(uuid) == null) {
nofallViolation.put(uuid, 1);
@@ -70,6 +70,13 @@ public class VersionUtil {
return p.isFlying() || p.isGliding() || p.hasPotionEffect(PotionEffectType.LEVITATION);
}
public static boolean isSlowFalling(Player player) {
if (isBountifulUpdate()) {
return false;
}
return player.hasPotionEffect(PotionEffectType.SLOW_FALLING);
}
public static boolean isFrostWalk(Player player) {
if (player.getInventory().getBoots() == null || isBountifulUpdate()) {
return false;