mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-19 14:01:20 +01:00
Make wrong block vl decrease over 2 minutes.
This commit is contained in:
parent
256fd6b26f
commit
8d41378688
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user