added protection check when placing hopper
This commit is contained in:
parent
00779b5f11
commit
16b7e00486
5
init.lua
5
init.lua
@ -130,6 +130,11 @@ minetest.register_node("hopper:hopper", {
|
|||||||
local x = pointed_thing.under.x - pos.x
|
local x = pointed_thing.under.x - pos.x
|
||||||
local z = pointed_thing.under.z - pos.z
|
local z = pointed_thing.under.z - pos.z
|
||||||
|
|
||||||
|
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||||
|
minetest.record_protection_violation(pos, placer:get_player_name())
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
if x == -1 then
|
if x == -1 then
|
||||||
minetest.set_node(pos, {name = "hopper:hopper_side", param2 = 0})
|
minetest.set_node(pos, {name = "hopper:hopper_side", param2 = 0})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user