Page 1 of 1

How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 00:35
by MangleFox70
Hi all,
We're continually being griefed by people adding lava and water sources to our world.

Is there any way to disable these two items unless a user has a permission to use them?

Thanks!!

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 01:06
by KCoombes
Disable buckets.

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 02:51
by MangleFox70
And how does one do this? :) I looked into it and the best suggestions I could find is to delete a "buckets" mod, but that mod does not exist.

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 08:07
by oleastre
If your server is based on minetest_game, there should be a bucket folder in the games/minetest_game/mods/ folder.
This should remove buckets for everyone.

A more friendly way to do it is to avoid people to create buckets (but let you and permitted users to get one via creative inventory or /giveme command).
To do that, edit the games/minetest_game/mods/bucket/init.lua file and remove the following lines:
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.register_craft({
        output = 'bucket:bucket_empty 1',
        recipe = {
                {'default:steel_ingot', '', 'default:steel_ingot'},
                {'', 'default:steel_ingot', ''},
        }
})

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 17:01
by MangleFox70
Thanks oleastre.

We are running minetestserver on Linux without minetest_game.

Should we be using minetest_game for some reason on our server? Till now I've just been using the engine, and adding any mods I want.

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 17:30
by oleastre
You must have a "game" installed somewhere... otherwise, the engine will not even start and your world would be quite empty :)

minetest_game is the default "game", or world type if you prefer, and it comes bundled with the various minetest distributions.

For example, if you installed minetest from the ubuntu ppa; the game is located in:
/usr/share/games/minetest/games/minetest_game/

Unfortunately, if you change those files, your modifications will be overwritten on the next package update.

But, there is still hope :) You can create a new bucket mod !
Just copy the existing one, modify the init.lua file, and add it to your world as any other mod. It will be used instead of the default one.

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 17:34
by MangleFox70
/usr/share/games/minetest/games/minetest_game/

That's the missing piece :) I was looking for a "games" folder inside ~/.minetest

Thanks for the info... so since I'm about to move over to a git build, looks like I'll find what I need in the places I expect.

So, if "bucket" is a mod, why does it not show up as being able to be disabled in the mod list for the world? Is it just hard-coded to always be in place?

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 17:49
by oleastre
As the bucket mod is part of the game you use, you can not deactivate it from the UI.

And in fact, each game is just a collection of mods working together; minetest_game includes default, beds, boats, bucket ...

On my own little home server, I use my own game that's just a copy of minetest_game with some small tweaks and I added some extra mods in the game's mod folder. The advantage is when I create a new world, I only have to select my game and I have all my mods activated.

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 18:09
by MangleFox70
Interesting. So could I copy the minetest_game folder and create a new subgame containing my preferred mods? Then do I just edit something in my world's folder to tell it which subgame to use? Or how do I connect the two?

Thanks!

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 18:29
by oleastre
Yes you can do that; just copy /usr/share/games/minetest/games/minetest_game to your own folder (like .minetest/games/manglefox).

Then, in that folder, locate the game.conf file and change the name to whatever you want.
You can also change the menu/header.png and menu/icon.png files. Those are used in the UI to visually identify your game (at least, add something in those images to see the difference).

To change an existing world:
- first, make a backup of your world folder !
- next, in the world folder, there is a file named world.mt. In that file, locate the following line and replace "minetest_game" with your game folder name:
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
gameid = minetest_game

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 18:38
by MangleFox70
Thank you! Sounds awesome.
I guess if I do this, I just have to keep an eye on minetest_game development and perhaps do a diff on the updated versions to see what I need to add/remove/edit in my subgame, eh?

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 19:42
by oleastre
Yes, that's exactly what I do (In fact, I wrote some scripts that does this for me).

The trick is: when a new version of minetest_game is out, create a diff between the old version and your subgame. Then, apply that diff to the new minetest_game, and you have your new game version.

Do not try to create the diff between two versions of minetest_game and apply that diff to your subgame; it should works, but in case of merge problem, it's more difficult to find what is going wrong and to understand the problem.

If you know how to use git, it's quite easy to do... the magic command is git rebase

:)

Re: How to disable lava and water source?

PostPosted: Thu Feb 11, 2016 19:51
by MangleFox70
Thanks. New to git, but savvy with the Linux terminal. I'll check out "rebase" to learn more. Thanks again!