Tightened velocity check, fixed issues with slime block

This commit is contained in:
Rammelkast committed 2020-04-23 19:37:47 +02:00
1 parent 27bb684736
commit df3c410436
3 files changed
+4 -3

No files matched your search

@@ -278,7 +278,8 @@ public class Backend {
public CheckResult checkYSpeed(Player player, double y) {
if (!isMovingExempt(player) && !player.isInsideVehicle() && !player.isSleeping() && (y > magic.Y_SPEED_MAX())
&& !isDoing(player, velocitized, magic.VELOCITY_TIME())
&& !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)) {
&& !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)
&& !Utilities.isSlime(player.getLocation().getBlock())) {
return new CheckResult(CheckResult.Result.FAILED,
"y speed was too high (speed=" + y + ", max=" + magic.Y_SPEED_MAX() + ")");
} else {
@@ -118,7 +118,7 @@ public final class Utilities {
public static boolean isNotNearSlime(Block block) {
return !isSlime(block.getRelative(BlockFace.NORTH)) && !isSlime(block.getRelative(BlockFace.EAST))
&& !isSlime(block.getRelative(BlockFace.SOUTH)) && !isSlime(block.getRelative(BlockFace.WEST));
&& !isSlime(block.getRelative(BlockFace.SOUTH)) && !isSlime(block.getRelative(BlockFace.WEST)) && !isSlime(block.getRelative(BlockFace.DOWN));
}
/**