diff --git a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index 44d0d146..aaad1de5 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -16,6 +16,7 @@ import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.util.Vector; /* * MM"""""""`YM dP @@ -68,6 +69,9 @@ public class PlayerLocation { /** Is the player on ladder? */ private Boolean onLadder; + + /** Simple test if the exact position is passable. */ + private Boolean passable; /** The bounding box of the player. */ private AxisAlignedBB boundingBox; @@ -329,6 +333,15 @@ public class PlayerLocation { return typeId == Material.LADDER.getId() || typeId == Material.VINE.getId(); } + /** + * Simple at the spot passability test, no bounding boxes. + * @return + */ + public boolean isPassable(){ + if (passable == null) passable = BlockProperties.isPassable(getBlockAccess(), x, y, z, getTypeId()); + return passable; + } + /** * Sets the player location object. * @@ -501,4 +514,8 @@ public class PlayerLocation { return worldServer; } + public Vector getVector() { + return new Vector(x, y, z); + } + }