Make wrong block vl decrease over 2 minutes.

This commit is contained in:
asofold 2012-09-10 20:57:40 +02:00
parent 256fd6b26f
commit 8d41378688
2 changed files with 6 additions and 4 deletions

View File

@ -70,7 +70,7 @@ public class BlockBreakData extends ACheckData {
public double fastBreakVL;
public double noSwingVL;
public double reachVL;
public double wrongBlockVL;
public final ActionFrequency wrongBlockVL;
// Shared data.
public int clickedX;
@ -94,6 +94,7 @@ public class BlockBreakData extends ACheckData {
public BlockBreakData(BlockBreakConfig cc) {
fastBreakBuffer = cc.fastBreakBuffer;
fastBreakPenalties = new ActionFrequency(cc.fastBreakBuckets, cc.fastBreakBucketDur);
wrongBlockVL = new ActionFrequency(6, 20000);
}
}

View File

@ -19,10 +19,11 @@ public class WrongBlock extends Check {
boolean cancel = false;
if (data.clickedX != block.getX() || data.clickedZ != block.getZ() || data.clickedY != block.getY()){
data.wrongBlockVL += 1D;
if (executeActions(player, data.wrongBlockVL, 1D, cc.wrongBlockActions))
final long now = System.currentTimeMillis();
data.wrongBlockVL.add(now, 1f);
if (executeActions(player, data.wrongBlockVL.getScore(0.9f), 1D, cc.wrongBlockActions))
cancel = true;
if (Improbable.check(player, 5.0f, System.currentTimeMillis()))
if (Improbable.check(player, 5.0f, now))
cancel = true;
}