Jump to content

[Solved][1.14.2] Custom Ore Generation


NickDerMitHut

Recommended Posts

Hello, I wanted to make a mod for me and my friends again, last time was in 1.8 I think so im not really experienced in modding, and I started searching up tutorials for 1.14. I wasn't suprised that I didn't find any since 1.14.2 is still quite new. I did find one for 1.13.2 which worked quite well. I made an ore with the fitting ingot and the Tools for it.(No recepies right now). Then I watched the tutorial for custom ore generation and it didn't work. I couldn't import the CompositeFeature and MinableConfig, I have found the equivalent class to import of MinableConfig on this website https://gist.github.com/williewillus/2dfc945b7b7fdb69cc3ff830072d22fe but I still don't know what to write instead of MinableConfig and still haven't found the new equivalent to CompositeFeature. It would be awesome If someone could help me to get this to work in the nether and the normal world. If you want to look at the code I mean you can see it at 5 Minutes.

 

Edited by NickDerMitHut
Link to comment
Share on other sites

PROGRESS! Okay thanks to @HyCraftHD(YT Comments) and @Kaelym searching in the DefaultBiomeFeatures Class did eventually help.

I only got it working for the overworld though so it would be great if someone could fiddle around with it to get it working in the nether/end/other dimension.

I've made an OreGeneration class that looks like this:

Spoiler

package nick.cockmod.world;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.common.BiomeManager;
import nick.cockmod.blocks.cockBlocks;

public class OreGeneration{
	public static void SetupOrGen() 
	{
	BiomeManager.getBiomes(BiomeManager.BiomeType.WARM).forEach((BiomeManager.BiomeEntry biomeEntry) -> biomeEntry.biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.func_222280_a(Feature.MINABLE, new OreFeatureConfig
			(OreFeatureConfig.FillerBlockType.NATURAL_STONE, cockBlocks.cockore.getDefaultState(), 8), Placement.field_215028_n, new CountRangeConfig(1, 0, 0, 16))));// Count, MinHeight, MaxHeightBase, MaxHeight


}  

}


 

  

 

I found this OreGen Class by @LTNightshade and edited it so it'd work with 1.14.2

 

The public static void SetupOrGen() can then be "called" in the setup function in your main class.

Spoiler

	private void setup(final FMLCommonSetupEvent event)
	{
		OreGeneration.SetupOrGen();		
	
		logger.info("Setup method registered");
	}

 

I realy hope a dimension implementation isn't too hard to pull off.

GL HF

  • Thanks 2
Link to comment
Share on other sites

Nether Ore Generation works now thanks to  @MrTroble. He helped me a lot on the HyCraftHD Discord, and spent quite a lot of time to find out how the things work.

My OreGeneration class now looks like this

Spoiler

package nick.cockmod.world;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.common.BiomeManager;
import nick.cockmod.blocks.cockBlocks;

public class OreGeneration{
	public static void SetupOrGen() 
	{
	BiomeManager.getBiomes(BiomeManager.BiomeType.WARM).forEach((BiomeManager.BiomeEntry biomeEntry) -> biomeEntry.biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.func_222280_a(Feature.MINABLE, new OreFeatureConfig
			(OreFeatureConfig.FillerBlockType.NATURAL_STONE, cockBlocks.cockore.getDefaultState(), 3), Placement.field_215028_n, new CountRangeConfig(1, 1, 1, 16))));// Vein/Chunk Count, MinHeight, MaxHeightBase, MaxHeight


}  

	public static void SetupNetherOreGen() 
	{
		Biomes.NETHER.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.func_222280_a(Feature.MINABLE, new OreFeatureConfig
                (OreFeatureConfig.FillerBlockType.NETHERRACK, cockBlocks.cockore.getDefaultState(), 7), Placement.field_215028_n, new CountRangeConfig(8, 10, 10, 128)));
}  

	
}


 

  

 

so I made another "public static void" called it SetupNetherOreGen. Inside of that Mr.Troble found out how to change the biome to the Nether

biomes.NETHER.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.func_222280_a(Feature.MINABLE, new OreFeatureConfig
                (OreFeatureConfig.FillerBlockType.NETHERRACK, YOURBLOCK.getDefaultState(), 7/*MaxOreVeinSize*/), Placement.field_215028_n, new CountRangeConfig(8, 10, 10, 128)));// Vein/Chunk Count, MinHeight, MaxHeightBase, MaxHeight

The of course add it to your setup function in the main class and it should be working for the nether

private void setup(final FMLCommonSetupEvent event)
	{
		OreGeneration.SetupOrGen();		
		OreGeneration.SetupNetherOreGen();		
		
		logger.info("Setup method registered");
	}

GL HF

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

For the end I used a costume feature to replace the 1.13 MinableConfig

(See attachments)

 

And then added the Feature to the biom using the following line!

 

