mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2025-01-08 00:47:38 +01:00
minor cleanup
This commit is contained in:
parent
e5feeb1b75
commit
1d35e59c0e
@ -127,7 +127,7 @@ public class WorldFileData
|
|||||||
CoordXZ region = new CoordXZ(CoordXZ.chunkToRegion(x), CoordXZ.chunkToRegion(z));
|
CoordXZ region = new CoordXZ(CoordXZ.chunkToRegion(x), CoordXZ.chunkToRegion(z));
|
||||||
List<Boolean> regionChunks = this.getRegionData(region);
|
List<Boolean> regionChunks = this.getRegionData(region);
|
||||||
// Bukkit.getLogger().info("x: "+x+" z: "+z+" offset: "+coordToRegionOffset(x, z));
|
// Bukkit.getLogger().info("x: "+x+" z: "+z+" offset: "+coordToRegionOffset(x, z));
|
||||||
return regionChunks.get(coordToRegionOffset(x, z)).booleanValue();
|
return regionChunks.get(coordToRegionOffset(x, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find out if the chunk at the given coordinates has been fully generated.
|
// Find out if the chunk at the given coordinates has been fully generated.
|
||||||
@ -135,13 +135,14 @@ public class WorldFileData
|
|||||||
public boolean isChunkFullyGenerated(int x, int z)
|
public boolean isChunkFullyGenerated(int x, int z)
|
||||||
{ // if all adjacent chunks exist, it should be a safe enough bet that this one is fully generated
|
{ // if all adjacent chunks exist, it should be a safe enough bet that this one is fully generated
|
||||||
// For 1.13+, due to world gen changes, this is now effectively a 3 chunk radius requirement vs a 1 chunk radius
|
// For 1.13+, due to world gen changes, this is now effectively a 3 chunk radius requirement vs a 1 chunk radius
|
||||||
for (int xx = x-3; xx <= x+3; xx++) {
|
for (int xx = x-3; xx <= x+3; xx++)
|
||||||
for (int zz = z-3; zz <= z+3; zz++) {
|
{
|
||||||
if (!doesChunkExist(xx, zz)) {
|
for (int zz = z-3; zz <= z+3; zz++)
|
||||||
|
{
|
||||||
|
if (!doesChunkExist(xx, zz))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,9 +206,8 @@ public class WorldFileData
|
|||||||
for (int j = 0; j < 1024; j++)
|
for (int j = 0; j < 1024; j++)
|
||||||
{
|
{
|
||||||
// if timestamp is zero, it is protochunk (ignore it)
|
// if timestamp is zero, it is protochunk (ignore it)
|
||||||
if ((regionData.readInt() == 0) && data.get(j)) {
|
if ((regionData.readInt() == 0) && data.get(j))
|
||||||
data.set(j, false);
|
data.set(j, false);
|
||||||
}
|
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
regionData.close();
|
regionData.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user