Merge branch 'v6' into feature/v6/json

# Conflicts:
#	Core/src/main/java/com/plotsquared/core/util/MainUtil.java
#	Core/src/main/java/com/plotsquared/core/util/OperationUtil.java
This commit is contained in:
Alexander Söderberg
2020-07-21 13:13:10 +02:00
10 changed files with 172 additions and 421 deletions

View File

@ -36,7 +36,6 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.MainUtil;
import com.sk89q.worldedit.math.BlockVector2;
import org.bukkit.World;
import org.bukkit.block.Biome;
@ -73,7 +72,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
this.populators = new ArrayList<>();
this.populators.add(new BlockStatePopulator(this.plotGenerator, this.plotAreaManager));
this.full = true;
MainUtil.initCache();
}
public BukkitPlotGenerator(final String world, final ChunkGenerator cg, @Nonnull final PlotAreaManager plotAreaManager) {
@ -86,7 +84,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
this.full = false;
this.platformGenerator = cg;
this.plotGenerator = new DelegatePlotGenerator(cg, world);
MainUtil.initCache();
}
@Override public void augment(PlotArea area) {

View File

@ -31,7 +31,7 @@ import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.ChunkUtil;
import com.plotsquared.core.util.PatternUtil;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.function.pattern.Pattern;
@ -149,12 +149,12 @@ public class GenChunk extends ScopedLocalBlockQueue {
}
private void storeCache(final int x, final int y, final int z, final BlockState id) {
int i = MainUtil.CACHE_I[y][x][z];
int i = y >> 4;
BlockState[] v = this.result[i];
if (v == null) {
this.result[i] = v = new BlockState[4096];
}
int j = MainUtil.CACHE_J[y][x][z];
int j = ChunkUtil.getJ(x, y, z);
v[j] = id;
}
@ -169,7 +169,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
}
@Override public BlockState getBlock(int x, int y, int z) {
int i = MainUtil.CACHE_I[y][x][z];
int i = y >> 4;
if (result == null) {
return BukkitBlockUtil.get(chunkData.getType(x, y, z));
}
@ -177,7 +177,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
if (array == null) {
return BlockTypes.AIR.getDefaultState();
}
int j = MainUtil.CACHE_J[y][x][z];
int j = ChunkUtil.getJ(x, y, z);
return array[j];
}