[Mod] Lava Restrictions [lavamod]

Post Reply
User avatar
LandMine
Member
Posts: 312
Joined: Tue May 01, 2012 16:44
Location: Mexico City
Contact:

[Mod] Lava Restrictions [lavamod]

by LandMine » Post

Info
This is a simple mod made by PilzAdam, i asked him if he was going to release it, he said i can do it so i will. Anyhow this mod is only useful for servers.

What this mod does is, it doesnt allow lava to be placed above sea level, that means no one will be able to place lava above 0 on the Y axis. This mod came in handy on my creative server, and i think it will help others as well.

Download
http://planetminetest.com/downloads/lavamod.zip

GitHub (PilzAdam)
https://gist.github.com/3927808

Licence
WTFPL
Last edited by LandMine on Mon Oct 29, 2012 23:22, edited 1 time in total.
List Of My Creative Servers - http://planetminetest.com
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

+1, awesome idea. I am going to remove my lava protection logic from skyblock in favor of this.

please include license, and pretty please host code on github...

Also, please consider when you override nodes, you should do it like this:
https://gist.github.com/3815683

The reason is that other mods may also override this same node, this will allow both changes without conflict, and is also a lot less code. Here is how I think the mod should look:

Code: Select all

local lava = {}
for k,v in pairs(minetest.registered_nodes["default:lava_source"]) do lava[k] = v end
lava.on_construct = function(pos) if pos.y >= 0 then minetest.env:remove_node(pos) end end
minetest.register_node(":default:lava_source", lava)
Neat, right?

User avatar
LandMine
Member
Posts: 312
Joined: Tue May 01, 2012 16:44
Location: Mexico City
Contact:

by LandMine » Post

Ok added licence and added the git page PilzAdam provided me. Fork it and make the changes if you wish :)
List Of My Creative Servers - http://planetminetest.com
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906

vktRus
Member
Posts: 67
Joined: Wed May 01, 2013 07:23

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Post

Link to the mod not working.

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Post

vktRus wrote:Link to the mod not working.
Updated the mod.
https://gist.github.com/SmallJoker/545225c71f85f8117599
Create a new mod folder and write those codes into a new init.lua file.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

vktRus
Member
Posts: 67
Joined: Wed May 01, 2013 07:23

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Post

ERROR[main]: ========== ERROR FROM LUA ===========
ERROR[main]: Failed to load and run script from
ERROR[main]: /home/v/.minetest/mods/lava_restriction/init.lua:
ERROR[main]: /home/v/.minetest/mods/lava_restriction/init.lua:1: Attempt to override non-existent item default:lava_source
ERROR[main]: stack traceback:
ERROR[main]: [C]: in function 'error'
ERROR[main]: /usr/share/minetest/builtin/game/register.lua:327: in function 'override_item'
ERROR[main]: /home/v/.minetest/mods/lava_restriction/init.lua:1: in main chunk
Need to add to the mod folder this file depends.txt:
default
Ups.
To place lava_source block — works.
Pour the lava from a bucket — is not working.

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Post

vktRus wrote:To place lava_source block — works.
Because you can place it in singleplayer, but not in multiplayer. Just remove the 'if minetest.is_singleplayer() then' from the codes.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

vktRus
Member
Posts: 67
Joined: Wed May 01, 2013 07:23

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Post

No. I've checked the mod in multiplayer. If you do better, then it will be fine. Video http://youtu.be/hHalR9sMp-w

I did this::

Code: Select all

minetest.override_item("default:lava_source", {
	on_construct = function(pos)
		if pos.y >= 0 then
			minetest.env:remove_node(pos)
		end
	end
})

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Post

vktRus wrote:No. I've checked the mod in multiplayer. If you do better, then it will be fine. Video http://youtu.be/hHalR9sMp-w

I did this::

Code: Select all

minetest.override_item("default:lava_source", {
	on_construct = function(pos)
		if pos.y >= 0 then
			minetest.env:remove_node(pos)
		end
	end
})
Oh yes. I totally forgot about the buckets. Thanks for sharing your codes.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

vktRus
Member
Posts: 67
Joined: Wed May 01, 2013 07:23

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Post

[Mod] Lava Restrictions [lavamod]
Attachments
lava_restriction.zip
(516 Bytes) Downloaded 202 times

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests