Posted April 27, 20205 yr 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 April 27, 20205 yr 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
April 27, 20205 yr Author 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 April 27, 20205 yr 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
April 27, 20205 yr 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.
April 27, 20205 yr Author 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
April 27, 20205 yr Author 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
April 27, 20205 yr I think the correct implementation is something like this: public static final FillerBlockType VAR_NAME = FillerBlockType.create("VAR_NAME", constructor_variables...); The enumName refers to your own variable that you are creating. Edited April 27, 20205 yr by ChampionAsh5357
April 27, 20205 yr Author 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
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.