Protect against block breaking and block placing in jails
Unless the player has admin permission. This does not include the penalties as those will be done in a future commit. This also has a little better performance on the block placing and breaking events, if these checks are disabled.
This commit is contained in:
@ -111,6 +111,22 @@ public class JailManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the jail which this location is in, will return null if none exist.
|
||||
*
|
||||
* @param loc to get the jail from
|
||||
* @return The jail this block is in, null if no jail found.
|
||||
*/
|
||||
public Jail getJailFromLocation(Location loc) {
|
||||
for(Jail j : jails.values()) {
|
||||
if(Util.isInsideAB(loc.toVector(), j.getMinPoint().toVector(), j.getMaxPoint().toVector())) {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the given name for a {@link Jail} is valid, returns true if it is a valid jail.
|
||||
*
|
||||
|
Reference in New Issue
Block a user