mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Compare commits
3 Commits
chore/v7/m
...
feature/v6
Author | SHA1 | Date | |
---|---|---|---|
6aa3f7c1b7 | |||
9f3507ea85 | |||
13d7357c85 |
@ -80,7 +80,8 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
|||||||
result.setBiome(x, z, BukkitAdapter.adapt(biome));
|
result.setBiome(x, z, BukkitAdapter.adapt(biome));
|
||||||
}
|
}
|
||||||
|
|
||||||
//do not annotate with Override until we discontinue support for 1.4.4
|
//do not annotate with Override until we discontinue support for 1.4.4 (we no longer support 1.4.4)
|
||||||
|
@Override
|
||||||
public void setBiome(int x, int y, int z, @NonNull Biome biome) {
|
public void setBiome(int x, int y, int z, @NonNull Biome biome) {
|
||||||
result.setBiome(x, z, BukkitAdapter.adapt(biome));
|
result.setBiome(x, z, BukkitAdapter.adapt(biome));
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ 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;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Container;
|
import org.bukkit.block.Container;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@ -266,7 +267,13 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
} catch (WorldEditException ignored) {
|
} catch (WorldEditException ignored) {
|
||||||
// Fallback to not so nice method
|
// Fallback to not so nice method
|
||||||
BlockData blockData = BukkitAdapter.adapt(block);
|
BlockData blockData = BukkitAdapter.adapt(block);
|
||||||
Block existing = getBukkitWorld().getBlockAt(x, y, z);
|
Block existing;
|
||||||
|
// Assume a chunk object has been given only when it should have been.
|
||||||
|
if (getChunkObject() instanceof Chunk chunkObject) {
|
||||||
|
existing = chunkObject.getBlock(x & 15, y, z & 15);
|
||||||
|
} else {
|
||||||
|
existing = getBukkitWorld().getBlockAt(x, y, z);
|
||||||
|
}
|
||||||
final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData());
|
final BlockState existingBaseBlock = BukkitAdapter.adapt(existing.getBlockData());
|
||||||
if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) {
|
if (BukkitBlockUtil.get(existing).equals(existingBaseBlock) && existing.getBlockData().matches(blockData)) {
|
||||||
return;
|
return;
|
||||||
|
@ -889,8 +889,8 @@ public class PlotSquared {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
LOGGER.info("| generator: {}>{}", baseGenerator, areaGen);
|
LOGGER.info("| generator: {}>{}", baseGenerator, areaGen);
|
||||||
LOGGER.info("| plot world: {}", pa);
|
LOGGER.info("| plot world: {}", pa.getClass().getCanonicalName());
|
||||||
LOGGER.info("| manager: {}", pa);
|
LOGGER.info("| manager: {}", pa.getPlotManager().getClass().getCanonicalName());
|
||||||
LOGGER.info("Note: Area created for cluster '{}' (invalid or old configuration?)", name);
|
LOGGER.info("Note: Area created for cluster '{}' (invalid or old configuration?)", name);
|
||||||
areaGen.getPlotGenerator().initialize(pa);
|
areaGen.getPlotGenerator().initialize(pa);
|
||||||
areaGen.augment(pa);
|
areaGen.augment(pa);
|
||||||
@ -906,6 +906,13 @@ public class PlotSquared {
|
|||||||
throw new IllegalArgumentException("Invalid Generator: " + gen_string);
|
throw new IllegalArgumentException("Invalid Generator: " + gen_string);
|
||||||
}
|
}
|
||||||
PlotArea pa = areaGen.getPlotGenerator().getNewPlotArea(world, null, null, null);
|
PlotArea pa = areaGen.getPlotGenerator().getNewPlotArea(world, null, null, null);
|
||||||
|
LOGGER.info("- generator: {}>{}", baseGenerator, areaGen);
|
||||||
|
LOGGER.info("- plot world: {}", pa.getClass().getCanonicalName());
|
||||||
|
LOGGER.info("- plot area manager: {}", pa.getPlotManager().getClass().getCanonicalName());
|
||||||
|
if (!this.worldConfiguration.contains(path)) {
|
||||||
|
this.worldConfiguration.createSection(path);
|
||||||
|
worldSection = this.worldConfiguration.getConfigurationSection(path);
|
||||||
|
}
|
||||||
pa.saveConfiguration(worldSection);
|
pa.saveConfiguration(worldSection);
|
||||||
pa.loadDefaultConfiguration(worldSection);
|
pa.loadDefaultConfiguration(worldSection);
|
||||||
try {
|
try {
|
||||||
@ -913,9 +920,6 @@ public class PlotSquared {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
LOGGER.info("- generator: {}>{}", baseGenerator, areaGen);
|
|
||||||
LOGGER.info("- plot world: {}", pa);
|
|
||||||
LOGGER.info("- plot area manager: {}", pa.getPlotManager());
|
|
||||||
areaGen.getPlotGenerator().initialize(pa);
|
areaGen.getPlotGenerator().initialize(pa);
|
||||||
areaGen.augment(pa);
|
areaGen.augment(pa);
|
||||||
addPlotArea(pa);
|
addPlotArea(pa);
|
||||||
|
@ -143,7 +143,8 @@ public abstract class QueueCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a chunk object (e.g. the Bukkit Chunk object) to the queue
|
* Set a chunk object (e.g. the Bukkit Chunk object) to the queue. This will be used as fallback in case of WNA failure.
|
||||||
|
* Should ONLY be used in specific cases (i.e. generation, where a chunk is being populated)
|
||||||
*
|
*
|
||||||
* @param chunkObject chunk object. Usually the implementation-specific chunk (e.g. bukkit Chunk)
|
* @param chunkObject chunk object. Usually the implementation-specific chunk (e.g. bukkit Chunk)
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user