mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
[BLEEDING] Re-sharpen NoFall, configurable.
Fall damage events for violations are not cancelled anymore due to the "moved too quickly" bypass. Instead the player is dealt 3 more damage than normal and added to the hover checking if that is activated. Further a config flag allows to specify if to reset the NoFall data, set to false by default, thus victims of Minecraft false-positives are at doubled suffering. punished
This commit is contained in:
parent
940e7d83e3
commit
85131dcadb
@ -79,7 +79,11 @@ public class MovingConfig extends ACheckConfig {
|
|||||||
public final ActionList morePacketsVehicleActions;
|
public final ActionList morePacketsVehicleActions;
|
||||||
|
|
||||||
public final boolean noFallCheck;
|
public final boolean noFallCheck;
|
||||||
|
/** Deal damage instead of Minecraft, whenever a player is judged to be on ground. */
|
||||||
public final boolean noFallDealDamage;
|
public final boolean noFallDealDamage;
|
||||||
|
/** Reset data on violation, i.e. a player taking fall damage without being on ground. */
|
||||||
|
public final boolean noFallViolationReset;
|
||||||
|
/** Reset data on tp. */
|
||||||
public final boolean noFallTpReset;
|
public final boolean noFallTpReset;
|
||||||
public final ActionList noFallActions;
|
public final ActionList noFallActions;
|
||||||
|
|
||||||
@ -136,6 +140,7 @@ public class MovingConfig extends ACheckConfig {
|
|||||||
|
|
||||||
noFallCheck = data.getBoolean(ConfPaths.MOVING_NOFALL_CHECK);
|
noFallCheck = data.getBoolean(ConfPaths.MOVING_NOFALL_CHECK);
|
||||||
noFallDealDamage = data.getBoolean(ConfPaths.MOVING_NOFALL_DEALDAMAGE);
|
noFallDealDamage = data.getBoolean(ConfPaths.MOVING_NOFALL_DEALDAMAGE);
|
||||||
|
noFallViolationReset = data.getBoolean(ConfPaths.MOVING_NOFALL_RESETONVL);
|
||||||
noFallTpReset = data.getBoolean(ConfPaths.MOVING_NOFALL_RESETONTP);
|
noFallTpReset = data.getBoolean(ConfPaths.MOVING_NOFALL_RESETONTP);
|
||||||
noFallActions = data.getOptimizedActionList(ConfPaths.MOVING_NOFALL_ACTIONS, Permissions.MOVING_NOFALL);
|
noFallActions = data.getOptimizedActionList(ConfPaths.MOVING_NOFALL_ACTIONS, Permissions.MOVING_NOFALL);
|
||||||
|
|
||||||
|
@ -367,6 +367,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
|
|
||||||
// Ignore players in vehicles.
|
// Ignore players in vehicles.
|
||||||
if (player.isInsideVehicle()){
|
if (player.isInsideVehicle()){
|
||||||
|
System.out.println("VEHICLE ");
|
||||||
// Workaround for pigs !
|
// Workaround for pigs !
|
||||||
final Entity vehicle = player.getVehicle();
|
final Entity vehicle = player.getVehicle();
|
||||||
if (vehicle != null && (vehicle instanceof Pig)){
|
if (vehicle != null && (vehicle instanceof Pig)){
|
||||||
@ -374,7 +375,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
System.out.println("NORMAL");
|
||||||
// Ignore dead players.
|
// Ignore dead players.
|
||||||
if (player.isDead()) return;
|
if (player.isDead()) return;
|
||||||
|
|
||||||
@ -945,9 +946,15 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Minecraft/NCP bug or cheating.
|
// Minecraft/NCP bug or cheating.
|
||||||
// Cancel the event, apply damage later.
|
// (Do not cancel the event, otherwise: "moved too quickly exploit".)
|
||||||
event.setCancelled(true);
|
if (cc.noFallViolationReset){
|
||||||
// TODO: Add player to hover checks ?.
|
data.clearNoFallData();
|
||||||
|
}
|
||||||
|
// Add player to hover checks.
|
||||||
|
if (cc.sfHoverCheck && data.sfHoverTicks < 0){
|
||||||
|
data.sfHoverTicks = 0;
|
||||||
|
hoverTicks.add(player.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Entity fall-distance should be reset elsewhere.
|
// Entity fall-distance should be reset elsewhere.
|
||||||
}
|
}
|
||||||
|
@ -475,6 +475,7 @@ public abstract class ConfPaths {
|
|||||||
private static final String MOVING_NOFALL = MOVING + "nofall.";
|
private static final String MOVING_NOFALL = MOVING + "nofall.";
|
||||||
public static final String MOVING_NOFALL_CHECK = MOVING_NOFALL + "active";
|
public static final String MOVING_NOFALL_CHECK = MOVING_NOFALL + "active";
|
||||||
public static final String MOVING_NOFALL_DEALDAMAGE = MOVING_NOFALL + "dealdamage";
|
public static final String MOVING_NOFALL_DEALDAMAGE = MOVING_NOFALL + "dealdamage";
|
||||||
|
public static final String MOVING_NOFALL_RESETONVL = MOVING_NOFALL + "resetonviolation";
|
||||||
public static final String MOVING_NOFALL_RESETONTP = MOVING_NOFALL + "resetonteleport";
|
public static final String MOVING_NOFALL_RESETONTP = MOVING_NOFALL + "resetonteleport";
|
||||||
public static final String MOVING_NOFALL_ACTIONS = MOVING_NOFALL + "actions";
|
public static final String MOVING_NOFALL_ACTIONS = MOVING_NOFALL + "actions";
|
||||||
|
|
||||||
|
@ -371,6 +371,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
|
|
||||||
set(ConfPaths.MOVING_NOFALL_CHECK, true);
|
set(ConfPaths.MOVING_NOFALL_CHECK, true);
|
||||||
set(ConfPaths.MOVING_NOFALL_DEALDAMAGE, true);
|
set(ConfPaths.MOVING_NOFALL_DEALDAMAGE, true);
|
||||||
|
set(ConfPaths.MOVING_NOFALL_RESETONVL, false);
|
||||||
set(ConfPaths.MOVING_NOFALL_RESETONTP, false);
|
set(ConfPaths.MOVING_NOFALL_RESETONTP, false);
|
||||||
set(ConfPaths.MOVING_NOFALL_ACTIONS, "log:nofall:0:5:if cancel vl>30 log:nofall:0:5:icf cancel");
|
set(ConfPaths.MOVING_NOFALL_ACTIONS, "log:nofall:0:5:if cancel vl>30 log:nofall:0:5:icf cancel");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user