From be3c5418454f97a032017388e0a6d6eaa427587f Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 19 May 2013 11:59:47 +0200 Subject: [PATCH] code style. --- src/de/craftinc/gates/util/FloodUtil.java | 28 ++++++++--------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/de/craftinc/gates/util/FloodUtil.java b/src/de/craftinc/gates/util/FloodUtil.java index 555b567..8f9371d 100644 --- a/src/de/craftinc/gates/util/FloodUtil.java +++ b/src/de/craftinc/gates/util/FloodUtil.java @@ -38,23 +38,19 @@ public class FloodUtil Set blocks1 = getAirFloodBlocks(block, new HashSet(), exp1, frameBlockSearchLimit); Set blocks2 = getAirFloodBlocks(block, new HashSet(), exp2, frameBlockSearchLimit); - if (blocks1 == null && blocks2 == null) - { + if (blocks1 == null && blocks2 == null) { return null; } - if (blocks1 == null) - { + if (blocks1 == null) { return blocks2; } - if (blocks2 == null) - { + if (blocks2 == null) { return blocks1; } - if (blocks1.size() > blocks2.size()) - { + if (blocks1.size() > blocks2.size()) { return blocks2; } @@ -64,28 +60,25 @@ public class FloodUtil private static Set getAirFloodBlocks(Block startBlock, Set foundBlocks, Set expandFaces, int limit) { - if (foundBlocks == null) - { + if (foundBlocks == null) { return null; } - if (foundBlocks.size() > limit) - { + if (foundBlocks.size() > limit) { Plugin.log(Level.ALL, "exceeding gate size limit."); return null; } - if (foundBlocks.contains(startBlock)) + if (foundBlocks.contains(startBlock)) { return foundBlocks; + } - if (startBlock.getType() == Material.AIR || startBlock.getType() == Material.PORTAL) - { + if (startBlock.getType() == Material.AIR || startBlock.getType() == Material.PORTAL) { // ... We found a block :D ... foundBlocks.add(startBlock); // ... And flood away ! - for (BlockFace face : expandFaces) - { + for (BlockFace face : expandFaces) { Block potentialBlock = startBlock.getRelative(face); foundBlocks = getAirFloodBlocks(potentialBlock, foundBlocks, expandFaces, limit); } @@ -93,5 +86,4 @@ public class FloodUtil return foundBlocks; } - }