mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-19 10:21:27 +02:00
Add option to assume the player is sprinting when possible (read on).
This is a workaround for the case that sprinting events are missing, wrongly set up or for events firing in an unusual order. This does allow speeding hacks that allow players to go at sprinting speed without telling the server, so it should only be turned on if there is any issues. The option has to be turned on: checks.moving.assumesprint
This commit is contained in:
parent
ad2105bdfb
commit
12b046f5a7
@ -145,6 +145,7 @@ public class MovingConfig extends ACheckConfig {
|
|||||||
public final boolean tempKickIllegal;
|
public final boolean tempKickIllegal;
|
||||||
public final boolean loadChunksOnJoin;
|
public final boolean loadChunksOnJoin;
|
||||||
public final long sprintingGrace;
|
public final long sprintingGrace;
|
||||||
|
public final boolean assumeSprint;
|
||||||
public final int speedGrace;
|
public final int speedGrace;
|
||||||
public final boolean vehicleEnforceLocation;
|
public final boolean vehicleEnforceLocation;
|
||||||
public final boolean vehiclePreventDestroyOwn;
|
public final boolean vehiclePreventDestroyOwn;
|
||||||
@ -221,6 +222,7 @@ public class MovingConfig extends ACheckConfig {
|
|||||||
tempKickIllegal = config.getBoolean(ConfPaths.MOVING_TEMPKICKILLEGAL);
|
tempKickIllegal = config.getBoolean(ConfPaths.MOVING_TEMPKICKILLEGAL);
|
||||||
loadChunksOnJoin = config.getBoolean(ConfPaths.MOVING_LOADCHUNKS_JOIN);
|
loadChunksOnJoin = config.getBoolean(ConfPaths.MOVING_LOADCHUNKS_JOIN);
|
||||||
sprintingGrace = Math.max(0L, (long) (config.getDouble(ConfPaths.MOVING_SPRINTINGGRACE) * 1000.0)); // Config: seconds.
|
sprintingGrace = Math.max(0L, (long) (config.getDouble(ConfPaths.MOVING_SPRINTINGGRACE) * 1000.0)); // Config: seconds.
|
||||||
|
assumeSprint = config.getBoolean(ConfPaths.MOVING_ASSUMESPRINT);
|
||||||
speedGrace = Math.max(0, (int) Math.round(config.getDouble(ConfPaths.MOVING_SPEEDGRACE) * 20.0)); // Config: seconds
|
speedGrace = Math.max(0, (int) Math.round(config.getDouble(ConfPaths.MOVING_SPEEDGRACE) * 20.0)); // Config: seconds
|
||||||
|
|
||||||
vehicleEnforceLocation = config.getBoolean(ConfPaths.MOVING_VEHICLES_ENFORCELOCATION);
|
vehicleEnforceLocation = config.getBoolean(ConfPaths.MOVING_VEHICLES_ENFORCELOCATION);
|
||||||
|
@ -479,8 +479,8 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
if (player.isSprinting()) {
|
if (player.isSprinting() || cc.assumeSprint) {
|
||||||
//
|
// Hard to confine assumesprint further (some logics change with hdist or sprinting).
|
||||||
if (player.getFoodLevel() > 5) {
|
if (player.getFoodLevel() > 5) {
|
||||||
data.timeSprinting = time;
|
data.timeSprinting = time;
|
||||||
}
|
}
|
||||||
|
@ -1439,6 +1439,7 @@ public class SurvivalFly extends Check {
|
|||||||
}
|
}
|
||||||
if (player.isSleeping()) tags.add("sleeping");
|
if (player.isSleeping()) tags.add("sleeping");
|
||||||
if (player.getFoodLevel() <= 5 && player.isSprinting()) {
|
if (player.getFoodLevel() <= 5 && player.isSprinting()) {
|
||||||
|
// Exception: does not take into account latency.
|
||||||
tags.add("lowfoodsprint");
|
tags.add("lowfoodsprint");
|
||||||
}
|
}
|
||||||
if (!tags.isEmpty()) builder.append("\n" + " tags: " + StringUtil.join(tags, "+"));
|
if (!tags.isEmpty()) builder.append("\n" + " tags: " + StringUtil.join(tags, "+"));
|
||||||
|
@ -640,6 +640,7 @@ public abstract class ConfPaths {
|
|||||||
private static final String MOVING_LOADCHUNKS = MOVING + "loadchunks.";
|
private static final String MOVING_LOADCHUNKS = MOVING + "loadchunks.";
|
||||||
public static final String MOVING_LOADCHUNKS_JOIN = MOVING_LOADCHUNKS + "join";
|
public static final String MOVING_LOADCHUNKS_JOIN = MOVING_LOADCHUNKS + "join";
|
||||||
public static final String MOVING_SPRINTINGGRACE = MOVING + "sprintinggrace";
|
public static final String MOVING_SPRINTINGGRACE = MOVING + "sprintinggrace";
|
||||||
|
public static final String MOVING_ASSUMESPRINT = MOVING + "assumesprint";
|
||||||
public static final String MOVING_SPEEDGRACE = MOVING + "speedgrace";
|
public static final String MOVING_SPEEDGRACE = MOVING + "speedgrace";
|
||||||
|
|
||||||
private static final String MOVING_VEHICLES = MOVING + "vehicles.";
|
private static final String MOVING_VEHICLES = MOVING + "vehicles.";
|
||||||
|
@ -410,15 +410,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
set(ConfPaths.INVENTORY_OPEN_CLOSE, true);
|
set(ConfPaths.INVENTORY_OPEN_CLOSE, true);
|
||||||
set(ConfPaths.INVENTORY_OPEN_CANCELOTHER, true);
|
set(ConfPaths.INVENTORY_OPEN_CANCELOTHER, true);
|
||||||
|
|
||||||
/*
|
// MOVING
|
||||||
* e e ,e,
|
|
||||||
* d8b d8b e88 88e Y8b Y888P " 888 8e e88 888
|
|
||||||
* e Y8b Y8b d888 888b Y8b Y8P 888 888 88b d888 888
|
|
||||||
* d8b Y8b Y8b Y888 888P Y8b " 888 888 888 Y888 888
|
|
||||||
* d888b Y8b Y8b "88 88" Y8P 888 888 888 "88 888
|
|
||||||
* , 88P
|
|
||||||
* "8",P"
|
|
||||||
*/
|
|
||||||
set(ConfPaths.MOVING_CREATIVEFLY_CHECK, true);
|
set(ConfPaths.MOVING_CREATIVEFLY_CHECK, true);
|
||||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT, false);
|
set(ConfPaths.MOVING_CREATIVEFLY_IGNOREALLOWFLIGHT, false);
|
||||||
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false);
|
set(ConfPaths.MOVING_CREATIVEFLY_IGNORECREATIVE, false);
|
||||||
@ -484,6 +476,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
set(ConfPaths.MOVING_TEMPKICKILLEGAL, true);
|
set(ConfPaths.MOVING_TEMPKICKILLEGAL, true);
|
||||||
set(ConfPaths.MOVING_LOADCHUNKS_JOIN, true);
|
set(ConfPaths.MOVING_LOADCHUNKS_JOIN, true);
|
||||||
set(ConfPaths.MOVING_SPRINTINGGRACE, 2.0);
|
set(ConfPaths.MOVING_SPRINTINGGRACE, 2.0);
|
||||||
|
set(ConfPaths.MOVING_ASSUMESPRINT, false);
|
||||||
set(ConfPaths.MOVING_SPEEDGRACE, 4.0);
|
set(ConfPaths.MOVING_SPEEDGRACE, 4.0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user