Set minimum "freemoves" to 1 and made neccessary codechanges to

support that.
This commit is contained in:
Evenprime 2011-03-12 17:12:26 +01:00
parent d05bd2be04
commit c4cbff5bef
4 changed files with 10 additions and 10 deletions

View File

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

View File

@ -119,6 +119,9 @@ public class NoCheatConfiguration {
airbuildAction = c.getString("airbuild.action", "logmed deny");
// 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"
// up 1.0D which is much more than a usual jump would allow in 1 event
if(movingFreeMoves < 1) movingFreeMoves = 1;
}
@ -175,6 +178,7 @@ public class NoCheatConfiguration {
w.write(" high: loghigh reset"); w.newLine();
w.write("# Moving specific optionse") ;w.newLine();
w.write("moving:"); w.newLine();
w.write("# After how many minor violations should the plugin react (minimum 1)"); w.newLine();
w.write(" freemoves: 5"); w.newLine();
w.write("# Moving Action, one or more of 'loglow logmed loghigh reset'"); w.newLine();
w.write(" action:"); w.newLine();

View File

@ -290,17 +290,17 @@ public class MovingCheck {
actions = NoCheatConfiguration.movingActionMinor;
// React only after the freebee illegal moves have all been used
if(data.movingMinorViolationsInARow % (NoCheatConfiguration.movingFreeMoves) != 0) {
if(data.movingMinorViolationsInARow <= NoCheatConfiguration.movingFreeMoves) {
vl = null;
actions = null;
}
if(data.movingMinorViolationsInARow != NoCheatConfiguration.movingFreeMoves) {
if(data.movingMinorViolationsInARow > NoCheatConfiguration.movingFreeMoves+1) {
log = false;
}
// using up all free moves 4 times in a row counts as one normal violation
if(data.movingMinorViolationsInARow % (NoCheatConfiguration.movingFreeMoves * 4) == 0) {
// after a set number of minor violations a normal violation gets thrown
if(data.movingMinorViolationsInARow % 40 == 0) {
vl = Level.WARNING;
log = true;
}
@ -361,7 +361,7 @@ public class MovingCheck {
NoCheatPlugin.logAction(NoCheatConfiguration.movingActionNormal, "Moving violation ended: "+event.getPlayer().getName()+ " total Events: "+ data.movingNormalViolationsInARow);
data.movingNormalViolationsInARow = 0;
}
if(data.movingMinorViolationsInARow > NoCheatConfiguration.movingFreeMoves) {
if(data.movingMinorViolationsInARow > NoCheatConfiguration.movingFreeMoves +1) {
NoCheatPlugin.logAction(NoCheatConfiguration.movingActionMinor, "Moving violation ended: "+event.getPlayer().getName()+ " total Events: "+ data.movingMinorViolationsInARow);
data.movingMinorViolationsInARow = 0;
}

View File

@ -18,9 +18,5 @@ public class NoCheatEntityListener extends EntityListener {
NoCheatPlugin.getPlayerData(p).movingJumpPhase = 0;
}
}
}