mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-15 08:28:10 +02:00
Final changes to moving-check + version bump
This commit is contained in:
parent
ad9d14dee1
commit
5df7af20b3
@ -3,7 +3,7 @@ name: NoCheatPlugin
|
||||
author: Evenprime
|
||||
|
||||
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
||||
version: 0.6.4c
|
||||
version: 0.6.5
|
||||
|
||||
commands:
|
||||
nocheat:
|
||||
|
@ -169,7 +169,7 @@ public class MovingCheck {
|
||||
// the array each contains [lowerX, higherX, Y, lowerZ, higherZ]
|
||||
int fromValues[] = {lowerBorder(from.getX()), upperBorder(from.getX()), from.getBlockY(), lowerBorder(from.getZ()),upperBorder(from.getZ()) };
|
||||
int toValues[] = {lowerBorder(to.getX()), upperBorder(to.getX()), to.getBlockY(), lowerBorder(to.getZ()), upperBorder(to.getZ()) };
|
||||
|
||||
|
||||
// compare locations to the world to guess if the player is standing on the ground, a half-block or next to a ladder
|
||||
boolean onGroundFrom = playerIsOnGround(from.getWorld(), fromValues, from);
|
||||
boolean onGroundTo = playerIsOnGround(from.getWorld(), toValues, to);
|
||||
@ -453,19 +453,27 @@ public class MovingCheck {
|
||||
return d > (double)i ? i : i - 1;
|
||||
}
|
||||
|
||||
public static int lowerBorder(double d1) {
|
||||
public static int lowerBorder(double d1) {
|
||||
double floor = Math.floor(d1);
|
||||
double d4 = (d1 - floor) - magic;
|
||||
//System.out.println(d4);
|
||||
return (int) (floor + d4);
|
||||
double d4 = floor + magic;
|
||||
|
||||
if(d4 <= d1)
|
||||
d4 = 0;
|
||||
else
|
||||
d4 = 1;
|
||||
|
||||
return (int) (floor - d4);
|
||||
}
|
||||
|
||||
public static int upperBorder(double d1) {
|
||||
double floor = Math.floor(d1);
|
||||
double d4 = (d1 - floor) - magic2;
|
||||
//System.out.println(d4);
|
||||
int tmp = (int) (floor - d4);
|
||||
double d4 = floor + magic2;
|
||||
|
||||
return tmp < floor ? tmp + 2 : (int)floor ;
|
||||
if(d4 < d1)
|
||||
d4 = -1;
|
||||
else
|
||||
d4 = 0;
|
||||
|
||||
return (int) (floor - d4);
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,9 @@ import cc.co.evenprime.bukkit.nocheat.NoCheatPlugin;
|
||||
public class NoCheatEntityListener extends EntityListener {
|
||||
|
||||
@Override
|
||||
public void onEntityDamage(EntityDamageEvent event) {
|
||||
public void onEntityDamage(EntityDamageEvent event) {
|
||||
|
||||
|
||||
if(event.getEntity() instanceof Player) {
|
||||
|
||||
if(event.getEntity() instanceof Player) {
|
||||
Player p = (Player)event.getEntity();
|
||||
|
||||
NoCheatPlugin.getPlayerData(p).movingJumpPhase = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user