Jump to content

Recommended Posts

Posted

HI! It's what the title says. I am looking to generate standard Block s with registry names amethyst_ore_overworld amethyst_ore_end , and amethyst_ore_nether in their respective dimensions, however I don't know the correct type of DeferredRegister to use. I think it is one of:

FEATURE, DECORATORS, CHUNK_GENERATOR, or possibly WORLD_CARVER , though of those I suspect, from looking at the Feature class of MC, it should be FEATURE ,  although I don't know how I would implement that. Right now I mostly get a lot of compiler errors saying that Feature has an invalid type argument, but again, I don't know what I'm aiming for as I don't know how many additional classes I may need for it. In 1.7.10, I used a full devoted class ; in 1.12.2 the generator was made in one line ;  in 1.15.2 I have seen people do it without DeferredRegistry , but not with it.

 

Thanks!

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted

Ore generators are FEATURES. You can look at the vanilla code for how it creates its own oregen.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok I've been trying and have been left going round in circles. Might need a bit of a pointer as to where to go from here :)

The problem I'm having right now is a compiler error on line 

new EvileOreFeature(EvileOreFeatureConfig::deserialize));

In EvileRegistry, which says:

The type of deserialize(Dynamic<?>) from the type EvileOreFeatureConfig is EvileOreFeatureConfig, this is incompatible with the descriptor's return type: OreFeatureConfig

And all I seem to be able to do is shift the issue elsewhere, eg to the constructor of EvileOreFeature by changing EvileOreFeature's parameters to fit, which then throws a similar error

 

I was about to go down the route of making a whole new Features class for myself, but I thought that ore generation should probably be simpler than that, so I thought I'd ask for some help instead :)

 

Here are my classes:
 

  Reveal hidden contents
  Reveal hidden contents
  Reveal hidden contents

 

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted
  On 2/3/2020 at 9:13 PM, GenElectrovise said:

Feature<OreFeatureConfig>

Expand  

 

  On 2/3/2020 at 9:13 PM, GenElectrovise said:

EvileOreFeatureConfig {

Expand  

Hmm....

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

Sorry it took sooooooo long for me to respond -- another project had to take over for a bit.

 

I have resolved the compiler errors I previously was asking about -- by deleting my copied classes, then readding them and simply extending the appropriate MC classes with a view to overriding their methods in the future.

 

However I don't believe it is being registered properly.

There are no errors, however my generator does not appear in the [ne.mi.re.ForgeRegistry/REGISTRYDUMP]: Registry Name: minecraft:feature  , so I assume that that means it isn't being registered (all of my other items and blocks appear in their respective registry dumps).

Any ideas how I can get the game to acknowledge my Feature's existance?

 

It is now being registered after I realised I hadn't been registering its registry. Oops!

Still no ore spawning though.

 

I haven't come across any place to put in AMETHYST_ORE as a parameter yet, so I'm not making anything happen, even if it is now being registered properly. Is there some documentation on use of DeferredRegistry? Because noone seems to have posted anything about it anywhere, and of course MC doesn't use it as it's part of Forge, so there's no help coming from there.

 

Ps I now have a github repo

Edited by GenElectrovise
More information

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted
  On 2/9/2020 at 2:46 PM, GenElectrovise said:

Is there some documentation on use of DeferredRegistry?

Expand  

The class is called DeferredRegister and the documentation is on the javadoc on the top of it. 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)
  On 2/9/2020 at 9:39 PM, Cadiboo said:

The class is called DeferredRegister and the documentation is on the javadoc on the top of it. 

Expand  

I am aware of this and have been very successfully using this for Items and Blocks. My question is how to generate ores in the world, registering the Feature / Generator using DeferredRegister.

 

Following the advice of my own signature, I have found another thread asking about general ore generation in 1.15 and have combined that information with MC source to create this bodged, yet functional method which is called on the FMLLoadCompleteEvent being fired:

  Reveal hidden contents

 

I would much rather use DeferredRegistry, however no-one appears to know how to do that. Or else I haven't been able to work it out from their hints.

I believe that you would do something like this to register it?

  Reveal hidden contents

 

If by some miracle that is correct, I seem to be getting an endless number of compiler errors in my EvileOreFeature and EvileOreFeatureConfig classes. How does one make a new FillerBlockType? Eg for generating ores in the end dimensions?

I have been trying to use the create(String enumName, String p_i50618_3_, Predicate<BlockState> p_i50618_4_) method, however I can't work out what to pass into the last parameter. So far I have this:

  Reveal hidden contents

... which throws 2 compiler errors, saying: 

 

"The method create(String, String, Predicate<BlockState>) in the type OreFeatureConfig.FillerBlockType is not applicable for the arguments (String, Block, Predicate<BlockState>)"

Which seems pretty self explanatory, as a Block is certainly not a String -- I just don't know what to put there.

 

AND 

 

"Cannot instantiate the type Predicate<BlockState>

Which I am less sure of.

 

Oh and I don't even think it will work as all the method does is:

  Reveal hidden contents

...sooooooo yeah. Any tips?

 

In a nutshell:

How to create new FillerBlockType for ore gen in other dimensions

How to do this with DeferredRegistry

 

I can't think of anything else to say, so I'll just make sure my GitHub repo is updated and await someone's reponse.

Many thanks, 

GenElectrovise

Edited by GenElectrovise
Heeding my own signature

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Posted
  On 2/10/2020 at 8:13 PM, GenElectrovise said:

Oh and I don't even think it will work as all the method does is:

  Reveal hidden contents

...sooooooo yeah. Any tips?

Expand  

Read the documentation on IExtensibleEnum.

I’ll take a look into world gen myself and report back (never done anything except super basic ore gen back in 1.12.2)

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 2/13/2020 at 2:32 AM, Cadiboo said:

Read the documentation on IExtensibleEnum.

I’ll take a look into world gen myself and report back (never done anything except super basic ore gen back in 1.12.2)

Expand  

Can do! Thanks!

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.