mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2025-02-19 01:41:30 +01:00
Performs nether
This commit is contained in:
parent
e6026dca4f
commit
739b1d5eab
@ -47,7 +47,7 @@ public class Boxed extends GameModeAddon {
|
|||||||
.type(Type.WORLD_SETTING)
|
.type(Type.WORLD_SETTING)
|
||||||
.defaultSetting(true)
|
.defaultSetting(true)
|
||||||
.build();
|
.build();
|
||||||
|
private static final String SEED = "seed";
|
||||||
private static final String NETHER = "_nether";
|
private static final String NETHER = "_nether";
|
||||||
private static final String THE_END = "_the_end";
|
private static final String THE_END = "_the_end";
|
||||||
|
|
||||||
@ -56,8 +56,10 @@ public class Boxed extends GameModeAddon {
|
|||||||
private BoxedChunkGenerator chunkGenerator;
|
private BoxedChunkGenerator chunkGenerator;
|
||||||
private final Config<Settings> configObject = new Config<>(this, Settings.class);
|
private final Config<Settings> configObject = new Config<>(this, Settings.class);
|
||||||
private AdvancementsManager advManager;
|
private AdvancementsManager advManager;
|
||||||
private ChunkGenerator netherChunkGenerator;
|
private BoxedChunkGenerator netherChunkGenerator;
|
||||||
private World seedWorld;
|
private World seedWorld;
|
||||||
|
private World seedWorldNether;
|
||||||
|
private World seedWorldEnd;
|
||||||
private BiomeProvider boxedBiomeProvider;
|
private BiomeProvider boxedBiomeProvider;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -85,6 +87,7 @@ public class Boxed extends GameModeAddon {
|
|||||||
}
|
}
|
||||||
// Initialize the Generator because createWorlds will be run after onLoad
|
// Initialize the Generator because createWorlds will be run after onLoad
|
||||||
this.chunkGenerator = new BoxedChunkGenerator(this);
|
this.chunkGenerator = new BoxedChunkGenerator(this);
|
||||||
|
this.netherChunkGenerator = new BoxedChunkGenerator(this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,14 +150,16 @@ public class Boxed extends GameModeAddon {
|
|||||||
// Create seed world
|
// Create seed world
|
||||||
log("Creating Boxed Seed world ...");
|
log("Creating Boxed Seed world ...");
|
||||||
seedWorld = WorldCreator
|
seedWorld = WorldCreator
|
||||||
.name("seed")
|
.name(SEED)
|
||||||
.generator(new BoxedSeedChunkGenerator(this))
|
.generator(new BoxedSeedChunkGenerator(this, Environment.NORMAL))
|
||||||
.environment(Environment.NORMAL)
|
.environment(Environment.NORMAL)
|
||||||
.generateStructures(false)
|
|
||||||
.seed(getSettings().getSeed())
|
.seed(getSettings().getSeed())
|
||||||
.createWorld();
|
.createWorld();
|
||||||
seedWorld.setDifficulty(Difficulty.PEACEFUL); // No damage wanted in this world.
|
seedWorld.setDifficulty(Difficulty.PEACEFUL); // No damage wanted in this world.
|
||||||
saveChunks(seedWorld);
|
saveChunks(seedWorld);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Unload seed world
|
// Unload seed world
|
||||||
//Bukkit.getServer().unloadWorld("seed", false);
|
//Bukkit.getServer().unloadWorld("seed", false);
|
||||||
String worldName = settings.getWorldName().toLowerCase();
|
String worldName = settings.getWorldName().toLowerCase();
|
||||||
@ -165,14 +170,25 @@ public class Boxed extends GameModeAddon {
|
|||||||
|
|
||||||
// Create the world if it does not exist
|
// Create the world if it does not exist
|
||||||
islandWorld = getWorld(worldName, World.Environment.NORMAL);
|
islandWorld = getWorld(worldName, World.Environment.NORMAL);
|
||||||
/*
|
|
||||||
// Make the nether if it does not exist
|
// Make the nether if it does not exist
|
||||||
if (settings.isNetherGenerate()) {
|
if (settings.isNetherGenerate()) {
|
||||||
|
log("Creating Boxed Seed Nether world ...");
|
||||||
|
seedWorldNether = WorldCreator
|
||||||
|
.name(SEED + NETHER)
|
||||||
|
.generator(new BoxedSeedChunkGenerator(this, Environment.NETHER))
|
||||||
|
.environment(Environment.NETHER)
|
||||||
|
.seed(getSettings().getSeed())
|
||||||
|
.createWorld();
|
||||||
|
seedWorldNether.setDifficulty(Difficulty.PEACEFUL); // No damage wanted in this world.
|
||||||
|
saveChunks(seedWorldNether);
|
||||||
|
|
||||||
if (getServer().getWorld(worldName + NETHER) == null) {
|
if (getServer().getWorld(worldName + NETHER) == null) {
|
||||||
log("Creating Boxed's Nether...");
|
log("Creating Boxed's Nether...");
|
||||||
}
|
}
|
||||||
netherWorld = settings.isNetherIslands() ? getWorld(worldName, World.Environment.NETHER) : getWorld(worldName, World.Environment.NETHER);
|
netherWorld = getWorld(worldName, World.Environment.NETHER);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
// Make the end if it does not exist
|
// Make the end if it does not exist
|
||||||
if (settings.isEndGenerate()) {
|
if (settings.isEndGenerate()) {
|
||||||
if (getServer().getWorld(worldName + THE_END) == null) {
|
if (getServer().getWorld(worldName + THE_END) == null) {
|
||||||
@ -184,6 +200,19 @@ public class Boxed extends GameModeAddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveChunks(World seedWorld) {
|
private void saveChunks(World seedWorld) {
|
||||||
|
BoxedChunkGenerator gen;
|
||||||
|
int startX = 0;
|
||||||
|
int startZ = 0;
|
||||||
|
if (seedWorld.getEnvironment().equals(Environment.NORMAL)) {
|
||||||
|
gen = chunkGenerator;
|
||||||
|
startX = this.settings.getSeedX() >> 4;
|
||||||
|
startZ = this.settings.getSeedZ() >> 4;
|
||||||
|
} else {
|
||||||
|
gen = netherChunkGenerator;
|
||||||
|
startX = this.settings.getNetherSeedX() >> 4;
|
||||||
|
startZ = this.settings.getNetherSeedZ() >> 4;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert to chunks
|
// Convert to chunks
|
||||||
int size = (int)(this.getSettings().getIslandDistance() / 16D);
|
int size = (int)(this.getSettings().getIslandDistance() / 16D);
|
||||||
double percent = size * 4D * size;
|
double percent = size * 4D * size;
|
||||||
@ -191,13 +220,13 @@ public class Boxed extends GameModeAddon {
|
|||||||
int last = 0;
|
int last = 0;
|
||||||
for (int x = -size; x <= size; x ++) {
|
for (int x = -size; x <= size; x ++) {
|
||||||
for (int z = -size; z <= size; z++) {
|
for (int z = -size; z <= size; z++) {
|
||||||
ChunkSnapshot chunk = seedWorld.getChunkAt(this.settings.getChunkX() + x, this.settings.getChunkZ() + z).getChunkSnapshot(true, true, false);
|
ChunkSnapshot chunk = seedWorld.getChunkAt(startX + x, startZ + z).getChunkSnapshot(true, true, false);
|
||||||
this.chunkGenerator.setChunk(x, z, chunk);
|
gen.setChunk(x, z, chunk);
|
||||||
count++;
|
count++;
|
||||||
int p = (int) (count / percent * 100);
|
int p = (int) (count / percent * 100);
|
||||||
if (p % 10 == 0 && p != last) {
|
if (p % 10 == 0 && p != last) {
|
||||||
last = p;
|
last = p;
|
||||||
this.log("Storing seed chunks. " + p + "% done");
|
this.log("Storing seed chunks for " + seedWorld.getEnvironment() + " " + p + "% done");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -205,11 +234,16 @@ public class Boxed extends GameModeAddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the chunkGenerator
|
* Get the chunk generator for a Boxed world
|
||||||
|
* @param env - nether, normal, or end
|
||||||
|
* @return the chunkGenerator for the environment
|
||||||
*/
|
*/
|
||||||
public BoxedChunkGenerator getChunkGenerator() {
|
public BoxedChunkGenerator getChunkGenerator(Environment env) {
|
||||||
|
if (env.equals(Environment.NORMAL)) {
|
||||||
return chunkGenerator;
|
return chunkGenerator;
|
||||||
}
|
}
|
||||||
|
return netherChunkGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a world or generates a new world if it does not exist
|
* Gets a world or generates a new world if it does not exist
|
||||||
@ -224,7 +258,7 @@ public class Boxed extends GameModeAddon {
|
|||||||
boxedBiomeProvider = new BoxedBiomeGenerator(this);
|
boxedBiomeProvider = new BoxedBiomeGenerator(this);
|
||||||
World w = WorldCreator
|
World w = WorldCreator
|
||||||
.name(worldName2)
|
.name(worldName2)
|
||||||
.generator(chunkGenerator)
|
.generator(env.equals(World.Environment.NETHER) ? netherChunkGenerator : chunkGenerator)
|
||||||
.environment(env)
|
.environment(env)
|
||||||
.seed(seedWorld.getSeed()) // For development
|
.seed(seedWorld.getSeed()) // For development
|
||||||
.createWorld();
|
.createWorld();
|
||||||
|
@ -76,11 +76,23 @@ public class Settings implements WorldSettings {
|
|||||||
@ConfigEntry(path = "world.generator.seed", needsReset = true)
|
@ConfigEntry(path = "world.generator.seed", needsReset = true)
|
||||||
private long seed = 602103456450L;
|
private long seed = 602103456450L;
|
||||||
|
|
||||||
@ConfigComment("Seed center chunk. This is where the areas are copied from.")
|
@ConfigComment("Area seed center. This is where the areas are copied from.")
|
||||||
@ConfigEntry(path = "world.generator.start-chunk.x")
|
@ConfigEntry(path = "world.generator.seed-start.normal.x")
|
||||||
private int chunkX = 0;
|
private int seedX = 0;
|
||||||
@ConfigEntry(path = "world.generator.start-chunk.z")
|
@ConfigEntry(path = "world.generator.seed-start.normal.z")
|
||||||
private int chunkZ = 0;
|
private int seedZ = 0;
|
||||||
|
|
||||||
|
@ConfigComment("Nether area seed center. This is where the areas are copied from.")
|
||||||
|
@ConfigEntry(path = "world.generator.seed-start.nether.x")
|
||||||
|
private int netherSeedX = 0;
|
||||||
|
@ConfigEntry(path = "world.generator.seed-start.nether.z")
|
||||||
|
private int netherSeedZ = 0;
|
||||||
|
|
||||||
|
@ConfigComment("End area seed center. This is where the areas are copied from.")
|
||||||
|
@ConfigEntry(path = "world.generator.seed-start.end.x")
|
||||||
|
private int endSeedX = 0;
|
||||||
|
@ConfigEntry(path = "world.generator.seed-start.end.z")
|
||||||
|
private int endSeedZ = 0;
|
||||||
|
|
||||||
@ConfigComment("World difficulty setting - PEACEFUL, EASY, NORMAL, HARD")
|
@ConfigComment("World difficulty setting - PEACEFUL, EASY, NORMAL, HARD")
|
||||||
@ConfigComment("Other plugins may override this setting")
|
@ConfigComment("Other plugins may override this setting")
|
||||||
@ -1832,30 +1844,88 @@ public class Settings implements WorldSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the chunkX
|
* @return the seedX
|
||||||
*/
|
*/
|
||||||
public int getChunkX() {
|
public int getSeedX() {
|
||||||
return chunkX;
|
return seedX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param chunkX the chunkX to set
|
* @param seedX the seedX to set
|
||||||
*/
|
*/
|
||||||
public void setChunkX(int chunkX) {
|
public void setSeedX(int seedX) {
|
||||||
this.chunkX = chunkX;
|
this.seedX = seedX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the chunkZ
|
* @return the seedZ
|
||||||
*/
|
*/
|
||||||
public int getChunkZ() {
|
public int getSeedZ() {
|
||||||
return chunkZ;
|
return seedZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param chunkZ the chunkZ to set
|
* @param seedZ the seedZ to set
|
||||||
*/
|
*/
|
||||||
public void setChunkZ(int chunkZ) {
|
public void setSeedZ(int seedZ) {
|
||||||
this.chunkZ = chunkZ;
|
this.seedZ = seedZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the netherSeedX
|
||||||
|
*/
|
||||||
|
public int getNetherSeedX() {
|
||||||
|
return netherSeedX;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param netherSeedX the netherSeedX to set
|
||||||
|
*/
|
||||||
|
public void setNetherSeedX(int netherSeedX) {
|
||||||
|
this.netherSeedX = netherSeedX;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the netherSeedZ
|
||||||
|
*/
|
||||||
|
public int getNetherSeedZ() {
|
||||||
|
return netherSeedZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param netherSeedZ the netherSeedZ to set
|
||||||
|
*/
|
||||||
|
public void setNetherSeedZ(int netherSeedZ) {
|
||||||
|
this.netherSeedZ = netherSeedZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the endSeedX
|
||||||
|
*/
|
||||||
|
public int getEndSeedX() {
|
||||||
|
return endSeedX;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param endSeedX the endSeedX to set
|
||||||
|
*/
|
||||||
|
public void setEndSeedX(int endSeedX) {
|
||||||
|
this.endSeedX = endSeedX;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the endSeedZ
|
||||||
|
*/
|
||||||
|
public int getEndSeedZ() {
|
||||||
|
return endSeedZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param endSeedZ the endSeedZ to set
|
||||||
|
*/
|
||||||
|
public void setEndSeedZ(int endSeedZ) {
|
||||||
|
this.endSeedZ = endSeedZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public abstract class AbstractBoxedBiomeProvider extends BiomeProvider {
|
|||||||
int size = (int)(dist / 16D); // Convert to chunk
|
int size = (int)(dist / 16D); // Convert to chunk
|
||||||
chunkX = BoxedChunkGenerator.repeatCalc(chunkX, size);
|
chunkX = BoxedChunkGenerator.repeatCalc(chunkX, size);
|
||||||
chunkZ = BoxedChunkGenerator.repeatCalc(chunkZ, size);
|
chunkZ = BoxedChunkGenerator.repeatCalc(chunkZ, size);
|
||||||
ChunkSnapshot c = addon.getChunkGenerator().getChunk(chunkX, chunkZ);
|
ChunkSnapshot c = addon.getChunkGenerator(worldInfo.getEnvironment()).getChunk(chunkX, chunkZ);
|
||||||
|
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
int xx = Math.floorMod(x, 16);
|
int xx = Math.floorMod(x, 16);
|
||||||
|
@ -36,7 +36,7 @@ public abstract class AbstractCopyBiomeProvider extends BiomeProvider {
|
|||||||
int size = (int)(dist / 16D); // Convert to chunk
|
int size = (int)(dist / 16D); // Convert to chunk
|
||||||
chunkX = BoxedChunkGenerator.repeatCalc(chunkX, size);
|
chunkX = BoxedChunkGenerator.repeatCalc(chunkX, size);
|
||||||
chunkZ = BoxedChunkGenerator.repeatCalc(chunkZ, size);
|
chunkZ = BoxedChunkGenerator.repeatCalc(chunkZ, size);
|
||||||
ChunkSnapshot c = addon.getChunkGenerator().getChunk(chunkX, chunkZ);
|
ChunkSnapshot c = addon.getChunkGenerator(worldInfo.getEnvironment()).getChunk(chunkX, chunkZ);
|
||||||
|
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
int xx = Math.floorMod(x, 16);
|
int xx = Math.floorMod(x, 16);
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package world.bentobox.boxed.generators;
|
||||||
|
|
||||||
|
import org.bukkit.World.Environment;
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
|
|
||||||
|
import world.bentobox.boxed.Boxed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author tastybento
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class BoxedNetherBiomeGenerator extends AbstractCopyBiomeProvider {
|
||||||
|
|
||||||
|
public BoxedNetherBiomeGenerator(Boxed boxed) {
|
||||||
|
super(boxed, Environment.NETHER, Biome.BASALT_DELTAS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package world.bentobox.boxed.generators;
|
package world.bentobox.boxed.generators;
|
||||||
|
|
||||||
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.generator.BiomeProvider;
|
import org.bukkit.generator.BiomeProvider;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import org.bukkit.generator.WorldInfo;
|
|
||||||
|
|
||||||
import world.bentobox.boxed.Boxed;
|
import world.bentobox.boxed.Boxed;
|
||||||
|
|
||||||
@ -13,13 +13,16 @@ import world.bentobox.boxed.Boxed;
|
|||||||
*/
|
*/
|
||||||
public class BoxedSeedChunkGenerator extends ChunkGenerator {
|
public class BoxedSeedChunkGenerator extends ChunkGenerator {
|
||||||
|
|
||||||
BiomeProvider seedBiomeProvider;
|
private final BiomeProvider seedBiomeProvider;
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param env
|
||||||
* @param seedBiomeProvider
|
* @param seedBiomeProvider
|
||||||
*/
|
*/
|
||||||
public BoxedSeedChunkGenerator(Boxed boxed) {
|
public BoxedSeedChunkGenerator(Boxed boxed, Environment env) {
|
||||||
this.seedBiomeProvider = new SeedBiomeGenerator(boxed);
|
this.seedBiomeProvider = new SeedBiomeGenerator(boxed);
|
||||||
|
this.env = env;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -56,6 +59,6 @@ public class BoxedSeedChunkGenerator extends ChunkGenerator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldGenerateStructures() {
|
public boolean shouldGenerateStructures() {
|
||||||
return false;
|
return env.equals(Environment.NETHER); // We allow structures in the Nether
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,21 +4,20 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import world.bentobox.bentobox.api.events.island.IslandCreatedEvent;
|
import world.bentobox.bentobox.api.events.island.IslandCreatedEvent;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.util.Pair;
|
import world.bentobox.bentobox.util.Pair;
|
||||||
import world.bentobox.bentobox.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
@ -35,6 +34,8 @@ public class NewAreaListener implements Listener {
|
|||||||
private Queue<Item> itemsToBuild = new LinkedList<>();
|
private Queue<Item> itemsToBuild = new LinkedList<>();
|
||||||
private boolean pasting;
|
private boolean pasting;
|
||||||
private record Item(World w, List<Pair<Integer, Integer>> cs, String cmd) {};
|
private record Item(World w, List<Pair<Integer, Integer>> cs, String cmd) {};
|
||||||
|
Pair<Integer, Integer> min = new Pair<Integer, Integer>(0,0);
|
||||||
|
Pair<Integer, Integer> max = new Pair<Integer, Integer>(0,0);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,13 +88,15 @@ public class NewAreaListener implements Listener {
|
|||||||
// Loop through the structures in the file - there could be more than one
|
// Loop through the structures in the file - there could be more than one
|
||||||
for (String structure : section.getKeys(false)) {
|
for (String structure : section.getKeys(false)) {
|
||||||
addon.log(structure);
|
addon.log(structure);
|
||||||
String value = section.getString(structure,"");
|
String key = section.getString(structure,"");
|
||||||
// Extract coords
|
// Extract coords
|
||||||
String[] coords = value.split(",");
|
String[] value = key.split(",");
|
||||||
if (coords.length == 3) {
|
if (value.length == 4) {
|
||||||
int x = Integer.valueOf(coords[0]) + center.getBlockX();
|
Environment env = Environment.valueOf(value[0].toUpperCase(Locale.ENGLISH).strip());
|
||||||
int y = Integer.valueOf(coords[1]);
|
World world = env.equals(Environment.NORMAL) ? addon.getOverWorld() : addon.getNetherWorld();
|
||||||
int z = Integer.valueOf(coords[2]) + center.getBlockZ();
|
int x = Integer.valueOf(value[1].strip()) + center.getBlockX();
|
||||||
|
int y = Integer.valueOf(value[2].strip());
|
||||||
|
int z = Integer.valueOf(value[3].strip()) + center.getBlockZ();
|
||||||
List<Pair<Integer, Integer>> cs = new ArrayList<>();
|
List<Pair<Integer, Integer>> cs = new ArrayList<>();
|
||||||
int size = 10;
|
int size = 10;
|
||||||
for (int cx = (x >> 4) - size; cx < (x >>4) + size; cx++) {
|
for (int cx = (x >> 4) - size; cx < (x >>4) + size; cx++) {
|
||||||
@ -102,13 +105,13 @@ public class NewAreaListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make command
|
// Make command
|
||||||
String cmd = "execute in " + center.getWorld().getName() + " run place "+ string + " minecraft:" + structure + " "
|
String cmd = "execute in " + world.getName() + " run place "+ string + " minecraft:" + structure + " "
|
||||||
+ x + " "
|
+ x + " "
|
||||||
+ y + " "
|
+ y + " "
|
||||||
+ z + " ";
|
+ z + " ";
|
||||||
itemsToBuild.add(new Item(center.getWorld(), cs, cmd));
|
itemsToBuild.add(new Item(world, cs, cmd));
|
||||||
} else {
|
} else {
|
||||||
addon.logError("Structure file syntax error: " + structure + " " + value);
|
addon.logError("Structure file syntax error: " + structure + " " + key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,15 +120,27 @@ public class NewAreaListener implements Listener {
|
|||||||
private void LoadChunksAsync(World w, List<Pair<Integer, Integer>> cs, int i, String cmd) {
|
private void LoadChunksAsync(World w, List<Pair<Integer, Integer>> cs, int i, String cmd) {
|
||||||
pasting = true;
|
pasting = true;
|
||||||
int total = cs.size();
|
int total = cs.size();
|
||||||
|
|
||||||
//addon.log("Loading chunk async " + i);
|
//addon.log("Loading chunk async " + i);
|
||||||
if (i < total) {
|
if (i < total) {
|
||||||
|
if (i == 0) {
|
||||||
|
min = new Pair<>(cs.get(0).x, cs.get(0).z);
|
||||||
|
max = new Pair<>(cs.get(0).x, cs.get(0).z);
|
||||||
|
}
|
||||||
|
if (cs.get(i).x < min.x || cs.get(i).z < min.z) {
|
||||||
|
min = cs.get(i);
|
||||||
|
}
|
||||||
|
if (cs.get(i).x > min.x || cs.get(i).z > min.z) {
|
||||||
|
max = cs.get(i);
|
||||||
|
}
|
||||||
Util.getChunkAtAsync(w, cs.get(i).x, cs.get(i).z, true).thenAccept(c -> {
|
Util.getChunkAtAsync(w, cs.get(i).x, cs.get(i).z, true).thenAccept(c -> {
|
||||||
//addon.log("Loaded chunk " + c.getX() + " " + c.getZ());
|
|
||||||
LoadChunksAsync(w, cs, i + 1, cmd);
|
LoadChunksAsync(w, cs, i + 1, cmd);
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addon.log("Complete");
|
addon.log("Complete");
|
||||||
|
addon.log("Loaded chunks in " + w.getName() + " min " + (min.x << 4) + " " + (min.z << 4) + " to " +
|
||||||
|
(max.x << 4) + " " + (max.z << 4));
|
||||||
addon.log("run command " + cmd);
|
addon.log("run command " + cmd);
|
||||||
Bukkit.getScheduler().runTaskLater(addon.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskLater(addon.getPlugin(), () -> {
|
||||||
addon.log("Comand success = " + addon.getServer().dispatchCommand(Bukkit.getConsoleSender(), cmd));
|
addon.log("Comand success = " + addon.getServer().dispatchCommand(Bukkit.getConsoleSender(), cmd));
|
||||||
|
@ -29,15 +29,24 @@ world:
|
|||||||
world-name: boxed_world
|
world-name: boxed_world
|
||||||
generator:
|
generator:
|
||||||
# World seed.
|
# World seed.
|
||||||
# If you change this, stop the server and delete the worlds made.
|
|
||||||
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
|
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
|
||||||
seed: 602103456450
|
seed: 602103456450
|
||||||
|
seed-start:
|
||||||
|
normal:
|
||||||
|
# Area seed center. This is where the areas are copied from.
|
||||||
|
x: 9920
|
||||||
|
z: 9856
|
||||||
|
nether:
|
||||||
|
# Nether area seed center. This is where the areas are copied from.
|
||||||
|
x: 9999
|
||||||
|
z: 10015
|
||||||
|
end:
|
||||||
|
# End area seed center. This is where the areas are copied from.
|
||||||
|
x: 0
|
||||||
|
z: 0
|
||||||
# Generate surface
|
# Generate surface
|
||||||
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
||||||
generate-surface: true
|
generate-surface: true
|
||||||
# Generate bedrock
|
|
||||||
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
|
||||||
generate-bedrock: true
|
|
||||||
# Generate caves
|
# Generate caves
|
||||||
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
||||||
generate-caves: true
|
generate-caves: true
|
||||||
@ -50,7 +59,7 @@ world:
|
|||||||
# Allow surface structures - villages, shipwrecks, broken portals, etc.
|
# Allow surface structures - villages, shipwrecks, broken portals, etc.
|
||||||
# These will be randomly placed, so may not be available for every player.
|
# These will be randomly placed, so may not be available for every player.
|
||||||
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
# /!\ In order to apply the changes made to this option, you must restart your server. Reloading BentoBox or the server won't work.
|
||||||
allow-structures: true
|
allow-structures: false
|
||||||
# World difficulty setting - PEACEFUL, EASY, NORMAL, HARD
|
# World difficulty setting - PEACEFUL, EASY, NORMAL, HARD
|
||||||
# Other plugins may override this setting
|
# Other plugins may override this setting
|
||||||
difficulty: NORMAL
|
difficulty: NORMAL
|
||||||
@ -100,7 +109,7 @@ world:
|
|||||||
# Note: Some default challenges will not be possible if there is no nether.
|
# Note: Some default challenges will not be possible if there is no nether.
|
||||||
# Note that with a standard nether all players arrive at the same portal and entering a
|
# Note that with a standard nether all players arrive at the same portal and entering a
|
||||||
# portal will return them back to their areas.
|
# portal will return them back to their areas.
|
||||||
generate: false
|
generate: true
|
||||||
# Nether spawn protection radius - this is the distance around the nether spawn
|
# Nether spawn protection radius - this is the distance around the nether spawn
|
||||||
# that will be public from player interaction (breaking blocks, pouring lava etc.)
|
# that will be public from player interaction (breaking blocks, pouring lava etc.)
|
||||||
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
|
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
|
||||||
@ -170,6 +179,7 @@ world:
|
|||||||
CROP_TRAMPLE: false
|
CROP_TRAMPLE: false
|
||||||
BREWING: false
|
BREWING: false
|
||||||
DROPPER: false
|
DROPPER: false
|
||||||
|
ENTITY_PORTAL_TELEPORT: false
|
||||||
OBSIDIAN_SCOOPING: false
|
OBSIDIAN_SCOOPING: false
|
||||||
CREEPER_DAMAGE: true
|
CREEPER_DAMAGE: true
|
||||||
TNT_PRIMING: false
|
TNT_PRIMING: false
|
||||||
@ -232,8 +242,8 @@ world:
|
|||||||
BREAK_HOPPERS: 500
|
BREAK_HOPPERS: 500
|
||||||
FURNACE: 500
|
FURNACE: 500
|
||||||
MONSTER_SPAWNERS_SPAWN: 500
|
MONSTER_SPAWNERS_SPAWN: 500
|
||||||
MINECART: 500
|
|
||||||
ANVIL: 500
|
ANVIL: 500
|
||||||
|
MINECART: 500
|
||||||
FISH_SCOOPING: 500
|
FISH_SCOOPING: 500
|
||||||
FIRE_IGNITE: 500
|
FIRE_IGNITE: 500
|
||||||
END_PORTAL: 500
|
END_PORTAL: 500
|
||||||
@ -246,8 +256,8 @@ world:
|
|||||||
LEVER: 0
|
LEVER: 0
|
||||||
ELYTRA: 0
|
ELYTRA: 0
|
||||||
CAKE: 500
|
CAKE: 500
|
||||||
RIDING: 500
|
|
||||||
HURT_MONSTERS: 0
|
HURT_MONSTERS: 0
|
||||||
|
RIDING: 500
|
||||||
NAME_TAG: 500
|
NAME_TAG: 500
|
||||||
ARMOR_STAND: 500
|
ARMOR_STAND: 500
|
||||||
TRADING: 0
|
TRADING: 0
|
||||||
@ -268,15 +278,15 @@ world:
|
|||||||
COMMAND_RANKS: 500
|
COMMAND_RANKS: 500
|
||||||
BEACON: 500
|
BEACON: 500
|
||||||
TRAPDOOR: 500
|
TRAPDOOR: 500
|
||||||
PRESSURE_PLATE: 0
|
|
||||||
EXPERIENCE_BOTTLE_THROWING: 500
|
EXPERIENCE_BOTTLE_THROWING: 500
|
||||||
|
PRESSURE_PLATE: 0
|
||||||
DYE: 500
|
DYE: 500
|
||||||
PLACE_BLOCKS: 500
|
|
||||||
ITEM_FRAME: 500
|
ITEM_FRAME: 500
|
||||||
|
PLACE_BLOCKS: 500
|
||||||
CRAFTING: 0
|
CRAFTING: 0
|
||||||
SHEARING: 500
|
|
||||||
ANIMAL_SPAWNERS_SPAWN: 500
|
|
||||||
ENCHANTING: 500
|
ENCHANTING: 500
|
||||||
|
ANIMAL_SPAWNERS_SPAWN: 500
|
||||||
|
SHEARING: 500
|
||||||
BOAT: 0
|
BOAT: 0
|
||||||
BED: 500
|
BED: 500
|
||||||
SPAWN_EGGS: 500
|
SPAWN_EGGS: 500
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
structures:
|
structures:
|
||||||
new:
|
new:
|
||||||
village_plains: "0,64,80"
|
village_plains: "normal, 0 ,64, 80"
|
||||||
ruined_portal_mountain: "-38,63,20"
|
ruined_portal_mountain: "normal, -38, 63, 20"
|
||||||
pillager_outpost: "3,63,-60"
|
pillager_outpost: "normal, 3, 63, -60"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user