diff --git a/src/me/ryanhamshire/GriefPrevention/AutoExtendClaimTask.java b/src/me/ryanhamshire/GriefPrevention/AutoExtendClaimTask.java index 708caeb..4f3a31d 100644 --- a/src/me/ryanhamshire/GriefPrevention/AutoExtendClaimTask.java +++ b/src/me/ryanhamshire/GriefPrevention/AutoExtendClaimTask.java @@ -32,40 +32,49 @@ class AutoExtendClaimTask implements Runnable } } - @SuppressWarnings("deprecation") private int getLowestBuiltY() { int y = this.claim.getLesserBoundaryCorner().getBlockY(); if(this.yTooSmall(y)) return y; - - for(ChunkSnapshot chunk : this.chunks) + + try { - Biome biome = chunk.getBiome(0, 0); - ArrayList playerBlockIDs = RestoreNatureProcessingTask.getPlayerBlocks(this.worldType, biome); - - boolean ychanged = true; - while(!this.yTooSmall(y) && ychanged) + for(ChunkSnapshot chunk : this.chunks) { - ychanged = false; - for(int x = 0; x < 16; x++) + Biome biome = chunk.getBiome(0, 0); + ArrayList playerBlockIDs = RestoreNatureProcessingTask.getPlayerBlocks(this.worldType, biome); + + boolean ychanged = true; + while(!this.yTooSmall(y) && ychanged) { - for(int z = 0; z < 16; z++) + ychanged = false; + for(int x = 0; x < 16; x++) { - Material blockType = chunk.getBlockType(x, y, z); - while(!this.yTooSmall(y) && playerBlockIDs.contains(blockType)) + for(int z = 0; z < 16; z++) { - ychanged = true; - blockType = chunk.getBlockType(x, --y, z); + Material blockType = chunk.getBlockType(x, y, z); + while(!this.yTooSmall(y) && playerBlockIDs.contains(blockType)) + { + ychanged = true; + blockType = chunk.getBlockType(x, --y, z); + } + + if(this.yTooSmall(y)) return y; } - - if(this.yTooSmall(y)) return y; } } + + if(this.yTooSmall(y)) return y; } - - if(this.yTooSmall(y)) return y; } + catch (NoSuchMethodError e) + { + GriefPrevention.instance.getLogger().severe("You are running an outdated build of Craftbukkit/Spigot/Paper. Please update."); + GriefPrevention.instance.AddLogEntry("Claim " + claim.getID() + " was auto-extended to maximum depth.", CustomLogEntryTypes.Debug, false); + return GriefPrevention.instance.config_claims_maxDepth; + } + return y; }