Indicate limits when a MaxChangedBlocksException is thrown by WorldEdit

This commit is contained in:
Thijs Wiefferink 2016-11-07 13:52:54 +01:00
parent 0950452692
commit 8a7e2ba5c2
2 changed files with 6 additions and 10 deletions

View File

@ -41,11 +41,9 @@ public class WorldEditHandler5 extends WorldEditInterface {
}
clipBoard.place(editSession, origin, false);
} catch(MaxChangedBlocksException e) {
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of " + regionInterface.getName());
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of "+regionInterface.getName()+", limit in exception: "+e.getBlockLimit()+", limit passed by AreaShop: "+pluginInterface.getConfig().getInt("maximumBlocks"));
result = false;
} catch(DataException e) {
otherException = e;
} catch(IOException e) {
} catch(DataException|IOException e) {
otherException = e;
}
if(otherException != null) {
@ -72,9 +70,7 @@ public class WorldEditHandler5 extends WorldEditInterface {
Exception otherException = null;
try {
SchematicFormat.MCEDIT.save(clipboard, file);
} catch (DataException e) {
otherException = e;
} catch (IOException e) {
} catch(DataException|IOException e) {
otherException = e;
}
if(otherException != null) {

View File

@ -74,7 +74,7 @@ public class WorldEditHandler6 extends WorldEditInterface {
.build();
Operations.completeLegacy(operation);
} catch (MaxChangedBlocksException e) {
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of " + regionInterface.getName());
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of "+regionInterface.getName()+", limit in exception: "+e.getBlockLimit()+", limit passed by AreaShop: "+pluginInterface.getConfig().getInt("maximumBlocks"));
return false;
} catch (IOException e) {
pluginInterface.getLogger().warning("An error occured while restoring schematic of " + regionInterface.getName() + ", enable debug to see the complete stacktrace");
@ -108,8 +108,8 @@ public class WorldEditHandler6 extends WorldEditInterface {
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, new CuboidRegion(world, regionInterface.getRegion().getMinimumPoint(), regionInterface.getRegion().getMaximumPoint()), clipboard, regionInterface.getRegion().getMinimumPoint());
try {
Operations.completeLegacy(copy);
} catch (MaxChangedBlocksException e1) {
pluginInterface.getLogger().warning("Exeeded the block limit while saving schematic of " + regionInterface.getName());
} catch(MaxChangedBlocksException e) {
pluginInterface.getLogger().warning("Exeeded the block limit while saving schematic of "+regionInterface.getName()+", limit in exception: "+e.getBlockLimit()+", limit passed by AreaShop: "+pluginInterface.getConfig().getInt("maximumBlocks"));
return false;
}
Closer closer = Closer.create();