Revert "Revert "Fixed Fastbreak, zero-hit place code went out of business because of a bypass, so Bye bye pass! Now ./h31ix.sh --push-to-bukkitdev""

This reverts commit af2fc18ac4.
This commit is contained in:
SuPaH sPii committed 2013-01-02 22:43:24 -06:00
1 parent af2fc18ac4
commit d338d4d1e2
2 files changed
+4 -15

No files matched your search

@@ -63,7 +63,6 @@ public class Backend {
private Map<String, Boolean> blockBreakHolder = new HashMap<String, Boolean>();
private Map<String, Long> lastBlockBroken = new HashMap<String, Long>();
private Map<String, Integer> fastPlaceViolation = new HashMap<String, Integer>();
private Map<String, Integer> lastZeroHitPlace = new HashMap<String, Integer>();
private Map<String, Long> lastBlockPlaced = new HashMap<String, Long>();
private Map<String, Long> lastBlockPlaceTime = new HashMap<String, Long>();
private Map<String, Integer> blockPunches = new HashMap<String, Integer>();
@@ -138,7 +137,6 @@ public class Backend {
blockBreakHolder.remove(pN);
lastBlockBroken.remove(pN);
fastPlaceViolation.remove(pN);
lastZeroHitPlace.remove(pN);
lastBlockPlaced.remove(pN);
lastBlockPlaceTime.remove(pN);
blockPunches.remove(pN);
@@ -671,23 +669,14 @@ public class Backend {
long last = lastBlockPlaced.get(name);
long lastTime = lastBlockPlaceTime.get(name);
long thisTime = time - last;
boolean nocheck = thisTime < 1 || lastTime < 1;
if (!lastZeroHitPlace.containsKey(name)) {
lastZeroHitPlace.put(name, 0);
}
if (nocheck) {
if (!lastZeroHitPlace.containsKey(name)) {
lastZeroHitPlace.put(name, 1);
} else {
lastZeroHitPlace.put(name, lastZeroHitPlace.get(name) + 1);
}
}
if (thisTime < magic.FASTPLACE_TIMEMAX && lastTime < magic.FASTPLACE_TIMEMAX && nocheck && lastZeroHitPlace.get(name) > magic.FASTPLACE_ZEROLIMIT) {
if (thisTime < magic.FASTPLACE_TIMEMAX || lastTime < magic.FASTPLACE_TIMEMAX) {
lastBlockPlaceTime.put(name, (time - last));
lastBlockPlaced.put(name, time);
fastPlaceViolation.put(name, fastPlaceViolation.get(name) + 1);
return true;
}
lastBlockPlaceTime.put(name, (time - last));
}
lastBlockPlaced.put(name, time);