forked from VoxeLibre/VoxeLibre
Protect: add bottles, mobspawner, fix repeater
This commit is contained in:
parent
312b17a958
commit
9a3c6a3fd7
|
@ -3577,6 +3577,10 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
||||||
local name = placer:get_player_name()
|
local name = placer:get_player_name()
|
||||||
local privs = minetest.get_player_privs(name)
|
local privs = minetest.get_player_privs(name)
|
||||||
if mod_mobspawners and under.name == "mcl_mobspawners:spawner" then
|
if mod_mobspawners and under.name == "mcl_mobspawners:spawner" then
|
||||||
|
if minetest.is_protected(pointed_thing.under, name) then
|
||||||
|
minetest.record_protection_violation(pointed_thing.under, name)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
if not privs.maphack then
|
if not privs.maphack then
|
||||||
minetest.chat_send_player(name, "You need the “maphack” privilege to change the mob spawner.")
|
minetest.chat_send_player(name, "You need the “maphack” privilege to change the mob spawner.")
|
||||||
return itemstack
|
return itemstack
|
||||||
|
|
|
@ -257,7 +257,7 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
||||||
on_rightclick = function (pos, node, clicker)
|
on_rightclick = function (pos, node, clicker)
|
||||||
local protname = clicker:get_player_name()
|
local protname = clicker:get_player_name()
|
||||||
if minetest.is_protected(pos, protname) then
|
if minetest.is_protected(pos, protname) then
|
||||||
minetest.report_protection_violation(pos, protname)
|
minetest.record_protection_violation(pos, protname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if node.name=="mesecons_delayer:delayer_off_1" then
|
if node.name=="mesecons_delayer:delayer_off_1" then
|
||||||
|
@ -325,7 +325,7 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
|
||||||
on_rightclick = function (pos, node, clicker)
|
on_rightclick = function (pos, node, clicker)
|
||||||
local protname = clicker:get_player_name()
|
local protname = clicker:get_player_name()
|
||||||
if minetest.is_protected(pos, protname) then
|
if minetest.is_protected(pos, protname) then
|
||||||
minetest.report_protection_violation(pos, protname)
|
minetest.record_protection_violation(pos, protname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if node.name=="mesecons_delayer:delayer_on_1" then
|
if node.name=="mesecons_delayer:delayer_on_1" then
|
||||||
|
|
|
@ -46,7 +46,13 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
|
||||||
get_water = true
|
get_water = true
|
||||||
river_water = node.name == "mclx_core:river_water_source"
|
river_water = node.name == "mclx_core:river_water_source"
|
||||||
-- Or reduce water level of cauldron by 1
|
-- Or reduce water level of cauldron by 1
|
||||||
elseif node.name == "mcl_cauldrons:cauldron_3" then
|
elseif string.sub(node.name, 1, 14) == "mcl_cauldrons:" then
|
||||||
|
local pname = placer:get_player_name()
|
||||||
|
if minetest.is_protected(pointed_thing.under, pname) then
|
||||||
|
minetest.record_protection_violation(pointed_thing.under, pname)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
if node.name == "mcl_cauldrons:cauldron_3" then
|
||||||
get_water = true
|
get_water = true
|
||||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron_2"})
|
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron_2"})
|
||||||
elseif node.name == "mcl_cauldrons:cauldron_2" then
|
elseif node.name == "mcl_cauldrons:cauldron_2" then
|
||||||
|
@ -68,6 +74,7 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
|
||||||
river_water = true
|
river_water = true
|
||||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if get_water then
|
if get_water then
|
||||||
-- Replace with water bottle, if possible, otherwise
|
-- Replace with water bottle, if possible, otherwise
|
||||||
-- place the water potion at a place where's space
|
-- place the water potion at a place where's space
|
||||||
|
@ -160,6 +167,11 @@ minetest.register_craftitem("mcl_potions:potion_water", {
|
||||||
|
|
||||||
local cauldron = fill_cauldron(node.name, "mcl_core:water_source")
|
local cauldron = fill_cauldron(node.name, "mcl_core:water_source")
|
||||||
if cauldron then
|
if cauldron then
|
||||||
|
local pname = placer:get_player_name()
|
||||||
|
if minetest.is_protected(pointed_thing.under, pname) then
|
||||||
|
minetest.record_protection_violation(pointed_thing.under, pname)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
-- Increase water level of cauldron by 1
|
-- Increase water level of cauldron by 1
|
||||||
minetest.set_node(pointed_thing.under, {name=cauldron})
|
minetest.set_node(pointed_thing.under, {name=cauldron})
|
||||||
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
|
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
|
||||||
|
@ -195,6 +207,11 @@ minetest.register_craftitem("mcl_potions:potion_river_water", {
|
||||||
|
|
||||||
local cauldron = fill_cauldron(node.name, "mclx_core:river_water_source")
|
local cauldron = fill_cauldron(node.name, "mclx_core:river_water_source")
|
||||||
if cauldron then
|
if cauldron then
|
||||||
|
local pname = placer:get_player_name()
|
||||||
|
if minetest.is_protected(pointed_thing.under, pname) then
|
||||||
|
minetest.record_protection_violation(pointed_thing.under, pname)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
-- Increase water level of cauldron by 1
|
-- Increase water level of cauldron by 1
|
||||||
minetest.set_node(pointed_thing.under, {name=cauldron})
|
minetest.set_node(pointed_thing.under, {name=cauldron})
|
||||||
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
|
minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16})
|
||||||
|
|
Loading…
Reference in New Issue