Further tweaking of initial values

This commit is contained in:
Evenprime 2011-02-25 18:27:06 +01:00
parent 66d801b1f8
commit c5b2fcb1f2
3 changed files with 10 additions and 10 deletions

View File

@ -3,5 +3,5 @@ name: NoCheatPlugin
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
version: 0.5.5
version: 0.5.5a

View File

@ -16,7 +16,7 @@ public class MovingCheck {
// 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.
private static double jumpingPhases[] = new double[]{ 0.501D, 0.34D, 0.26D, 0.17D, 0.09D, 0.02D, 0.00D, -0.07D, -0.15D, -0.22D, -0.29D, -0.36D, -0.43D, -0.50D };
private static double jumpingPhases[] = new double[]{ 0.501D, 0.34D, 0.26D, 0.17D, 0.09D, 0.02D, 0.00D, -0.07D, -0.15D, -0.22D, -0.29D, -0.36D, -0.43D, -0.49D };
// Violation levels
private static final int HEAVY = 3;
@ -181,7 +181,7 @@ public class MovingCheck {
double offset = (to.getY() - from.getY()) - jumpingPhases[data.movingJumpPhase];
if(offset > 2D) vl = vl > HEAVY ? vl : HEAVY;
else if(offset > 0.6D) vl = vl > NORMAL ? vl : NORMAL;
else if(offset > 1D) vl = vl > NORMAL ? vl : NORMAL;
else vl = vl > MINOR ? vl : MINOR;
}
}
@ -197,7 +197,7 @@ public class MovingCheck {
double offset = (to.getY() - from.getY()) - jumpingPhases[data.movingJumpPhase];
if(offset > 2D) vl = vl > HEAVY ? vl : HEAVY;
else if(offset > 0.6D) vl = vl > NORMAL ? vl : NORMAL;
else if(offset > 1D) vl = vl > NORMAL ? vl : NORMAL;
else vl = vl > MINOR ? vl : MINOR;
}
else if(to.getY() <= from.getY()) {
@ -215,7 +215,7 @@ public class MovingCheck {
double offset = (to.getY() - from.getY()) - jumpingPhases[data.movingJumpPhase];
if(offset > 2D) vl = vl > HEAVY ? vl : HEAVY;
else if(offset > 0.6D) vl = vl > NORMAL ? vl : NORMAL;
else if(offset > 1D) vl = vl > NORMAL ? vl : NORMAL;
else vl = vl > MINOR ? vl : MINOR;
}
else {
@ -275,8 +275,8 @@ public class MovingCheck {
data.movingMinorViolationsInARow++;
// 16 minor violations in a row count as one normal violation
if(data.movingMinorViolationsInARow % (NoCheatConfiguration.movingFreeMoves+10) == 0) {
// using up all free moves 4 times in a row counts as one normal violation
if(data.movingMinorViolationsInARow % (NoCheatConfiguration.movingFreeMoves * 4) == 0) {
normalViolation(data, event);
}
// Each time the freebee moves are all used up, we may reset the player to his old location

View File

@ -39,7 +39,7 @@ public class NoCheatConfiguration {
public static double movingDistanceMed = 1.0D;
public static double movingDistanceHigh = 5.0D;
public static int movingFreeMoves = 2;
public static int movingFreeMoves = 5;
// Should moving violations be punished?
public static boolean movingLogOnly = false;
@ -103,7 +103,7 @@ public class NoCheatConfiguration {
speedhackHigh = c.getInt("speedhack.limits.high", 120);
movingLogOnly = c.getBoolean("moving.logonly", false);
movingFreeMoves = c.getInt("moving.freemoves", 2);
movingFreeMoves = c.getInt("moving.freemoves", 5);
}
/**
@ -153,7 +153,7 @@ public class NoCheatConfiguration {
w.write(" high: 120"); w.newLine();
w.write("moving:"); w.newLine();
w.write(" logonly: false"); w.newLine();
w.write(" freemoves: 2"); w.newLine();
w.write(" freemoves: 5"); w.newLine();
w.flush(); w.close();
} catch (IOException e) {
// TODO Auto-generated catch block