package dk.thoerup.bukkit.hoeruputils.secretdoor; import java.util.Map; import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; class Door { final static int EAST = 0; final static int WEST = 1; final static int NORTH = 2; final static int SOUTH = 3; Location leftUpper; Location blocks[][]; // [width][height] - [0][0] == leftUpper int material; int direction; int width; int height; public Door(Block sign, int width, int height, DoorStorage store) throws ConflictingDoorException{ leftUpper = sign.getLocation().clone(); this.width = width; this.height = height; blocks = new Location[width][height]; direction = sign.getData() - 2; switch ( sign.getData() ) { case 2: //facing east leftUpper.setZ( leftUpper.getZ() + 1 ); break; case 3: //facing west leftUpper.setZ( leftUpper.getZ() - 1 ); break; case 4: //facing north leftUpper.setX( leftUpper.getX() + 1); break; case 5: //facing south leftUpper.setX( leftUpper.getX() - 1); break; } material = leftUpper.getBlock().getTypeId(); loadBlocks(); for (int w=0; w map) { for (int w=0; w map) { for (int w=0; w