mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-04 03:10:27 +02:00
Yet another fix for a "player getting stuck in wall" bug.
I forgot to handle the case where a player is stuck in a wall without something below (e.g. the infamous minecart ride against a ceiling).
This commit is contained in:
parent
7340933587
commit
461097af56
|
@ -3,5 +3,5 @@ name: NoCheatPlugin
|
||||||
author: Evenprime
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
||||||
version: 0.4.2
|
version: 0.4.3
|
||||||
|
|
||||||
|
|
|
@ -392,11 +392,19 @@ public class NoCheatPluginPlayerListener extends PlayerListener {
|
||||||
else if(types[w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY(), l.getBlockZ())] == BlockType.LADDER ||
|
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)
|
types[w.getBlockTypeIdAt(l.getBlockX(), l.getBlockY()+1, l.getBlockZ())] == BlockType.LADDER)
|
||||||
return true;
|
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)
|
// 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)
|
||||||
else if(types[w.getBlockTypeIdAt(values[0], values[2], values[3])] == BlockType.UNKNOWN ||
|
// 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)
|
||||||
types[w.getBlockTypeIdAt(values[1], values[2], values[3])] == BlockType.UNKNOWN ||
|
else if(types[w.getBlockTypeIdAt(values[0], values[2], values[3])] != BlockType.NONSOLID ||
|
||||||
types[w.getBlockTypeIdAt(values[0], values[2], values[4])] == BlockType.UNKNOWN ||
|
types[w.getBlockTypeIdAt(values[1], values[2], values[3])] != BlockType.NONSOLID||
|
||||||
types[w.getBlockTypeIdAt(values[1], values[2], values[4])] == BlockType.UNKNOWN)
|
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;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user