getSchematic feedback if selection contains non-existent chunk

This commit is contained in:
boy0001 2015-03-31 21:05:40 +11:00
parent b6d86ec1e1
commit 86a7974f84
3 changed files with 7 additions and 2 deletions

View File

@ -67,6 +67,10 @@ public class SQLManager implements AbstractDB {
// Private Final // Private Final
private Connection connection; private Connection connection;
public Connection getConnection() {
return this.connection;
}
/** /**
* Constructor * Constructor
* *

View File

@ -61,12 +61,13 @@ public class BukkitSchematicHandler extends SchematicHandler {
for (j = (pos1.getZ() / 16) * 16; j < (16 + ((pos2.getZ() / 16) * 16)); j += 16) { for (j = (pos1.getZ() / 16) * 16; j < (16 + ((pos2.getZ() / 16) * 16)); j += 16) {
boolean result = ChunkManager.manager.loadChunk(world, new ChunkLoc(i, j)); boolean result = ChunkManager.manager.loadChunk(world, new ChunkLoc(i, j));
if (!result) { if (!result) {
System.out.print("&cIllegal selection. Cannot save non-existent chunk at " + (i / 16) + ", " + (j / 16));
return null; return null;
} }
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
PlotSquared.log("&7 - Cannot save: corrupt chunk at " + (i / 16) + ", " + (j / 16)); PlotSquared.log("&cIllegal selection. Cannot save corrupt chunk at " + (i / 16) + ", " + (j / 16));
return null; return null;
} }
final int width = (pos2.getX() - pos1.getX()) + 1; final int width = (pos2.getX() - pos1.getX()) + 1;