Let's try out the move protection, maybe this will work the first time

This commit is contained in:
graywolf336
2014-01-22 14:43:14 -06:00
parent fe1db3bb04
commit cb22fe9786
6 changed files with 92 additions and 1 deletions

View File

@ -7,8 +7,10 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.graywolf336.jail.JailMain;
import com.graywolf336.jail.Util;
/** Represents a Jail, contains the prisoners and the cells.
*
@ -314,4 +316,18 @@ public class Jail {
if (loc.getWorld().getName().equalsIgnoreCase(getTeleportIn().getWorld().getName())) return (double) Integer.MAX_VALUE;
else return loc.distance(getTeleportIn());
}
/**
* Returns whether the given location is inside this Jail.
*
* @param loc to check whether is inside this jail
* @return True if the location is in the jail, false if it isn't
*/
public boolean isInside(Location loc) {
if(loc.getWorld().getName().equalsIgnoreCase(world)) {
return Util.isInsideAB(loc.toVector(), new Vector(minX, minY, minZ), new Vector(maxX, maxY, maxZ));
}else {
return false;
}
}
}