1.8.8 Having trouble generating a new world with custom world generator

Discussion in 'Spigot Plugin Development' started by Justbod, Jan 25, 2020.

  1. ChunkGenerator class
    Code (Java):
    public class SkyWorldGenerator extends ChunkGenerator {
     
        @Override
        public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
            ChunkData chunk = createChunkData(world);
            for (int x = 0; x < 16; x++) {
                for (int z = 0; z < 16; z++) {
                    chunk.setBlock(x, 0, z, Material.AIR);
                }
            }
            return chunk;
        }
     
    }
    Main class
    Code (Text):
    void GenerateSkyWorld() {
            if(Bukkit.getWorld("SkyWorld") == null) {
                Bukkit.getLogger().info(ChatColor.DARK_GREEN + "Couldn't find SkyWorld world generating one now...");
                WorldCreator wc = new WorldCreator("SkyWorld");
                wc.generator(new SkyWorldGenerator());
                wc.createWorld();
            } else {
                Bukkit.getLogger().info(ChatColor.DARK_GREEN + "Found world!");
            }
        }
    Error
    Code (Text):
    Error occurred while enabling Sky v1.0.0 (Is it up to date?)
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_231]
        at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_231]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getDefaultGameMode(CraftServer.java:1419) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.createWorld(CraftServer.java:883) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.Bukkit.createWorld(Bukkit.java:464) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.WorldCreator.createWorld(WorldCreator.java:261) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at me.justbod.Sky.GenerateSkyWorld(Sky.java:26) ~[?:?]
        at me.justbod.Sky.onEnable(Sky.java:13) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:199) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
    Any help would be appreciated
     
    #1 Justbod, Jan 25, 2020
    Last edited: Jan 25, 2020
  2. What's the issue?
    Lol
    Please provide more information
     
  3. Sorry forgot to paste the error its edited now
     
  4. Paste the entire trace stack.
     
  5. Here are the logs
    Code (Text):
    [16:20:57] [Server thread/INFO]: Starting minecraft server version 1.8.8
    [16:20:57] [Server thread/INFO]: Loading properties
    [16:20:57] [Server thread/INFO]: Default game type: SURVIVAL
    [16:20:57] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-db6de12-18fbb24 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
    [16:20:57] [Server thread/INFO]: Debug logging is disabled
    [16:20:57] [Server thread/INFO]: Server Ping Player Sample Count: 12
    [16:20:57] [Server thread/INFO]: Using 4 threads for Netty based IO
    [16:20:57] [Server thread/INFO]: Generating keypair
    [16:20:57] [Server thread/INFO]: Starting Minecraft server on *:25565
    [16:20:57] [Server thread/INFO]: Using default channel type
    [16:20:57] [Server thread/INFO]: Set PluginClassLoader as parallel capable
    [16:20:57] [Server thread/INFO]: [Sky] Loading Sky v1.0.0
    [16:20:57] [Server thread/INFO]: [Sky] Enabling Sky v1.0.0
    [16:20:57] [Server thread/INFO]: [Sky] Couldn't find Sky world generating one now...
    [16:20:57] [Server thread/ERROR]: Error occurred while enabling Sky v1.0.0 (Is it up to date?)
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_231]
        at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_231]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getDefaultGameMode(CraftServer.java:1419) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.createWorld(CraftServer.java:883) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.Bukkit.createWorld(Bukkit.java:464) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.WorldCreator.createWorld(WorldCreator.java:261) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at me.justbod.Sky.GenerateSkyWorld(Sky.java:25) ~[?:?]
        at me.justbod.Sky.onEnable(Sky.java:11) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:199) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
    [16:20:57] [Server thread/INFO]: **** Beginning UUID conversion, this may take A LONG time ****
    [16:20:57] [Server thread/INFO]: Preparing level "world"
    [16:20:57] [Server thread/INFO]: -------- World Settings For [world] --------
    [16:20:57] [Server thread/INFO]: View Distance: 10
    [16:20:57] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:20:57] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:20:57] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:20:57] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:20:57] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:20:57] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [16:20:57] [Server thread/INFO]: Clear tick list: false
    [16:20:57] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:20:57] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:20:57] [Server thread/INFO]: Anti X-Ray: true
    [16:20:57] [Server thread/INFO]:     Engine Mode: 1
    [16:20:57] [Server thread/INFO]:     Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [16:20:57] [Server thread/INFO]:     Replace Blocks: [1, 5]
    [16:20:57] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mob Spawn Range: 4
    [16:20:57] [Server thread/INFO]: Random Lighting Updates: false
    [16:20:57] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:20:57] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:20:57] [Server thread/INFO]: Structure Info Saving: true
    [16:20:57] [Server thread/INFO]: Max TNT Explosions: 100
    [16:20:57] [Server thread/INFO]: Sending up to 10 chunks per packet
    [16:20:57] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:20:57] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
    [16:20:57] [Server thread/INFO]: Max Entity Collisions: 8
    [16:20:57] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617
    [16:20:57] [Server thread/INFO]: -------- World Settings For [world_nether] --------
    [16:20:57] [Server thread/INFO]: View Distance: 10
    [16:20:57] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:20:57] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:20:57] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:20:57] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:20:57] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:20:57] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [16:20:57] [Server thread/INFO]: Clear tick list: false
    [16:20:57] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:20:57] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:20:57] [Server thread/INFO]: Anti X-Ray: true
    [16:20:57] [Server thread/INFO]:     Engine Mode: 1
    [16:20:57] [Server thread/INFO]:     Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [16:20:57] [Server thread/INFO]:     Replace Blocks: [1, 5]
    [16:20:57] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mob Spawn Range: 4
    [16:20:57] [Server thread/INFO]: Random Lighting Updates: false
    [16:20:57] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:20:57] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:20:57] [Server thread/INFO]: Structure Info Saving: true
    [16:20:57] [Server thread/INFO]: Max TNT Explosions: 100
    [16:20:57] [Server thread/INFO]: Sending up to 10 chunks per packet
    [16:20:57] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:20:57] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
    [16:20:57] [Server thread/INFO]: Max Entity Collisions: 8
    [16:20:57] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617
    [16:20:57] [Server thread/INFO]: -------- World Settings For [world_the_end] --------
    [16:20:57] [Server thread/INFO]: View Distance: 10
    [16:20:57] [Server thread/INFO]: Item Merge Radius: 2.5
    [16:20:57] [Server thread/INFO]: Item Despawn Rate: 6000
    [16:20:57] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [16:20:57] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [16:20:57] [Server thread/INFO]: Experience Merge Radius: 3.0
    [16:20:57] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [16:20:57] [Server thread/INFO]: Clear tick list: false
    [16:20:57] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [16:20:57] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [16:20:57] [Server thread/INFO]: Anti X-Ray: true
    [16:20:57] [Server thread/INFO]:     Engine Mode: 1
    [16:20:57] [Server thread/INFO]:     Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [16:20:57] [Server thread/INFO]:     Replace Blocks: [1, 5]
    [16:20:57] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Cane Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Melon Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [16:20:57] [Server thread/INFO]: Mob Spawn Range: 4
    [16:20:57] [Server thread/INFO]: Random Lighting Updates: false
    [16:20:57] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [16:20:57] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [16:20:57] [Server thread/INFO]: Structure Info Saving: true
    [16:20:57] [Server thread/INFO]: Max TNT Explosions: 100
    [16:20:57] [Server thread/INFO]: Sending up to 10 chunks per packet
    [16:20:57] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [16:20:57] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1
    [16:20:57] [Server thread/INFO]: Max Entity Collisions: 8
    [16:20:57] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617
    [16:20:57] [Server thread/INFO]: Preparing start region for level 0 (Seed: -1941973079806970742)
    [16:20:58] [Server thread/INFO]: Preparing start region for level 1 (Seed: -1941973079806970742)
    [16:20:58] [Server thread/INFO]: Preparing start region for level 2 (Seed: -1941973079806970742)
    [16:20:59] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [16:20:59] [Server thread/INFO]: Done (1,340s)! For help, type "help" or "?"
     
  6. Why do you use a world creator like that? Just provide the generator in your plugin class like it's stated here.