Skip to content

Commit

Permalink
[BLEEDING] Remove pvp-knockback workaround with 1.9 (read on).
Browse files Browse the repository at this point in the history
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.]
  • Loading branch information
asofold committed Mar 9, 2016
1 parent 81c7444 commit cb50f2c
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -14,23 +14,23 @@
*
*/
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.
Expand All @@ -57,13 +57,13 @@ else if (GenericVersion.compareVersions(mcVersion, "1.8") >= 0) {
// Consider Bukkit.getLogger, or put to status after post-enable.
}
}

public static boolean shouldEnforceLocation() {
return enforceLocation;
}

public static boolean shouldPvpKnockBackVelocity() {
return pvpKnockBackVelocity;
}

}

0 comments on commit cb50f2c

Please sign in to comment.