Error regarding mod I created

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Error regarding mod I created

by Midnight » Post

So recently I edited the code of one of my mods named new_biomes, and it started giving me an obnoxious error

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

I'm sorry to hear that, but the version of new_biomes on GitHub is only up to date for 22 January. So unless you provide the new version somewhere (like a git branch) and the error message, we can't really do much to help.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Well I haven't provided any information about the error cause and no the current version on github is alright, the actual problem is with my code lemme share

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post


minetest.unregister_biome("grassland_under")

minetest.register_biome({
name = "grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 50,
humidity_point = 35,
})

minetest.register_biome({
name = "underground_grassland",
node_stone = "new_biomes:glowing_dirt",
node_cave_liquid = {"default:river_water_source"},
node_dungeon = "new_biomes:glowing_dirt",
node_dungeon_stair = "new_biomes:gdwg",
y_max= -29000,
y_min = -31000,
vertical_blend = 10,
heat_point = 50,
humidity_point = 35,
})

minetest.register_decoration({
name = "new_biomes:plain_floor",
deco_type = "simple",
place_on = {"new_biomes:glowing_dirt"},
sidelen = 16,
fill_ratio = 10,
biomes = {"underground_grassland", "underground_deciduous_forest"},
y_max = -29000,
y_min = -30910,
decoration = "new_biomes:gdwg",
place_offset = -1,
flags = "all_floors,force_placement",
})

minetest.unregister_biome("taiga_under")

minetest.register_biome({
name = "taiga_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 25,
humidity_point = 70,
})

minetest.register_biome({
name = "underground_taiga",
node_stone = "new_biomes:glowing_dirt",
node_cave_liquid = {"default:river_water_source"},
node_dungeon_stair = "new_biomes:gdws",
node_dungeon = "new_biomes:glowing_dirt",
y_max = -29000,
y_min = -31000,
heat_point = 25,
humidity_point = 70,
})

minetest.unregister_biome("snowy_grassland_under")

minetest.register_biome({
name = "snowy_grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -28999,
heat_point = 20,
humidity_point = 35,
})

minetest.register_biome({
name = "underground_snowy_grassland",
node_stone = "new_biomes:glowing_dirt",
node_dungeon = "new_biomes:glowing_dirt",
node_dungeon_stair = "new_biomes:gdws",
node_cave_liquid = {"default:river_water_source"},
y_max= -29000,
y_min = -31000,
vertical_blend = 10,
heat_point = 20,
humidity_point = 35,
})

minetest.register_decoration({
name = "new_biomes:cold_floor",
deco_type = "simple",
place_on = {"new_biomes:glowing_dirt"},
sidelen = 16,
fill_ratio = 10,
biomes = {"underground_snowy_grassland", "underground_taiga"},
y_max = -29000,
y_min = -30910,
decoration = "new_biomes:gdws",
place_offset = -1,
flags = "all_floors,force_placement",
})



Now for some reason the underground_snowy_grassland does generate but the dirt cover over it is new_biomes:gdwg so this is causing some no plantation and ore deposits which were supposed to generate in there

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

screenshot_20240206_150418.png
screenshot_20240206_150418.png (472.68 KiB) Viewed 2237 times

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Midnight wrote:
Tue Feb 06, 2024 09:57
screenshot_20240206_150418.png
Ignore the lighting part well cuz its the engine bug

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Hello anybody here, I unfortunately want some advice on how to fix this problem, not a good coder need help?

Josselin2
Member
Posts: 134
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

Presumably this is your problem:

Code: Select all

fill_ratio = 10,
flags = "all_floors,force_placement",
These lines guarantee that a single decoration is placed on all possible surfaces, so there is nowhere to place other decorations like plants and ores.

You didn't post all of your code to github, as Blockhead suggested, so that is all the help you are going to get.

If this were my mod, I would start by adding these lines at the top of mapgen.lua:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
Then I would comment out every biome and decoration. Then I would uncomment each biome and decoration, one at a time, until the code stops behaving as expected.

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Josselin2 wrote:
Sun Feb 11, 2024 09:06
Presumably this is your problem:

