mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-29 03:48:50 +01:00
Replaced airbuild-check with something simpler + set minimum freemove
limit to 1.
This commit is contained in:
parent
6cca892298
commit
d05bd2be04
@ -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:
|
||||
|
@ -119,7 +119,7 @@ public class NoCheatConfiguration {
|
||||
|
||||
airbuildAction = c.getString("airbuild.action", "logmed deny");
|
||||
|
||||
if(movingFreeMoves < 5) movingFreeMoves = 5;
|
||||
if(movingFreeMoves < 1) movingFreeMoves = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user