Liquid Guard

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Liquid Guard

by everamzah » Sun Jul 10, 2016 15:02

Description: Require a priv named 'liquid' to use liquid source nodes. Lava, including its bucket, require a `lava` priv.
License: WTFPL
Depends: default, bucket
Git repo: https://github.com/everamzah/liquid_guard


Code: Select all
minetest.register_privilege("liquid", "Can place liquid source nodes.")
minetest.register_privilege("lava", "Can use liquid igniters.")

local old_lava_bucket_place = minetest.registered_items["bucket:bucket_lava"].on_place

minetest.override_item("bucket:bucket_lava", {
   on_place = function(itemstack, placer, pointed_thing)
      if not minetest.check_player_privs(placer:get_player_name(),
            {lava = true}) then
         return itemstack
      else
         return old_lava_bucket_place(itemstack, placer, pointed_thing)
      end
   end,
})

minetest.override_item("default:lava_source", {
   after_place_node = function(pos, placer, itemstack, pointed_thing)
      if not minetest.check_player_privs(placer:get_player_name(),
            {liquid = true, lava = true}) then
         minetest.remove_node(pos)
      end
   end,
})

minetest.override_item("default:water_source", {
   after_place_node = function(pos, placer, itemstack, pointed_thing)
      if not minetest.check_player_privs(placer:get_player_name(),
            {liquid = true}) then
         minetest.remove_node(pos)
      end
   end,
})

minetest.override_item("default:river_water_source", {
   after_place_node = function(pos, placer, itemstack, pointed_thing)
      if not minetest.check_player_privs(placer:get_player_name(),
            {liquid = true}) then
         minetest.remove_node(pos)
      end
   end,
})
 

User avatar
MineYoshi
Member
 
Posts: 5372
Joined: Wed Jul 08, 2015 13:20

Re: Liquid Guard

by MineYoshi » Mon Jul 11, 2016 20:53

liquid privileges?
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
azekill_DIABLO
Member
 
Posts: 7491
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
D00Med
Member
 
Posts: 943
Joined: Sat Feb 07, 2015 22:49
Location: Australia...somewhere
GitHub: D00Med

Re: Liquid Guard

by D00Med » Wed Jul 13, 2016 06:23

^lol
Nice mod though, it will be useful.
 

User avatar
DS-minetest
Member
 
Posts: 1123
Joined: Thu Jun 19, 2014 19:49
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
GitHub: DS-Minetest
In-game: DS

Re: Liquid Guard

by DS-minetest » Fri Jul 15, 2016 16:25

good against griefing with lava or corium (technic mod)
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
Fixer
Member
 
Posts: 894
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer
 

User avatar
Hamlet
Member
 
Posts: 698
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: Liquid Guard

by Hamlet » Thu Mar 01, 2018 19:43

Thanks for this simple yet most useful mod.
I've updated it to handle water buckets and river water buckets.

Downloads: zip, tar.gz
Source code: GitHub
 


Return to WIP Mods



Who is online

Users browsing this forum: BuckarooBanzay, Imk and 3 guests