Code: Select all

fill_ratio = 10,
flags = "all_floors,force_placement",
These lines guarantee that a single decoration is placed on all possible surfaces, so there is nowhere to place other decorations like plants and ores.

You didn't post all of your code to github, as Blockhead suggested, so that is all the help you are going to get.

If this were my mod, I would start by adding these lines at the top of mapgen.lua:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
Then I would comment out every biome and decoration. Then I would uncomment each biome and decoration, one at a time, until the code stops behaving as expected.
The thing is that only this particular biome is causing errors, but not any other biome all is working normal except for these lines. Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Also, these particular lines are the cause of errors, nothing other than them

Josselin2
Member
Posts: 134
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

Midnight wrote:
Sun Feb 11, 2024 10:28
Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming
Add those lines temporarily. Comment out other biomes/decorations temporarily. When you have fixed the problem, you can restore the old code.

Josselin2
Member
Posts: 134
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: Error regarding mod I created

by Josselin2 » Post

You need to upload your code. No-one can fix code that they can't see.

Go to your github, click the "main" button in the top left, in the box type "new_biomes_test", and then upload the broken code to that branch. You can delete the broken branch when you don't need it any more.

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Josselin2 wrote:
Mon Feb 12, 2024 08:47
Midnight wrote:
Sun Feb 11, 2024 10:28
Also I'm not willing to re-register the all biomes and decorations. It's quite size- consuming
Add those lines temporarily. Comment out other biomes/decorations temporarily. When you have fixed the problem, you can restore the old code.
I think then I'll just copy the mapgen.lua file in my mod

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Josselin2 wrote:
Mon Feb 12, 2024 08:58
You need to upload your code. No-one can fix code that they can't see.

Go to your github, click the "main" button in the top left, in the box type "new_biomes_test", and then upload the broken code to that branch. You can delete the broken branch when you don't need it any more.
Sorry for that long of a wait but I've uploaded the error causing code on the repository. The late was due to github third party 2 step verification problem

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Sat Mar 22, 2025 14:35
The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
Use findbiome world, find the new_biomes:underground_snowy_grassland

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

Midnight wrote:
Sun Mar 23, 2025 02:01
Blockhead wrote:
Sat Mar 22, 2025 14:35
The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
Use findbiome world, find the new_biomes:underground_snowy_grassland
It will be easier if you send me the seed (or is findbiome the seed?) and exact co-ordinates.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Sun Mar 23, 2025 06:39
Midnight wrote:
Sun Mar 23, 2025 02:01
Blockhead wrote:
Sat Mar 22, 2025 14:35
The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
Use findbiome world, find the new_biomes:underground_snowy_grassland
It will be easier if you send me the seed (or is findbiome the seed?) and exact co-ordinates.
oh sorry I was reffering you to use the findbiome mod

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Sun Mar 23, 2025 06:39
Midnight wrote:
Sun Mar 23, 2025 02:01
Blockhead wrote:
Sat Mar 22, 2025 14:35
The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
Use findbiome world, find the new_biomes:underground_snowy_grassland
It will be easier if you send me the seed (or is findbiome the seed?) and exact co-ordinates.
Sorry for replying so late I was literally struggling to keep up with
my college life here.

but here is a seed and see the problem urself pls.

8652216453922479942
underground_snowy_grassland 462, -29187, -1069
underground_taiga 882, -29251, -907(For some reason permafrost is being genrated, and sometimes grass, but never snowy grass)

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Sun Mar 23, 2025 06:39
Midnight wrote:
Sun Mar 23, 2025 02:01
Blockhead wrote:
Sat Mar 22, 2025 14:35
The latest main branch version at midnightx756/New_Biomes runs fine for me when I start a new world with it enabled. Are you stilling getting an error?
Use findbiome world, find the new_biomes:underground_snowy_grassland
It will be easier if you send me the seed (or is findbiome the seed?) and exact co-ordinates.
Hey bro

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

