From 8c9c45acbb0a99f411ed29718ecf037e80706906 Mon Sep 17 00:00:00 2001 From: headhunter45 Date: Sun, 19 Feb 2012 03:55:08 -0800 Subject: [PATCH] v0.4.5 --- .../metropolis/MetropolisPlugin.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Metropolis/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java b/Metropolis/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java index 65c7cc3..cafd413 100644 --- a/Metropolis/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java +++ b/Metropolis/src/main/java/com/majinnaibu/bukkitplugins/metropolis/MetropolisPlugin.java @@ -160,7 +160,7 @@ public class MetropolisPlugin extends JavaPlugin { block.setTypeId(floorMaterial); for(int i=0; i= -ring; col--){ if(!isBlockOccupied(row, col)){ - return new Cuboid(getPlotMin(row, col), getPlotMax(row, col)); + if(row != 0 || col != 0){ + log.info(String.format("row: %d, col: %d", row, col)); + return new Cuboid(getPlotMin(row, col), getPlotMax(row, col)); + } } } col = -ring; - for(col = ring; col > -ring; col--){ + for(row = ring; row > -ring; row--){ if(!isBlockOccupied(row, col)){ - return new Cuboid(getPlotMin(row, col), getPlotMax(row, col)); + if(row != 0 || col != 0){ + log.info(String.format("row: %d, col: %d", row, col)); + return new Cuboid(getPlotMin(row, col), getPlotMax(row, col)); + } } } ring++; } + log.info(String.format("row: %d, col: %d", row, col)); return new Cuboid(getPlotMin(row, col), getPlotMax(row, col)); } @@ -295,14 +308,16 @@ public class MetropolisPlugin extends JavaPlugin { } private int calculateCitySize() { - int iSize = 0; + int iSize = 3; for(PlayerHome home: _occupiedHomes){ int plotCol=Math.abs(getPlotXFromMin(home.getCuboid())); int plotRow=Math.abs(getPlotZFromMin(home.getCuboid())); + log.info(String.format("col: %d, row: %d, iSize: %d", plotCol, plotRow, iSize)); iSize = Math.max(Math.max(plotRow*2+1, plotCol*2+1), iSize); } + log.info(String.format("City size is %d", iSize)); return iSize; }