Fix fence false positive with vertical Speed, fixed console nag about floodgate depend

This commit is contained in:
Rammelkast committed 2021-12-22 20:17:22 +01:00
1 parent 64788fb1a0
commit 6fabd73432
3 files changed
+15 -14

No files matched your search

@@ -380,7 +380,7 @@ public final class SpeedCheck {
Utilities.couldBeOnBoat(player), Utilities.couldBeOnBoat(player),
Utilities.isClimbableBlock(distance.getFrom().getBlock()) Utilities.isClimbableBlock(distance.getFrom().getBlock())
|| Utilities.isClimbableBlock(distance.getFrom().getBlock().getRelative(BlockFace.DOWN)), || Utilities.isClimbableBlock(distance.getFrom().getBlock().getRelative(BlockFace.DOWN)),
movementManager.halfMovement, checksConfig); (movementManager.halfMovement || Utilities.isNearWall(distance.getFrom())), checksConfig);
// Fix false positive with soulsand boost // Fix false positive with soulsand boost
if (movementManager.nearLiquidTicks > 6) { if (movementManager.nearLiquidTicks > 6) {
maxMotionY *= 1.0525D; maxMotionY *= 1.0525D;
@@ -407,7 +407,7 @@ public final class SpeedCheck {
// TODO config for these values // TODO config for these values
// TODO something funky vanilla stuff going on with 0.42, like 0.445.., check // TODO something funky vanilla stuff going on with 0.42, like 0.445.., check
// this.. // this..
double base = couldBeOnBoat ? 0.600000025 : (nearBed ? 0.5625 : ((halfMovement) ? 0.6 : 0.42)); double base = couldBeOnBoat ? 0.6f : (nearBed ? 0.5625f : ((halfMovement) ? 0.6f : 0.42f));
if (fromClimbable) { if (fromClimbable) {
base += checksConfig.getDouble(CheckType.SPEED, "verticalSpeed", "climbableCompensation"); // Default 0.04 base += checksConfig.getDouble(CheckType.SPEED, "verticalSpeed", "climbableCompensation"); // Default 0.04
} }
@@ -210,7 +210,7 @@ public final class Utilities {
return true; return true;
} }
} }
return isSlab(block) || isStair(block) || isWall(block) || block.getType() == Material.SNOW return isSlab(block) || isStair(block) || isWall(block) || block.getType() == XMaterial.SNOW.parseMaterial()
|| block.getType().name().endsWith("HEAD"); || block.getType().name().endsWith("HEAD");
} }
@@ -357,7 +357,7 @@ public final class Utilities {
* @param block block to check * @param block block to check
* @return true if stair * @return true if stair
*/ */
public static boolean isStair(Block block) { public static boolean isStair(final Block block) {
Material type = block.getType(); Material type = block.getType();
return type.name().endsWith("STAIRS"); return type.name().endsWith("STAIRS");
} }
@@ -368,19 +368,20 @@ public final class Utilities {
* @param block block to check * @param block block to check
* @return true if wall * @return true if wall
*/ */
public static boolean isWall(Block block) { public static boolean isWall(final Block block) {
Material type = block.getType(); Material type = block.getType();
return type.name().endsWith("WALL") || type.name().endsWith("FENCE"); return type.name().endsWith("WALL") || type.name().endsWith("FENCE");
} }
/** public static boolean isNearWall(final Location location) {
* Determine whether a player is sprinting or flying return isWall(location.getBlock()) || isWall(location.getBlock().getRelative(BlockFace.NORTH))
* || isWall(location.getBlock().getRelative(BlockFace.SOUTH))
* @param player player to check || isWall(location.getBlock().getRelative(BlockFace.EAST))
* @return true if sprinting or flying || isWall(location.getBlock().getRelative(BlockFace.WEST))
*/ || isWall(location.getBlock().getRelative(BlockFace.NORTH_EAST))
public static boolean sprintFly(Player player) { || isWall(location.getBlock().getRelative(BlockFace.NORTH_WEST))
return player.isSprinting() || player.isFlying(); || isWall(location.getBlock().getRelative(BlockFace.SOUTH_EAST))
|| isWall(location.getBlock().getRelative(BlockFace.SOUTH_WEST));
} }
/** /**
+1 -1
View File
@@ -4,7 +4,7 @@ description: AntiCheatReloaded helps easily identify and block malicious players
main: com.rammelkast.anticheatreloaded.AntiCheatReloaded main: com.rammelkast.anticheatreloaded.AntiCheatReloaded
api-version: 1.13 api-version: 1.13
depend: [ProtocolLib] depend: [ProtocolLib]
softdepend: [Floodgate] softdepend: [Floodgate, floodgate]
startup: postworld startup: postworld
version: ${project.build.version} version: ${project.build.version}
commands: commands: