[Mod] Lava Restrictions [lavamod]
[Mod] Lava Restrictions [lavamod]
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
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
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
+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:
Neat, right?
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)
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
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906
Re: [Mod] Lava Restrictions [lavamod]
Link to the mod not working.
- Krock
- Developer
- Posts: 4648
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Lava Restrictions [lavamod]
Updated the mod.vktRus wrote:Link to the mod not working.
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>
Re: [Mod] Lava Restrictions [lavamod]
Need to add to the mod folder this file depends.txt: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
Ups.default
To place lava_source block — works.
Pour the lava from a bucket — is not working.
- Krock
- Developer
- Posts: 4648
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Lava Restrictions [lavamod]
Because you can place it in singleplayer, but not in multiplayer. Just remove the 'if minetest.is_singleplayer() then' from the codes.vktRus wrote:To place lava_source block — works.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: [Mod] Lava Restrictions [lavamod]
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::
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
})
- Krock
- Developer
- Posts: 4648
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Lava Restrictions [lavamod]
Oh yes. I totally forgot about the buckets. Thanks for sharing your codes.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 })
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: [Mod] Lava Restrictions [lavamod]
[Mod] Lava Restrictions [lavamod]
- Attachments
-
- lava_restriction.zip
- (516 Bytes) Downloaded 202 times
Who is online
Users browsing this forum: No registered users and 3 guests