Feature ft = new MinableFeature(MinableConfig::func_214641_a);
Biomes.THE_END.addFeature(Decoration.UNDERGROUND_ORES, Biome.func_222280_a(ft, new MinableConfig(Blocks.END_STONE.getDefaultState(), Blocks.GRASS.getDefaultState(), 30), Placement.field_215028_n, new CountRangeConfig(100, 0, 0, 200)));

 

I hope this helps all of you!

 

Cheers

~MrTroble

MinableConfig.java MinableFeature.java

  • Thanks 2
Link to comment
Share on other sites

  • 7 months later...

Hey does anyone know if these methods will work for 1.15? I am new to moddding as well, but have created a basic mod with a special ore, resulting ingot, and block, that works. However, I am struggling to get the custom ore to generate in the world. I think the stuff I have been going off of are too outdated (1.12), but this gives me hope, being 1.14. Does anyone know a good place to find how to insert custom ore generation in the over world in 1.15? I’ll try this stuff when I get home and update if these methods do indeed work for 1.15

I hate signatures, they're too distracting

Link to comment
Share on other sites

2 hours ago, devguydan said:

Hey does anyone know if these methods will work for 1.15? I am new to moddding as well, but have created a basic mod with a special ore, resulting ingot, and block, that works. However, I am struggling to get the custom ore to generate in the world. I think the stuff I have been going off of are too outdated (1.12), but this gives me hope, being 1.14. Does anyone know a good place to find how to insert custom ore generation in the over world in 1.15? I’ll try this stuff when I get home and update if these methods do indeed work for 1.15

Hi Dan, I'm in the same boat as you. Trying to find a working custom ore generation for 1.15. It seems some things changed from 1.14 and you won't find a lot of the classes matching the names and fields used in the above examples.

 

I spent some time looking around and seemed to have found a solution that works.

 

Here's what I found to work so far:

 

for(Biome biome : ForgeRegistries.BIOMES )
{
  CountRangeConfig myCustomOrePlacementConfig = new CountRangeConfig(/*frequency per chunk*/  2, /*Min*/8,/*Offset*/ 8,/*Max*/ 22);
  biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, ModBlocks.myCustomOreBlock.getDefaultState(), 4)).func_227228_a_(Placement.COUNT_RANGE.func_227446_a_(myCustomOrePlacementConfig)));
}

 

Put this in the Preinit function (normally called setup(final FMLCommonSetupEvent event) in the Forge example mod ) or you can also place it inside a method in a separate OreGeneration class and then call it from setup.

 

If anyone has any corrections or better suggestions than this then definitely please let me know!

Link to comment
Share on other sites

20 minutes ago, Jebadiah said:

Hi Dan, I'm in the same boat as you. Trying to find a working custom ore generation for 1.15. It seems some things changed from 1.14 and you won't find a lot of the classes matching the names and fields used in the above examples.

 

I spent some time looking around and seemed to have found a solution that works.

 

Here's what I found to work so far:

 


for(Biome biome : ForgeRegistries.BIOMES )
{
  CountRangeConfig myCustomOrePlacementConfig = new CountRangeConfig(/*frequency per chunk*/  2, /*Min*/8,/*Offset*/ 8,/*Max*/ 22);
  biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, ModBlocks.myCustomOreBlock.getDefaultState(), 4)).func_227228_a_(Placement.COUNT_RANGE.func_227446_a_(myCustomOrePlacementConfig)));
}
 

 

Put this in the Preinit function (normally called setup(final FMLCommonSetupEvent event) in the Forge example mod ) or you can also place it inside a method in a separate OreGeneration class and then call it from setup.

 

If anyone has any corrections or better suggestions than this then definitely please let me know!

Thanks so much, will give this a go

 

I hate signatures, they're too distracting

Link to comment
Share on other sites

@SuppressWarnings({"ConstantConditions"})
@SubscribeEvent
public static void FMLLoadCompleteEvent(FMLLoadCompleteEvent event) {
    for (Biome biome : ForgeRegistries.BIOMES) {
        biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(
                OreFeatureConfig.FillerBlockType.NATURAL_STONE, ModBlocks.LOAD_STONE_ORE.getDefaultState(), 8))
                .withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(4, 0, 0, 32))));
    }
}

Tried this, but unfortunately, withConfiguration is not a function in my case. Note sure why yet.

 

Ok turns out mine was "obsfucated" still? instead of withConfiguration I have func_225566_b_. Anyone know why this happens?

Edited by devguydan
updated mappings

I hate signatures, they're too distracting

Link to comment
Share on other sites

23 hours ago, devguydan said:

withConfiguration is not a function in my case

Same

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/

Link to comment
Share on other sites

Make sure your mappings are up to date.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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)

Link to comment
Share on other sites

4 hours ago, rowan662 said:

withConfiguration is also not a function for me. I'm using Forge 1.15.2 - 31.1.0

 

2 hours ago, Cadiboo said:

Make sure your mappings are up to date.

Yes, either find the func_... function that matches the signature, or update your 

mappings channel: 'snapshot', '....'

 in build.gradle

Edited by devguydan
formatting

I hate signatures, they're too distracting

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
  • Topics

×
×
  • Create New...

Important Information

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