mirror of
https://github.com/plexusorg/Plex.git
synced 2026-06-04 21:46:55 +00:00
More modernization for the database
This commit is contained in:
@@ -9,14 +9,12 @@ import org.bukkit.generator.BlockPopulator;
|
||||
|
||||
public class ConfigurationChunkGenerator extends BlockMapChunkGenerator
|
||||
{
|
||||
private static final Plex plugin = Plex.get();
|
||||
|
||||
public ConfigurationChunkGenerator(String worldName, BlockPopulator... populators)
|
||||
public ConfigurationChunkGenerator(Plex plugin, String worldName, BlockPopulator... populators)
|
||||
{
|
||||
super(createBlockMap(worldName), populators);
|
||||
super(createBlockMap(plugin, worldName), populators);
|
||||
}
|
||||
|
||||
private static LinkedHashMap<Material, Integer> createBlockMap(String worldName)
|
||||
private static LinkedHashMap<Material, Integer> createBlockMap(Plex plugin, String worldName)
|
||||
{
|
||||
LinkedHashMap<Material, Integer> blockMap = new LinkedHashMap<>();
|
||||
for (String key : plugin.config.getConfigurationSection("worlds." + worldName + ".parameters").getKeys(false))
|
||||
|
||||
@@ -17,8 +17,6 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
public class CustomWorld extends WorldCreator
|
||||
{
|
||||
private static final Plex plugin = Plex.get();
|
||||
|
||||
private final CustomChunkGenerator chunks;
|
||||
|
||||
public CustomWorld(String name, CustomChunkGenerator generator)
|
||||
@@ -28,13 +26,13 @@ public class CustomWorld extends WorldCreator
|
||||
this.generator(this.chunks);
|
||||
}
|
||||
|
||||
public static World generateConfigFlatWorld(String name)
|
||||
public static World generateConfigFlatWorld(Plex plugin, String name)
|
||||
{
|
||||
if (!plugin.config.contains("worlds." + name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
CustomWorld customWorld = new CustomWorld(name, new ConfigurationChunkGenerator(name))
|
||||
CustomWorld customWorld = new CustomWorld(name, new ConfigurationChunkGenerator(plugin, name))
|
||||
{
|
||||
@Override
|
||||
public World generate()
|
||||
|
||||
Reference in New Issue
Block a user