[BLEEDING] Remove pvp-knockback workaround with 1.9 (read on).

If false positives with players receiving knockback from pvp hits
increase, setting checks.fight.pvp.knockbackvelocity to true instead of
default will force-activate the workaround.

Debug logging would reveal if this works or not. If the velocity events
fire correctly, the horizontal components will be clearly greater than
zero most of the time with pvp hits. [Can't test this right now.]
This commit is contained in:
asofold 2016-03-09 11:53:59 +01:00
parent 81c74441da
commit cb50f2cc61

View File

@ -14,23 +14,23 @@ import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
*
*/
public class Bugs {
private static boolean enforceLocation = false;
private static boolean pvpKnockBackVelocity = false;
protected static void init() {
final String mcVersion = ServerVersion.getMinecraftVersion();
final String serverVersion = Bukkit.getServer().getVersion().toLowerCase();
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
final List<String> noteWorthy = new LinkedList<String>();
// Need to add velocity (only internally) because the server does not.
pvpKnockBackVelocity = ServerVersion.select("1.8", false, true, true, false);
pvpKnockBackVelocity = ServerVersion.isMinecraftVersionBetween("1.8", true, "1.9", false);
if (pvpKnockBackVelocity) {
noteWorthy.add("pvpKnockBackVelocity");
}
// First move exploit (classic CraftBukkit or Spigot before 1.7.5).
if (mcVersion == GenericVersion.UNKNOWN_VERSION) {
// Assume something where it's not an issue.
@ -57,13 +57,13 @@ public class Bugs {
// Consider Bukkit.getLogger, or put to status after post-enable.
}
}
public static boolean shouldEnforceLocation() {
return enforceLocation;
}
public static boolean shouldPvpKnockBackVelocity() {
return pvpKnockBackVelocity;
}
}