Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] Get IChunk World / get current World for the overworld.
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
MistyMarshes

[1.16.4] Get IChunk World / get current World for the overworld.

By MistyMarshes, January 20 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

MistyMarshes    0

MistyMarshes

MistyMarshes    0

  • Tree Puncher
  • MistyMarshes
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)

Hello. I was trying to get the World an IChunk is in, on version 1.16.4 (in the WorldCarver's carveRegion method).

 

Given that that seemed impossible, I'm trying now to do the next best thing for my particular case: get the current World for the OVERWORLD, but I couldn't figure that either.

 

Do you know how to do any of those?

 

Thanks for your help!

Edited January 20 by MistyMarshes
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 20

What's the context? If you only have an IChunk (not a Chunk) you are likely in world generation, which does not have a world yet.

  • Quote

Share this post


Link to post
Share on other sites

MistyMarshes    0

MistyMarshes

MistyMarshes    0

  • Tree Puncher
  • MistyMarshes
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)

Is that always the case? I'm in a WorldCarver's carveRegion method. I remember reading some 1.16 mod's code recently were they used the world there, but I don't remember what kind of pattern they used to make it available at that point.

 

I need it for a couple of reasons. I need to get its server -> ServerWorld -> DimensionSavedManager to start my WorldSavedData, I also want to use its getBiome, and probably a couple more methods. Do I need to look for alternatives?

Edited January 20 by MistyMarshes
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 20
31 minutes ago, MistyMarshes said:

Is that always the case? I'm in a WorldCarver's carveRegion method. I remember reading some 1.16 mod's code recently were they used the world there, but I don't remember what kind of pattern they used to make it available at that point.

Yup, thats world gen - i.e. no world access.

 

32 minutes ago, MistyMarshes said:

I need it for a couple of reasons. I need to get its server -> ServerWorld -> DimensionSavedManager to start my WorldSavedData

WorldSavedData cannot be accessed during world gen.

 

32 minutes ago, MistyMarshes said:

I also want to use its getBiome, and probably a couple more methods. Do I need to look for alternatives?

You can use IChunk#getBiomes to get biome information.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MistyMarshes    0

MistyMarshes

MistyMarshes    0

  • Tree Puncher
  • MistyMarshes
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)
2 hours ago, diesieben07 said:

WorldSavedData cannot be accessed during world gen.

I see. I used to do it in 1.12 to load some world-dependent worldgen NBT data of my own. How would you go about it for 1.16.4? Do I need to implement my own file subsystem? Maybe capabilities? It is a considerable amount of data (not just some settings).

Edited January 20 by MistyMarshes
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 20

Why does your world gen depend on WorldSavedData? The thing is that world generation now happens on a threadpool, so there is no safe way to access the main game data structures like WorldSavedData.

  • Quote

Share this post


Link to post
Share on other sites

MistyMarshes    0

MistyMarshes

MistyMarshes    0

  • Tree Puncher
  • MistyMarshes
  • Members
  • 0
  • 9 posts
Posted January 20

Oh ok. It is a similar thing to how they used to load structures nbt files. Now that I think of it I should browse to see how they do it now. Do they regenerate structures on the fly every time, or save them to disk?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 20

I'm sure I understand your question.

  • Quote

Share this post


Link to post
Share on other sites

MistyMarshes    0

MistyMarshes

MistyMarshes    0

  • Tree Puncher
  • MistyMarshes
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)

That's ok, you made me think. Thank you for your time.

 

For completeness, my question was: how does vanilla load world-dependent data during worldgen? At least they used to do it to load the mineshafts NBT, and so on.

Edited January 20 by MistyMarshes
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 20

Mineshafts are not world-dependent. They generate the same in every world.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • JayNeedsHelp
      How can I fix this encoding issue?

      By JayNeedsHelp · Posted 2 hours ago

      Hey so I'm creating a forge mod and I'm trying to use the "§" character but I'm getting an illegal character error in the compiler. I've tried using the -encoding option in the compiler, I've also tried converting the file to UTF-8 without BOM, but it wasn't UTF-8 BOM in the first place. I was making a jar mod with mcp in eclipse and everything was working just fine with these characters, which I'm now moving to a forge mod. I'm using IntelliJ Community IDEA currently.   Here's a link to part of the error list: https://jay-hosts-a.dark-web.store/6AXsbJqG. Obviously the other errors were due to the illegal character error but I thought I might as well show it. I'm making a forge mod for 1.12.2, forgegradle is version 2.3-SNAPSHOT and I'm using mixingradle-0.6-SNAPSHOT.   I'm not sure how to fix this and any help would be greatly appreciated.
    • mchase
      Forge crashing

      By mchase · Posted 2 hours ago

      I downloaded and installed forge for 1.16.4 and it shows up in my installations and will start to open but then crashes and gives me "exit code 255". I am on MacOS if that makes a difference. it says The game crashed whilst initializing game Error: java.lang.IllegalStateException: GLFW error before init: [0x10008]Cocoa: Failed to find service port for display Exit Code: 255 does forge just not work on Mac? am I missing something? please help
    • MiToKonndria
      cant download pixelmon

      By MiToKonndria · Posted 2 hours ago

      when i click install on the Pixelmon modpack it gets to 42% and mod 3 out of 7 and then gives me the error message: Timeout attempting to download: "https://edge.forgecdn.net/files/3072/298/pixelmon-1.12.2-8.1.2-universal.jar"
    • lupicus
      can someone help with server crashing

      By lupicus · Posted 3 hours ago

      Looks like Wonderful Enchantments has problems, try and remove it.
    • Draco18s
      can someone help with server crashing

      By Draco18s · Posted 3 hours ago

      Surprise, accessing the client thread from the server thread isn't possible. Bitch at the author of wonderfulenchantments.
  • Topics

    • JayNeedsHelp
      0
      How can I fix this encoding issue?

      By JayNeedsHelp
      Started 2 hours ago

    • mchase
      0
      Forge crashing

      By mchase
      Started 2 hours ago

    • MiToKonndria
      0
      cant download pixelmon

      By MiToKonndria
      Started 2 hours ago

    • IRONDALEK
      3
      can someone help with server crashing

      By IRONDALEK
      Started 7 hours ago

    • Twu
      0
      Need help with Potion Brewing recipes

      By Twu
      Started 3 hours ago

  • Who's Online (See full list)

    • Ryutso
    • Spectere
    • Choonster
    • DavidM
    • NorthWestWind
    • Foofantastic
    • MiToKonndria
    • D_Captain
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] Get IChunk World / get current World for the overworld.
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community