mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Recover from world gen error.
This commit is contained in:
parent
b524d5fcfe
commit
9682e2914c
@ -26,38 +26,43 @@ public abstract class BukkitPlotPopulator extends BlockPopulator {
|
||||
|
||||
@Override
|
||||
public void populate(final World world, final Random rand, final Chunk chunk) {
|
||||
this.world = world;
|
||||
worldname = world.getName();
|
||||
X = chunk.getX() << 4;
|
||||
Z = chunk.getZ() << 4;
|
||||
if (ChunkManager.FORCE_PASTE) {
|
||||
for (short x = 0; x < 16; x++) {
|
||||
for (short z = 0; z < 16; z++) {
|
||||
final PlotLoc loc = new PlotLoc((short) (X + x), (short) (Z + z));
|
||||
final HashMap<Short, Byte> blocks = ChunkManager.GENERATE_DATA.get(loc);
|
||||
for (final Entry<Short, Byte> entry : blocks.entrySet()) {
|
||||
setBlock(x, entry.getKey(), z, entry.getValue());
|
||||
try {
|
||||
this.world = world;
|
||||
worldname = world.getName();
|
||||
X = chunk.getX() << 4;
|
||||
Z = chunk.getZ() << 4;
|
||||
if (ChunkManager.FORCE_PASTE) {
|
||||
for (short x = 0; x < 16; x++) {
|
||||
for (short z = 0; z < 16; z++) {
|
||||
final PlotLoc loc = new PlotLoc((short) (X + x), (short) (Z + z));
|
||||
final HashMap<Short, Byte> blocks = ChunkManager.GENERATE_DATA.get(loc);
|
||||
for (final Entry<Short, Byte> entry : blocks.entrySet()) {
|
||||
setBlock(x, entry.getKey(), z, entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
populate(world, ChunkManager.CURRENT_PLOT_CLEAR, random, X, Z);
|
||||
if (ChunkManager.CURRENT_PLOT_CLEAR != null) {
|
||||
PlotLoc loc;
|
||||
for (final Entry<PlotLoc, HashMap<Short, Byte>> entry : ChunkManager.GENERATE_DATA.entrySet()) {
|
||||
for (final Entry<Short, Byte> entry2 : entry.getValue().entrySet()) {
|
||||
loc = entry.getKey();
|
||||
final int xx = loc.x - X;
|
||||
final int zz = loc.z - Z;
|
||||
if ((xx >= 0) && (xx < 16)) {
|
||||
if ((zz >= 0) && (zz < 16)) {
|
||||
setBlock(xx, entry2.getKey(), zz, entry2.getValue());
|
||||
populate(world, ChunkManager.CURRENT_PLOT_CLEAR, random, X, Z);
|
||||
if (ChunkManager.CURRENT_PLOT_CLEAR != null) {
|
||||
PlotLoc loc;
|
||||
for (final Entry<PlotLoc, HashMap<Short, Byte>> entry : ChunkManager.GENERATE_DATA.entrySet()) {
|
||||
for (final Entry<Short, Byte> entry2 : entry.getValue().entrySet()) {
|
||||
loc = entry.getKey();
|
||||
final int xx = loc.x - X;
|
||||
final int zz = loc.z - Z;
|
||||
if ((xx >= 0) && (xx < 16)) {
|
||||
if ((zz >= 0) && (zz < 16)) {
|
||||
setBlock(xx, entry2.getKey(), zz, entry2.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void populate(final World world, final RegionWrapper requiredRegion, final PseudoRandom random, final int cx, final int cz);
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user