[Mod] lava ore generator [lava_ore_gen]

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

[Mod] lava ore generator [lava_ore_gen]

by Coder12 » Post

This mod makes the lava turn stone into ore over time. When lava comes in contact with stone it turns red hot. After a specific time it turns into ore.
License: MIT
Mod dependencies: default
Optional dependencies: none lava_ore_gen.blacklist is a table where you can blacklist node names.

Example code:

Code: Select all

lava_ore_gen.blacklist["default:stone_with_iron"] = true

Fixed interval of when stone is changed into ore.

Code: Select all

lava_ore_gen.interval = 3600
Random chance of when to change stone into ore.

Code: Select all

lava_ore_gen.chance = 86400
Make ores random instead of being based on how rare they are.

Code: Select all

lava_ore_gen.random = false
Image ContentDB
Browse Code
Download
Last edited by Coder12 on Mon Sep 06, 2021 00:14, edited 22 times in total.

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] Lava ore generator [lava_ore_gen]

by cx384 » Post

I have seen a mod like this on an old server about 4 years ago. So this is nothing new, but Good job!

It would be nice if the chance of each ore would depend on its ore generating rarity.
Can your read this?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Lava ore generator [lava_ore_gen]

by azekill_DIABLO » Post

A bit overpowered no? an ore farm? could even be automated with mesecons and pipes... anyway it's nice. But it needs what cx884 said.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

Sure thing when I have time I will make the ores generate based on how rare it is.

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

Could you make it work for any ore from any mod? That would make it awesome for an all-ocean world.
What is SCP-055?

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

I rewrote the code to make it work with more ore mods(if the name of the ores is right). And I added rarity. I did not test the rarity for long to see if it truly works right tho.

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

Never mind I got it work. :)
Chem871 wrote:Could you make it work for any ore from any mod? That would make it awesome for an all-ocean world.
Yep I did that it. If the ore names is like :stone_with_ or :mineral_

John_Constructor
Member
Posts: 76
Joined: Thu Jun 01, 2017 20:06
GitHub: John-Constructor
In-game: Nooberton
Location: On Minetest 24/7

Re: [Mod] Lava ore generator [lava_ore_gen]

by John_Constructor » Post

Tried the mod out in Creative, this literally gave me two Mithril ores within 50 seconds.



Image

10/10 though for the possibilities! Rarity might want to be further tested.

Hopefully this was helpful.
Attachments
Quickest two mithril ores in the world.
Quickest two mithril ores in the world.
QuickMithril.png (300.98 KiB) Viewed 1700 times
Constructing mechs and wingless aircraft since 2016.

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

John_Constructor wrote:Tried the mod out in Creative, this literally gave me two Mithril ores within 50 seconds.



Image

10/10 though for the possibilities! Rarity might want to be further tested.

Hopefully this was helpful.
...
Thanks for pointing that out.
Okay I tested it my self and it gave me lots of Mithril.
[Update]
I change the code again. The abm now has a interval of 20 and a chance of 400, and I change the some code in the abm.
it now gives me lots of iron.

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

Is there a way to keep a specific ore from generating?
What is SCP-055?

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

Chem871 wrote:Is there a way to keep a specific ore from generating?
I can add a way. Would you like a ore blacklist or block ores if they are too rare? Or both?

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

For an all-ocean world, there's already a way to get coal and diamonds, so maybe those?
What is SCP-055?

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

Chem871 wrote:For an all-ocean world, there's already a way to get coal and diamonds, so maybe those?
you have to download again.
I added a blacklist. All you have to do is edit the init.lua file.
Just copy and paste this line of code.

Code: Select all

local blacklist = {"default:stone_with_coal","default:stone_with_diamond"}

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

Awesome!
What is SCP-055?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Lava ore generator [lava_ore_gen]

by TechNolaByte » Post

does this use a set list(whitelist) or a ore gen table(can spawn any ore added by minetest.register_ore)?
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

It does it by what it starts with, (mod):stone_with_(name) and (mod):mineral_(name) are supported.
What is SCP-055?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Lava ore generator [lava_ore_gen]

by TechNolaByte » Post

Chem871 wrote:It does it by what it starts with, (mod):stone_with_(name) and (mod):mineral_(name) are supported.
so its a universal stone_with_(random name of random ore random mod registers) or mineral_(random name of random ore random mod registers)
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

Yep.
What is SCP-055?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Lava ore generator [lava_ore_gen]

by TechNolaByte » Post

Chem871 wrote:Yep.
sweet!
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Lava ore generator [lava_ore_gen]

by bell07 » Post

Just for reference: In Unternull an other ore enabled lava cooling is implemented too, without usage of ABM but by direct redefinition of "default" lava cooling: https://github.com/CasimirKaPazi/untern ... t.lua#L130

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Lava ore generator [lava_ore_gen]

by Chem871 » Post

Bell07, that doesn't work anymore, as soon as I updated to 0.4.16, it stopped working.
What is SCP-055?

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

Bell07 a abm is still created in the default mod pack for lava cooling. That mod just overrides the function that is used in the abm.

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Lava ore generator [lava_ore_gen]

by bell07 » Post

The reason it was stopped working was https://github.com/minetest/minetest_game/issues/1761. The issue is already fixed.
About ABM's you are right. But your mod adds an second ABM in addition to the default one ;-)

By the way, I like the generic way in unternull to select ores, wrote by me ;-)

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] Lava ore generator [lava_ore_gen]

by Coder12 » Post

bell07 wrote:The reason it was stopped working was https://github.com/minetest/minetest_game/issues/1761. The issue is already fixed.
About ABM's you are right. But your mod adds an second ABM in addition to the default one ;-)
Yeah maybe I should change that.
bell07 wrote:By the way, I like the generic way in unternull to select ores, wrote by me ;-)
Cool.

Coder12
Member
Posts: 162
Joined: Sat Sep 30, 2017 00:15

Re: [Mod] lava ore generator [lava_ore_gen]

by Coder12 » Post

I updated this mod. I removed the ABM and made the stone turn a bit red when its next to the lava.
Spoiler
Image
Attachments
screenshot_20181010_210028.png
screenshot_20181010_210028.png (382.04 KiB) Viewed 1700 times

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests