handle case of server not having ChunkSnapshot#getBlockType
i.e. tell server owner to update and handle conservatively.
This commit is contained in:
parent
2a68fb9795
commit
fd0ddbf405
|
|
@ -32,40 +32,49 @@ class AutoExtendClaimTask implements Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private int getLowestBuiltY()
|
private int getLowestBuiltY()
|
||||||
{
|
{
|
||||||
int y = this.claim.getLesserBoundaryCorner().getBlockY();
|
int y = this.claim.getLesserBoundaryCorner().getBlockY();
|
||||||
|
|
||||||
if(this.yTooSmall(y)) return y;
|
if(this.yTooSmall(y)) return y;
|
||||||
|
|
||||||
for(ChunkSnapshot chunk : this.chunks)
|
try
|
||||||
{
|
{
|
||||||
Biome biome = chunk.getBiome(0, 0);
|
for(ChunkSnapshot chunk : this.chunks)
|
||||||
ArrayList<Material> playerBlockIDs = RestoreNatureProcessingTask.getPlayerBlocks(this.worldType, biome);
|
|
||||||
|
|
||||||
boolean ychanged = true;
|
|
||||||
while(!this.yTooSmall(y) && ychanged)
|
|
||||||
{
|
{
|
||||||
ychanged = false;
|
Biome biome = chunk.getBiome(0, 0);
|
||||||
for(int x = 0; x < 16; x++)
|
ArrayList<Material> 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);
|
for(int z = 0; z < 16; z++)
|
||||||
while(!this.yTooSmall(y) && playerBlockIDs.contains(blockType))
|
|
||||||
{
|
{
|
||||||
ychanged = true;
|
Material blockType = chunk.getBlockType(x, y, z);
|
||||||
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;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user