mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-09-11 01:48:59 +02:00
Merge branch 'features/v5/internal-updates' of https://github.com/IntellectualSites/PlotSquared into features/v5/internal-updates
This commit is contained in:
commit
26b5ee7482
@ -290,10 +290,9 @@ public class BukkitChunkManager extends ChunkManager {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false);
|
final LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false);
|
||||||
if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z
|
if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z) {
|
||||||
&& PlotSquared.imp().getServerVersion()[1] == 13) {
|
AugmentedUtils.bypass(ignoreAugment,
|
||||||
AugmentedUtils
|
() -> queue.regenChunkSafe(chunk.getX(), chunk.getZ()));
|
||||||
.bypass(ignoreAugment, () -> queue.regenChunkSafe(chunk.getX(), chunk.getZ()));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
boolean checkX1 = false;
|
boolean checkX1 = false;
|
||||||
|
@ -7,7 +7,13 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
|||||||
import com.github.intellectualsites.plotsquared.plot.util.block.BasicLocalBlockQueue;
|
import com.github.intellectualsites.plotsquared.plot.util.block.BasicLocalBlockQueue;
|
||||||
import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil;
|
import com.github.intellectualsites.plotsquared.plot.util.world.BlockUtil;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
|
import com.sk89q.worldedit.EditSession;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import com.sk89q.worldedit.function.operation.Operations;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
@ -64,7 +70,18 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue {
|
|||||||
@Override public final void regenChunk(int x, int z) {
|
@Override public final void regenChunk(int x, int z) {
|
||||||
World worldObj = Bukkit.getWorld(getWorld());
|
World worldObj = Bukkit.getWorld(getWorld());
|
||||||
if (worldObj != null) {
|
if (worldObj != null) {
|
||||||
worldObj.regenerateChunk(x, z);
|
try {
|
||||||
|
worldObj.regenerateChunk(x, z);
|
||||||
|
} catch (UnsupportedOperationException e) {
|
||||||
|
com.sk89q.worldedit.world.World world = BukkitAdapter.adapt(worldObj);
|
||||||
|
try (EditSession editSession = WorldEdit.getInstance().getEditSessionFactory()
|
||||||
|
.getEditSession(world, -1);) {
|
||||||
|
CuboidRegion region =
|
||||||
|
new CuboidRegion(world, BlockVector3.at((x << 4), 0, (z << 4)),
|
||||||
|
BlockVector3.at((x << 4) + 15, 255, (z << 4) + 15));
|
||||||
|
world.regenerate(region, editSession);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
PlotSquared.debug("Error Regenerating Chunk");
|
PlotSquared.debug("Error Regenerating Chunk");
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
ChunkManager.chunkTask(pos1, pos2, new RunnableVal<int[]>() {
|
ChunkManager.chunkTask(pos1, pos2, new RunnableVal<int[]>() {
|
||||||
@Override public void run(int[] value) {
|
@Override public void run(int[] value) {
|
||||||
// If the chunk isn't near the edge and it isn't an augmented world we can just regen the whole chunk
|
// If the chunk isn't near the edge and it isn't an augmented world we can just regen the whole chunk
|
||||||
if (canRegen && (value[6] == 0) && PlotSquared.imp().getServerVersion()[1] == 13) {
|
if (canRegen && (value[6] == 0)) {
|
||||||
queue.regenChunk(value[0], value[1]);
|
queue.regenChunk(value[0], value[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user