From c44d18f8f86478cef5f63bd0c20c91a59594c476 Mon Sep 17 00:00:00 2001 From: cmastudios Date: Sun, 27 Oct 2013 16:15:45 -0500 Subject: [PATCH] Ends war in middle east. Closes #693. --- .../java/com/tommytony/war/volume/Volume.java | 61 +++++++++++-------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/war/src/main/java/com/tommytony/war/volume/Volume.java b/war/src/main/java/com/tommytony/war/volume/Volume.java index fca0325..c4beea6 100644 --- a/war/src/main/java/com/tommytony/war/volume/Volume.java +++ b/war/src/main/java/com/tommytony/war/volume/Volume.java @@ -280,33 +280,42 @@ public class Volume { } } - private static final Material[] nonFloatingBlocks = { - Material.SIGN_POST, - Material.WALL_SIGN, - Material.IRON_DOOR, - Material.WOOD_DOOR, - Material.LADDER, - Material.YELLOW_FLOWER, - Material.RED_ROSE, - Material.RED_MUSHROOM, - Material.BROWN_MUSHROOM, - Material.SAPLING, - Material.TORCH, - Material.RAILS, - Material.STONE_BUTTON, - Material.STONE_PLATE, - Material.WOOD_PLATE, - Material.LEVER, - Material.REDSTONE, - Material.REDSTONE_TORCH_ON, - Material.REDSTONE_TORCH_OFF, - Material.CACTUS, - Material.SNOW, - Material.ICE - }; - public void clearBlocksThatDontFloat() { - this.replaceMaterials(nonFloatingBlocks, Material.AIR); + Validate.isTrue(this.hasTwoCorners(), "Incomplete volume"); + for (int x = this.getMinX(); x <= this.getMaxX(); x++) { + for (int y = this.getMinY(); y <= this.getMaxY(); y++) { + for (int z = this.getMinZ(); z <= this.getMaxZ(); z++) { + switch (this.getWorld().getBlockAt(x, y, z).getType()) { + case SIGN_POST: + case WALL_SIGN: + case IRON_DOOR: + case WOOD_DOOR: + case LADDER: + case YELLOW_FLOWER: + case RED_ROSE: + case RED_MUSHROOM: + case BROWN_MUSHROOM: + case SAPLING: + case TORCH: + case RAILS: + case STONE_BUTTON: + case STONE_PLATE: + case WOOD_PLATE: + case LEVER: + case REDSTONE: + case REDSTONE_TORCH_ON: + case REDSTONE_TORCH_OFF: + case CACTUS: + case SNOW: + case ICE: + this.getWorld().getBlockAt(x, y, z) + .setType(Material.AIR); + default: + break; + } + } + } + } } @Override