Fix regenallroads extend (height)

This commit is contained in:
dordsor21 2019-01-16 01:55:45 +00:00
parent 61f8ceaaaa
commit 0e0a534620

View File

@ -5,7 +5,6 @@ import com.github.intellectualsites.plotsquared.plot.config.C;
import com.github.intellectualsites.plotsquared.plot.flag.FlagManager; import com.github.intellectualsites.plotsquared.plot.flag.FlagManager;
import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.listener.WEExtent; import com.github.intellectualsites.plotsquared.plot.listener.WEExtent;
import com.github.intellectualsites.plotsquared.plot.listener.WEManager;
import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.object.*;
import com.github.intellectualsites.plotsquared.plot.util.*; import com.github.intellectualsites.plotsquared.plot.util.*;
import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue;
@ -13,7 +12,6 @@ import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis; import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
@ -183,8 +181,8 @@ public abstract class HybridUtils {
@Override public void run(Object value) { @Override public void run(Object value) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Iterator<ChunkLoc> iterator = chunks.iterator(); Iterator<ChunkLoc> iterator = chunks.iterator();
while (System.currentTimeMillis() - start < 20 while (System.currentTimeMillis() - start < 20 && !chunks
&& !chunks.isEmpty()) { .isEmpty()) {
final ChunkLoc chunk = iterator.next(); final ChunkLoc chunk = iterator.next();
iterator.remove(); iterator.remove();
regenerateRoad(area, chunk, extend); regenerateRoad(area, chunk, extend);
@ -350,18 +348,23 @@ public abstract class HybridUtils {
if (condition) { if (condition) {
BaseBlock[] blocks = plotWorld.G_SCH.get(MathMan.pair(absX, absZ)); BaseBlock[] blocks = plotWorld.G_SCH.get(MathMan.pair(absX, absZ));
int minY = Math.min(plotWorld.PLOT_HEIGHT, plotWorld.ROAD_HEIGHT); int minY = Math.min(plotWorld.PLOT_HEIGHT, plotWorld.ROAD_HEIGHT);
int maxY = Math.max(extend, blocks.length);
if (blocks != null) { if (blocks != null) {
for (int y = 0; y < blocks.length; y++) { for (int y = 0; y < maxY; y++) {
if (blocks[y] != null) { if (y > blocks.length - 1) {
queue.setBlock(x + X + plotWorld.ROAD_OFFSET_X, minY + y,
z + Z + plotWorld.ROAD_OFFSET_Z, WEExtent.AIRBASE);
} else {
BaseBlock block = blocks[y]; BaseBlock block = blocks[y];
if (block != null) { if (block != null) {
queue queue
.setBlock(x + X + plotWorld.ROAD_OFFSET_X, minY + y, .setBlock(x + X + plotWorld.ROAD_OFFSET_X, minY + y,
z + Z + plotWorld.ROAD_OFFSET_Z, block); z + Z + plotWorld.ROAD_OFFSET_Z, block);
} else if (y <= extend) { } else {
queue queue
.setBlock(x + X + plotWorld.ROAD_OFFSET_X, minY + y, .setBlock(x + X + plotWorld.ROAD_OFFSET_X, minY + y,
z + Z + plotWorld.ROAD_OFFSET_Z, WEExtent.AIRBASE); z + Z + plotWorld.ROAD_OFFSET_Z,
WEExtent.AIRBASE);
} }
} }
} }