handle case of server not having ChunkSnapshot#getBlockType

i.e. tell server owner to update and handle conservatively.
This commit is contained in:
RoboMWM 2017-12-20 09:57:12 -08:00
parent 2a68fb9795
commit fd0ddbf405

View File

@ -32,13 +32,14 @@ class AutoExtendClaimTask implements Runnable
}
}
@SuppressWarnings("deprecation")
private int getLowestBuiltY()
{
int y = this.claim.getLesserBoundaryCorner().getBlockY();
if(this.yTooSmall(y)) return y;
try
{
for(ChunkSnapshot chunk : this.chunks)
{
Biome biome = chunk.getBiome(0, 0);
@ -66,6 +67,14 @@ class AutoExtendClaimTask implements Runnable
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;
}