Reintroduce non-Air constraint to cannon explosion

This commit is contained in:
cnr 2016-04-17 16:25:44 -05:00
parent e375db5aec
commit 4227e24ae0

View File

@ -431,7 +431,8 @@ public class Cannon extends SiegeWeapon
List<Block> blocks = Stream.generate(() -> UtilAlg.getRandomLocation(event.getProjectile().getLocation(), 4 * getPowerLevel()).getBlock())
.limit(30) // Generate up to 30
.distinct() // distinct blocks,
.filter(block -> // filter for those unclaimed,
.filter(block -> block.getType() != Material.AIR) // filter for non-air
.filter(block -> // and blocks whose locations aren't blacklisted,
{
ClanTerritory claim = _siegeManager.getClansManager().getClanUtility().getClaim(block.getLocation());
return claim == null || _siegeManager.getClansManager().getBlacklist().allowed(claim.Owner);