mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
Fix up issues with code
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
@@ -179,7 +179,7 @@ ij_java_space_before_for_left_brace = true
|
||||
ij_java_space_before_for_parentheses = false
|
||||
ij_java_space_before_for_semicolon = false
|
||||
ij_java_space_before_if_left_brace = true
|
||||
ij_java_space_before_if_parentheses = false
|
||||
ij_java_space_before_if_parentheses = true
|
||||
ij_java_space_before_method_call_parentheses = false
|
||||
ij_java_space_before_method_left_brace = true
|
||||
ij_java_space_before_method_parentheses = false
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -134,3 +134,5 @@ build
|
||||
.idea/codeStyles/**
|
||||
.idea/**.xml
|
||||
.idea/modules/**.iml
|
||||
|
||||
!lib/*.jar
|
||||
@@ -44,6 +44,8 @@ dependencies {
|
||||
// JUnit.
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
|
||||
|
||||
testImplementation(name = "Gaea-1.14.0", group = "")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
@@ -92,6 +94,7 @@ val setupServer = tasks.create("setupServer") {
|
||||
}
|
||||
|
||||
val testWithPaper = task<JavaExec>(name = "testWithPaper") {
|
||||
standardInput = System.`in`
|
||||
dependsOn(setupServer)
|
||||
//dependsOn(tasks.shadowJar)
|
||||
// Copy Terra into dir
|
||||
@@ -104,13 +107,13 @@ val testWithPaper = task<JavaExec>(name = "testWithPaper") {
|
||||
|
||||
main = "io.papermc.paperclip.Paperclip"
|
||||
jvmArgs = listOf("-XX:+UseG1GC", "-XX:+ParallelRefProcEnabled", "-XX:MaxGCPauseMillis=200",
|
||||
"-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC", "-XX:+AlwaysPreTouch",
|
||||
"-XX:G1NewSizePercent=30", "-XX:G1MaxNewSizePercent=40", "-XX:G1HeapRegionSize=8M",
|
||||
"-XX:G1ReservePercent=20", "-XX:G1HeapWastePercent=5", "-XX:G1MixedGCCountTarget=4",
|
||||
"-XX:InitiatingHeapOccupancyPercent=15", "-XX:G1MixedGCLiveThresholdPercent=90",
|
||||
"-XX:G1RSetUpdatingPauseTimePercent=5", "-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem",
|
||||
"-XX:MaxTenuringThreshold=1", "-Dusing.aikars.flags=https://mcflags.emc.gs",
|
||||
"-Daikars.new.flags=true")
|
||||
"-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC", "-XX:+AlwaysPreTouch",
|
||||
"-XX:G1NewSizePercent=30", "-XX:G1MaxNewSizePercent=40", "-XX:G1HeapRegionSize=8M",
|
||||
"-XX:G1ReservePercent=20", "-XX:G1HeapWastePercent=5", "-XX:G1MixedGCCountTarget=4",
|
||||
"-XX:InitiatingHeapOccupancyPercent=15", "-XX:G1MixedGCLiveThresholdPercent=90",
|
||||
"-XX:G1RSetUpdatingPauseTimePercent=5", "-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem",
|
||||
"-XX:MaxTenuringThreshold=1", "-Dusing.aikars.flags=https://mcflags.emc.gs",
|
||||
"-Daikars.new.flags=true")
|
||||
maxHeapSize = "2G"
|
||||
workingDir = file("${testDir}/")
|
||||
classpath = files("${testDir}/paper.jar")
|
||||
@@ -138,6 +141,7 @@ tasks.build {
|
||||
/**
|
||||
* Version class that does version stuff.
|
||||
*/
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
class Version(val major: String, val minor: String, val revision: String, val preReleaseData: String? = null) {
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class Terra extends GaeaPlugin {
|
||||
private static Terra instance;
|
||||
private final Map<String, TerraChunkGenerator> generatorMap = new HashMap<>();
|
||||
@@ -53,6 +54,7 @@ public class Terra extends GaeaPlugin {
|
||||
locatePl.setTabCompleter(locate);
|
||||
|
||||
saveDefaultConfig();
|
||||
//noinspection deprecation
|
||||
Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, TerraChunkGenerator::saveAll, ConfigUtil.dataSave, ConfigUtil.dataSave);
|
||||
Bukkit.getPluginManager().registerEvents(new EventListener(this), this);
|
||||
PaperUtil.checkPaper(this);
|
||||
|
||||
@@ -23,6 +23,14 @@ public class TerraWorld {
|
||||
private final WorldConfig worldConfig;
|
||||
private boolean safe;
|
||||
|
||||
public static void loadWorld(WorldConfig w) {
|
||||
loaded.put(w.getWorldID(), w);
|
||||
}
|
||||
|
||||
public static synchronized TerraWorld getWorld(World w) {
|
||||
return map.computeIfAbsent(w, TerraWorld::new);
|
||||
}
|
||||
|
||||
private TerraWorld(World w) {
|
||||
safe = true;
|
||||
worldConfig = loaded.get(w.getName());
|
||||
@@ -31,7 +39,7 @@ public class TerraWorld {
|
||||
for(int i = 0; i < config.biomeList.size(); i++) {
|
||||
String partName = config.biomeList.get(i);
|
||||
try {
|
||||
if(partName.startsWith("BIOME:")) {
|
||||
if (partName.startsWith("BIOME:")) {
|
||||
UserDefinedBiome[][] temp = new UserDefinedBiome[1][1];
|
||||
UserDefinedBiome b = config.getBiomes().get(partName.substring(6)).getBiome();
|
||||
temp[0][0] = b;
|
||||
@@ -78,14 +86,6 @@ public class TerraWorld {
|
||||
grid = new TerraBiomeGrid(w, config.freq1, config.freq2, zone, config, erosion);
|
||||
}
|
||||
|
||||
public static void loadWorld(WorldConfig w) {
|
||||
loaded.put(w.getWorldID(), w);
|
||||
}
|
||||
|
||||
public static synchronized TerraWorld getWorld(World w) {
|
||||
return map.computeIfAbsent(w, TerraWorld::new);
|
||||
}
|
||||
|
||||
public static synchronized void invalidate() {
|
||||
map.clear();
|
||||
for(WorldConfig config : loaded.values()) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Consumer;
|
||||
@@ -28,7 +29,7 @@ public class AsyncStructureFinder implements Runnable {
|
||||
private final World world;
|
||||
private final Consumer<Vector> callback;
|
||||
|
||||
public AsyncStructureFinder(TerraBiomeGrid grid, StructureConfig target, Location origin, int startRadius, int maxRadius, Consumer<Vector> callback) {
|
||||
public AsyncStructureFinder(TerraBiomeGrid grid, StructureConfig target, @NotNull Location origin, int startRadius, int maxRadius, Consumer<Vector> callback) {
|
||||
this.grid = grid;
|
||||
this.target = target;
|
||||
this.startRadius = startRadius;
|
||||
@@ -36,6 +37,7 @@ public class AsyncStructureFinder implements Runnable {
|
||||
this.centerX = origin.getBlockX();
|
||||
this.centerZ = origin.getBlockZ();
|
||||
this.world = origin.getWorld();
|
||||
assert world != null;
|
||||
this.seed = world.getSeed();
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
@@ -21,21 +21,25 @@ public class TerraBiomeGrid extends BiomeGrid {
|
||||
|
||||
public TerraBiomeGrid(World w, double freq1, double freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
|
||||
super(w, freq1, freq2, 0, 0);
|
||||
if(c.biomeBlend) {
|
||||
if (c.biomeBlend) {
|
||||
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
|
||||
}
|
||||
this.zone = zone;
|
||||
if(c.erosionEnable) {
|
||||
if (c.erosionEnable) {
|
||||
erode = new ErosionNoise(c.erosionFreq, c.erosionThresh, c.erosionOctaves, w.getSeed());
|
||||
this.erosionGrid = erosion;
|
||||
}
|
||||
}
|
||||
|
||||
public UserDefinedGrid getGrid(int x, int z) {
|
||||
return (UserDefinedGrid) zone.getGrid(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome getBiome(int x, int z, GenerationPhase phase) {
|
||||
int xp = x;
|
||||
int zp = z;
|
||||
if(perturb != null && phase.equals(GenerationPhase.PALETTE_APPLY)) {
|
||||
if (perturb != null && phase.equals(GenerationPhase.PALETTE_APPLY)) {
|
||||
Vector2 perturbCoords = perturb.getShiftedCoords(x, z);
|
||||
xp = (int) perturbCoords.getX();
|
||||
zp = (int) perturbCoords.getZ();
|
||||
@@ -62,7 +66,5 @@ public class TerraBiomeGrid extends BiomeGrid {
|
||||
return getBiome(l.getBlockX(), l.getBlockZ(), phase);
|
||||
}
|
||||
|
||||
public UserDefinedGrid getGrid(int x, int z) {
|
||||
return (UserDefinedGrid) zone.getGrid(x, z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import parsii.tokenizer.ParseException;
|
||||
/**
|
||||
* What happens if terrain generation is attempted with an unrecoverable config error.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public enum FailType {
|
||||
/**
|
||||
* Return failover biome, then shut down server to minimize damage.
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.polydev.gaea.world.carving.Worm;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class SimplexCarver extends Carver {
|
||||
private final FastNoiseLite noise;
|
||||
private final FastNoiseLite height;
|
||||
@@ -39,20 +40,6 @@ public class SimplexCarver extends Carver {
|
||||
hasCaves.setFrequency(0.005f);
|
||||
}
|
||||
|
||||
private static double acot(double x) {
|
||||
return Math.PI / 2 - Math.atan(x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Worm getWorm(long l, Vector vector) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkCarved(World world, int i, int i1, Random random) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvingData carve(int chunkX, int chunkZ, World w) {
|
||||
CarvingData c = new CarvingData(chunkX, chunkZ);
|
||||
@@ -71,7 +58,7 @@ public class SimplexCarver extends Carver {
|
||||
if(finalNoise > 0.5) {
|
||||
c.carve(x - ox, y, z - oz, type);
|
||||
double finalNoiseUp = (-0.05 * Math.abs((y + 1) - (heightNoise * 16 + 24)) + 1 - simplex) * hc;
|
||||
if(finalNoiseUp > 0.5) {
|
||||
if (finalNoiseUp > 0.5) {
|
||||
type = CarvingData.CarvingType.CENTER;
|
||||
} else type = CarvingData.CarvingType.TOP;
|
||||
}
|
||||
@@ -80,4 +67,18 @@ public class SimplexCarver extends Carver {
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
private static double acot(double x) {
|
||||
return Math.PI / 2 - Math.atan(x);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Worm getWorm(long l, Vector vector) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChunkCarved(World world, int i, int i1, Random random) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@ public class OreCommand extends WorldCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||
return Collections.emptyList();
|
||||
@@ -52,11 +57,6 @@ public class OreCommand extends WorldCommand {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -23,10 +23,8 @@ public class SaveDataCommand extends WorldCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Player sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args, World w) {
|
||||
TerraChunkGenerator.saveAll();
|
||||
LangUtil.send("debug.data-save", sender, w.getName());
|
||||
return true;
|
||||
public List<Command> getSubCommands() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,12 +33,14 @@ public class SaveDataCommand extends WorldCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Command> getSubCommands() {
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
public boolean execute(@NotNull Player sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args, World w) {
|
||||
TerraChunkGenerator.saveAll();
|
||||
LangUtil.send("debug.data-save", sender, w.getName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@ public class ImageCommand extends WorldCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "image";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||
return Arrays.asList(new RenderCommand(this), new GUICommand(this));
|
||||
@@ -34,11 +39,6 @@ public class ImageCommand extends WorldCommand {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "image";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -25,7 +25,9 @@ public class RenderCommand extends WorldCommand {
|
||||
WorldImageGenerator g = new WorldImageGenerator(world, Integer.parseInt(args[0]), Integer.parseInt(args[1]));
|
||||
g.drawWorld(sender.getLocation().getBlockX(), sender.getLocation().getBlockZ());
|
||||
File file = new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "map" + File.separator + "map_" + System.currentTimeMillis() + ".png");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.mkdirs();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.createNewFile();
|
||||
g.save(file);
|
||||
LangUtil.send("command.image.render.save", sender, file.getAbsolutePath());
|
||||
|
||||
@@ -37,7 +37,9 @@ public class ExportCommand extends PlayerCommand {
|
||||
}
|
||||
try {
|
||||
File file = new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "structures", args[0] + ".tstructure");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.getParentFile().mkdirs();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.createNewFile();
|
||||
structure.save(file);
|
||||
LangUtil.send("command.structure.export", sender, file.getAbsolutePath());
|
||||
@@ -47,11 +49,6 @@ public class ExportCommand extends PlayerCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "export";
|
||||
@@ -66,4 +63,9 @@ public class ExportCommand extends PlayerCommand {
|
||||
public int arguments() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,11 +46,6 @@ public class LoadCommand extends PlayerCommand implements DebugCommand {
|
||||
return "load";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||
return Collections.emptyList();
|
||||
@@ -60,4 +55,9 @@ public class LoadCommand extends PlayerCommand implements DebugCommand {
|
||||
public int arguments() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ public class StructureCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||
return Arrays.asList(new ExportCommand(this), new LoadCommand(this), new LocateCommand(this, false), new LocateCommand(this, true), new SpawnCommand(this));
|
||||
public String getName() {
|
||||
return "structure";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
public List<org.polydev.gaea.command.Command> getSubCommands() {
|
||||
return Arrays.asList(new ExportCommand(this), new LoadCommand(this), new LocateCommand(this, false), new LocateCommand(this, true), new SpawnCommand(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,7 +38,7 @@ public class StructureCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "structure";
|
||||
public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public class ConfigLoader {
|
||||
public static <T extends TerraConfig> Map<String, T> load(Path file, ConfigPack config, Class<T> clazz) {
|
||||
long l = System.nanoTime();
|
||||
Map<String, T> configs = new HashMap<>();
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.toFile().mkdirs();
|
||||
List<String> ids = new ArrayList<>();
|
||||
try(Stream<Path> paths = Files.walk(file)) {
|
||||
@@ -40,7 +41,7 @@ public class ConfigLoader {
|
||||
LangUtil.log("config.error.generic", Level.SEVERE, path.toString());
|
||||
} catch(IllegalArgumentException | InvocationTargetException e) {
|
||||
if(ConfigUtil.debug) e.printStackTrace();
|
||||
LangUtil.log("config.error.file", Level.SEVERE, path.toString(), ((e instanceof InvocationTargetException) ? "INVOCATION: " + e.getCause().getMessage() : e.getMessage()));
|
||||
LangUtil.log("config.error.file", Level.SEVERE, path.toString(), e.getMessage());
|
||||
}
|
||||
});
|
||||
LangUtil.log("config.loaded-all", Level.INFO, String.valueOf(configs.size()), clazz.getSimpleName(), String.valueOf((System.nanoTime() - l) / 1000000D));
|
||||
|
||||
@@ -161,6 +161,7 @@ public class ConfigPack extends YamlConfiguration {
|
||||
public static synchronized void loadAll(JavaPlugin main) {
|
||||
configs.clear();
|
||||
File file = new File(main.getDataFolder(), "packs");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.mkdirs();
|
||||
List<Path> subfolder;
|
||||
try {
|
||||
@@ -187,6 +188,22 @@ public class ConfigPack extends YamlConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Map<String, BiomeConfig> getBiomes() {
|
||||
return biomes;
|
||||
}
|
||||
|
||||
public StructureConfig getStructure(String id) {
|
||||
return structures.get(id);
|
||||
}
|
||||
|
||||
public BiomeGridConfig getBiomeGrid(String id) {
|
||||
return grids.get(id);
|
||||
}
|
||||
|
||||
public static synchronized ConfigPack fromID(String id) {
|
||||
return configs.get(id);
|
||||
}
|
||||
@@ -199,10 +216,6 @@ public class ConfigPack extends YamlConfiguration {
|
||||
return abstractBiomes;
|
||||
}
|
||||
|
||||
public Map<String, BiomeConfig> getBiomes() {
|
||||
return biomes;
|
||||
}
|
||||
|
||||
public Map<String, CarverConfig> getCarvers() {
|
||||
return carvers;
|
||||
}
|
||||
@@ -215,10 +228,6 @@ public class ConfigPack extends YamlConfiguration {
|
||||
return dataFolder;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public BiomeConfig getBiome(UserDefinedBiome b) {
|
||||
for(BiomeConfig biome : biomes.values()) {
|
||||
if(biome.getBiome().equals(b)) return biome;
|
||||
@@ -241,10 +250,6 @@ public class ConfigPack extends YamlConfiguration {
|
||||
throw new IllegalArgumentException("Unable to find carver!");
|
||||
}
|
||||
|
||||
public StructureConfig getStructure(String id) {
|
||||
return structures.get(id);
|
||||
}
|
||||
|
||||
public PaletteConfig getPalette(String id) {
|
||||
return palettes.get(id);
|
||||
}
|
||||
@@ -273,10 +278,6 @@ public class ConfigPack extends YamlConfiguration {
|
||||
return flora.get(id);
|
||||
}
|
||||
|
||||
public BiomeGridConfig getBiomeGrid(String id) {
|
||||
return grids.get(id);
|
||||
}
|
||||
|
||||
public TreeConfig getTree(String id) {
|
||||
return trees.get(id);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class WorldConfig {
|
||||
|
||||
|
||||
private final String worldID;
|
||||
private final String configID;
|
||||
private final GaeaPlugin main;
|
||||
@@ -44,10 +42,11 @@ public class WorldConfig {
|
||||
FileConfiguration config = new YamlConfiguration();
|
||||
Debug.info("Loading config " + configID + " for world " + worldID);
|
||||
try { // Load/create world config file
|
||||
if(configID == null || configID.equals(""))
|
||||
if (configID == null || configID.equals(""))
|
||||
throw new ConfigException("Config pack unspecified in bukkit.yml!", worldID);
|
||||
File configFile = new File(main.getDataFolder() + File.separator + "worlds", worldID + ".yml");
|
||||
if(!configFile.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
configFile.getParentFile().mkdirs();
|
||||
LangUtil.log("world-config.not-found", Level.WARNING, worldID);
|
||||
FileUtils.copyInputStreamToFile(Objects.requireNonNull(main.getResource("world.yml")), configFile);
|
||||
@@ -59,21 +58,23 @@ public class WorldConfig {
|
||||
|
||||
tConfig = ConfigPack.fromID(configID);
|
||||
|
||||
if(tConfig == null)
|
||||
if (tConfig == null)
|
||||
throw new ConfigException("No such config pack: \"" + configID + "\". This pack either does not exist, or failed to load due to configuration errors.", worldID);
|
||||
|
||||
// Load image stuff
|
||||
try {
|
||||
biomeXChannel = ImageLoader.Channel.valueOf(Objects.requireNonNull(config.getString("image.channels.biome-x", "red")).toUpperCase());
|
||||
biomeZChannel = ImageLoader.Channel.valueOf(Objects.requireNonNull(config.getString("image.channels.biome-z", "green")).toUpperCase());
|
||||
if(biomeZChannel.equals(biomeXChannel))
|
||||
if (biomeZChannel.equals(biomeXChannel))
|
||||
throw new InvalidConfigurationException("2 objects share the same image channels: biome-x and biome-z");
|
||||
zoneChannel = ImageLoader.Channel.valueOf(Objects.requireNonNull(config.getString("image.channels.zone", "blue")).toUpperCase());
|
||||
if(zoneChannel.equals(biomeXChannel) || zoneChannel.equals(biomeZChannel))
|
||||
if (zoneChannel.equals(biomeXChannel) || zoneChannel.equals(biomeZChannel))
|
||||
throw new InvalidConfigurationException("2 objects share the same image channels: zone and biome-x/z");
|
||||
if(fromImage) {
|
||||
if (fromImage) {
|
||||
try {
|
||||
imageLoader = new ImageLoader(new File(Objects.requireNonNull(config.getString("image.file"))), ImageLoader.Align.valueOf(config.getString("image.align", "center").toUpperCase()));
|
||||
//noinspection ConstantConditions
|
||||
imageLoader = new ImageLoader(new File(config.getString("image.file")),
|
||||
ImageLoader.Align.valueOf(config.getString("image.align", "center").toUpperCase()));
|
||||
LangUtil.log("world-config.using-image", Level.INFO, worldID);
|
||||
} catch(IOException | NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
@@ -83,7 +84,7 @@ public class WorldConfig {
|
||||
} catch(IllegalArgumentException | NullPointerException e) {
|
||||
throw new InvalidConfigurationException(e.getCause());
|
||||
}
|
||||
Bukkit.getLogger().info("Loaded " + tConfig.biomeList.size() + " BiomeGrids from list.");
|
||||
Bukkit.getLogger().log(Level.INFO, "Loaded {0} BiomeGrids from list.", tConfig.biomeList.size());
|
||||
} catch(IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
LangUtil.log("world-config.error", Level.SEVERE, worldID);
|
||||
|
||||
@@ -46,30 +46,29 @@ public class BiomeGridConfig extends TerraConfig {
|
||||
}
|
||||
}
|
||||
|
||||
public int getSizeX() {
|
||||
return sizeX;
|
||||
}
|
||||
|
||||
public int getSizeZ() {
|
||||
return sizeZ;
|
||||
public String getID() {
|
||||
return gridID;
|
||||
}
|
||||
|
||||
public UserDefinedBiome[][] getBiomeGrid() {
|
||||
return gridRaw;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return gridID;
|
||||
}
|
||||
|
||||
public UserDefinedGrid getGrid(World w, WorldConfig wc) {
|
||||
ConfigPack c = wc.getConfig();
|
||||
return new UserDefinedGrid(w, c.freq1, c.freq2, gridRaw, wc);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BiomeGrid with ID " + getID() + ", dimensions " + getSizeX() + ":" + getSizeZ();
|
||||
}
|
||||
|
||||
public int getSizeX() {
|
||||
return sizeX;
|
||||
}
|
||||
|
||||
public int getSizeZ() {
|
||||
return sizeZ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CarverConfig extends TerraConfig {
|
||||
super(file, config);
|
||||
load(file);
|
||||
if(!contains("id")) throw new ConfigException("No ID specified for Carver!", "null");
|
||||
id = getString("id");
|
||||
id = Objects.requireNonNull(getString("id"));
|
||||
|
||||
inner = getBlocks("palette.inner.layers");
|
||||
|
||||
@@ -95,14 +95,6 @@ public class CarverConfig extends TerraConfig {
|
||||
carver = new UserDefinedCarver(height, radius, length, start, mutate, radiusMultiplier, id.hashCode(), getInt("cut.top", 0), getInt("cut.bottom", 0));
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public UserDefinedCarver getCarver() {
|
||||
return carver;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<Integer, ProbabilityCollection<BlockData>> getBlocks(String key) throws InvalidConfigurationException {
|
||||
if(!contains(key)) throw new ConfigException("Missing Carver Palette!", getID());
|
||||
@@ -123,6 +115,14 @@ public class CarverConfig extends TerraConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public UserDefinedCarver getCarver() {
|
||||
return carver;
|
||||
}
|
||||
|
||||
public Map<Material, Set<Material>> getShiftedBlocks() {
|
||||
return shift;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,11 @@ public class PaletteConfig extends TerraConfig {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Palette with ID " + getID() + " with " + getPalette().getSize() + " layers, using Simplex: " + useNoise;
|
||||
}
|
||||
|
||||
public Palette<BlockData> getPalette() {
|
||||
return palette;
|
||||
}
|
||||
@@ -75,9 +80,4 @@ public class PaletteConfig extends TerraConfig {
|
||||
public String getID() {
|
||||
return paletteID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Palette with ID " + getID() + " with " + getPalette().getSize() + " layers, using Simplex: " + useNoise;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,14 +159,14 @@ public class BiomeConfig extends TerraConfig {
|
||||
}
|
||||
}
|
||||
|
||||
public UserDefinedBiome getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return biomeID;
|
||||
}
|
||||
|
||||
public UserDefinedBiome getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
public BiomeOreConfig getOres() {
|
||||
return ore;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.dfsek.terra.config.base.ConfigPack;
|
||||
import com.dfsek.terra.config.base.ConfigUtil;
|
||||
import com.dfsek.terra.config.exception.ConfigException;
|
||||
import com.dfsek.terra.config.exception.NotFoundException;
|
||||
import com.dfsek.terra.population.StructurePopulator;
|
||||
import com.dfsek.terra.procgen.GridSpawn;
|
||||
import com.dfsek.terra.structure.Structure;
|
||||
import com.dfsek.terra.structure.features.Feature;
|
||||
@@ -36,8 +35,6 @@ public class StructureConfig extends TerraConfig {
|
||||
private final Map<Integer, LootTable> loot = new HashMap<>();
|
||||
private final List<Feature> features;
|
||||
|
||||
StructurePopulator.SearchType type;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public StructureConfig(File file, ConfigPack config) throws IOException, InvalidConfigurationException {
|
||||
super(file, config);
|
||||
@@ -95,15 +92,6 @@ public class StructureConfig extends TerraConfig {
|
||||
spawn = new GridSpawn(getInt("spawn.width", 500), getInt("spawn.padding", 100));
|
||||
searchStart = new Range(getInt("spawn.start.min", 72), getInt("spawn.start.max", 72));
|
||||
bound = new Range(getInt("spawn.bound.min", 48), getInt("spawn.bound.max", 72));
|
||||
try {
|
||||
type = StructurePopulator.SearchType.valueOf(getString("spawn.search", "DOWN"));
|
||||
} catch(IllegalArgumentException e) {
|
||||
throw new ConfigException("Invalid search type, " + getString("spawn.search"), getID());
|
||||
}
|
||||
}
|
||||
|
||||
public List<Feature> getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,6 +99,10 @@ public class StructureConfig extends TerraConfig {
|
||||
return id;
|
||||
}
|
||||
|
||||
public List<Feature> getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
public Structure getStructure(Random r) {
|
||||
return structure.get(r);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public abstract class TerraWorldEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private final TerraWorld world;
|
||||
|
||||
@@ -43,6 +43,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
||||
public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
private static final Map<World, PopulationManager> popMap = new HashMap<>();
|
||||
private final PopulationManager popMan = new PopulationManager(Terra.getInstance());
|
||||
@@ -69,16 +70,22 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
}
|
||||
|
||||
public static synchronized void fixChunk(Chunk c) {
|
||||
if(!(c.getWorld().getGenerator() instanceof TerraChunkGenerator)) throw new IllegalArgumentException();
|
||||
if (!(c.getWorld().getGenerator() instanceof TerraChunkGenerator)) throw new IllegalArgumentException();
|
||||
popMap.get(c.getWorld()).checkNeighbors(c.getX(), c.getZ(), c.getWorld());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachProfiler(WorldProfiler p) {
|
||||
super.attachProfiler(p);
|
||||
popMan.attachProfiler(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkData generateBase(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, ChunkInterpolator interpolator) {
|
||||
if(needsLoad) load(world); // Load population data for world.
|
||||
if (needsLoad) load(world); // Load population data for world.
|
||||
ChunkData chunk = createChunkData(world);
|
||||
TerraWorld tw = TerraWorld.getWorld(world);
|
||||
if(!tw.isSafe()) return chunk;
|
||||
if (!tw.isSafe()) return chunk;
|
||||
ConfigPack config = tw.getConfig();
|
||||
int xOrig = (chunkX << 4);
|
||||
int zOrig = (chunkZ << 4);
|
||||
@@ -98,10 +105,11 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
BlockData data = b.getGenerator().getPalette(y).get(paletteLevel, cx, cz);
|
||||
chunk.setBlock(x, y, z, data);
|
||||
if(paletteLevel == 0 && slab != null && y < 255) {
|
||||
prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(), slab.getStairs(), slab.getSlabThreshold(), interpolator);
|
||||
prepareBlockPart(data, chunk.getBlockData(x, y + 1, z), chunk, new Vector(x, y + 1, z), slab.getSlabs(),
|
||||
slab.getStairs(), slab.getSlabThreshold(), interpolator);
|
||||
}
|
||||
paletteLevel++;
|
||||
} else if(y <= sea) {
|
||||
} else if (y <= sea) {
|
||||
chunk.setBlock(x, y, z, seaPalette.get(sea - y, x + xOrig, z + zOrig));
|
||||
paletteLevel = 0;
|
||||
} else paletteLevel = 0;
|
||||
@@ -111,16 +119,17 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
return chunk;
|
||||
}
|
||||
|
||||
private void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map<Material, Palette<BlockData>> slabs, Map<Material, Palette<BlockData>> stairs, double thresh, ChunkInterpolator interpolator) {
|
||||
if(interpolator.getNoise(block.getBlockX(), block.getBlockY() - 0.4, block.getBlockZ()) > thresh) {
|
||||
if(stairs != null) {
|
||||
private void prepareBlockPart(BlockData down, BlockData orig, ChunkData chunk, Vector block, Map<Material, Palette<BlockData>> slabs,
|
||||
Map<Material, Palette<BlockData>> stairs, double thresh, ChunkInterpolator interpolator) {
|
||||
if (interpolator.getNoise(block.getBlockX(), block.getBlockY() - 0.4, block.getBlockZ()) > thresh) {
|
||||
if (stairs != null) {
|
||||
Palette<BlockData> stairPalette = stairs.get(down.getMaterial());
|
||||
if(stairPalette != null) {
|
||||
if (stairPalette != null) {
|
||||
BlockData stair = stairPalette.get(0, block.getBlockX(), block.getBlockZ());
|
||||
Stairs stairNew = (Stairs) stair.clone();
|
||||
if(interpolator.getNoise(block.getBlockX() - 0.5, block.getBlockY(), block.getBlockZ()) > thresh) {
|
||||
if (interpolator.getNoise(block.getBlockX() - 0.5, block.getBlockY(), block.getBlockZ()) > thresh) {
|
||||
stairNew.setFacing(BlockFace.WEST);
|
||||
} else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() - 0.5) > thresh) {
|
||||
} else if (interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() - 0.5) > thresh) {
|
||||
stairNew.setFacing(BlockFace.NORTH);
|
||||
} else if(interpolator.getNoise(block.getBlockX(), block.getBlockY(), block.getBlockZ() + 0.5) > thresh) {
|
||||
stairNew.setFacing(BlockFace.SOUTH);
|
||||
@@ -154,12 +163,6 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
needsLoad = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachProfiler(WorldProfiler p) {
|
||||
super.attachProfiler(p);
|
||||
popMan.attachProfiler(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNoiseOctaves(World world) {
|
||||
return configPack.octaves;
|
||||
@@ -186,6 +189,11 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
return Arrays.asList(new CavePopulator(), new StructurePopulator(), popMan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isParallelCapable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldGenerateCaves() {
|
||||
return configPack.vanillaCaves;
|
||||
@@ -206,9 +214,4 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
return configPack.vanillaStructures;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isParallelCapable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import parsii.tokenizer.ParseException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
|
||||
public class UserDefinedGenerator extends Generator {
|
||||
private static final Object noiseLock = new Object();
|
||||
@@ -32,14 +32,15 @@ public class UserDefinedGenerator extends Generator {
|
||||
private final boolean preventSmooth;
|
||||
|
||||
|
||||
public UserDefinedGenerator(String equation, List<Variable> v, TreeMap<Integer, Palette<BlockData>> pa, boolean preventSmooth) throws ParseException {
|
||||
public UserDefinedGenerator(String equation, List<Variable> userVariables, Map<Integer, Palette<BlockData>> paletteMap, boolean preventSmooth)
|
||||
throws ParseException {
|
||||
Parser p = new Parser();
|
||||
p.registerFunction("noise2", n2);
|
||||
p.registerFunction("noise3", n3);
|
||||
for(int y = 0; y < 256; y++) {
|
||||
Palette<BlockData> d = DataUtil.BLANK_PALETTE;
|
||||
for(Map.Entry<Integer, Palette<BlockData>> e : pa.entrySet()) {
|
||||
if(e.getKey() >= y) {
|
||||
for(Map.Entry<Integer, Palette<BlockData>> e : paletteMap.entrySet()) {
|
||||
if (e.getKey() >= y) {
|
||||
d = e.getValue();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.io.IOException;
|
||||
public class ImageLoader {
|
||||
private final BufferedImage image;
|
||||
private final Align align;
|
||||
double inverseRoot2 = 0.7071067811865475;
|
||||
private static final double INVERSE_ROOT_2 = 0.7071067811865475;
|
||||
|
||||
public ImageLoader(File file, Align align) throws IOException {
|
||||
image = ImageIO.read(file);
|
||||
@@ -59,6 +59,20 @@ public class ImageLoader {
|
||||
return b;
|
||||
}
|
||||
|
||||
public void debug(boolean genStep, World w) {
|
||||
if (!ConfigUtil.debug) return;
|
||||
BufferedImage newImg = copyImage(image);
|
||||
if (genStep) {
|
||||
newImg = redrawStepped(image, w, align);
|
||||
}
|
||||
DebugGUI debugGUI = new DebugGUI(newImg);
|
||||
debugGUI.start();
|
||||
}
|
||||
|
||||
public double getNoiseVal(int x, int y, Channel channel) {
|
||||
return ((double) (getChannel(x, y, channel) - 128) / 128) * INVERSE_ROOT_2;
|
||||
}
|
||||
|
||||
public int getChannel(int x, int y, Channel channel) {
|
||||
int rgb;
|
||||
rgb = align.getRGB(image, x, y);
|
||||
@@ -70,7 +84,7 @@ public class ImageLoader {
|
||||
case BLUE:
|
||||
return rgb & 0xff;
|
||||
case ALPHA:
|
||||
return rgb >> 32 & 0xff;
|
||||
return rgb >> 24 & 0xff;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@ public class NoiseFunction2 implements Function {
|
||||
return cache.get(list.get(0).evaluate(), list.get(1).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaturalFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
|
||||
private final class Cache {
|
||||
private final double[] cacheX = new double[ConfigUtil.cacheSize];
|
||||
private final double[] cacheZ = new double[ConfigUtil.cacheSize];
|
||||
@@ -37,7 +37,7 @@ public class NoiseFunction2 implements Function {
|
||||
|
||||
public double get(double x, double z) {
|
||||
for(int i = 0; i < cacheX.length; i++) {
|
||||
if(cacheX[i] == x && cacheZ[i] == z) return cacheValues[i];
|
||||
if (cacheX[i] == x && cacheZ[i] == z) return cacheValues[i];
|
||||
}
|
||||
cacheX[0] = x;
|
||||
cacheZ[0] = z;
|
||||
|
||||
@@ -19,12 +19,12 @@ public class NoiseFunction3 implements Function {
|
||||
return gen.getNoise(list.get(0).evaluate(), list.get(1).evaluate(), list.get(2).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaturalFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,36 +30,6 @@ import java.util.Random;
|
||||
* Populates Flora and Trees
|
||||
*/
|
||||
public class FloraPopulator extends GaeaBlockPopulator {
|
||||
private static boolean doTrees(@NotNull UserDefinedBiome biome, TerraWorld world, @NotNull Random random, @NotNull Chunk chunk, int x, int z) {
|
||||
for(Block block : getValidTreeSpawnsAt(chunk, x, z, new Range(0, 254))) {
|
||||
Tree tree = biome.getDecorator().getTrees().get(random);
|
||||
Range range = world.getConfig().getBiome(biome).getTreeRange(tree);
|
||||
if(!range.isInRange(block.getY())) continue;
|
||||
try {
|
||||
Location l = block.getLocation();
|
||||
TreeGenerateEvent event = new TreeGenerateEvent(world, l, tree);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(!event.isCancelled()) tree.plant(l, random, Terra.getInstance());
|
||||
} catch(NullPointerException ignore) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int offset(Random r, int i) {
|
||||
return Math.min(Math.max(i + r.nextInt(3) - 1, 0), 15);
|
||||
}
|
||||
|
||||
public static List<Block> getValidTreeSpawnsAt(Chunk chunk, int x, int z, Range check) {
|
||||
List<Block> blocks = new ArrayList<>();
|
||||
for(int y : check) {
|
||||
if(chunk.getBlock(x, y, z).getType().isSolid() && chunk.getBlock(x, y + 1, z).getType().isAir()) {
|
||||
blocks.add(chunk.getBlock(x, y + 1, z));
|
||||
}
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("FloraTime")) {
|
||||
@@ -90,7 +60,7 @@ public class FloraPopulator extends GaeaBlockPopulator {
|
||||
item = biome.getDecorator().getFlora().get(f.getFloraNoise(), originX + x, originZ + z);
|
||||
else item = biome.getDecorator().getFlora().get(random);
|
||||
for(Block highest : item.getValidSpawnsAt(chunk, x, z, c.getFloraHeights(item))) {
|
||||
if(random.nextInt(100) < biome.getDecorator().getFloraChance())
|
||||
if (random.nextInt(100) < biome.getDecorator().getFloraChance())
|
||||
item.plant(highest.getLocation());
|
||||
}
|
||||
}
|
||||
@@ -100,4 +70,34 @@ public class FloraPopulator extends GaeaBlockPopulator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean doTrees(@NotNull UserDefinedBiome biome, TerraWorld world, @NotNull Random random, @NotNull Chunk chunk, int x, int z) {
|
||||
for(Block block : getValidTreeSpawnsAt(chunk, x, z, new Range(0, 254))) {
|
||||
Tree tree = biome.getDecorator().getTrees().get(random);
|
||||
Range range = world.getConfig().getBiome(biome).getTreeRange(tree);
|
||||
if (!range.isInRange(block.getY())) continue;
|
||||
try {
|
||||
Location l = block.getLocation();
|
||||
TreeGenerateEvent event = new TreeGenerateEvent(world, l, tree);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) tree.plant(l, random, Terra.getInstance());
|
||||
} catch(NullPointerException ignore) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<Block> getValidTreeSpawnsAt(Chunk chunk, int x, int z, Range check) {
|
||||
List<Block> blocks = new ArrayList<>();
|
||||
for(int y : check) {
|
||||
if (chunk.getBlock(x, y, z).getType().isSolid() && chunk.getBlock(x, y + 1, z).getType().isAir()) {
|
||||
blocks.add(chunk.getBlock(x, y + 1, z));
|
||||
}
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
private static int offset(Random r, int i) {
|
||||
return Math.min(Math.max(i + r.nextInt(3) - 1, 0), 15);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,8 +76,4 @@ public class StructurePopulator extends BlockPopulator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum SearchType {
|
||||
UP, DOWN
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.dfsek.terra.procgen.math;
|
||||
/**
|
||||
* oh yeah
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Vector2 implements Cloneable {
|
||||
private double x;
|
||||
private double z;
|
||||
@@ -58,36 +59,6 @@ public class Vector2 implements Cloneable {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide X and Z components by a value.
|
||||
*
|
||||
* @param d Divisor
|
||||
* @return Mutated vector, for chaining.
|
||||
*/
|
||||
public Vector2 divide(double d) {
|
||||
x /= d;
|
||||
z /= d;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the squared length of this Vector
|
||||
*
|
||||
* @return squared length
|
||||
*/
|
||||
public double lengthSquared() {
|
||||
return x * x + z * z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the length of this Vector
|
||||
*
|
||||
* @return length
|
||||
*/
|
||||
public double length() {
|
||||
return Math.sqrt(lengthSquared());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add this vector to another.
|
||||
*
|
||||
@@ -122,6 +93,36 @@ public class Vector2 implements Cloneable {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide X and Z components by a value.
|
||||
*
|
||||
* @param d Divisor
|
||||
* @return Mutated vector, for chaining.
|
||||
*/
|
||||
public Vector2 divide(double d) {
|
||||
x /= d;
|
||||
z /= d;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the length of this Vector
|
||||
*
|
||||
* @return length
|
||||
*/
|
||||
public double length() {
|
||||
return Math.sqrt(lengthSquared());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the squared length of this Vector
|
||||
*
|
||||
* @return squared length
|
||||
*/
|
||||
public double lengthSquared() {
|
||||
return x * x + z * z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the distance from this vector to another.
|
||||
*
|
||||
@@ -162,8 +163,12 @@ public class Vector2 implements Cloneable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "(" + x + ", " + z + ")";
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Vector2)) {
|
||||
return false;
|
||||
}
|
||||
Vector2 other = (Vector2) obj;
|
||||
return other.x == this.x && other.z == this.z;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,4 +179,9 @@ public class Vector2 implements Cloneable {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "(" + x + ", " + z + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.dfsek.terra.procgen.math.Vector2;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public abstract class Polygon {
|
||||
public abstract Set<Vector2> getContainedPixels();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.dfsek.terra.procgen.math.Vector2;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Rectangle extends Polygon {
|
||||
private final Vector2 min;
|
||||
private final Vector2 max;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class VoxelGeometry {
|
||||
public List<Vector> geometry = new ArrayList<>();
|
||||
private final List<Vector> geometry = new ArrayList<>();
|
||||
|
||||
public static VoxelGeometry getBlank() {
|
||||
return new VoxelGeometry() {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.dfsek.terra.structure;
|
||||
import org.bukkit.Location;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class InitializationException extends Exception {
|
||||
private final Location worldLoc;
|
||||
|
||||
|
||||
@@ -38,8 +38,9 @@ import java.util.function.Consumer;
|
||||
|
||||
import static com.dfsek.terra.util.structure.RotationUtil.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Structure implements Serializable {
|
||||
public static final long serialVersionUID = -6664585217063842035L;
|
||||
private static final long serialVersionUID = -6664585217063842035L;
|
||||
private final StructureContainedBlock[][][] structure;
|
||||
private final StructureInfo structureInfo;
|
||||
private final String id;
|
||||
@@ -53,7 +54,7 @@ public class Structure implements Serializable {
|
||||
this.uuid = UUID.randomUUID();
|
||||
this.spawns = new HashSet<>();
|
||||
this.inventories = new HashSet<>();
|
||||
if(l1.getX() > l2.getX() || l1.getY() > l2.getY() || l1.getZ() > l2.getZ())
|
||||
if (l1.getX() > l2.getX() || l1.getY() > l2.getY() || l1.getZ() > l2.getZ())
|
||||
throw new IllegalArgumentException("Invalid locations provided!");
|
||||
structure = new StructureContainedBlock[l2.getBlockX() - l1.getBlockX() + 1][l2.getBlockZ() - l1.getBlockZ() + 1][l2.getBlockY() - l1.getBlockY() + 1];
|
||||
for(int x = 0; x <= l2.getBlockX() - l1.getBlockX(); x++) {
|
||||
@@ -67,16 +68,16 @@ public class Structure implements Serializable {
|
||||
int pullOffset = 0;
|
||||
StructureSpawnRequirement requirement = StructureSpawnRequirement.BLANK;
|
||||
try {
|
||||
if(state instanceof Sign) { // Magic sign stuff
|
||||
if (state instanceof Sign) { // Magic sign stuff
|
||||
Sign s = (Sign) b.getState();
|
||||
if(s.getLine(0).equals("[TERRA]")) {
|
||||
if (s.getLine(0).equals("[TERRA]")) {
|
||||
try {
|
||||
d = Bukkit.createBlockData(s.getLine(2) + s.getLine(3));
|
||||
useState = false;
|
||||
if(s.getLine(1).equals("[CENTER]")) {
|
||||
if (s.getLine(1).equals("[CENTER]")) {
|
||||
centerX = x;
|
||||
centerZ = z;
|
||||
} else if(s.getLine(1).startsWith("[SPAWN=") && s.getLine(1).endsWith("]")) {
|
||||
} else if (s.getLine(1).startsWith("[SPAWN=") && s.getLine(1).endsWith("]")) {
|
||||
String og = s.getLine(1);
|
||||
String spawn = og.substring(og.indexOf("=") + 1, og.length() - 1);
|
||||
try {
|
||||
@@ -84,7 +85,7 @@ public class Structure implements Serializable {
|
||||
} catch(IllegalArgumentException e) {
|
||||
throw new InitializationException("Invalid spawn type: " + spawn, b.getLocation());
|
||||
}
|
||||
} else if(s.getLine(1).startsWith("[PULL=") && s.getLine(1).endsWith("]")) {
|
||||
} else if (s.getLine(1).startsWith("[PULL=") && s.getLine(1).endsWith("]")) {
|
||||
String og = s.getLine(1);
|
||||
String spawn = og.substring(og.indexOf("=") + 1, og.indexOf("_"));
|
||||
pullOffset = Integer.parseInt(og.substring(og.indexOf("_") + 1, og.length() - 1));
|
||||
@@ -105,15 +106,15 @@ public class Structure implements Serializable {
|
||||
throw new InitializationException("Invalid sign.", b.getLocation());
|
||||
}
|
||||
StructureContainedBlock block = new StructureContainedBlock(x, y, z, useState ? state : null, d, requirement, pull, pullOffset);
|
||||
if(state instanceof BlockInventoryHolder) {
|
||||
if (state instanceof BlockInventoryHolder) {
|
||||
inventories.add(new StructureContainedInventory(((BlockInventoryHolder) state).getInventory(), block));
|
||||
}
|
||||
if(!requirement.equals(StructureSpawnRequirement.BLANK)) spawns.add(block);
|
||||
if (!requirement.equals(StructureSpawnRequirement.BLANK)) spawns.add(block);
|
||||
structure[x][z][y] = block;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(centerX < 0 || centerZ < 0) throw new InitializationException("No structure center specified.", null);
|
||||
if (centerX < 0 || centerZ < 0) throw new InitializationException("No structure center specified.", null);
|
||||
structureInfo = new StructureInfo(l2.getBlockX() - l1.getBlockX() + 1, l2.getBlockY() - l1.getBlockY() + 1, l2.getBlockZ() - l1.getBlockZ() + 1, new Vector2(centerX, centerZ));
|
||||
}
|
||||
|
||||
@@ -150,22 +151,6 @@ public class Structure implements Serializable {
|
||||
return (Structure) o;
|
||||
}
|
||||
|
||||
private static void toFile(@NotNull Serializable o, @NotNull File f) throws IOException {
|
||||
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));
|
||||
oos.writeObject(o);
|
||||
oos.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get GaeaStructureInfo object
|
||||
*
|
||||
* @return Structure Info
|
||||
*/
|
||||
@NotNull
|
||||
public StructureInfo getStructureInfo() {
|
||||
return structureInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste the structure at a Location, ignoring chunk boundaries.
|
||||
*
|
||||
@@ -203,11 +188,53 @@ public class Structure implements Serializable {
|
||||
int zOr = (chunk.getZ() << 4);
|
||||
Range intersectX = new Range(xOr, xOr + 16).sub(origin.getBlockX() - structureInfo.getCenterX());
|
||||
Range intersectZ = new Range(zOr, zOr + 16).sub(origin.getBlockZ() - structureInfo.getCenterZ());
|
||||
if(intersectX == null || intersectZ == null) return;
|
||||
if (intersectX == null || intersectZ == null) return;
|
||||
executeForBlocksInRange(intersectX, getRange(Axis.Y, r), intersectZ, block -> pasteBlock(block, origin, r), r);
|
||||
Debug.info(intersectX.toString() + " : " + intersectZ.toString());
|
||||
}
|
||||
|
||||
public boolean checkSpawns(Location origin, Rotation r) {
|
||||
for(StructureContainedBlock b : spawns) {
|
||||
Vector2 rot = getRotatedCoords(new Vector2(b.getX() - structureInfo.getCenterX(), b.getZ() - structureInfo.getCenterZ()), r);
|
||||
if (!b.getRequirement().matches(origin.getWorld(), (int) rot.getX() + origin.getBlockX(), origin.getBlockY() + b.getY(), (int) rot.getZ() + origin.getBlockZ()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public HashSet<StructureContainedInventory> getInventories() {
|
||||
return inventories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste structure at an origin location, confined to a single chunk.
|
||||
*
|
||||
* @param origin Origin location
|
||||
* @param chunk Chunk to confine pasting to
|
||||
* @param r Rotation
|
||||
*/
|
||||
public void paste(Location origin, Chunk chunk, Rotation r) {
|
||||
int xOr = (chunk.getX() << 4);
|
||||
int zOr = (chunk.getZ() << 4);
|
||||
Range intersectX = new Range(xOr, xOr + 16).sub(origin.getBlockX() - structureInfo.getCenterX());
|
||||
Range intersectZ = new Range(zOr, zOr + 16).sub(origin.getBlockZ() - structureInfo.getCenterZ());
|
||||
if (intersectX == null || intersectZ == null) return;
|
||||
executeForBlocksInRange(intersectX, getRange(Axis.Y, r), intersectZ, block -> pasteBlock(block, origin, r), r);
|
||||
Debug.info(intersectX.toString() + " : " + intersectZ.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a set of coordinates is within the current structure
|
||||
*
|
||||
* @param x X coordinate
|
||||
* @param y Y coordinate
|
||||
* @param z Z coordinate
|
||||
* @return True if coordinate set is in structure, false if it is not.
|
||||
*/
|
||||
private boolean isInStructure(int x, int y, int z) {
|
||||
return x < structureInfo.getSizeX() && y < structureInfo.getSizeY() && z < structureInfo.getSizeZ() && x >= 0 && y >= 0 && z >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste a single StructureDefinedBlock at an origin location, offset by its coordinates.
|
||||
*
|
||||
@@ -223,8 +250,8 @@ public class Structure implements Serializable {
|
||||
Block worldBlock = loc.getBlock();
|
||||
main:
|
||||
while(worldBlock.isEmpty()) {
|
||||
if(loc.getBlockY() > 255 || loc.getBlockY() < 0) return;
|
||||
if(block.getPull() == null) break;
|
||||
if (loc.getBlockY() > 255 || loc.getBlockY() < 0) return;
|
||||
if (block.getPull() == null) break;
|
||||
switch(block.getPull()) {
|
||||
case UP:
|
||||
worldBlock = worldBlock.getRelative(BlockFace.UP);
|
||||
@@ -238,16 +265,16 @@ public class Structure implements Serializable {
|
||||
|
||||
}
|
||||
int offset = block.getPullOffset();
|
||||
if(offset != 0)
|
||||
if (offset != 0)
|
||||
worldBlock = worldBlock.getRelative((offset > 0) ? BlockFace.UP : BlockFace.DOWN, Math.abs(offset));
|
||||
|
||||
if(data instanceof Rotatable) {
|
||||
if (data instanceof Rotatable) {
|
||||
BlockFace rt = getRotatedFace(((Rotatable) data).getRotation(), r);
|
||||
((Rotatable) data).setRotation(rt);
|
||||
} else if(data instanceof Directional) {
|
||||
} else if (data instanceof Directional) {
|
||||
BlockFace rt = getRotatedFace(((Directional) data).getFacing(), r);
|
||||
((Directional) data).setFacing(rt);
|
||||
} else if(data instanceof MultipleFacing) {
|
||||
} else if (data instanceof MultipleFacing) {
|
||||
MultipleFacing mfData = (MultipleFacing) data;
|
||||
Map<BlockFace, Boolean> faces = new HashMap<>();
|
||||
for(BlockFace f : mfData.getAllowedFaces()) {
|
||||
@@ -256,13 +283,13 @@ public class Structure implements Serializable {
|
||||
for(Map.Entry<BlockFace, Boolean> face : faces.entrySet()) {
|
||||
mfData.setFace(getRotatedFace(face.getKey(), r), face.getValue());
|
||||
}
|
||||
} else if(data instanceof Rail) {
|
||||
} else if (data instanceof Rail) {
|
||||
Rail.Shape newShape = getRotatedRail(((Rail) data).getShape(), r);
|
||||
((Rail) data).setShape(newShape);
|
||||
} else if(data instanceof Orientable) {
|
||||
} else if (data instanceof Orientable) {
|
||||
org.bukkit.Axis newAxis = getRotatedAxis(((Orientable) data).getAxis(), r);
|
||||
((Orientable) data).setAxis(newAxis);
|
||||
} else if(data instanceof RedstoneWire) {
|
||||
} else if (data instanceof RedstoneWire) {
|
||||
Map<BlockFace, RedstoneWire.Connection> connections = new HashMap<>();
|
||||
RedstoneWire rData = (RedstoneWire) data;
|
||||
for(BlockFace f : rData.getAllowedFaces()) {
|
||||
@@ -273,12 +300,26 @@ public class Structure implements Serializable {
|
||||
}
|
||||
}
|
||||
worldBlock.setBlockData(data, false);
|
||||
if(block.getState() != null) {
|
||||
if (block.getState() != null) {
|
||||
block.getState().getState(worldBlock.getState()).update(true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Range getRawRange(@NotNull Axis a) {
|
||||
switch(a) {
|
||||
case X:
|
||||
return new Range(0, structureInfo.getSizeX());
|
||||
case Y:
|
||||
return new Range(0, structureInfo.getSizeY());
|
||||
case Z:
|
||||
return new Range(0, structureInfo.getSizeZ());
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a Consumer for all blocks in a cuboid region defined by 3 Ranges, accounting for rotation.
|
||||
*
|
||||
@@ -294,7 +335,7 @@ public class Structure implements Serializable {
|
||||
for(int z : zM) {
|
||||
Vector2 c = getRotatedCoords(new Vector2(x - structureInfo.getCenterX(), z - structureInfo.getCenterZ()), r);
|
||||
c.add(new Vector2(structureInfo.getCenterX(), structureInfo.getCenterZ()));
|
||||
if(isInStructure((int) c.getX(), y, (int) c.getZ())) {
|
||||
if (isInStructure((int) c.getX(), y, (int) c.getZ())) {
|
||||
StructureContainedBlock b = structure[(int) c.getX()][(int) c.getZ()][y];
|
||||
exec.accept(new StructureContainedBlock(x - getStructureInfo().getCenterX(), y, z - getStructureInfo().getCenterZ(), b.getState(), b.getBlockData(), b.getRequirement(), b.getPull(), b.getPullOffset()));
|
||||
}
|
||||
@@ -304,15 +345,28 @@ public class Structure implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a set of coordinates is within the current structure
|
||||
* Get GaeaStructureInfo object
|
||||
*
|
||||
* @param x X coordinate
|
||||
* @param y Y coordinate
|
||||
* @param z Z coordinate
|
||||
* @return True if coordinate set is in structure, false if it is not.
|
||||
* @return Structure Info
|
||||
*/
|
||||
private boolean isInStructure(int x, int y, int z) {
|
||||
return x < structureInfo.getSizeX() && y < structureInfo.getSizeY() && z < structureInfo.getSizeZ() && x >= 0 && y >= 0 && z >= 0;
|
||||
@NotNull
|
||||
public StructureInfo getStructureInfo() {
|
||||
return structureInfo;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Range getRange(@NotNull Axis a, @NotNull Rotation r) {
|
||||
if (a.equals(Axis.Y)) return getRawRange(a);
|
||||
Vector2 center = new Vector2(structureInfo.getCenterX(), structureInfo.getCenterZ());
|
||||
Range x = getRawRange(Axis.X);
|
||||
Range z = getRawRange(Axis.Z);
|
||||
Vector2 min = getRotatedCoords(new Vector2(x.getMin(), z.getMin()).subtract(center), r.inverse()).add(center);
|
||||
Vector2 max = getRotatedCoords(new Vector2(x.getMax(), z.getMax()).subtract(center), r.inverse()).add(center);
|
||||
|
||||
if (a.equals(Axis.X))
|
||||
return new Range((int) Math.floor(Math.min(min.getX(), max.getX())), (int) Math.ceil(Math.max(min.getX(), max.getX())) + 1);
|
||||
else
|
||||
return new Range((int) Math.floor(Math.min(min.getZ(), max.getZ())), (int) Math.ceil(Math.max(min.getZ(), max.getZ())) + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,6 +389,12 @@ public class Structure implements Serializable {
|
||||
toFile(this, f);
|
||||
}
|
||||
|
||||
private static void toFile(@NotNull Serializable o, @NotNull File f) throws IOException {
|
||||
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));
|
||||
oos.writeObject(o);
|
||||
oos.close();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return id;
|
||||
@@ -345,35 +405,6 @@ public class Structure implements Serializable {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Range getRange(@NotNull Axis a, @NotNull Rotation r) {
|
||||
if(a.equals(Axis.Y)) return getRawRange(a);
|
||||
Vector2 center = new Vector2(structureInfo.getCenterX(), structureInfo.getCenterZ());
|
||||
Range x = getRawRange(Axis.X);
|
||||
Range z = getRawRange(Axis.Z);
|
||||
Vector2 min = getRotatedCoords(new Vector2(x.getMin(), z.getMin()).subtract(center), r.inverse()).add(center);
|
||||
Vector2 max = getRotatedCoords(new Vector2(x.getMax(), z.getMax()).subtract(center), r.inverse()).add(center);
|
||||
|
||||
if(a.equals(Axis.X))
|
||||
return new Range((int) Math.floor(Math.min(min.getX(), max.getX())), (int) Math.ceil(Math.max(min.getX(), max.getX())) + 1);
|
||||
else
|
||||
return new Range((int) Math.floor(Math.min(min.getZ(), max.getZ())), (int) Math.ceil(Math.max(min.getZ(), max.getZ())) + 1);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Range getRawRange(@NotNull Axis a) {
|
||||
switch(a) {
|
||||
case X:
|
||||
return new Range(0, structureInfo.getSizeX());
|
||||
case Y:
|
||||
return new Range(0, structureInfo.getSizeY());
|
||||
case Z:
|
||||
return new Range(0, structureInfo.getSizeZ());
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public enum Axis {
|
||||
X, Y, Z
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class StructureContainedBlock implements Serializable {
|
||||
public static final long serialVersionUID = 6143969483382710947L;
|
||||
private static final long serialVersionUID = 6143969483382710947L;
|
||||
private final SerializableBlockData bl;
|
||||
private final Pull pull;
|
||||
private final int pullOffset;
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class StructureContainedInventory implements Serializable {
|
||||
public static final long serialVersionUID = -175339605585943678L;
|
||||
private static final long serialVersionUID = -175339605585943678L;
|
||||
private final int uid;
|
||||
private final int x, y, z;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.dfsek.terra.procgen.math.Vector2;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class StructureInfo implements Serializable {
|
||||
public static final long serialVersionUID = -175639605885943678L;
|
||||
private static final long serialVersionUID = -175639605885943678L;
|
||||
private final int sizeX;
|
||||
private final int sizeY;
|
||||
private final int sizeZ;
|
||||
|
||||
@@ -21,7 +21,7 @@ public enum StructureSpawnRequirement implements Serializable {
|
||||
ConfigPack wc = tw.getConfig();
|
||||
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
|
||||
BiomeConfig c = wc.getBiome(b);
|
||||
if(y <= c.getOcean().getSeaLevel()) return false;
|
||||
if (y <= c.getOcean().getSeaLevel()) return false;
|
||||
return b.getGenerator().getNoise(getNoise(w), w, x, y, z) <= 0;
|
||||
}
|
||||
}, OCEAN {
|
||||
@@ -30,7 +30,7 @@ public enum StructureSpawnRequirement implements Serializable {
|
||||
setNoise(w, x, y, z);
|
||||
UserDefinedBiome b = (UserDefinedBiome) TerraWorld.getWorld(w).getGrid().getBiome(x, z, GenerationPhase.POPULATE);
|
||||
BiomeConfig c = TerraWorld.getWorld(w).getConfig().getBiome(b);
|
||||
if(y > c.getOcean().getSeaLevel()) return false;
|
||||
if (y > c.getOcean().getSeaLevel()) return false;
|
||||
return b.getGenerator().getNoise(getNoise(w), w, x, y, z) <= 0;
|
||||
}
|
||||
}, LAND {
|
||||
@@ -49,18 +49,10 @@ public enum StructureSpawnRequirement implements Serializable {
|
||||
private static final long serialVersionUID = -175639605885943679L;
|
||||
private static final transient Map<World, FastNoiseLite> noiseMap = new HashMap<>();
|
||||
|
||||
public static void putNoise(World w, FastNoiseLite noise) {
|
||||
noiseMap.putIfAbsent(w, noise);
|
||||
}
|
||||
|
||||
private static FastNoiseLite getNoise(World w) {
|
||||
return noiseMap.get(w);
|
||||
}
|
||||
|
||||
private static void setNoise(World w, int x, int y, int z) {
|
||||
TerraWorld tw = TerraWorld.getWorld(w);
|
||||
ConfigPack wc = tw.getConfig();
|
||||
if(getNoise(w) == null) {
|
||||
if (getNoise(w) == null) {
|
||||
FastNoiseLite gen = new FastNoiseLite((int) w.getSeed());
|
||||
gen.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
gen.setFractalType(FastNoiseLite.FractalType.FBm);
|
||||
@@ -70,5 +62,13 @@ public enum StructureSpawnRequirement implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public static void putNoise(World w, FastNoiseLite noise) {
|
||||
noiseMap.putIfAbsent(w, noise);
|
||||
}
|
||||
|
||||
private static FastNoiseLite getNoise(World w) {
|
||||
return noiseMap.get(w);
|
||||
}
|
||||
|
||||
public abstract boolean matches(World w, int x, int y, int z);
|
||||
}
|
||||
|
||||
@@ -32,10 +32,6 @@ public class EntityFeature implements Feature {
|
||||
this.inSize = inSize;
|
||||
}
|
||||
|
||||
private static boolean isInChunk(Chunk c, Location l) {
|
||||
return Math.floorDiv(l.getBlockX(), 16) == c.getX() && Math.floorDiv(l.getBlockZ(), 16) == c.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Structure structure, Location l, Chunk chunk) {
|
||||
Random random = new Random(MathUtil.getCarverChunkSeed(chunk.getX(), chunk.getZ(), chunk.getWorld().getSeed()));
|
||||
@@ -67,15 +63,19 @@ public class EntityFeature implements Feature {
|
||||
for(int j = 1; j < inSize + 1; j++)
|
||||
if(!in.contains(on.getRelative(BlockFace.UP, j).getType())) canSpawn = false;
|
||||
|
||||
if(canSpawn) break;
|
||||
if (canSpawn) break;
|
||||
}
|
||||
if(canSpawn) {
|
||||
if (canSpawn) {
|
||||
Debug.info("Spawning entity at " + attempt);
|
||||
chunk.getWorld().spawnEntity(attempt.add(0.5, 2, 0.5), type); // Add 0.5 to X & Z so entity spawns in center of block.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isInChunk(Chunk c, Location l) {
|
||||
return Math.floorDiv(l.getBlockX(), 16) == c.getX() && Math.floorDiv(l.getBlockZ(), 16) == c.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Structure structure, Location l, Random random) {
|
||||
int amountSpawn = amount.get(random);
|
||||
@@ -112,8 +112,4 @@ public class EntityFeature implements Feature {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SpawnRule {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SerializableBlockData implements Serializable {
|
||||
public static final long serialVersionUID = 5298928608478640008L;
|
||||
private static final long serialVersionUID = 5298928608478640008L;
|
||||
private final String data;
|
||||
|
||||
public SerializableBlockData(BlockData d) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SerializableBanner implements SerializableBlockState {
|
||||
public static final long serialVersionUID = 5298928608478640004L;
|
||||
private static final long serialVersionUID = 5298928608478640004L;
|
||||
private final DyeColor base;
|
||||
private final ArrayList<Pattern> patterns = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class SerializableMonsterCage implements SerializableBlockState {
|
||||
public static final long serialVersionUID = 529892860847864007L;
|
||||
private static final long serialVersionUID = 529892860847864007L;
|
||||
private final EntityType type;
|
||||
private final int minDelay;
|
||||
private final int maxDelay;
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Sign;
|
||||
|
||||
public class SerializableSign implements SerializableBlockState {
|
||||
public static final long serialVersionUID = 5298928608478640001L;
|
||||
private static final long serialVersionUID = 5298928608478640001L;
|
||||
private final String[] text;
|
||||
private final boolean isEditable;
|
||||
|
||||
|
||||
@@ -5,10 +5,14 @@ import org.bukkit.StructureType;
|
||||
/**
|
||||
* Enum to represent StructureType, which is a class for some reason.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public enum StructureTypeEnum {
|
||||
MINESHAFT(StructureType.MINESHAFT),
|
||||
VILLAGE(StructureType.VILLAGE),
|
||||
NETHER_FORTRESS(StructureType.NETHER_FORTRESS),
|
||||
/**
|
||||
* Currently the only one used.
|
||||
*/
|
||||
STRONGHOLD(StructureType.STRONGHOLD),
|
||||
JUNGLE_PYRAMID(StructureType.JUNGLE_PYRAMID),
|
||||
OCEAN_RUIN(StructureType.OCEAN_RUIN),
|
||||
|
||||
@@ -40,27 +40,116 @@ public final class RotationUtil {
|
||||
BlockFace n = f;
|
||||
int rotateNum = r.getDegrees() / 90;
|
||||
int rn = faceRotation(f);
|
||||
if(rn >= 0) {
|
||||
if (rn >= 0) {
|
||||
n = fromRotation(faceRotation(n) + 4 * rotateNum);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an integer representation of a BlockFace, to perform math on.
|
||||
*
|
||||
* @param f BlockFace to get integer for
|
||||
* @return integer representation of BlockFace
|
||||
*/
|
||||
public static int faceRotation(BlockFace f) {
|
||||
switch(f) {
|
||||
case NORTH:
|
||||
return 0;
|
||||
case NORTH_NORTH_EAST:
|
||||
return 1;
|
||||
case NORTH_EAST:
|
||||
return 2;
|
||||
case EAST_NORTH_EAST:
|
||||
return 3;
|
||||
case EAST:
|
||||
return 4;
|
||||
case EAST_SOUTH_EAST:
|
||||
return 5;
|
||||
case SOUTH_EAST:
|
||||
return 6;
|
||||
case SOUTH_SOUTH_EAST:
|
||||
return 7;
|
||||
case SOUTH:
|
||||
return 8;
|
||||
case SOUTH_SOUTH_WEST:
|
||||
return 9;
|
||||
case SOUTH_WEST:
|
||||
return 10;
|
||||
case WEST_SOUTH_WEST:
|
||||
return 11;
|
||||
case WEST:
|
||||
return 12;
|
||||
case WEST_NORTH_WEST:
|
||||
return 13;
|
||||
case NORTH_WEST:
|
||||
return 14;
|
||||
case NORTH_NORTH_WEST:
|
||||
return 15;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert integer to BlockFace representation
|
||||
*
|
||||
* @param r integer to get BlockFace for
|
||||
* @return BlockFace represented by integer.
|
||||
*/
|
||||
public static BlockFace fromRotation(int r) {
|
||||
switch(Math.floorMod(r, 16)) {
|
||||
case 0:
|
||||
return BlockFace.NORTH;
|
||||
case 1:
|
||||
return BlockFace.NORTH_NORTH_EAST;
|
||||
case 2:
|
||||
return BlockFace.NORTH_EAST;
|
||||
case 3:
|
||||
return BlockFace.EAST_NORTH_EAST;
|
||||
case 4:
|
||||
return BlockFace.EAST;
|
||||
case 5:
|
||||
return BlockFace.EAST_SOUTH_EAST;
|
||||
case 6:
|
||||
return BlockFace.SOUTH_EAST;
|
||||
case 7:
|
||||
return BlockFace.SOUTH_SOUTH_EAST;
|
||||
case 8:
|
||||
return BlockFace.SOUTH;
|
||||
case 9:
|
||||
return BlockFace.SOUTH_SOUTH_WEST;
|
||||
case 10:
|
||||
return BlockFace.SOUTH_WEST;
|
||||
case 11:
|
||||
return BlockFace.WEST_SOUTH_WEST;
|
||||
case 12:
|
||||
return BlockFace.WEST;
|
||||
case 13:
|
||||
return BlockFace.WEST_NORTH_WEST;
|
||||
case 14:
|
||||
return BlockFace.NORTH_WEST;
|
||||
case 15:
|
||||
return BlockFace.NORTH_NORTH_WEST;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static org.bukkit.Axis getRotatedAxis(org.bukkit.Axis orig, Structure.Rotation r) {
|
||||
org.bukkit.Axis other = orig;
|
||||
final boolean shouldSwitch = r.equals(Structure.Rotation.CW_90) || r.equals(Structure.Rotation.CCW_90);
|
||||
switch(orig) {
|
||||
case X:
|
||||
if(shouldSwitch) other = org.bukkit.Axis.Z;
|
||||
if (shouldSwitch) other = org.bukkit.Axis.Z;
|
||||
break;
|
||||
case Z:
|
||||
if(shouldSwitch) other = org.bukkit.Axis.X;
|
||||
if (shouldSwitch) other = org.bukkit.Axis.X;
|
||||
break;
|
||||
}
|
||||
return other;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to rotate the incredibly obnoxious Rail.Shape enum
|
||||
*
|
||||
|
||||
@@ -12,13 +12,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public final class WorldEditUtil {
|
||||
public static WorldEditPlugin getWorldEdit() {
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(p instanceof WorldEditPlugin) return (WorldEditPlugin) p;
|
||||
Bukkit.getLogger().severe("[Terra] a command requiring WorldEdit was executed, but WorldEdit was not detected!");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Location[] getSelectionLocations(Player sender) {
|
||||
WorldEditPlugin we = WorldEditUtil.getWorldEdit();
|
||||
if(we == null) {
|
||||
@@ -43,9 +36,16 @@ public final class WorldEditUtil {
|
||||
return new Location[] {l1, l2};
|
||||
}
|
||||
|
||||
public static WorldEditPlugin getWorldEdit() {
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if (p instanceof WorldEditPlugin) return (WorldEditPlugin) p;
|
||||
Bukkit.getLogger().severe("[Terra] a command requiring WorldEdit was executed, but WorldEdit was not detected!");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Location[] getSelectionPositions(Player sender) {
|
||||
WorldEditPlugin we = WorldEditUtil.getWorldEdit();
|
||||
if(we == null) {
|
||||
if (we == null) {
|
||||
sender.sendMessage("WorldEdit is not installed! Please install WorldEdit before attempting to export structures.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
debug: false
|
||||
data-save: PT6M
|
||||
language: "en_us"
|
||||
fail-type: SHUTDOWN
|
||||
debug: false
|
||||
data-save: PT6M
|
||||
language: "en_us"
|
||||
fail-type: SHUTDOWN
|
||||
dump-default: true
|
||||
cache-size: 8
|
||||
cache-size: 8
|
||||
master-disable:
|
||||
caves: false
|
||||
@@ -9,57 +9,57 @@ carving:
|
||||
CAVERN: 5
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
COAL_ORE:
|
||||
min: 4
|
||||
max: 8
|
||||
min: 4
|
||||
max: 8
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 1
|
||||
min: 1
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -40,57 +40,57 @@ flora:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
COAL_ORE:
|
||||
min: 5
|
||||
max: 15
|
||||
min: 5
|
||||
max: 15
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -33,57 +33,57 @@ structures:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
COAL_ORE:
|
||||
min: 5
|
||||
max: 15
|
||||
min: 5
|
||||
max: 15
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -11,58 +11,58 @@ structures:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
COAL_ORE:
|
||||
min: 4
|
||||
max: 8
|
||||
min: 4
|
||||
max: 8
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 1
|
||||
min: 1
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
|
||||
@@ -82,7 +82,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.1
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
SMALL_ROCK:
|
||||
weight: 1
|
||||
@@ -106,8 +106,8 @@ flora:
|
||||
max: 180
|
||||
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
palettes:
|
||||
- "minecraft:stone": "MOUNTAIN_SLABS"
|
||||
- "minecraft:gravel": "MOUNTAIN_SLABS"
|
||||
|
||||
@@ -11,58 +11,58 @@ structures:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
COAL_ORE:
|
||||
min: 4
|
||||
max: 8
|
||||
min: 4
|
||||
max: 8
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 1
|
||||
min: 1
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
|
||||
@@ -82,7 +82,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.1
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
SMALL_ROCK:
|
||||
weight: 1
|
||||
@@ -106,8 +106,8 @@ flora:
|
||||
max: 180
|
||||
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
palettes:
|
||||
- "minecraft:stone": "MOUNTAIN_SLABS"
|
||||
- "minecraft:gravel": "MOUNTAIN_SLABS"
|
||||
|
||||
@@ -11,58 +11,58 @@ structures:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 1
|
||||
min: 0
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
COAL_ORE:
|
||||
min: 4
|
||||
max: 8
|
||||
min: 4
|
||||
max: 8
|
||||
min-height: 0
|
||||
max-height: 84
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 1
|
||||
min: 1
|
||||
max: 1
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
|
||||
@@ -82,7 +82,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.1
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
SMALL_ROCK:
|
||||
weight: 1
|
||||
@@ -106,8 +106,8 @@ flora:
|
||||
max: 180
|
||||
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
palettes:
|
||||
- "minecraft:stone": "MOUNTAIN_SLABS"
|
||||
- "minecraft:gravel": "MOUNTAIN_SLABS"
|
||||
|
||||
@@ -33,57 +33,57 @@ structures:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
COAL_ORE:
|
||||
min: 5
|
||||
max: 15
|
||||
min: 5
|
||||
max: 15
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -1,5 +1,5 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + |(noise2(x, z) / 3) + 0.1|"
|
||||
id: "PLAINS_ABSTRACT"
|
||||
id: "PLAINS_ABSTRACT"
|
||||
|
||||
carving:
|
||||
CAVE: 30
|
||||
@@ -12,57 +12,57 @@ structures:
|
||||
erodible: true
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
COAL_ORE:
|
||||
min: 3
|
||||
max: 7
|
||||
min: 3
|
||||
max: 7
|
||||
min-height: 0
|
||||
max-height: 72
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 7
|
||||
min: 2
|
||||
max: 7
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -32,57 +32,57 @@ carving:
|
||||
|
||||
ores:
|
||||
DIRT:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRAVEL:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
DIORITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
ANDESITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
GRANITE:
|
||||
min: 0
|
||||
max: 2
|
||||
min: 0
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
COAL_ORE:
|
||||
min: 5
|
||||
max: 15
|
||||
min: 5
|
||||
max: 15
|
||||
min-height: 0
|
||||
max-height: 128
|
||||
IRON_ORE:
|
||||
min: 2
|
||||
max: 6
|
||||
min: 2
|
||||
max: 6
|
||||
min-height: 0
|
||||
max-height: 64
|
||||
GOLD_ORE:
|
||||
min: 1
|
||||
max: 3
|
||||
min: 1
|
||||
max: 3
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
LAPIS_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 32
|
||||
REDSTONE_ORE:
|
||||
min: 1
|
||||
max: 4
|
||||
min: 1
|
||||
max: 4
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
DIAMOND_ORE:
|
||||
min: 1
|
||||
max: 2
|
||||
min: 1
|
||||
max: 2
|
||||
min-height: 0
|
||||
max-height: 16
|
||||
@@ -1,4 +1,4 @@
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "BEACH"
|
||||
vanilla: BEACH
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "BEACH"
|
||||
vanilla: BEACH
|
||||
erodible: true
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "COLD_BEACH"
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "COLD_BEACH"
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
- BEDROCK_MOST: 1
|
||||
@@ -8,4 +8,4 @@ palette:
|
||||
- GRAVEL: 64
|
||||
- TUNDRA: 255
|
||||
erodible: true
|
||||
vanilla: SNOWY_BEACH
|
||||
vanilla: SNOWY_BEACH
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "FROZEN_BEACH"
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "FROZEN_BEACH"
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
- BEDROCK_MOST: 1
|
||||
@@ -8,7 +8,7 @@ palette:
|
||||
- GRAVEL: 64
|
||||
- TUNDRA: 255
|
||||
erodible: true
|
||||
vanilla: SNOWY_BEACH
|
||||
vanilla: SNOWY_BEACH
|
||||
ocean:
|
||||
palette: "COLD_OCEAN"
|
||||
level: 62
|
||||
level: 62
|
||||
@@ -1,6 +1,6 @@
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "WARM_BEACH"
|
||||
vanilla: BEACH
|
||||
extends: "BEACH_ABSTRACT"
|
||||
id: "WARM_BEACH"
|
||||
vanilla: BEACH
|
||||
|
||||
erodible: true
|
||||
palette:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "DESERT"
|
||||
id: "DESERT"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -36,8 +36,8 @@ trees:
|
||||
max: 72
|
||||
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
palettes:
|
||||
- "minecraft:sand": "BLOCK:minecraft:sandstone_slab"
|
||||
use-stairs-if-available: true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "BIRCH_FOREST"
|
||||
extends: "BASIC_ORES"
|
||||
id: "BIRCH_FOREST"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -9,10 +9,10 @@ palette:
|
||||
- BEDROCK_LITTLE: 3
|
||||
- SANDY: 62
|
||||
- GRASSY: 255
|
||||
vanilla: BIRCH_FOREST
|
||||
vanilla: BIRCH_FOREST
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -30,7 +30,7 @@ flora:
|
||||
y:
|
||||
min: 62
|
||||
max: 84
|
||||
erodible: true
|
||||
erodible: true
|
||||
|
||||
trees:
|
||||
density: 200
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "DARK_FOREST"
|
||||
extends: "BASIC_ORES"
|
||||
id: "DARK_FOREST"
|
||||
|
||||
structures:
|
||||
- MANSION
|
||||
@@ -12,11 +12,11 @@ palette:
|
||||
- BEDROCK_LITTLE: 3
|
||||
- SANDY: 62
|
||||
- GRASSY: 255
|
||||
vanilla: DARK_FOREST
|
||||
erodible: true
|
||||
flora-chance: 40
|
||||
vanilla: DARK_FOREST
|
||||
erodible: true
|
||||
flora-chance: 40
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.25) / 3)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "JUNGLE"
|
||||
extends: "BASIC_ORES"
|
||||
id: "JUNGLE"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -10,14 +10,14 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: JUNGLE
|
||||
vanilla: JUNGLE
|
||||
|
||||
erodible: true
|
||||
erodible: true
|
||||
structures:
|
||||
- JUNGLE
|
||||
- STRONGHOLD
|
||||
flora:
|
||||
chance: 80
|
||||
chance: 80
|
||||
attempts: 2
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "FOREST"
|
||||
extends: "BASIC_ORES"
|
||||
id: "FOREST"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -10,10 +10,10 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: FOREST
|
||||
vanilla: FOREST
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -41,7 +41,7 @@ flora:
|
||||
y:
|
||||
min: 62
|
||||
max: 84
|
||||
erodible: true
|
||||
erodible: true
|
||||
|
||||
trees:
|
||||
density: 250
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 3)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "SAVANNA"
|
||||
extends: "BASIC_ORES"
|
||||
id: "SAVANNA"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -10,10 +10,10 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: SAVANNA
|
||||
vanilla: SAVANNA
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -26,7 +26,7 @@ flora:
|
||||
y:
|
||||
min: 62
|
||||
max: 84
|
||||
erodible: true
|
||||
erodible: true
|
||||
|
||||
trees:
|
||||
density: 20
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "SNOWY_TAIGA"
|
||||
erodible: true
|
||||
extends: "BASIC_ORES"
|
||||
id: "SNOWY_TAIGA"
|
||||
erodible: true
|
||||
|
||||
|
||||
palette:
|
||||
@@ -12,11 +12,11 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- TAIGA: 255
|
||||
vanilla: TAIGA
|
||||
vanilla: TAIGA
|
||||
|
||||
snow:
|
||||
- min: 0
|
||||
max: 255
|
||||
- min: 0
|
||||
max: 255
|
||||
chance: 100
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 63)^2)) + 1) + ((noise2(x, z)+0.5) / 2)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "TAIGA"
|
||||
extends: "BASIC_ORES"
|
||||
id: "TAIGA"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -10,11 +10,11 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- TAIGA: 255
|
||||
vanilla: TAIGA
|
||||
erodible: true
|
||||
vanilla: TAIGA
|
||||
erodible: true
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((max(noise2(x/1.5, z/1.5)+0.1, 0)) + 0.1)*5), 3)/2.5 + |(noise2(x, z)+0.1)/3|"
|
||||
extends: "BASIC_ORES"
|
||||
id: "MESA"
|
||||
extends: "BASIC_ORES"
|
||||
id: "MESA"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -22,9 +22,9 @@ palette:
|
||||
- "BLOCK:minecraft:red_terracotta": 84
|
||||
- "BLOCK:minecraft:orange_terracotta": 80
|
||||
- RED_DESERT: 72
|
||||
vanilla: BADLANDS
|
||||
vanilla: BADLANDS
|
||||
|
||||
flora-chance: 2
|
||||
flora-chance: 2
|
||||
flora:
|
||||
chance: 2
|
||||
attempts: 1
|
||||
@@ -40,8 +40,8 @@ flora:
|
||||
min: 62
|
||||
max: 84
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
enable: true
|
||||
threshold: 0.0075
|
||||
palettes:
|
||||
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab"
|
||||
use-stairs-if-available: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)*4), 3)/2.5 + |noise2(x/2.5, z/2.5)|"
|
||||
|
||||
id: "ARID_MOUNTAINS"
|
||||
extends: "BASIC_ORES"
|
||||
id: "ARID_MOUNTAINS"
|
||||
extends: "BASIC_ORES"
|
||||
|
||||
|
||||
palette:
|
||||
@@ -10,12 +10,12 @@ palette:
|
||||
- BEDROCK_HALF: 2
|
||||
- BEDROCK_LITTLE: 3
|
||||
- ARID: 255
|
||||
vanilla: SAVANNA
|
||||
vanilla: SAVANNA
|
||||
|
||||
erodible: false
|
||||
erodible: false
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -38,8 +38,8 @@ trees:
|
||||
min: 58
|
||||
max: 128
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
palettes:
|
||||
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab"
|
||||
use-stairs-if-available: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)), 3)/5 + |noise2(x/2.5, z/2.5)|"
|
||||
|
||||
id: "ARID_MOUNTAINS_0"
|
||||
extends: "BASIC_ORES"
|
||||
id: "ARID_MOUNTAINS_0"
|
||||
extends: "BASIC_ORES"
|
||||
|
||||
|
||||
palette:
|
||||
@@ -10,12 +10,12 @@ palette:
|
||||
- BEDROCK_HALF: 2
|
||||
- BEDROCK_LITTLE: 3
|
||||
- ARID: 255
|
||||
vanilla: SAVANNA
|
||||
vanilla: SAVANNA
|
||||
|
||||
erodible: false
|
||||
erodible: false
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -38,8 +38,8 @@ trees:
|
||||
min: 58
|
||||
max: 128
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
palettes:
|
||||
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab"
|
||||
use-stairs-if-available: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
noise-equation: "((-((y / 64)^2)) + 1) + min(floor(((|noise2(x/2.5, z/2.5)|) + 0.1)*3), 3)/3 + |noise2(x/2.5, z/2.5)|"
|
||||
|
||||
id: "ARID_MOUNTAINS_1"
|
||||
extends: "BASIC_ORES"
|
||||
id: "ARID_MOUNTAINS_1"
|
||||
extends: "BASIC_ORES"
|
||||
|
||||
|
||||
palette:
|
||||
@@ -10,12 +10,12 @@ palette:
|
||||
- BEDROCK_HALF: 2
|
||||
- BEDROCK_LITTLE: 3
|
||||
- ARID: 255
|
||||
vanilla: SAVANNA
|
||||
vanilla: SAVANNA
|
||||
|
||||
erodible: false
|
||||
erodible: false
|
||||
|
||||
flora:
|
||||
chance: 40
|
||||
chance: 40
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
@@ -38,8 +38,8 @@ trees:
|
||||
min: 58
|
||||
max: 128
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
palettes:
|
||||
- "minecraft:red_sand": "BLOCK:minecraft:red_sandstone_slab"
|
||||
use-stairs-if-available: true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "MOUNTAINS_PRETTY"
|
||||
id: "MOUNTAINS_STONE"
|
||||
extends: "MOUNTAINS_PRETTY"
|
||||
id: "MOUNTAINS_STONE"
|
||||
noise-equation: "((-((y / 76)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2)*4 + noise2(x*8, z*8)*0.25, 0)"
|
||||
prevent-smooth: true
|
||||
palette:
|
||||
@@ -10,16 +10,16 @@ palette:
|
||||
- MOUNTAIN_STONE: 255
|
||||
- MOUNTAIN_STONE_GRASS: 108
|
||||
- MOUNTAIN_GRASS: 84
|
||||
vanilla: MOUNTAINS
|
||||
vanilla: MOUNTAINS
|
||||
snow:
|
||||
- min: 0
|
||||
max: 120
|
||||
- min: 0
|
||||
max: 120
|
||||
chance: 50
|
||||
- min: 120
|
||||
max: 140
|
||||
- min: 120
|
||||
max: 140
|
||||
chance: 75
|
||||
- min: 140
|
||||
max: 255
|
||||
- min: 140
|
||||
max: 255
|
||||
chance: 100
|
||||
trees:
|
||||
density: 200
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "MOUNTAINS_PRETTY_0"
|
||||
id: "MOUNTAINS_STONE_0"
|
||||
extends: "MOUNTAINS_PRETTY_0"
|
||||
id: "MOUNTAINS_STONE_0"
|
||||
noise-equation: "((-((y / 64)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2), 0)"
|
||||
prevent-smooth: true
|
||||
palette:
|
||||
@@ -10,16 +10,16 @@ palette:
|
||||
- MOUNTAIN_STONE: 255
|
||||
- MOUNTAIN_STONE_GRASS: 108
|
||||
- MOUNTAIN_GRASS: 84
|
||||
vanilla: MOUNTAINS
|
||||
vanilla: MOUNTAINS
|
||||
snow:
|
||||
- min: 0
|
||||
max: 120
|
||||
- min: 0
|
||||
max: 120
|
||||
chance: 50
|
||||
- min: 120
|
||||
max: 140
|
||||
- min: 120
|
||||
max: 140
|
||||
chance: 75
|
||||
- min: 140
|
||||
max: 255
|
||||
- min: 140
|
||||
max: 255
|
||||
chance: 100
|
||||
trees:
|
||||
density: 200
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "MOUNTAINS_PRETTY_1"
|
||||
id: "MOUNTAINS_STONE_1"
|
||||
extends: "MOUNTAINS_PRETTY_1"
|
||||
id: "MOUNTAINS_STONE_1"
|
||||
noise-equation: "((-((y / 70)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(noise2(x/2, z/2)*3 + noise2(x*8, z*8)*0.125, 0)"
|
||||
prevent-smooth: true
|
||||
palette:
|
||||
@@ -10,16 +10,16 @@ palette:
|
||||
- MOUNTAIN_STONE: 255
|
||||
- MOUNTAIN_STONE_GRASS: 108
|
||||
- MOUNTAIN_GRASS: 84
|
||||
vanilla: MOUNTAINS
|
||||
vanilla: MOUNTAINS
|
||||
snow:
|
||||
- min: 0
|
||||
max: 120
|
||||
- min: 0
|
||||
max: 120
|
||||
chance: 50
|
||||
- min: 120
|
||||
max: 140
|
||||
- min: 120
|
||||
max: 140
|
||||
chance: 75
|
||||
- min: 140
|
||||
max: 255
|
||||
- min: 140
|
||||
max: 255
|
||||
chance: 100
|
||||
trees:
|
||||
density: 200
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 62)^2)) + 1) + ((noise2(x, z)+0.5) / 3) + max(floor(noise3(x/2, y, z/2)*10 + noise2(x/2, z/2)*55)/8, 0)"
|
||||
extends: "BASIC_ORES"
|
||||
id: "MOUNTAINS"
|
||||
extends: "BASIC_ORES"
|
||||
id: "MOUNTAINS"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -9,10 +9,10 @@ palette:
|
||||
- BEDROCK_LITTLE: 3
|
||||
- TUNDRA: 100
|
||||
- SNOW: 255
|
||||
vanilla: MOUNTAINS
|
||||
vanilla: MOUNTAINS
|
||||
|
||||
flora:
|
||||
chance: 2
|
||||
chance: 2
|
||||
attempts: 1
|
||||
items:
|
||||
SMALL_ROCK:
|
||||
@@ -21,8 +21,8 @@ flora:
|
||||
min: 60
|
||||
max: 72
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
palettes:
|
||||
- "minecraft:stone": "MOUNTAIN_SLABS"
|
||||
- "minecraft:snow_block": "SNOW_LAYERS"
|
||||
|
||||
@@ -14,7 +14,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.05
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
TALL_SEAGRASS:
|
||||
weight: 1
|
||||
|
||||
@@ -14,7 +14,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.05
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
TALL_SEAGRASS:
|
||||
weight: 1
|
||||
|
||||
@@ -14,7 +14,7 @@ flora:
|
||||
simplex:
|
||||
enable: true
|
||||
frequency: 0.05
|
||||
seed: 4
|
||||
seed: 4
|
||||
items:
|
||||
TALL_SEAGRASS:
|
||||
weight: 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "PLAINS"
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "PLAINS"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -9,12 +9,12 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: PLAINS
|
||||
vanilla: PLAINS
|
||||
|
||||
erodible: true
|
||||
|
||||
flora:
|
||||
chance: 60
|
||||
chance: 60
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "SKY_ISLANDS"
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "SKY_ISLANDS"
|
||||
|
||||
noise-equation: "if(max(y-96, 0), -(if(max(y-150, 0), |y-150|, |y-150|/16)) - 0.25 + (noise2(x*3, z*3)*3), ((-((y / 63)^2)) + 1) + |(noise2(x, z) / 3) + 0.1|)"
|
||||
|
||||
@@ -11,12 +11,12 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: PLAINS
|
||||
vanilla: PLAINS
|
||||
|
||||
erodible: true
|
||||
erodible: true
|
||||
|
||||
flora:
|
||||
chance: 60
|
||||
chance: 60
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 58)^2)) + 1) + ((noise2(x, z)/4))"
|
||||
extends: "BASIC_ORES"
|
||||
id: "RIVER"
|
||||
extends: "BASIC_ORES"
|
||||
id: "RIVER"
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
- BEDROCK_MOST: 1
|
||||
@@ -9,10 +9,10 @@ palette:
|
||||
- RIVER_BOTTOM: 61
|
||||
- RIVER_SHORE: 62
|
||||
- GRASSY: 255
|
||||
vanilla: RIVER
|
||||
vanilla: RIVER
|
||||
|
||||
flora:
|
||||
chance: 60
|
||||
chance: 60
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
noise-equation: "((-((y / 62)^2)) + 1) + ((noise2(x, z)/4))"
|
||||
extends: "BASIC_ORES"
|
||||
id: "SWAMP"
|
||||
extends: "BASIC_ORES"
|
||||
id: "SWAMP"
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
- BEDROCK_MOST: 1
|
||||
@@ -8,9 +8,9 @@ palette:
|
||||
- BEDROCK_LITTLE: 3
|
||||
- SWAMP_BOTTOM: 61
|
||||
- SWAMP: 255
|
||||
vanilla: SWAMP
|
||||
vanilla: SWAMP
|
||||
flora:
|
||||
chance: 80
|
||||
chance: 80
|
||||
attempts: 1
|
||||
items:
|
||||
TALL_GRASS:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "TUNDRA"
|
||||
extends: "PLAINS_ABSTRACT"
|
||||
id: "TUNDRA"
|
||||
|
||||
palette:
|
||||
- "BLOCK:minecraft:bedrock": 0
|
||||
@@ -7,15 +7,15 @@ palette:
|
||||
- BEDROCK_HALF: 2
|
||||
- BEDROCK_LITTLE: 3
|
||||
- TUNDRA: 255
|
||||
vanilla: SNOWY_TUNDRA
|
||||
vanilla: SNOWY_TUNDRA
|
||||
carving:
|
||||
CAVE_TUNDRA: 35
|
||||
RAVINE: 5
|
||||
CAVERN: 5
|
||||
RAVINE: 5
|
||||
CAVERN: 5
|
||||
|
||||
snow:
|
||||
- min: 0
|
||||
max: 255
|
||||
- min: 0
|
||||
max: 255
|
||||
chance: 30
|
||||
erodible: true
|
||||
|
||||
@@ -36,8 +36,8 @@ trees:
|
||||
min: 58
|
||||
max: 84
|
||||
slabs:
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
enable: true
|
||||
threshold: 0.015
|
||||
palettes:
|
||||
- "minecraft:stone": "MOUNTAIN_SLABS"
|
||||
- "minecraft:snow_block": "SNOW_LAYERS"
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 0
|
||||
bottom: 1
|
||||
mutate:
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 0
|
||||
bottom: 0
|
||||
mutate:
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 0
|
||||
bottom: 0
|
||||
mutate:
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 0
|
||||
bottom: 0
|
||||
mutate:
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 0
|
||||
bottom: 1
|
||||
mutate:
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
x: 2
|
||||
y: 6
|
||||
z: 2
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -20,9 +20,9 @@ cut:
|
||||
top: 1
|
||||
bottom: 2
|
||||
mutate:
|
||||
x: 1
|
||||
y: 4
|
||||
z: 1
|
||||
x: 1
|
||||
y: 4
|
||||
z: 1
|
||||
radius: 0.125
|
||||
palette:
|
||||
inner:
|
||||
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:andesite"
|
||||
radius:
|
||||
min: 3
|
||||
max: 4
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.1
|
||||
id: "ANDESITE"
|
||||
id: "ANDESITE"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:diorite"
|
||||
radius:
|
||||
min: 3
|
||||
max: 4
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.1
|
||||
id: "DIORITE"
|
||||
id: "DIORITE"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:dirt"
|
||||
radius:
|
||||
min: 3
|
||||
max: 4
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.1
|
||||
id: "DIRT"
|
||||
id: "DIRT"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:granite"
|
||||
radius:
|
||||
min: 3
|
||||
max: 4
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.1
|
||||
id: "GRANITE"
|
||||
id: "GRANITE"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:gravel"
|
||||
radius:
|
||||
min: 3
|
||||
max: 4
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.1
|
||||
id: "GRAVEL"
|
||||
id: "GRAVEL"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
@@ -2,8 +2,8 @@ material: "minecraft:coal_ore"
|
||||
radius:
|
||||
min: 1
|
||||
max: 2
|
||||
deform: 0.75
|
||||
deform: 0.75
|
||||
deform-frequency: 0.2
|
||||
id: "COAL_ORE"
|
||||
id: "COAL_ORE"
|
||||
replace:
|
||||
- "minecraft:stone"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user