mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
Reformat it all.
This commit is contained in:
@ -32,12 +32,13 @@ import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.queue.LocalBlockQueue;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
import java.util.Random;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
final class BlockStatePopulator extends BlockPopulator {
|
||||
|
||||
private final IndependentPlotGenerator plotGenerator;
|
||||
@ -47,13 +48,15 @@ final class BlockStatePopulator extends BlockPopulator {
|
||||
this.plotGenerator = plotGenerator;
|
||||
}
|
||||
|
||||
@Override public void populate(@NotNull final World world, @NotNull final Random random,
|
||||
@Override
|
||||
public void populate(@NotNull final World world, @NotNull final Random random,
|
||||
@NotNull final Chunk source) {
|
||||
if (this.queue == null) {
|
||||
this.queue = GlobalBlockQueue.IMP.getNewQueue(world.getName(), false);
|
||||
}
|
||||
final PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
final ChunkWrapper wrap = new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
|
||||
final ChunkWrapper wrap =
|
||||
new ChunkWrapper(area.getWorldName(), source.getX(), source.getZ());
|
||||
final ScopedLocalBlockQueue chunk = this.queue.getForChunk(wrap.x, wrap.z);
|
||||
if (this.plotGenerator.populateChunk(chunk, area)) {
|
||||
this.queue.flush();
|
||||
|
@ -25,17 +25,17 @@
|
||||
*/
|
||||
package com.plotsquared.bukkit.generator;
|
||||
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.bukkit.queue.GenChunk;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.generator.GeneratorWrapper;
|
||||
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
||||
import com.plotsquared.core.generator.SingleWorldGenerator;
|
||||
import com.plotsquared.core.location.ChunkWrapper;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.generator.SingleWorldGenerator;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
import com.plotsquared.core.util.ChunkManager;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.World;
|
||||
@ -103,9 +103,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
return this.platformGenerator;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
|
||||
@Override @NotNull public List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
|
||||
try {
|
||||
if (!this.loaded) {
|
||||
String name = world.getName();
|
||||
@ -149,8 +147,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
return toAdd;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Override @NotNull
|
||||
public ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z,
|
||||
@NotNull BiomeGrid biome) {
|
||||
|
||||
@ -203,8 +200,9 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
}
|
||||
PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
if (area == null && (area = PlotSquared.get().getPlotArea(this.levelName, null)) == null) {
|
||||
throw new IllegalStateException("Cannot regenerate chunk that does not belong to a plot area."
|
||||
+ " Location: " + loc + ", world: " + world);
|
||||
throw new IllegalStateException(
|
||||
"Cannot regenerate chunk that does not belong to a plot area." + " Location: " + loc
|
||||
+ ", world: " + world);
|
||||
}
|
||||
try {
|
||||
this.plotGenerator.generateChunk(result, area);
|
||||
@ -215,8 +213,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
ChunkManager.postProcessChunk(loc, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSpawn(@NotNull final World world, final int x, final int z) {
|
||||
@Override public boolean canSpawn(@NotNull final World world, final int x, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,9 @@ import com.plotsquared.core.generator.IndependentPlotGenerator;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import java.util.Random;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
@ -42,6 +41,8 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Range;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
||||
|
||||
private final ChunkGenerator chunkGenerator;
|
||||
@ -71,7 +72,8 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
||||
Random random = new Random(MathMan.pair((short) chunkX, (short) chunkZ));
|
||||
try {
|
||||
ChunkGenerator.BiomeGrid grid = new ChunkGenerator.BiomeGrid() {
|
||||
@Override public void setBiome(@Range(from = 0, to = 15) int x,
|
||||
@Override
|
||||
public void setBiome(@Range(from = 0, to = 15) int x,
|
||||
@Range(from = 0, to = 15) int z, @NotNull Biome biome) {
|
||||
result.setBiome(x, z, BukkitAdapter.adapt(biome));
|
||||
}
|
||||
@ -86,8 +88,7 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
||||
return Biome.FOREST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Biome getBiome(int x, int y, int z) {
|
||||
@Override public @NotNull Biome getBiome(int x, int y, int z) {
|
||||
return Biome.FOREST;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user