feat: correct privs of the air block
This commit is contained in:
parent
667b2de068
commit
0b130ca0cc
24
airblock.lua
24
airblock.lua
@ -2,16 +2,20 @@ local S = minetest.get_translator("tech_additions")
|
|||||||
|
|
||||||
local placeairblock = function ()
|
local placeairblock = function ()
|
||||||
return function(itemstack, user, pointed_thing)
|
return function(itemstack, user, pointed_thing)
|
||||||
if minetest.is_creative_enabled(user:get_player_name()) then
|
local name = user:get_player_name()
|
||||||
local pos = user:getpos()
|
local pos = user:getpos()
|
||||||
local dir = user:get_look_dir()
|
local dir = user:get_look_dir()
|
||||||
local distancefromplayer = 3
|
local distancefromplayer = 3
|
||||||
local new_pos = {
|
local new_pos = {
|
||||||
x = pos.x + (dir.x * distancefromplayer),
|
x = pos.x + (dir.x * distancefromplayer),
|
||||||
y = pos.y + 1 + (dir.y * distancefromplayer),
|
y = pos.y + 1 + (dir.y * distancefromplayer),
|
||||||
z = pos.z + (dir.z * distancefromplayer),
|
z = pos.z + (dir.z * distancefromplayer),
|
||||||
}
|
}
|
||||||
local getPos = minetest.get_node(new_pos)
|
local getPos = minetest.get_node(new_pos)
|
||||||
|
if
|
||||||
|
not minetest.is_protected(new_pos, name) and
|
||||||
|
minetest.is_creative_enabled(name)
|
||||||
|
then
|
||||||
if getPos.name == "air" or
|
if getPos.name == "air" or
|
||||||
getPos.name == "default:water_source" or
|
getPos.name == "default:water_source" or
|
||||||
getPos.name == "default:water_flowing" or
|
getPos.name == "default:water_flowing" or
|
||||||
|
Loading…
Reference in New Issue
Block a user