explicitly ignore vehicles with movingCheck (skypirates) and up the

threshold for jumping by 1, meaning the jumping arc can be a bit
longer than before (but not higher at total).
This commit is contained in:
Evenprime 2011-03-21 15:32:18 +01:00
parent c655086b4e
commit e4af83b425
3 changed files with 14 additions and 6 deletions

View File

@ -3,7 +3,7 @@ name: NoCheatPlugin
author: Evenprime author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
version: 0.7.2 version: 0.7.2a
commands: commands:
nocheat: nocheat:

View File

@ -110,12 +110,14 @@ public class NoCheatConfiguration {
movingActionNormal = c.getString("moving.action.med", "logmed reset"); movingActionNormal = c.getString("moving.action.med", "logmed reset");
movingActionHeavy = c.getString("moving.action.high", "loghigh reset"); movingActionHeavy = c.getString("moving.action.high", "loghigh reset");
speedhackActionMinor = c.getString("speedhack.action.low", "loglow"); speedhackActionMinor = c.getString("speedhack.action.low", "loglow reset");
speedhackActionNormal = c.getString("speedhack.action.med", "logmed"); speedhackActionNormal = c.getString("speedhack.action.med", "logmed reset");
speedhackActionHeavy = c.getString("speedhack.action.high", "loghigh"); speedhackActionHeavy = c.getString("speedhack.action.high", "loghigh reset");
airbuildAction = c.getString("airbuild.action", "logmed deny"); airbuildAction = c.getString("airbuild.action", "logmed deny");
System.out.println(airbuildAction);
// 1 is minimum. This is needed to smooth over some minecraft bugs like // 1 is minimum. This is needed to smooth over some minecraft bugs like
// when a minecart gets broken while a player is inside it (which causes the player to "move" // when a minecart gets broken while a player is inside it (which causes the player to "move"
// up 1.0D which is much more than a usual jump would allow in 1 event // up 1.0D which is much more than a usual jump would allow in 1 event

View File

@ -22,7 +22,7 @@ public class MovingCheck {
// previously-calculated upper bound values for jumps. Minecraft is very deterministic when it comes to jumps // previously-calculated upper bound values for jumps. Minecraft is very deterministic when it comes to jumps
// Each entry represents the maximum gain in height per move event. // Each entry represents the maximum gain in height per move event.
static final int jumpingLimit = 3; static final int jumpingLimit = 4;
static final double jumpingHeightLimit = 1.3D; static final double jumpingHeightLimit = 1.3D;
static double stepHeight = 0.501D; static double stepHeight = 0.501D;
@ -175,12 +175,18 @@ public class MovingCheck {
data.movingLocation = null; data.movingLocation = null;
} }
if(event.getPlayer().isInsideVehicle()) {
data.movingSetBackPoint = null;
data.speedhackSetBackPoint = null;
return;
}
// The actual movingCheck starts here // The actual movingCheck starts here
// Get the two locations of the event // Get the two locations of the event
Location from = event.getFrom(); Location from = event.getFrom();
Location to = event.getTo(); Location to = event.getTo();
// First check the distance the player has moved horizontally // First check the distance the player has moved horizontally
// TODO: Make this check much more precise // TODO: Make this check much more precise
double xDistance = Math.abs(from.getX() - to.getX()); double xDistance = Math.abs(from.getX() - to.getX());