Replaced airbuild-check with something simpler + set minimum freemove

limit to 1.
This commit is contained in:
Evenprime 2011-03-11 13:00:38 +01:00
parent 6cca892298
commit d05bd2be04
3 changed files with 4 additions and 13 deletions

View File

@ -3,7 +3,7 @@ name: NoCheatPlugin
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
version: 0.6.7
version: 0.6.7a
commands:
nocheat:

View File

@ -119,7 +119,7 @@ public class NoCheatConfiguration {
airbuildAction = c.getString("airbuild.action", "logmed deny");
if(movingFreeMoves < 5) movingFreeMoves = 5;
if(movingFreeMoves < 1) movingFreeMoves = 1;
}
/**

View File

@ -2,7 +2,6 @@ package cc.co.evenprime.bukkit.nocheat.checks;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.event.block.BlockPlaceEvent;
import cc.co.evenprime.bukkit.nocheat.NoCheatConfiguration;
@ -24,18 +23,10 @@ public class AirbuildCheck {
if(NoCheatPlugin.hasPermission(event.getPlayer(), "nocheat.airbuild"))
return;
Location l = event.getBlockPlaced().getLocation();
World w = event.getBlock().getWorld();
int airId = Material.AIR.getId();
// Are all 6 sides "air-blocks" -> cancel the event
if(w.getBlockTypeIdAt(l.getBlockX()-1, l.getBlockY(), l.getBlockZ()) == airId &&
w.getBlockTypeIdAt(l.getBlockX()+1, l.getBlockY(), l.getBlockZ()) == airId &&
w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY()-1, l.getBlockZ()) == airId &&
w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY()+1, l.getBlockZ()) == airId &&
w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY(), l.getBlockZ()-1) == airId &&
w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY(), l.getBlockZ()+1) == airId)
action(NoCheatConfiguration.airbuildAction, event);
if(event.getBlockAgainst().getType() == Material.AIR)
action(NoCheatConfiguration.airbuildAction, event);
}