Java 7 and make intellij happy

This commit is contained in:
Trent Hensler
2017-12-19 02:18:13 -08:00
parent ce132ed033
commit 3b644cd6c3
53 changed files with 222 additions and 285 deletions

View File

@@ -82,10 +82,7 @@ public class Worldguard {
World world = loc.getWorld();
Vector pt = toVector(loc);
if (wg.getRegionManager(world).getApplicableRegions(pt).size() > 0) {
return wg.canBuild(player, loc);
}
return false;
return wg.getRegionManager(world).getApplicableRegions(pt).size() > 0 && wg.canBuild(player, loc);
}
// Check for Regions in chunk the chunk
@@ -125,17 +122,13 @@ public class Worldguard {
RegionManager regionManager = wg.getRegionManager(world);
ProtectedCuboidRegion region = new ProtectedCuboidRegion("wgfactionoverlapcheck", minChunk, maxChunk);
Map<String, ProtectedRegion> allregions = regionManager.getRegions();
Collection<ProtectedRegion> allregionslist = new ArrayList<ProtectedRegion>(allregions.values());
Collection<ProtectedRegion> allregionslist = new ArrayList<>(allregions.values());
List<ProtectedRegion> overlaps;
boolean foundregions = false;
try {
overlaps = region.getIntersectingRegions(allregionslist);
if (overlaps == null || overlaps.isEmpty()) {
foundregions = false;
} else {
foundregions = true;
}
foundregions = overlaps != null && !overlaps.isEmpty();
} catch (Exception e) {
e.printStackTrace();
}