More modernization for the database

This commit is contained in:
2026-05-19 02:30:16 -04:00
parent a980e26cc7
commit 64c691bb58
68 changed files with 588 additions and 456 deletions
@@ -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()