On my public server I have big problems with lava.
What can I do to solve the problem in a creative world? Which solution do You recommend?
I read some stuff in the forum, but I'm not sure, which solution is really the best.
Any hint is welcome!
Control / disable lava
- thminer
- Member
- Posts: 83
- Joined: Sat Aug 12, 2017 16:24
- GitHub: TEbinger
- In-game: thomas or thomas321
- Contact:
Control / disable lava
Find my minetest stuff in my blog: http://thomas-ebinger.de/?s=minetest
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: Control / disable lava
Add the following global function overrides to the end of default/functions.lua:
viewtopic.php?p=299612#p299612
Then, instead of the example for TNT provided, you can limit placement of lava in this way:
I would recommend creating a new mod for this purpose, something like "antigrief", and then simply adding the above code to the init.lua. Be sure to include a depends.txt file in that same directory with the following dependencies:
Later on, should you decide, you can easily add antigrief hooks for anything else you choose to restrict. Just remember to update the dependencies as necessary.
viewtopic.php?p=299612#p299612
Then, instead of the example for TNT provided, you can limit placement of lava in this way:
Code: Select all
local LAVA_PLACE_DEPTH = -50
function allow_place_lava( pos, player )
if pos.y > LAVA_PLACE_DEPTH and not minetest.check_player_privs( player, "lava" ) then
minetest.chat_send_player( player:get_player_name( ), "You are not allowed to place lava above " .. LAVA_PLACE_DEPTH .. "!" )
minetest.log( "action", player:get_player_name( ) .. " tried to place default:lava_source above " .. LAVA_PLACE_DEPTH )
return false
end
return true
end
minetest.override_item( "bucket:bucket_lava", {
allow_place = allow_place_lava
} )
minetest.override_item( "default:lava_source", {
allow_place = allow_place_lava
} )
Code: Select all
default
bucket
- thminer
- Member
- Posts: 83
- Joined: Sat Aug 12, 2017 16:24
- GitHub: TEbinger
- In-game: thomas or thomas321
- Contact:
Re: Control / disable lava
Sounds good. thank you very much. I will try this later
Find my minetest stuff in my blog: http://thomas-ebinger.de/?s=minetest
- thminer
- Member
- Posts: 83
- Joined: Sat Aug 12, 2017 16:24
- GitHub: TEbinger
- In-game: thomas or thomas321
- Contact:
Re: Control / disable lava
This solution unfortunately did not work for me. Made a mod with github (https://github.com/TEbinger/lavacontrol).
You can try the mod on the server, maybe You find the reason why it's not working.
Server: minetest.rpi-virtuell.de:30001
You can try the mod on the server, maybe You find the reason why it's not working.
Server: minetest.rpi-virtuell.de:30001
Find my minetest stuff in my blog: http://thomas-ebinger.de/?s=minetest
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: Control / disable lava
I forgot to mention that you will need to register a privilege called "lava".
The rest of the code was pretty much copied verbatim from my city_block mod fork, so it's baffling why it wouldn't work. I will check out your server soon to see what's happening. Most likely it's something very simple that I overlooked :)
Code: Select all
minetest.register_privilege( "lava", "Can place lava at any depth.")
- thminer
- Member
- Posts: 83
- Joined: Sat Aug 12, 2017 16:24
- GitHub: TEbinger
- In-game: thomas or thomas321
- Contact:
Re: Control / disable lava
Thank You very much in advance!
Find my minetest stuff in my blog: http://thomas-ebinger.de/?s=minetest
- thminer
- Member
- Posts: 83
- Joined: Sat Aug 12, 2017 16:24
- GitHub: TEbinger
- In-game: thomas or thomas321
- Contact:
Re: Control / disable lava
I think this mod will do it: https://github.com/Cat5TV/tps_spill
Find my minetest stuff in my blog: http://thomas-ebinger.de/?s=minetest
Who is online
Users browsing this forum: Amazon [Bot] and 43 guests