[Mod] Lava Restrictions [lavamod]

User avatar
LandMine
Member
 
Posts: 310
Joined: Tue May 01, 2012 16:44

[Mod] Lava Restrictions [lavamod]

by LandMine » Mon Oct 29, 2012 22:16

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 » Mon Oct 29, 2012 23:13

+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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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: 310
Joined: Tue May 01, 2012 16:44

by LandMine » Mon Oct 29, 2012 23:23

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 » Wed Nov 26, 2014 17:53

Link to the mod not working.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Wed Nov 26, 2014 18:32

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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Thu Nov 27, 2014 16:37

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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Thu Nov 27, 2014 19:04

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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Thu Nov 27, 2014 20:43

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::
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Lava Restrictions [lavamod]

by Krock » Fri Nov 28, 2014 16:49

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::
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: [Mod] Lava Restrictions [lavamod]

by vktRus » Fri Nov 28, 2014 17:03

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


Return to Old Mods

Who is online

Users browsing this forum: No registered users and 2 guests

cron