Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6957

Bad default value for WorldCreator#generatorSettings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • his server is running CraftBukkit version 3447-Spigot-fb0dd5f-86292d3 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)
    • Yes

      With the changes in this commit, Spigot fails to create worlds when using WorldCreator with WorldType.FLAT but without explicitly setting a generatorSettings string.

      Code:
      Bukkit.createWorld(WorldCreator.name("bug").type(WorldType.FLAT)); (can be put in a onEnable method or similar)

      Stacktrace:

      [20:45:43] [Server thread/INFO]: [SpigotWorldCreator] Enabling SpigotWorldCreator v1.0.0
      [20:45:43] [Server thread/ERROR]: Error occurred while enabling SpigotWorldCreator v1.0.0 (Is it up to date?)
      com.google.gson.JsonParseException: java.io.EOFException: End of input at line 1 column 1 path $
              at net.minecraft.util.ChatDeserializer.a(SourceFile:505) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.util.ChatDeserializer.a(SourceFile:555) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.util.ChatDeserializer.a(SourceFile:551) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.util.ChatDeserializer.a(SourceFile:559) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at org.bukkit.craftbukkit.v1_18_R2.CraftServer.createWorld(CraftServer.java:1061) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at org.bukkit.Bukkit.createWorld(Bukkit.java:671) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
              at de.sirywell.spigotwc.SpigotWorldCreator.onEnable(SpigotWorldCreator.java:12) ~[?:?]
              at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
              at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
              at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?]
              at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:517) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:431) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:614) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:416) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:263) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1013) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:306) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              at java.lang.Thread.run(Thread.java:833) [?:?]
      Caused by: java.io.EOFException: End of input at line 1 column 1 path $
              at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1395) ~[gson-2.8.9.jar:?]
              at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:548) ~[gson-2.8.9.jar:?]
              at com.google.gson.stream.JsonReader.peek(JsonReader.java:424) ~[gson-2.8.9.jar:?]
              at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:661) ~[gson-2.8.9.jar:?]
              at com.google.gson.internal.bind.TypeAdapters$27.read(TypeAdapters.java:655) ~[gson-2.8.9.jar:?]
              at com.google.gson.internal.bind.TypeAdapters$33$1.read(TypeAdapters.java:866) ~[gson-2.8.9.jar:?]
              at net.minecraft.util.ChatDeserializer.a(SourceFile:503) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3447-Spigot-fb0dd5f-86292d3]
              ... 17 more
      

      I think the code in CraftServer should either handle empty strings separatly or the default value should be set to "{}" instead of "".

            Unassigned Unassigned
            SirYwell SirYwell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: