mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-09-15 01:05:34 +02:00
Potential fixes
This commit is contained in:
@@ -22,15 +22,15 @@ public abstract class BukkitPlotPopulator extends BlockPopulator {
|
||||
public int X;
|
||||
public int Z;
|
||||
public String worldname;
|
||||
private World world;
|
||||
private Chunk chunk;
|
||||
|
||||
@Override
|
||||
public void populate(final World world, final Random rand, final Chunk chunk) {
|
||||
try {
|
||||
this.world = world;
|
||||
this.chunk = chunk;
|
||||
worldname = world.getName();
|
||||
X = chunk.getX() << 4;
|
||||
Z = chunk.getZ() << 4;
|
||||
X = this.chunk.getX() << 4;
|
||||
Z = this.chunk.getZ() << 4;
|
||||
if (ChunkManager.FORCE_PASTE) {
|
||||
for (short x = 0; x < 16; x++) {
|
||||
for (short z = 0; z < 16; z++) {
|
||||
@@ -92,7 +92,7 @@ public abstract class BukkitPlotPopulator extends BlockPopulator {
|
||||
*/
|
||||
public void setBlock(final int x, final int y, final int z, final byte data) {
|
||||
if (data != 0) {
|
||||
world.getBlockAt(X + x, y, Z + z).setData(data);
|
||||
chunk.getBlock(x, y, z).setData(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public abstract class BukkitPlotPopulator extends BlockPopulator {
|
||||
* @param data
|
||||
*/
|
||||
public void setBlockAbs(final int x, final int y, final int z, final byte data) {
|
||||
world.getBlockAt(X + x, y, Z + z).setData(data);
|
||||
chunk.getBlock(x, y, z).setData(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -107,7 +107,6 @@ public class HybridPop extends BukkitPlotPopulator {
|
||||
|
||||
@Override
|
||||
public void populate(final World world, final RegionWrapper requiredRegion, final PseudoRandom random, final int cx, final int cz) {
|
||||
PS.get().getPlotManager(world.getName());
|
||||
PS.get().getPlotManager(world.getName());
|
||||
int sx = (short) ((X - plotworld.ROAD_OFFSET_X) % size);
|
||||
int sz = (short) ((Z - plotworld.ROAD_OFFSET_Z) % size);
|
||||
|
@@ -940,8 +940,18 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unloadChunk(final String world, final ChunkLoc loc, final boolean save, final boolean safe) {
|
||||
return BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe);
|
||||
public void unloadChunk(final String world, final ChunkLoc loc, final boolean save, final boolean safe) {
|
||||
if (!PS.get().isMainThread(Thread.currentThread())) {
|
||||
TaskManager.runTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe);
|
||||
}
|
||||
}
|
||||
|
||||
public static void swapChunk(final World world1, final World world2, final Chunk pos1, final Chunk pos2, final RegionWrapper r1, final RegionWrapper r2) {
|
||||
|
Reference in New Issue
Block a user