Midnight wrote:
Tue Feb 06, 2024 09:30
Now for some reason the underground_snowy_grassland does generate but the dirt cover over it is new_biomes:gdwg so this is causing some no plantation and ore deposits which were supposed to generate in there
Ores specify a wherein property when set up with core.register_ore. You should not be too surprised that when your caves are made of your modded dirt nodes, that the ores in MTG that are specifically coded only to spawn inside of default:stone do not spawn. You will need to copy & paste the ore definitions from MTG's mods (and any other mods you intend to support), or parse core.registered_ores for existing ore spawn types and make new ones that spawn in your modded dirt nodes. Hope that helps.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Sun Nov 30, 2025 16:01
Midnight wrote:
Tue Feb 06, 2024 09:30
Now for some reason the underground_snowy_grassland does generate but the dirt cover over it is new_biomes:gdwg so this is causing some no plantation and ore deposits which were supposed to generate in there

Ores specify a wherein property when set up with core.register_ore. You should not be too surprised that when your caves are made of your modded dirt nodes, that the ores in MTG that are specifically coded only to spawn inside of default:stone do not spawn. You will need to copy & paste the ore definitions from MTG's mods (and any other mods you intend to support), or parse core.registered_ores for existing ore spawn types and make new ones that spawn in your modded dirt nodes. Hope that helps.
I had registered a new decoration made up of ores that spawn in these biomes, but all other biomes have ore clusters except these

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

Midnight wrote:
Tue Dec 02, 2025 14:11
I had registered a new decoration made up of ores that spawn in these biomes, but all other biomes have ore clusters except these
That is a pretty unusual approach for ores, but fair enough. I haven't investigated in depth, but looking at deco.lua I would hazard a guess that the decoration placement code doesn't place decorations inside of caves, but instead only works on the surface where heightmap data is actually useful.

Two references:
  • Ethereal NG's illumishrooms spawn on top of coal with a register_on_generated call (decor.lua, end of of file)
  • Underch's mushroom generation uses an on_generated callback as well.
I don't think it's a mere coincidence that neither mod uses the decoration system, it would seem to corroborate my theory above. Again, not an in-depth investigation. And yes, I believe mushroom placement and the pillars in your mod are comparable.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Midnight
Member
Posts: 218
Joined: Sun Dec 19, 2021 13:56
GitHub: Midnightx756
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: Error regarding mod I created

by Midnight » Post

Blockhead wrote:
Tue Dec 02, 2025 17:24
Midnight wrote:
Tue Dec 02, 2025 14:11
I had registered a new decoration made up of ores that spawn in these biomes, but all other biomes have ore clusters except these
That is a pretty unusual approach for ores, but fair enough. I haven't investigated in depth, but looking at deco.lua I would hazard a guess that the decoration placement code doesn't place decorations inside of caves, but instead only works on the surface where heightmap data is actually useful.

Two references:
  • Ethereal NG's illumishrooms spawn on top of coal with a register_on_generated call (decor.lua, end of of file)
  • Underch's mushroom generation uses an on_generated callback as well.
I don't think it's a mere coincidence that neither mod uses the decoration system, it would seem to corroborate my theory above. Again, not an in-depth investigation. And yes, I believe mushroom placement and the pillars in your mod are comparable.
Ok I'll try but can u please help me with the grass problem, that underground_snowy_grassland still has gdwg instead of gdws on it

User avatar
Blockhead
Moderator
Posts: 2793
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Error regarding mod I created

by Blockhead » Post

Midnight wrote:
Wed Dec 03, 2025 01:52
Ok I'll try but can u please help me with the grass problem, that underground_snowy_grassland still has gdwg instead of gdws on it
In functions.lua, you have an ABM that turns glow dirt into grass. That doesn't check for air above the node at all though, so the cave at 886,-29253,-901 (still same seed, mapgen v7, which may matter for caves, I think probably not though) started turning into gdwg over time.

Meanwhile in mapgen.lua, underground_snowy_grass_land as a biome only refers to "new_biomes:gdws" as its node_dungeon_stair, and not in any way that would make it spawn gdws as the main material of the cave that I could see. While you're there, the indentation is a mess of different amounts of spaces...
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest