Solved Custom Biomes In Custom World

Discussion in 'Spigot Plugin Development' started by ChickenStyle, Feb 3, 2022.

  1. Hello, I am trying to recreate Twilight Forest as a plugin and I encountered a weird issue.
    So I found this really cool tutorial https://www.spigotmc.org/threads/how-to-create-custom-biomes.512105/
    which explains how to make custom biomes and apply them, I followed the tutorial and it works perfectly fine, but when I try to use the same code when generation a custom world, it just freezes the server and after a couple of minutes the server crashes.

    My NMS handler class:
    https://github.com/ChickenStyle/Twi...style/twilightforest/nms/Handler_1_17_R1.java

    Chunk Generator:
    https://github.com/ChickenStyle/Twi...le/twilightforest/world/TFChunkGenerator.java (When I remove the line 49, the code works perfectly fine and it loads the custom world without any issues)

    Here is the crash error:
    https://pastebin.com/MvwtSthN
     
  2. The chunk should never be access in generateChunkData as stated in the docs. The chunk is not available there, is loaded, the generator is called again, etc - which results in a loop.

    upload_2022-2-3_23-54-37.png

    Do the biome stuff in a populator.
     
  3. Thank you! It fixed the issue :)
    But now there is another issue xD
    When I start the server and load the twilight forest world everything works fine, you can join the world and play in it, but if I leave and reload the server, It starts to kick me from the server with this error:
    https://gyazo.com/2963719d4ace6b66d8b247ef3079825a
     
  4. You mean restart?
    Reload is not really supported and discouraged.
     
  5. He meant reload, he used a reload and it caused this issue
     
  6. Then it isn't an issue. Just don't reload.
     
  7. Thank you guys! Issue solved :)
     
  8. Btw, found the cause of this issue
    You gotta make sure that you don't register the custom biomes twice (which happens if you reload the server)
    You just need to find a way to check if the biome is registered or not :)
     
    • Like Like x 1