Jump to content

[SOLVED] [1.15.2] Custom FillerBlockType for Ore Generation


ModMCdl

Recommended Posts

Hey, I'm trying to generate my custom ore in my dimension which is completely composed of my custom block. I've tried following how vanilla does it, utilizing the OreFeatureConfig file, but with no luck. It looks like OreFeatureConfig has a method for doing this: FillerBlockType.create, however its parameters are obfuscated and I can't make sense of it. Anyone have any ideas or demonstration they could point me to for help?

 

The method in question from OreFeatureConfig.java

public static FillerBlockType create(String enumName, String p_i50618_3_, Predicate<BlockState> p_i50618_4_) {
         throw new IllegalStateException("Enum not extended");
      }

 

I've dissected that p_i50618_3_ is probably the name of the FillerBlockType (as the string is returned as "natural_stone" for FillerBlockType.NATURAL_STONE and "netherrack" for FillerBlockType.NETHERRACK), but beyond that, I can't figure it out.

 

Thanks!

 

Edited by ModMCdl
the problem was solved

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

UPDATE:

A quick update of the mappings clears it up a bit, and its been deobfuscated.

public static FillerBlockType create(String enumName, String nameIn, Predicate<BlockState> predicateIn) {
         throw new IllegalStateException("Enum not extended");
      }

I was right about the nameIn and learned that predicateIn just finds the block, feel kinda dumb not figuring that out before.

 

Still stuck on the enumName however.

Edited by ModMCdl

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

Just now, ChampionAsh5357 said:

If I remember correctly, the enumName is the name of the variable you are defining the enum value for (e.g. NATURAL_STONE, NETHERRACK). If it's not that, it probably is the name of the enum class.

So should I just create a static string and definite it as my own value, or do I need to call it from FillerBlockType? Because the only two options there are NATURAL_STONE and NETHERRACK and those both throw back errors that they aren't the proper strings.

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

Another update: setting it to the existing enum value doesn't work - the ore doesn't spawn in. 

         ConfiguredPlacement orePlacement = Placement.COUNT_RANGE.configure(new CountRangeConfig(12, 5, 5, 64));
                biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES,
                        Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig
                                .FillerBlockType.create(OreFeatureConfig.FillerBlockType.NATURAL_STONE.getName(),
                                        "voidstone",
                                        new BlockMatcher(VoidaicBlocks.VOIDSTONE.get())), VoidaicBlocks.VOID_ORE.get().getDefaultState(), 10)).withPlacement(orePlacement));
            

 

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

Sorry for the delayed response, it was 1 am for me and I was getting frustrated. I played around with it a little bit this morning, and got it working thanks to both of you. For future people looking at this thread, here was the solution:

 

I created my own fillerBlockType class that called from OreFeatureConfig.FillerBlockType, and then adjust the  constructor parameters to match what I needed.

 

public static class customFillerBlockType
    {
        public static final OreFeatureConfig.FillerBlockType CUSTOM_FILLER = OreFeatureConfig.FillerBlockType.create("CustomFiller", "custom_filler", new BlockMatcher(ModBlocks.DFBLOCKNAME.get()));
    }

 

And then I called my customFillerBlockType.CUSTOM_FILLER where you would call FillerBlockType.NATURAL_STONE or otherwise.

 

Thanks again!

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
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.
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.



×
×
  • Create New...

Important Information

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