This commit is contained in:
Rammelkast committed 2017-01-15 16:27:24 +01:00
1 parent 52b96bedc4
commit b2571a32f1
3 files changed
+11 -6

No files matched your search

@@ -649,10 +649,11 @@ public class Backend {
public CheckResult checkFastHeal(Player player) { public CheckResult checkFastHeal(Player player) {
if (lastHeal.containsKey(player.getUniqueId())) // Otherwise it was modified by a plugin, don't worry about it. if (lastHeal.containsKey(player.getUniqueId())) // Otherwise it was modified by a plugin, don't worry about it.
{ {
long healTime = VersionUtil.getHealTime();
long l = lastHeal.get(player.getUniqueId()); long l = lastHeal.get(player.getUniqueId());
lastHeal.remove(player.getUniqueId()); lastHeal.remove(player.getUniqueId());
if ((System.currentTimeMillis() - l) < magic.HEAL_TIME_MIN()) { if ((System.currentTimeMillis() - l) < healTime) {
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " healed too quickly (time=" + (System.currentTimeMillis() - l) + " ms, min=" + magic.HEAL_TIME_MIN() + " ms)"); return new CheckResult(CheckResult.Result.FAILED, player.getName() + " healed too quickly (time=" + (System.currentTimeMillis() - l) + " ms, min=" + healTime + " ms)");
} }
} }
return PASS; return PASS;
@@ -257,10 +257,6 @@ public interface Magic {
* Minimum time in between block placing; Type=INTEGER, Leniency=DECREASE. * Minimum time in between block placing; Type=INTEGER, Leniency=DECREASE.
*/ */
public double BLOCK_PLACE_MIN(); public double BLOCK_PLACE_MIN();
/**
* Minimum time in between healing; Type=SYSTEM, Leniency=DECREASE.
*/
public int HEAL_TIME_MIN();
/** /**
* Minimum time in between eating; Type=SYSTEM, Leniency=DECREASE. * Minimum time in between eating; Type=SYSTEM, Leniency=DECREASE.
*/ */
@@ -43,4 +43,12 @@ public class VersionUtil {
} }
} }
public static long getHealTime() {
if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) {
return 499;
} else {
return 1999;
}
}
} }