[SPIGOT-4011] ChunkGenerator causes java.lang.ClassCastException Created: 15/Jul/18  Updated: 18/Jul/18  Resolved: 15/Jul/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lorenzo Lapucci Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.13, Craftbukkit, bug, chunks, error
Environment:

Win10, Java 10


Version: CraftBukkit version git-Spigot-1d0aef7-1fccb89 (MC: 1.13-pre7) (Implementing API version 1.13-pre7-R0.1-SNAPSHOT)

 Description   

Using WorldCreator#generator(new EmptyGenerator()) where EmptyGenerator extends ChunkGenerator causes a java.lang.ClassCastException: https://pastebin.com/63Zpxdsf

Content of EmptyGenerator: https://pastebin.com/FkvjDmSD

Maps#loadWorld method

public static World loadWorld(WorldCreator creator) {
    creator.generator(new EmptyGenerator());
    World world = Bukkit.createWorld(creator);
    world.setAutoSave(false);
    return world;
}


 Comments   
Comment by Lorenzo Lapucci [ 16/Jul/18 ]

I will link the sources + .jar of an example the next time, thanks.

Comment by md_5 [ 16/Jul/18 ]

You need to use https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/generator/ChunkGenerator.html#createChunkData-org.bukkit.World-

The report instructions were in the 1.13-pre7 post.

Comment by Lorenzo Lapucci [ 16/Jul/18 ]
you did not follow hug reporting instructions

Where can I find them?

you must create it using the method in Server

I've read this in the JavaDoc

This method <b>must</b> return a ChunkData returned by...

that's the first thing I've tried, but how do I empty sections? I didn't pay enough attention, solved

Comment by md_5 [ 15/Jul/18 ]

Made this a clear illegalargument exception.
There is also a method within the generator that calls the server method for you

Comment by md_5 [ 15/Jul/18 ]

1) you did not follow hug reporting instructions
2) you cannot extend chunk data, you must create it using the method in Server

Generated at Tue Apr 22 03:43:28 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.