mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 18:42:30 +00:00
Implement new config exceptions, general config cleanup
This commit is contained in:
parent
88067a04c8
commit
a5c85a7e5d
@ -1,7 +1,7 @@
|
|||||||
package com.dfsek.terra;
|
package com.dfsek.terra;
|
||||||
|
|
||||||
import com.dfsek.terra.command.TerraCommand;
|
import com.dfsek.terra.command.TerraCommand;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.generation.TerraChunkGenerator;
|
import com.dfsek.terra.generation.TerraChunkGenerator;
|
||||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||||
import me.lucko.commodore.Commodore;
|
import me.lucko.commodore.Commodore;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.dfsek.terra.biome;
|
package com.dfsek.terra.biome;
|
||||||
|
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import com.dfsek.terra.image.ImageLoader;
|
import com.dfsek.terra.image.ImageLoader;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.dfsek.terra.biome;
|
package com.dfsek.terra.biome;
|
||||||
|
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.dfsek.terra.biome;
|
package com.dfsek.terra.biome;
|
||||||
|
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import com.dfsek.terra.config.genconfig.BiomeGridConfig;
|
|
||||||
import com.dfsek.terra.image.ImageLoader;
|
import com.dfsek.terra.image.ImageLoader;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -9,7 +8,6 @@ import org.polydev.gaea.biome.Biome;
|
|||||||
import org.polydev.gaea.biome.BiomeGrid;
|
import org.polydev.gaea.biome.BiomeGrid;
|
||||||
import org.polydev.gaea.biome.NormalizationUtil;
|
import org.polydev.gaea.biome.NormalizationUtil;
|
||||||
import org.polydev.gaea.generation.GenerationPhase;
|
import org.polydev.gaea.generation.GenerationPhase;
|
||||||
import org.polydev.gaea.math.Interpolator;
|
|
||||||
|
|
||||||
public class UserDefinedGrid extends BiomeGrid {
|
public class UserDefinedGrid extends BiomeGrid {
|
||||||
private final ImageLoader imageLoader;
|
private final ImageLoader imageLoader;
|
||||||
|
@ -2,7 +2,7 @@ package com.dfsek.terra.command;
|
|||||||
|
|
||||||
import com.dfsek.terra.Terra;
|
import com.dfsek.terra.Terra;
|
||||||
import com.dfsek.terra.command.type.Command;
|
import com.dfsek.terra.command.type.Command;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package com.dfsek.terra.command.image.gui;
|
package com.dfsek.terra.command.image.gui;
|
||||||
|
|
||||||
import com.dfsek.terra.command.type.WorldCommand;
|
import com.dfsek.terra.command.type.WorldCommand;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import com.dfsek.terra.image.ImageLoader;
|
import com.dfsek.terra.image.ImageLoader;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package com.dfsek.terra.command.image.gui;
|
package com.dfsek.terra.command.image.gui;
|
||||||
|
|
||||||
import com.dfsek.terra.command.type.WorldCommand;
|
import com.dfsek.terra.command.type.WorldCommand;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import com.dfsek.terra.image.ImageLoader;
|
import com.dfsek.terra.image.ImageLoader;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
|
@ -6,11 +6,54 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a command or subcommand, can be nested via getSubCommands.
|
||||||
|
*/
|
||||||
public abstract class Command {
|
public abstract class Command {
|
||||||
|
/**
|
||||||
|
* Gets the name of the command/subcommand
|
||||||
|
* @return Name of command
|
||||||
|
*/
|
||||||
public abstract String getName();
|
public abstract String getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a list of subcommands
|
||||||
|
* @return List of subcommands
|
||||||
|
*/
|
||||||
public abstract List<Command> getSubCommands();
|
public abstract List<Command> getSubCommands();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes the given command, returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Source of the command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
public abstract boolean onCommand(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args);
|
public abstract boolean onCommand(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the number of arguments
|
||||||
|
* @return Number of arguments
|
||||||
|
*/
|
||||||
public abstract int arguments();
|
public abstract int arguments();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes the given command, invoking subcommands if applicable and returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Source of the command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
public final boolean execute(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) {
|
public final boolean execute(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
if(args.length > 0) {
|
if(args.length > 0) {
|
||||||
for(Command c : getSubCommands()) {
|
for(Command c : getSubCommands()) {
|
||||||
|
@ -4,7 +4,22 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A command that may only be executed by a player. If executor is not a player, a message will be displayed and no action will be performed.
|
||||||
|
*/
|
||||||
public abstract class PlayerCommand extends Command {
|
public abstract class PlayerCommand extends Command {
|
||||||
|
/**
|
||||||
|
* Executes the given command, returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Source of the command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
if(!(sender instanceof Player)) {
|
if(!(sender instanceof Player)) {
|
||||||
@ -14,5 +29,17 @@ public abstract class PlayerCommand extends Command {
|
|||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
return onCommand(p, command, label, args);
|
return onCommand(p, command, label, args);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Executes the given command, returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Player that executed command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
public abstract boolean onCommand(@NotNull Player sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args);
|
public abstract boolean onCommand(@NotNull Player sender, org.bukkit.command.@NotNull Command command, @NotNull String label, @NotNull String[] args);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,22 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A command that must be executed by a player, in a Terra world.
|
||||||
|
*/
|
||||||
public abstract class WorldCommand extends PlayerCommand {
|
public abstract class WorldCommand extends PlayerCommand {
|
||||||
|
/**
|
||||||
|
* Executes the given command, returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Source of the command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
public boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
if(sender.getWorld().getGenerator() instanceof TerraChunkGenerator) {
|
if(sender.getWorld().getGenerator() instanceof TerraChunkGenerator) {
|
||||||
@ -17,5 +32,18 @@ public abstract class WorldCommand extends PlayerCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes the given command, returning its success.
|
||||||
|
* <br>
|
||||||
|
* If false is returned, then the "usage" plugin.yml entry for this command
|
||||||
|
* (if defined) will be sent to the player.
|
||||||
|
*
|
||||||
|
* @param sender Player that executed command
|
||||||
|
* @param command Command which was executed
|
||||||
|
* @param label Alias of the command which was used
|
||||||
|
* @param args Passed command arguments
|
||||||
|
* @param world World in which command was executed
|
||||||
|
* @return true if a valid command, otherwise false
|
||||||
|
*/
|
||||||
public abstract boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, World world);
|
public abstract boolean onCommand(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args, World world);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.dfsek.terra.config;
|
package com.dfsek.terra.config;
|
||||||
|
|
||||||
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.polydev.gaea.commons.io.FilenameUtils;
|
import org.polydev.gaea.commons.io.FilenameUtils;
|
||||||
@ -11,9 +12,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class ConfigLoader {
|
public class ConfigLoader {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.dfsek.terra.config;
|
package com.dfsek.terra.config.base;
|
||||||
|
|
||||||
import com.dfsek.terra.biome.BiomeZone;
|
import com.dfsek.terra.biome.BiomeZone;
|
||||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||||
|
import com.dfsek.terra.config.ConfigLoader;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import com.dfsek.terra.config.genconfig.AbstractBiomeConfig;
|
import com.dfsek.terra.config.genconfig.AbstractBiomeConfig;
|
||||||
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
||||||
import com.dfsek.terra.config.genconfig.BiomeGridConfig;
|
import com.dfsek.terra.config.genconfig.BiomeGridConfig;
|
||||||
@ -10,13 +12,18 @@ import com.dfsek.terra.config.genconfig.FloraConfig;
|
|||||||
import com.dfsek.terra.config.genconfig.OreConfig;
|
import com.dfsek.terra.config.genconfig.OreConfig;
|
||||||
import com.dfsek.terra.config.genconfig.PaletteConfig;
|
import com.dfsek.terra.config.genconfig.PaletteConfig;
|
||||||
import com.dfsek.terra.config.genconfig.StructureConfig;
|
import com.dfsek.terra.config.genconfig.StructureConfig;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -59,4 +66,16 @@ public class ConfigUtil {
|
|||||||
public static <E extends Enum<E>> List<E> getElements(List<String> st, Class<E> clazz) {
|
public static <E extends Enum<E>> List<E> getElements(List<String> st, Class<E> clazz) {
|
||||||
return st.stream().map((s) -> E.valueOf(clazz, s)).collect(Collectors.toList());
|
return st.stream().map((s) -> E.valueOf(clazz, s)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
public static Set<Material> toBlockData(List<String> list, String phase, String id) throws InvalidConfigurationException {
|
||||||
|
Set<Material> bl = new HashSet<>();
|
||||||
|
for(String s : list) {
|
||||||
|
try {
|
||||||
|
if(bl.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in " + phase + " list: " + s);
|
||||||
|
bl.add(Bukkit.createBlockData(s).getMaterial());
|
||||||
|
} catch(NullPointerException | IllegalArgumentException e) {
|
||||||
|
throw new ConfigException("Could not load BlockData data for \"" + s + "\"", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bl;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.dfsek.terra.config;
|
package com.dfsek.terra.config.base;
|
||||||
|
|
||||||
import com.dfsek.terra.Terra;
|
import com.dfsek.terra.Terra;
|
||||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
import com.dfsek.terra.biome.UserDefinedBiome;
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.dfsek.terra.config.exception;
|
||||||
|
|
||||||
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thrown when a config item is not valid.
|
||||||
|
*/
|
||||||
|
public class ConfigException extends InvalidConfigurationException {
|
||||||
|
private final String message;
|
||||||
|
private final String id;
|
||||||
|
public ConfigException(String message, String id) {
|
||||||
|
this.message = message;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
String ex = getStackTrace()[0].getClassName();
|
||||||
|
return "Configuration error for " + ex.substring(ex.lastIndexOf(".")+1) + " with ID \"" + id + "\": \n\n" + message;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.dfsek.terra.config.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thrown when a required config item is not found.
|
||||||
|
*/
|
||||||
|
public class NotFoundException extends ConfigException {
|
||||||
|
public NotFoundException(String item, String itemName, String id) {
|
||||||
|
super(item + " \"" + itemName + "\" cannot be found!", id);
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,11 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
import org.polydev.gaea.math.Range;
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import com.dfsek.terra.TerraTree;
|
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.polydev.gaea.math.ProbabilityCollection;
|
|
||||||
import org.polydev.gaea.tree.Tree;
|
|
||||||
import org.polydev.gaea.tree.TreeType;
|
|
||||||
import org.polydev.gaea.world.Flora;
|
|
||||||
import org.polydev.gaea.world.FloraType;
|
|
||||||
import org.polydev.gaea.world.palette.Palette;
|
import org.polydev.gaea.world.palette.Palette;
|
||||||
import org.polydev.gaea.world.palette.RandomPalette;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -23,8 +13,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
public class AbstractBiomeConfig extends TerraConfigObject {
|
public class AbstractBiomeConfig extends TerraConfigObject {
|
||||||
private static final Map<String, AbstractBiomeConfig> biomes = new HashMap<>();
|
private static final Map<String, AbstractBiomeConfig> biomes = new HashMap<>();
|
||||||
@ -56,7 +44,7 @@ public class AbstractBiomeConfig extends TerraConfigObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Abstract Biome ID unspecified!");
|
if(!contains("id")) throw new ConfigException("Abstract Biome ID unspecified!", "null");
|
||||||
this.biomeID = getString("id");
|
this.biomeID = getString("id");
|
||||||
|
|
||||||
if(contains("carving")) carvingData = getMapList("carving");
|
if(contains("carving")) carvingData = getMapList("carving");
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
|
import com.dfsek.terra.config.exception.NotFoundException;
|
||||||
import org.polydev.gaea.math.Range;
|
import org.polydev.gaea.math.Range;
|
||||||
import com.dfsek.terra.TerraTree;
|
import com.dfsek.terra.TerraTree;
|
||||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||||
import com.dfsek.terra.generation.UserDefinedDecorator;
|
import com.dfsek.terra.generation.UserDefinedDecorator;
|
||||||
import com.dfsek.terra.generation.UserDefinedGenerator;
|
import com.dfsek.terra.generation.UserDefinedGenerator;
|
||||||
import com.dfsek.terra.carving.UserDefinedCarver;
|
import com.dfsek.terra.carving.UserDefinedCarver;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -63,9 +65,8 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked, rawtypes")
|
@SuppressWarnings("unchecked, rawtypes")
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Biome ID unspecified!");
|
if(!contains("id")) throw new ConfigException("Biome ID unspecified!", "null");
|
||||||
this.biomeID = getString("id");
|
this.biomeID = getString("id");
|
||||||
if(!contains("noise-equation") && !contains("extends")) throw new InvalidConfigurationException("Biomes must either include noise equation or extend biome containing an equation.");
|
|
||||||
|
|
||||||
AbstractBiomeConfig abstractBiome = null;
|
AbstractBiomeConfig abstractBiome = null;
|
||||||
// Whether an abstract biome is to be extended. Default to false.
|
// Whether an abstract biome is to be extended. Default to false.
|
||||||
@ -77,7 +78,7 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
extending = true;
|
extending = true;
|
||||||
Bukkit.getLogger().info("Extending biome " + getString("extends"));
|
Bukkit.getLogger().info("Extending biome " + getString("extends"));
|
||||||
} catch(NullPointerException e) {
|
} catch(NullPointerException e) {
|
||||||
throw new InvalidConfigurationException("No abstract biome, " +getString("extends") + ", found.");
|
throw new ConfigException("No abstract biome with ID " + getString("extends") + " found.", getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,22 +102,22 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
try {
|
try {
|
||||||
paletteMap.put((Integer) entry.getValue(), new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(((String) entry.getKey()).substring(6)), 1), 1));
|
paletteMap.put((Integer) entry.getValue(), new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(((String) entry.getKey()).substring(6)), 1), 1));
|
||||||
} catch(IllegalArgumentException ex) {
|
} catch(IllegalArgumentException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Palettes in biome ID: " + biomeID + ". BlockData " + entry.getKey() + " is invalid!");
|
throw new ConfigException("BlockData " + entry.getKey() + " is invalid! (Palettes)", getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
paletteMap.put((Integer) entry.getValue(), PaletteConfig.fromID((String) entry.getKey()).getPalette());
|
paletteMap.put((Integer) entry.getValue(), PaletteConfig.fromID((String) entry.getKey()).getPalette());
|
||||||
} catch(NullPointerException ex) {
|
} catch(NullPointerException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Palettes in biome ID: " + biomeID + "\n\nPalette " + entry.getKey() + " cannot be found!");
|
throw new NotFoundException("Palette", (String) entry.getKey(), getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ClassCastException ex) {
|
} catch(ClassCastException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Palettes in biome ID: " + biomeID);
|
throw new ConfigException("Unable to parse Palette configuration! Check YAML syntax.", getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else throw new InvalidConfigurationException("No palette specified in biome or super biome.");
|
} else throw new ConfigException("No Palette specified in biome or super biome.", getID());
|
||||||
|
|
||||||
// Check if carving should be handled by super biome.
|
// Check if carving should be handled by super biome.
|
||||||
List<Map<?, ?>> carvingData;
|
List<Map<?, ?>> carvingData;
|
||||||
@ -138,9 +139,9 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
Bukkit.getLogger().info("Got carver " + c + ". Adding with weight " + entry.getValue());
|
Bukkit.getLogger().info("Got carver " + c + ". Adding with weight " + entry.getValue());
|
||||||
carvers.put(c, (Integer) entry.getValue());
|
carvers.put(c, (Integer) entry.getValue());
|
||||||
} catch(ClassCastException ex) {
|
} catch(ClassCastException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Carvers in biome ID: " + biomeID);
|
throw new ConfigException("Unable to parse Carver configuration! Check YAML syntax.", getID());
|
||||||
} catch(NullPointerException ex) {
|
} catch(NullPointerException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Carvers in biome ID: " + biomeID + "\n\n" + "No such carver " + entry.getKey());
|
throw new NotFoundException("carver", (String) entry.getKey(), getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,13 +211,13 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
flora.add(floraCustom, (Integer) val.get("weight"));
|
flora.add(floraCustom, (Integer) val.get("weight"));
|
||||||
floraHeights.put(floraCustom, new Range((Integer) y.get("min"), (Integer) y.get("max")));
|
floraHeights.put(floraCustom, new Range((Integer) y.get("min"), (Integer) y.get("max")));
|
||||||
} catch(NullPointerException ex2) {
|
} catch(NullPointerException ex2) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for flora in biome ID " + getID() + "\n\nFlora with ID " + e.getKey() + " cannot be found!");
|
throw new NotFoundException("Flora", e.getKey(), getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ClassCastException e) {
|
} catch(ClassCastException e) {
|
||||||
if(ConfigUtil.debug) e.printStackTrace();
|
if(ConfigUtil.debug) e.printStackTrace();
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for flora in biome ID " + getID());
|
throw new ConfigException("Unable to parse Flora configuration! Check YAML syntax.", getID());
|
||||||
}
|
}
|
||||||
} else flora = new ProbabilityCollection<>();
|
} else flora = new ProbabilityCollection<>();
|
||||||
|
|
||||||
@ -242,7 +243,7 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
} else trees = new ProbabilityCollection<>();
|
} else trees = new ProbabilityCollection<>();
|
||||||
|
|
||||||
//Make sure equation is non-null
|
//Make sure equation is non-null
|
||||||
if(eq == null) throw new InvalidConfigurationException("Noise equation must be specified in biome or super biome.");
|
if(eq == null || eq.equals("")) throw new ConfigException("Could not find noise equation! Biomes must include a noise equation, or extend an abstract biome with one.", getID());
|
||||||
|
|
||||||
// Create decorator for this config.
|
// Create decorator for this config.
|
||||||
UserDefinedDecorator dec = new UserDefinedDecorator(flora, trees, floraChance, treeChance, treeDensity);
|
UserDefinedDecorator dec = new UserDefinedDecorator(flora, trees, floraChance, treeChance, treeDensity);
|
||||||
@ -250,10 +251,10 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
// Get Vanilla biome, throw exception if it is invalid/unspecified.
|
// Get Vanilla biome, throw exception if it is invalid/unspecified.
|
||||||
org.bukkit.block.Biome vanillaBiome;
|
org.bukkit.block.Biome vanillaBiome;
|
||||||
try {
|
try {
|
||||||
if(!contains("vanilla")) throw new InvalidConfigurationException("Vanilla Biome unspecified!");
|
if(!contains("vanilla")) throw new ConfigException("Vanilla Biome unspecified!", getID());
|
||||||
vanillaBiome = org.bukkit.block.Biome.valueOf(getString("vanilla"));
|
vanillaBiome = org.bukkit.block.Biome.valueOf(getString("vanilla"));
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
throw new InvalidConfigurationException("Invalid Vanilla biome: " + getString("vanilla"));
|
throw new ConfigException("Invalid Vanilla biome: \"" + getString("vanilla") + "\"", getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if ores should be handled by super biome.
|
// Check if ores should be handled by super biome.
|
||||||
@ -290,13 +291,13 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
try {
|
try {
|
||||||
ocean = new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(oceanPalette.substring(6)), 1), 1);
|
ocean = new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(oceanPalette.substring(6)), 1), 1);
|
||||||
} catch(IllegalArgumentException ex) {
|
} catch(IllegalArgumentException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Ocean Palette in biome ID: " + biomeID + ". BlockData " + oceanPalette + " is invalid!");
|
throw new ConfigException("BlockData \"" + oceanPalette + "\" is invalid! (Ocean Palette)", getID());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
ocean = PaletteConfig.fromID(oceanPalette).getPalette();
|
ocean = PaletteConfig.fromID(oceanPalette).getPalette();
|
||||||
} catch(NullPointerException ex) {
|
} catch(NullPointerException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Ocean Palette in biome ID: " + biomeID + "\n\nPalette " + oceanPalette + " cannot be found!");
|
throw new NotFoundException("Palette", oceanPalette, getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else ocean = oceanDefault;
|
} else ocean = oceanDefault;
|
||||||
@ -328,7 +329,7 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
}
|
}
|
||||||
} catch(ClassCastException e) {
|
} catch(ClassCastException e) {
|
||||||
if(ConfigUtil.debug) e.printStackTrace();
|
if(ConfigUtil.debug) e.printStackTrace();
|
||||||
throw new InvalidConfigurationException("Material in stair config is not stair.");
|
throw new ConfigException("Materials in stair config must be stairs.", getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bukkit.getLogger().info("[Terra] Slabs: " + slabs.size());
|
Bukkit.getLogger().info("[Terra] Slabs: " + slabs.size());
|
||||||
@ -343,7 +344,7 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
try {
|
try {
|
||||||
structures.add(Objects.requireNonNull(StructureConfig.fromID(s)));
|
structures.add(Objects.requireNonNull(StructureConfig.fromID(s)));
|
||||||
} catch(NullPointerException e) {
|
} catch(NullPointerException e) {
|
||||||
throw new InvalidConfigurationException("No such structure " + s);
|
throw new NotFoundException("Structure", s, getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +353,7 @@ public class BiomeConfig extends TerraConfigObject {
|
|||||||
this.biome = new UserDefinedBiome(vanillaBiome, dec, new UserDefinedGenerator(eq, Collections.emptyList(), paletteMap), biomeID);
|
this.biome = new UserDefinedBiome(vanillaBiome, dec, new UserDefinedGenerator(eq, Collections.emptyList(), paletteMap), biomeID);
|
||||||
} catch(ParseException e) {
|
} catch(ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new IllegalArgumentException("Unable to parse noise equation!");
|
throw new ConfigException("Unable to parse noise equation!", getID());
|
||||||
}
|
}
|
||||||
biomes.put(biomeID, this);
|
biomes.put(biomeID, this);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
|
import com.dfsek.terra.config.exception.NotFoundException;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@ -26,7 +28,7 @@ public class BiomeConfigUtil {
|
|||||||
Bukkit.getLogger().info("Adding slab palette with single material " + entry.getKey());
|
Bukkit.getLogger().info("Adding slab palette with single material " + entry.getKey());
|
||||||
paletteMap.put(Bukkit.createBlockData((String) entry.getKey()).getMaterial(), new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(((String) entry.getValue()).substring(6)), 1), 1));
|
paletteMap.put(Bukkit.createBlockData((String) entry.getKey()).getMaterial(), new RandomPalette<BlockData>(new Random(0)).add(new ProbabilityCollection<BlockData>().add(Bukkit.createBlockData(((String) entry.getValue()).substring(6)), 1), 1));
|
||||||
} catch(IllegalArgumentException ex) {
|
} catch(IllegalArgumentException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Slab Palettes in biome " + config.getID() + ": " + ex.getMessage());
|
throw new ConfigException("Invalid BlockData in slab configuration: " + ex.getMessage(), config.getID());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@ -34,11 +36,11 @@ public class BiomeConfigUtil {
|
|||||||
if(p.getSize() != 1) throw new InvalidConfigurationException("Slab palette must hold only one layer. Palette " + entry.getValue() + " is too large/small");
|
if(p.getSize() != 1) throw new InvalidConfigurationException("Slab palette must hold only one layer. Palette " + entry.getValue() + " is too large/small");
|
||||||
paletteMap.put(Bukkit.createBlockData((String) entry.getKey()).getMaterial(), p);
|
paletteMap.put(Bukkit.createBlockData((String) entry.getKey()).getMaterial(), p);
|
||||||
} catch(NullPointerException ex) {
|
} catch(NullPointerException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Slab Palettes in biome " + config.getID() + "\n\nPalette " + entry.getValue() + " cannot be found!");
|
throw new NotFoundException("Slab Palette", (String) entry.getValue(), config.getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ClassCastException ex) {
|
} catch(ClassCastException ex) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Slab Palettes in biome " + config.getID());
|
throw new ConfigException("Unable to parse Slab Palette configuration! Check YAML syntax.", config.getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@ package com.dfsek.terra.config.genconfig;
|
|||||||
|
|
||||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||||
import com.dfsek.terra.biome.UserDefinedGrid;
|
import com.dfsek.terra.biome.UserDefinedGrid;
|
||||||
import com.dfsek.terra.config.ConfigLoader;
|
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
|
import com.dfsek.terra.config.exception.NotFoundException;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -29,11 +29,12 @@ public class BiomeGridConfig extends TerraConfigObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
isEnabled = false;
|
isEnabled = false;
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Grid ID unspecified!");
|
if(!contains("id")) throw new ConfigException("Grid ID unspecified!", "null");
|
||||||
this.gridID = getString("id");
|
this.gridID = getString("id");
|
||||||
if(!contains("grid")) throw new InvalidConfigurationException("Grid not found!");
|
if(!contains("grid")) throw new ConfigException("Grid key not found!", getID());
|
||||||
this.sizeX = Objects.requireNonNull(getList("grid")).size();
|
this.sizeX = Objects.requireNonNull(getList("grid")).size();
|
||||||
this.sizeZ = ((List<List<String>>) getList("grid")).get(0).size();
|
this.sizeZ = ((List<List<String>>) getList("grid")).get(0).size();
|
||||||
gridRaw = new UserDefinedBiome[sizeX][sizeZ];
|
gridRaw = new UserDefinedBiome[sizeX][sizeZ];
|
||||||
@ -41,14 +42,14 @@ public class BiomeGridConfig extends TerraConfigObject {
|
|||||||
for(int x = 0; x < sizeX; x++) {
|
for(int x = 0; x < sizeX; x++) {
|
||||||
for(int z = 0; z < sizeZ; z++) {
|
for(int z = 0; z < sizeZ; z++) {
|
||||||
try {
|
try {
|
||||||
gridRaw[x][z] = BiomeConfig.fromID(((List<List<String>>) getList("grid")).get(x).get(z)).getBiome();
|
gridRaw[x][z] = BiomeConfig.fromID(((List<List<String>>) Objects.requireNonNull(getList("grid"))).get(x).get(z)).getBiome();
|
||||||
} catch(NullPointerException e) {
|
} catch(NullPointerException e) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for BiomeGrid ID: " + getID() + "\n\nNo such biome " + ((List<List<String>>) getList("grid")).get(x).get(z));
|
throw new NotFoundException("Biome",((List<List<String>>) Objects.requireNonNull(getList("grid"))).get(x).get(z), getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ClassCastException e) {
|
} catch(ClassCastException |NullPointerException e) {
|
||||||
throw new InvalidConfigurationException("Malformed grid!");
|
throw new ConfigException("Malformed grid! Ensure all dimensions are correct.", getID());
|
||||||
}
|
}
|
||||||
isEnabled = true;
|
isEnabled = true;
|
||||||
biomeGrids.put(gridID, this);
|
biomeGrids.put(gridID, this);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import org.polydev.gaea.math.Range;
|
import org.polydev.gaea.math.Range;
|
||||||
import com.dfsek.terra.carving.UserDefinedCarver;
|
import com.dfsek.terra.carving.UserDefinedCarver;
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
@ -52,6 +54,9 @@ public class CarverConfig extends TerraConfigObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
|
if(!contains("id")) throw new ConfigException("No ID specified for Carver!", "null");
|
||||||
|
id = getString("id");
|
||||||
|
|
||||||
inner = getBlocks("palette.inner.blocks");
|
inner = getBlocks("palette.inner.blocks");
|
||||||
|
|
||||||
outer = getBlocks("palette.outer.blocks");
|
outer = getBlocks("palette.outer.blocks");
|
||||||
@ -60,53 +65,16 @@ public class CarverConfig extends TerraConfigObject {
|
|||||||
|
|
||||||
bottom = getBlocks("palette.bottom.blocks");
|
bottom = getBlocks("palette.bottom.blocks");
|
||||||
|
|
||||||
replaceableInner = new HashSet<>();
|
replaceableInner = ConfigUtil.toBlockData(getStringList("palette.inner.replace"), "replaceable inner", getID());
|
||||||
replaceableOuter = new HashSet<>();
|
|
||||||
replaceableTop = new HashSet<>();
|
|
||||||
replaceableBottom = new HashSet<>();
|
|
||||||
|
|
||||||
for(String s : getStringList("palette.inner.replace")) {
|
replaceableOuter = ConfigUtil.toBlockData(getStringList("palette.outer.replace"), "replaceable outer", getID());
|
||||||
try {
|
|
||||||
if(replaceableInner.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in replaceable list: " + s);
|
replaceableTop = ConfigUtil.toBlockData(getStringList("palette.top.replace"), "replaceable top", getID());
|
||||||
replaceableInner.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
replaceableBottom = ConfigUtil.toBlockData(getStringList("palette.bottom.replace"), "replaceable bottom", getID());
|
||||||
throw new InvalidConfigurationException("Could not load data for " + s);
|
|
||||||
}
|
update = ConfigUtil.toBlockData(getStringList("update"), "update", getID());
|
||||||
}
|
|
||||||
for(String s : getStringList("palette.outer.replace")) {
|
|
||||||
try {
|
|
||||||
if(replaceableOuter.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in replaceable list: " + s);
|
|
||||||
replaceableOuter.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Could not load data for " + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(String s : getStringList("palette.top.replace")) {
|
|
||||||
try {
|
|
||||||
if(replaceableTop.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in replaceable list: " + s);
|
|
||||||
replaceableTop.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Could not load data for " + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(String s : getStringList("palette.bottom.replace")) {
|
|
||||||
try {
|
|
||||||
if(replaceableBottom.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in replaceable list: " + s);
|
|
||||||
replaceableBottom.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Could not load data for " + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
update = new HashSet<>();
|
|
||||||
for(String s : getStringList("update")) {
|
|
||||||
try {
|
|
||||||
if(update.contains(Bukkit.createBlockData(s).getMaterial())) Bukkit.getLogger().warning("Duplicate material in update list: " + s);
|
|
||||||
update.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Could not load data for " + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shift = new HashMap<>();
|
shift = new HashMap<>();
|
||||||
for(Map.Entry<String, Object> e : getConfigurationSection("shift").getValues(false).entrySet()) {
|
for(Map.Entry<String, Object> e : getConfigurationSection("shift").getValues(false).entrySet()) {
|
||||||
Set<Material> l = new HashSet<>();
|
Set<Material> l = new HashSet<>();
|
||||||
@ -129,14 +97,13 @@ public class CarverConfig extends TerraConfigObject {
|
|||||||
Range length = new Range(getInt("length.min"), getInt("length.max"));
|
Range length = new Range(getInt("length.min"), getInt("length.max"));
|
||||||
Range radius = new Range(getInt("start.radius.min"), getInt("start.radius.max"));
|
Range radius = new Range(getInt("start.radius.min"), getInt("start.radius.max"));
|
||||||
Range height = new Range(getInt("start.height.min"), getInt("start.height.max"));
|
Range height = new Range(getInt("start.height.min"), getInt("start.height.max"));
|
||||||
id = getString("id");
|
|
||||||
if(id == null) throw new InvalidConfigurationException("No ID specified for Carver!");
|
|
||||||
carver = new UserDefinedCarver(height, radius, length, start, mutate, radiusMultiplier, id.hashCode(), getInt("cut.top", 0), getInt("cut.bottom", 0));
|
carver = new UserDefinedCarver(height, radius, length, start, mutate, radiusMultiplier, id.hashCode(), getInt("cut.top", 0), getInt("cut.bottom", 0));
|
||||||
caveConfig.put(id, this);
|
caveConfig.put(id, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Integer, ProbabilityCollection<BlockData>> getBlocks(String key) throws InvalidConfigurationException {
|
private Map<Integer, ProbabilityCollection<BlockData>> getBlocks(String key) throws InvalidConfigurationException {
|
||||||
if(!contains(key)) throw new InvalidConfigurationException("Missing Carver Palette!");
|
if(!contains(key)) throw new ConfigException("Missing Carver Palette!", getID());
|
||||||
Map<Integer, ProbabilityCollection<BlockData>> result = new TreeMap<>();
|
Map<Integer, ProbabilityCollection<BlockData>> result = new TreeMap<>();
|
||||||
for(Map<?, ?> m : getMapList(key)) {
|
for(Map<?, ?> m : getMapList(key)) {
|
||||||
try {
|
try {
|
||||||
@ -148,7 +115,7 @@ public class CarverConfig extends TerraConfigObject {
|
|||||||
result.put((Integer) m.get("y"), layer);
|
result.put((Integer) m.get("y"), layer);
|
||||||
Bukkit.getLogger().info("Added at level " + m.get("y"));
|
Bukkit.getLogger().info("Added at level " + m.get("y"));
|
||||||
} catch(ClassCastException e) {
|
} catch(ClassCastException e) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Carver Palette: \n\n" + e.getMessage());
|
throw new ConfigException("Unable to parse Carver Palette configuration! Check YAML syntax:" + e.getMessage(), getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -37,36 +39,18 @@ public class FloraConfig extends TerraConfigObject implements Flora {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
if(!contains("blocks")) throw new InvalidConfigurationException("No blocks defined in custom flora!");
|
if(!contains("id")) throw new ConfigException("Flora ID unspecified!", "null");
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Flora ID unspecified!");
|
this.id = getString("id");
|
||||||
if(!contains("name")) throw new InvalidConfigurationException("Flora name unspecified!");
|
if(!contains("blocks")) throw new ConfigException("No blocks defined in custom flora!", getID());
|
||||||
if(!contains("spawnable")) throw new InvalidConfigurationException("Flora spawnable blocks unspecified!");
|
if(!contains("spawnable")) throw new ConfigException("Flora spawnable blocks unspecified!", getID());
|
||||||
|
|
||||||
spawnable = new HashSet<>();
|
spawnable = ConfigUtil.toBlockData(getStringList("spawnable"), "spawnable", getID());
|
||||||
replaceable = new HashSet<>();
|
replaceable = ConfigUtil.toBlockData(getStringList("replaceable"), "replaceable", getID());
|
||||||
|
|
||||||
try {
|
|
||||||
for(String s : getStringList("spawnable")) {
|
|
||||||
spawnable.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
}
|
|
||||||
Bukkit.getLogger().info("[Terra] Added " + spawnable.size() + " items to spawnable list.");
|
|
||||||
} catch(IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Invalid material ID in spawnable list: " + e.getMessage());
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
for(String s : getStringList("replaceable")) {
|
|
||||||
replaceable.add(Bukkit.createBlockData(s).getMaterial());
|
|
||||||
}
|
|
||||||
Bukkit.getLogger().info("[Terra] Added " + spawnable.size() + " items to replaceable list.");
|
|
||||||
} catch(IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Invalid material ID in replaceable list: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
Palette<BlockData> p = new RandomPalette<>(new Random(getInt("seed", 4)));
|
Palette<BlockData> p = new RandomPalette<>(new Random(getInt("seed", 4)));
|
||||||
|
|
||||||
floraPalette = PaletteConfig.getPalette(getMapList("blocks"), p);
|
floraPalette = PaletteConfig.getPalette(getMapList("blocks"), p);
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Flora ID unspecified!");
|
|
||||||
this.id = getString("id");
|
|
||||||
floraConfig.put(id, this);
|
floraConfig.put(id, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -18,6 +19,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class OreConfig extends TerraConfigObject {
|
public class OreConfig extends TerraConfigObject {
|
||||||
private static final Map<String, OreConfig> ores = new HashMap<>();
|
private static final Map<String, OreConfig> ores = new HashMap<>();
|
||||||
@ -27,33 +29,29 @@ public class OreConfig extends TerraConfigObject {
|
|||||||
private double deform;
|
private double deform;
|
||||||
private double deformFrequency;
|
private double deformFrequency;
|
||||||
private String id;
|
private String id;
|
||||||
List<Material> replaceable;
|
Set<Material> replaceable;
|
||||||
public OreConfig(File file) throws IOException, InvalidConfigurationException {
|
public OreConfig(File file) throws IOException, InvalidConfigurationException {
|
||||||
super(file);
|
super(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
if(!contains("material")) throw new InvalidConfigurationException("Ore material not found!");
|
if(!contains("id")) throw new ConfigException("Ore ID not found!", "null");
|
||||||
if(!contains("deform")) throw new InvalidConfigurationException("Ore vein deformation not found!");
|
this.id = getString("id");
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Ore ID not found!");
|
if(!contains("material")) throw new ConfigException("Ore material not found!", getID());
|
||||||
if(!contains("replace")) throw new InvalidConfigurationException("Ore replaceable materials not found!");
|
if(!contains("deform")) throw new ConfigException("Ore vein deformation not found!", getID());
|
||||||
|
if(!contains("replace")) throw new ConfigException("Ore replaceable materials not found!", getID());
|
||||||
min = getInt("radius.min", 1);
|
min = getInt("radius.min", 1);
|
||||||
max = getInt("radius.max", 1);
|
max = getInt("radius.max", 1);
|
||||||
deform = getDouble("deform");
|
deform = getDouble("deform");
|
||||||
deformFrequency = getDouble("deform-frequency");
|
deformFrequency = getDouble("deform-frequency");
|
||||||
this.id = getString("id");
|
|
||||||
|
|
||||||
try {
|
replaceable = ConfigUtil.toBlockData(getStringList("replace"), "replaceable", getID());
|
||||||
replaceable = ConfigUtil.getElements(getStringList("replace"), Material.class);
|
|
||||||
} catch(IllegalArgumentException e) {
|
|
||||||
throw new InvalidConfigurationException("Invalid material ID in replace list: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
oreData = Bukkit.createBlockData(Objects.requireNonNull(getString("material")));
|
oreData = Bukkit.createBlockData(Objects.requireNonNull(getString("material")));
|
||||||
} catch(NullPointerException | IllegalArgumentException e) {
|
} catch(NullPointerException | IllegalArgumentException e) {
|
||||||
throw new InvalidConfigurationException("Invalid ore material: " + getString("material"));
|
throw new ConfigException("Invalid ore material: " + getString("material"), getID());
|
||||||
}
|
}
|
||||||
ores.put(id, this);
|
ores.put(id, this);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
@ -28,6 +29,8 @@ public class PaletteConfig extends TerraConfigObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
|
if(!contains("id")) throw new ConfigException("Palette ID unspecified!", "null");
|
||||||
|
this.paletteID = getString("id");
|
||||||
Palette<BlockData> pal;
|
Palette<BlockData> pal;
|
||||||
if(getBoolean("simplex", false)) {
|
if(getBoolean("simplex", false)) {
|
||||||
useNoise = true;
|
useNoise = true;
|
||||||
@ -38,8 +41,6 @@ public class PaletteConfig extends TerraConfigObject {
|
|||||||
pal = new SimplexPalette<>(pNoise);
|
pal = new SimplexPalette<>(pNoise);
|
||||||
} else pal = new RandomPalette<>(new Random(getInt("seed", 3)));
|
} else pal = new RandomPalette<>(new Random(getInt("seed", 3)));
|
||||||
palette = getPalette(getMapList("blocks"), pal);
|
palette = getPalette(getMapList("blocks"), pal);
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("Palette ID unspecified!");
|
|
||||||
this.paletteID = getString("id");
|
|
||||||
palettes.put(paletteID, this);
|
palettes.put(paletteID, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +73,6 @@ public class PaletteConfig extends TerraConfigObject {
|
|||||||
}
|
}
|
||||||
p.add(Bukkit.createBlockData(data), (Integer) m.get("layers"));
|
p.add(Bukkit.createBlockData(data), (Integer) m.get("layers"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(ClassCastException e) {
|
} catch(ClassCastException e) {
|
||||||
throw new InvalidConfigurationException("SEVERE configuration error for Palette: \n\n" + e.getMessage());
|
throw new InvalidConfigurationException("SEVERE configuration error for Palette: \n\n" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package com.dfsek.terra.config.genconfig;
|
package com.dfsek.terra.config.genconfig;
|
||||||
|
|
||||||
|
import com.dfsek.terra.config.exception.ConfigException;
|
||||||
|
import com.dfsek.terra.config.exception.NotFoundException;
|
||||||
import org.polydev.gaea.math.Range;
|
import org.polydev.gaea.math.Range;
|
||||||
import com.dfsek.terra.Terra;
|
import com.dfsek.terra.Terra;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.TerraConfigObject;
|
import com.dfsek.terra.config.TerraConfigObject;
|
||||||
import com.dfsek.terra.population.StructurePopulator;
|
import com.dfsek.terra.population.StructurePopulator;
|
||||||
import com.dfsek.terra.structure.GaeaStructure;
|
import com.dfsek.terra.structure.GaeaStructure;
|
||||||
@ -29,6 +31,8 @@ public class StructureConfig extends TerraConfigObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws InvalidConfigurationException {
|
public void init() throws InvalidConfigurationException {
|
||||||
|
if(!contains("id")) throw new ConfigException("No ID specified!", "null");
|
||||||
|
id = getString("id");
|
||||||
try {
|
try {
|
||||||
File file = new File(Terra.getInstance().getDataFolder() + File.separator + "config" + File.separator + "structures" + File.separator + "data", Objects.requireNonNull(getString("file")));
|
File file = new File(Terra.getInstance().getDataFolder() + File.separator + "config" + File.separator + "structures" + File.separator + "data", Objects.requireNonNull(getString("file")));
|
||||||
structure = GaeaStructure.load(file);
|
structure = GaeaStructure.load(file);
|
||||||
@ -36,17 +40,16 @@ public class StructureConfig extends TerraConfigObject {
|
|||||||
if(ConfigUtil.debug) {
|
if(ConfigUtil.debug) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
throw new InvalidConfigurationException("Unable to locate structure: " + getString("file"));
|
throw new NotFoundException("Structure", getString("file"), getID());
|
||||||
}
|
}
|
||||||
if(!contains("id")) throw new InvalidConfigurationException("No ID specified!");
|
|
||||||
id = getString("id");
|
|
||||||
spawn = new GridSpawn(getInt("spawn.width", 500), getInt("spawn.padding", 100));
|
spawn = new GridSpawn(getInt("spawn.width", 500), getInt("spawn.padding", 100));
|
||||||
searchStart = new Range(getInt("spawn.start.min", 72), getInt("spawn.start.max", 72));
|
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));
|
bound = new Range(getInt("spawn.bound.min", 48), getInt("spawn.bound.max", 72));
|
||||||
try {
|
try {
|
||||||
type = StructurePopulator.SearchType.valueOf(getString("spawn.search", "DOWN"));
|
type = StructurePopulator.SearchType.valueOf(getString("spawn.search", "DOWN"));
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
throw new InvalidConfigurationException("Invalid search type, " + getString("spawn.search"));
|
throw new ConfigException("Invalid search type, " + getString("spawn.search"), getID());
|
||||||
}
|
}
|
||||||
configs.put(id, this);
|
configs.put(id, this);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package com.dfsek.terra.image;
|
|||||||
import com.dfsek.terra.generation.TerraChunkGenerator;
|
import com.dfsek.terra.generation.TerraChunkGenerator;
|
||||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
import com.dfsek.terra.config.base.WorldConfig;
|
||||||
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -2,9 +2,7 @@ package com.dfsek.terra.image;
|
|||||||
|
|
||||||
import com.dfsek.terra.biome.BiomeZone;
|
import com.dfsek.terra.biome.BiomeZone;
|
||||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.polydev.gaea.biome.NormalizationUtil;
|
import org.polydev.gaea.biome.NormalizationUtil;
|
||||||
|
|
||||||
@ -12,8 +10,6 @@ import java.awt.*;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
@ -2,7 +2,6 @@ package com.dfsek.terra.image;
|
|||||||
|
|
||||||
import com.dfsek.terra.biome.BiomeZone;
|
import com.dfsek.terra.biome.BiomeZone;
|
||||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||||
import com.dfsek.terra.config.WorldConfig;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.polydev.gaea.biome.NormalizationUtil;
|
import org.polydev.gaea.biome.NormalizationUtil;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.dfsek.terra.population;
|
package com.dfsek.terra.population;
|
||||||
|
|
||||||
import com.dfsek.terra.TerraProfiler;
|
import com.dfsek.terra.TerraProfiler;
|
||||||
import com.dfsek.terra.config.ConfigUtil;
|
import com.dfsek.terra.config.base.ConfigUtil;
|
||||||
import com.dfsek.terra.config.genconfig.CarverConfig;
|
import com.dfsek.terra.config.genconfig.CarverConfig;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -17,7 +17,6 @@ import org.polydev.gaea.world.carving.CarvingData;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user