diff --git a/plugin.yml b/plugin.yml index ce5d3708..bea70f34 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,5 +3,5 @@ name: NoCheatPlugin author: Evenprime main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin -version: 0.4.2 +version: 0.4.3 diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPluginPlayerListener.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPluginPlayerListener.java index f8805742..a237a125 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPluginPlayerListener.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPluginPlayerListener.java @@ -392,11 +392,19 @@ public class NoCheatPluginPlayerListener extends PlayerListener { else if(types[w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY(), l.getBlockZ())] == BlockType.LADDER || types[w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY()+1, l.getBlockZ())] == BlockType.LADDER) return true; - // check if he is standing "in" an unknown block (we give him the benefit of a doubt and see that as a legit move) - else if(types[w.getBlockTypeIdAt(values[0], values[2], values[3])] == BlockType.UNKNOWN || - types[w.getBlockTypeIdAt(values[1], values[2], values[3])] == BlockType.UNKNOWN || - types[w.getBlockTypeIdAt(values[0], values[2], values[4])] == BlockType.UNKNOWN || - types[w.getBlockTypeIdAt(values[1], values[2], values[4])] == BlockType.UNKNOWN) + // check if he is standing "in" an block that's potentially solid (we give him the benefit of a doubt and see that as a legit move) + // If it is not legit, the MC server already has a safeguard against that (You'll get "xy moved wrongly" on the console in that case) + else if(types[w.getBlockTypeIdAt(values[0], values[2], values[3])] != BlockType.NONSOLID || + types[w.getBlockTypeIdAt(values[1], values[2], values[3])] != BlockType.NONSOLID|| + types[w.getBlockTypeIdAt(values[0], values[2], values[4])] != BlockType.NONSOLID || + types[w.getBlockTypeIdAt(values[1], values[2], values[4])] != BlockType.NONSOLID) + return true; + // check if his head is "stuck" in an block that's potentially solid (we give him the benefit of a doubt and see that as a legit move) + // If it is not legit, the MC server already has a safeguard against that (You'll get "xy moved wrongly" on the console in that case) + else if(types[w.getBlockTypeIdAt(values[0], values[2]+1, values[3])] != BlockType.NONSOLID || + types[w.getBlockTypeIdAt(values[1], values[2]+1, values[3])] != BlockType.NONSOLID || + types[w.getBlockTypeIdAt(values[0], values[2]+1, values[4])] != BlockType.NONSOLID || + types[w.getBlockTypeIdAt(values[1], values[2]+1, values[4])] != BlockType.NONSOLID) return true; else return false;