mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Fix FastLadder false with elytra, fix speed & flight false positive with trident, fix #122 and fix #119, fix illegalinteract false positive with torches
This commit is contained in:
1 parent
9473781a26
commit
646e906ada
9 files changed
+83
-23
No files matched your search
@@ -89,6 +89,14 @@ public class MovementManager {
|
||||
public boolean hasSpeedEffect = false;
|
||||
// If the player had speed effect previous tick
|
||||
public boolean hadSpeedEffect = false;
|
||||
// If the player has a fire resistance effect
|
||||
public boolean hasFireResistanceEffect = false;
|
||||
// If the player had fire resistance effect previous tick
|
||||
public boolean hadFireResistanceEffect = false;
|
||||
// If the player has a bad omen effect
|
||||
public boolean hasBadOmenEffect = false;
|
||||
// If the player had bad omen effect previous tick
|
||||
public boolean hadBadOmenEffect = false;
|
||||
// Time of last update
|
||||
public long lastUpdate;
|
||||
|
||||
@@ -180,6 +188,12 @@ public class MovementManager {
|
||||
|
||||
this.hadSpeedEffect = this.hasSpeedEffect;
|
||||
this.hasSpeedEffect = player.hasPotionEffect(PotionEffectType.SPEED);
|
||||
|
||||
this.hadFireResistanceEffect = this.hasFireResistanceEffect;
|
||||
this.hasFireResistanceEffect = player.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE);
|
||||
|
||||
this.hadBadOmenEffect = this.hasBadOmenEffect;
|
||||
this.hasBadOmenEffect = player.hasPotionEffect(PotionEffectType.BAD_OMEN);
|
||||
|
||||
double lastDistanceSq = Math.sqrt(this.lastDistance.getXDifference() * this.lastDistance.getXDifference()
|
||||
+ this.lastDistance.getZDifference() * this.lastDistance.getZDifference());
|
||||
|
||||
@@ -487,6 +487,26 @@ public final class Utilities {
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether a location is near a liquid block
|
||||
*
|
||||
* @param location Location to check
|
||||
* @return true if near liquid block
|
||||
*/
|
||||
public static boolean isNearWater(Location location) {
|
||||
return location.getBlock().isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.UP).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.DOWN).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.NORTH).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.SOUTH).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.EAST).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.WEST).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.NORTH_EAST).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.NORTH_WEST).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||
|| location.getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether a player is surrounded by liquid blocks
|
||||
|
||||
Reference in new issue
Block a user