Fixed wrong violation when "teleporting" into a bed

This commit is contained in:
Evenprime 2011-02-26 19:38:54 +01:00
parent 80aa08d279
commit 8ea62ae52a
3 changed files with 7 additions and 2 deletions

View File

@ -3,5 +3,5 @@ name: NoCheatPlugin
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
version: 0.5.6
version: 0.5.7

View File

@ -154,6 +154,11 @@ public class MovingCheck {
else if(xDistance > NoCheatConfiguration.movingDistanceLow || zDistance > NoCheatConfiguration.movingDistanceLow) {
vl = vl > MINOR ? vl : MINOR;
}
// If the target is a bed, allow it
if(to.getWorld().getBlockTypeIdAt(to) == Material.BED_BLOCK.getId() && vl <= NORMAL) {
return; // players are allowed to "teleport" into a bed over short distances
}
// pre-calculate boundary values that are needed multiple times in the following checks

View File

@ -80,7 +80,7 @@ public class NoCheatConfiguration {
if(fh == null) {
try {
fh = new FileHandler(c.getString("logging.filename"), 2000, 2, true);
fh = new FileHandler(c.getString("logging.filename"), true);
fh.setLevel(stringToLevel(c.getString("logging.logtofile")));
fh.setFormatter(Logger.getLogger("Minecraft").getHandlers()[0].getFormatter());
logger.addHandler(fh);