Refactored code in generatorsettings and WorldConfig

This commit is contained in:
Daniel 2019-05-04 09:17:39 +02:00
parent 8336823b62
commit d7bc9975e2
2 changed files with 15 additions and 15 deletions

View File

@ -26,6 +26,17 @@ public class WorldConfig {
private static final HashMap<String, WorldConfig> instances = new HashMap<>();
private final UUID owner;
private final int id;
private final HashMap<UUID, HashSet<WorldPerm>> permissions = new HashMap<>();
private String ownerName;
private String templateKey;
private boolean fire, tnt;
private Location home = null;
public static File getWorldFile(String worldname) {
File worldconfig = new File(Bukkit.getWorldContainer(), worldname + "/worldconfig.yml");
if (!worldconfig.exists()) {
@ -60,17 +71,6 @@ public class WorldConfig {
return instances.get(worldname).load();
}
private final UUID owner;
private final int id;
private final HashMap<UUID, HashSet<WorldPerm>> permissions = new HashMap<>();
private String ownerName;
private String templateKey;
private boolean fire, tnt;
private Location home = null;
private WorldConfig(String worldname) {
if (!exists(worldname))
throw new IllegalArgumentException("WorldConfig doesn't exist");

View File

@ -7,10 +7,10 @@ import org.bukkit.WorldType;
@AllArgsConstructor
public class GeneratorSettings {
final long seed;
final World.Environment environment;
final WorldType type;
final String generator;
final private long seed;
final private World.Environment environment;
final private WorldType type;
final private String generator;
public WorldCreator asWorldCreator(String name) {
WorldCreator creator = new WorldCreator(name);