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.15.2] Does my OreGen Function work?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
DragonITA

[1.15.2] Does my OreGen Function work?

By DragonITA, February 20, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 20, 2020

Hello, i have looked to find the Vanilla Code, but i simply cant find it. I followed a tutorial on youtube for the 1.15.2 and i have this code: 

https://github.com/DragonGamerDevelopers/NewFantasyMod/blob/1.15.2/src/main/java/mod/dragonita/fantasymod/world/gen/FantasyOreGen.java#L25 Then i looked into my World to see if it worked or not, but nothing, i cant find my Ore. I ask here: does my Code actually work and if not, then why?

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

OBCLetter    2

OBCLetter

OBCLetter    2

  • Tree Puncher
  • OBCLetter
  • Members
  • 2
  • 14 posts
Posted February 20, 2020 (edited)

100% sure all world generation events get loaded in FMLCommonSetupEvent. Try moving FantasyOreGen.generateOre() into setup in Main. Works for me with my custom structure generation.

Edited February 20, 2020 by OBCLetter
  • Like 1
  • Quote

Hi! I'm a Java programmer but barely know anything Minecraft related. 

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 20, 2020

Ok, i will try, thanks!

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 20, 2020

For a start, Biome#addFeature is not threadsafe. So you cannot call that method in FMLCommonSetupEvent or any other parallel-mod-loading event. It must be delayed using DeferredWorkQueue.

  • Thanks 2
  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 21, 2020

Ehm, sorry to boring you, but i dont have any idea on how use it.

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 21, 2020
7 minutes ago, DragonITA said:

Ehm, sorry to boring you, but i dont have any idea on how use it.

Did you read the Javadocs? Did you look at the available methods?

  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 23, 2020

Ok, i read the Javadocs, but it still dont work. Why? i implemented DeferredWorkQueue.CheckedRunnable to my Main class, but still dont work. Why?

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 23, 2020
3 hours ago, DragonITA said:

Ok, i read the Javadocs, but it still dont work. Why? i implemented DeferredWorkQueue.CheckedRunnable to my Main class, but still dont work. Why?

Why did you do that? That doesn't accomplish anything.

  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 23, 2020 (edited)
On 2/21/2020 at 12:10 PM, diesieben07 said:

Did you read the Javadocs? Did you look at the available methods?

 

3 hours ago, diesieben07 said:

Why did you do that? That doesn't accomplish anything.

 

I have read the Docs and see the Methods, and the only thing i have see was a interface. Then i tried with implementing it and have see the run function. I have think that it should work but no. How should i then use it? It only has a Inerface.

 

Edit: I false used it and now see a couple of functions, now i am trying to use it (Dont have a Idea on how using Runnable).

Edited February 23, 2020 by DragonITA
  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 23, 2020

Ok, i have implemented Runnable to my OreGen class, but still dont know how to pass it in the Parameters of DeferredWorkQueue.runLater. Any Idea? Realy need help pls.

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 23, 2020

Do you actually understand what runLater does?

  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 23, 2020
37 minutes ago, diesieben07 said:

Do you actually understand what runLater does?

Yes, it load the Thread after something has accomplished (my Laptop battery was empty and i am writting from mobile), i think after the World has loaded?

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 24, 2020
14 hours ago, DragonITA said:

Yes, it load the Thread after something has accomplished

This doesn't make any sense.

 

It runs the runnables you give it after parallel mod loading has completed and it runs them on the main thread (so it is safe to access things that are not threadsafe).

  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 24, 2020

Ok, but how can i the use it? Any idea? I dont know how to work with the DeferredWorkqueue. I implemented Runnable to my Oregen, but still dont know how to pass my class to the parameters of from the function.

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

diesieben07    7619

diesieben07

diesieben07    7619

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7619
  • 55252 posts
Posted February 24, 2020

Implementing Runnable "to your Oregen" doesn't make sense.

You need to pass in a Runnable that will use Biome#addFeature like you already do now.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 24, 2020

Ok, then it is pretty simple  When i come to my home (after the school) then i will try what you suggest. Thanks for helping me!

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 24, 2020 (edited)
 
9 hours ago, diesieben07 said:

Implementing Runnable "to your Oregen" doesn't make sense.

You need to pass in a Runnable that will use Biome#addFeature like you already do now.

Ehm nope, i am getting a error when launching the game: Registry Object non present. I the have see the Log and it sems to see that it dont work because it dont find my custom Ore. Ok, yet i really understanding nothing. Was this a problem from DeferredWorkQueue, that it run before the DeferredRegister? Log: https://github.com/DragonGamerDevelopers/Minecraft-Modding-Logs/blob/master/LOG.log

Main.java: https://github.com/DragonGamerDevelopers/NewFantasyMod/blob/1.15.2/src/main/java/mod/dragonita/fantasymod/Main.java

 

Edited February 24, 2020 by DragonITA
  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 24, 2020

@diesieben07Is this the reason that it was deprecated? 

  • Quote

New in Modding? == Still learning!

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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Minecraft Eternal Modpack Server won't start

      By diesieben07 · Posted just now

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      Valhelsia 3 server not starting

      By diesieben07 · Posted just now

      There seem to be a lot of data pack errors showing up there. Make sure you installed the pack correctly, otherwise speak with the pack authors.
    • Purity
      Valhelsia 3 server not starting

      By Purity · Posted 3 minutes ago

      https://gist.github.com/PurityLive/fa9d73909e340393c6824e4f8afbcb9a
    • Milano
      My forge wont install

      By Milano · Posted 5 minutes ago

      Hey there,   I just downloaded my forge File: forge-1.16.4-35.1.4-installer but it wont let me open it to install forge. Does anyone know how to fix this? 
    • xX_deadbush_Xx
      1.15.2 compiled mod crashes due to IllegalAccessError

      By xX_deadbush_Xx · Posted 6 minutes ago

      So I exported my mod with gradlew build but when I try to run it it crashes. Here is the crash log: https://pastebin.com/tjHAxZ4g, debug log: https://pastebin.com/nZKm4wgZ. Im assuming this is caused by an access transformer not transforming properly since the method that causes the error should be public. I have made sure that the AT file is actually contained in the compiled jar which you can find here https://www.swisstransfer.com/d/e08cb842-1b8b-4809-aecf-30021a92b8fb. Im using forge 1.15.2-31.1.0 and the mappings are 20201219-1.15.1
  • Topics

    • Exced
      1
      Minecraft Eternal Modpack Server won't start

      By Exced
      Started 26 minutes ago

    • Purity
      9
      Valhelsia 3 server not starting

      By Purity
      Started 16 hours ago

    • Milano
      0
      My forge wont install

      By Milano
      Started 5 minutes ago

    • xX_deadbush_Xx
      0
      1.15.2 compiled mod crashes due to IllegalAccessError

      By xX_deadbush_Xx
      Started 7 minutes ago

    • Mopaseo
      2
      Minecraft launcher unable to launch

      By Mopaseo
      Started 4 hours ago

  • Who's Online (See full list)

    • diesieben07
    • octa
    • Sterling00
    • Mopaseo
    • Beethoven92
    • apollos
    • Milano
    • xX_deadbush_Xx
    • ChampionAsh5357
    • Purity
    • F0RZera
    • Tieso2001
    • kiou.23
    • Shlub
    • daniel gonzalez
    • SpeedDemon640
    • Yuqera
    • Exced
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2] Does my OreGen Function work?
  • Theme

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