Question on api
batkins62 opened this issue ยท 2 comments
In my plugin i referenced pstone protection regions by creating a method canBuild(Player player, Block block) then i want to (in the method) return true if player can build at block in a pstone region.
looking through your plugin i dont see any method that can help me, i skimmed through forcefieldmanager fairly thoroughly and didnt see anything that returns boolean for player and block... though, maybe i missed it, any suggestions?
/**
* If the block is ps protected
*
* @param block
* @return
*/
private boolean canBuild(Player player, Block block)
{
if (ps != null)
{
Field field= ps.getForceFieldManager().getEnabledSourceField(block.getLocation(), FieldFlag.PREVENT_DESTROY);
if (field != null)
{
boolean allowed = ps.getForceFieldManager().isApplyToAllowed(field, player.getName());
if (!allowed || field.hasFlag(FieldFlag.APPLY_TO_ALL))
{
return false;
}
}
}
return true;
}