worlds load problem

Discussion in 'Programming' started by FUZIK, Jun 3, 2018.

  1. help me. how to fix this error?

    this my code:
    Code (Java):
            File worldContainer = getServer().getWorldContainer();
            for(File entry : worldContainer.listFiles()) {
                getServer().createWorld(new WorldCreator(entry.getName())); // line 46
            }
    Code (Text):
    java.lang.IllegalArgumentException: File exists with the name 'spigot.yml' and isn't a folder
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.createWorld(CraftServer.java:856) ~[spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at com.andrey.Main.onEnable(Main.java:46) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) [spigot-1.12.2.jar:git-Spigot-2086bb0-8cc5a7e]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
     
  2. Taken from the JavaDocs.
    For most, if not all servers, the world container is the same folder with all your server configuration files. The error even says