mirror of
https://notabug.org/TenPlus1/protector.git
synced 2024-12-05 03:03:48 +01:00
fix playerfaction support, code tidy
This commit is contained in:
parent
d1327e799f
commit
60b9f5846f
@ -77,7 +77,7 @@ function register_door(name, def)
|
||||
minetest.get_meta(pt2):set_int("right", 1)
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
@ -150,6 +150,7 @@ function register_door(name, def)
|
||||
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
use_texture_alpha = "clip",
|
||||
is_ground_content = false,
|
||||
drop = name,
|
||||
drawtype = "nodebox",
|
||||
@ -187,6 +188,7 @@ function register_door(name, def)
|
||||
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
use_texture_alpha = "clip",
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
@ -224,6 +226,7 @@ function register_door(name, def)
|
||||
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
use_texture_alpha = "clip",
|
||||
is_ground_content = false,
|
||||
drop = name,
|
||||
drawtype = "nodebox",
|
||||
@ -261,6 +264,7 @@ function register_door(name, def)
|
||||
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
use_texture_alpha = "clip",
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
@ -404,6 +408,7 @@ function register_trapdoor(name, def)
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = "facedir"
|
||||
def.use_texture_alpha = "clip"
|
||||
def.is_ground_content = false
|
||||
|
||||
local def_opened = table.copy(def)
|
||||
|
9
init.lua
9
init.lua
@ -177,10 +177,10 @@ local protector_formspec = function(meta)
|
||||
checkbox_faction = true
|
||||
end
|
||||
else
|
||||
if factions.get_player_factions(meta:get_string("owner")) ~= nil then
|
||||
if next(factions.get_player_faction(meta:get_string("owner"))) then
|
||||
checkbox_faction = true
|
||||
end
|
||||
local player_factions = factions.get_player_factions(meta:get_string("owner"))
|
||||
|
||||
if player_factions ~= nil and #player_factions >= 1 then
|
||||
checkbox_faction = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -578,6 +578,7 @@ minetest.register_node("protector:protect2", {
|
||||
inventory_image = "protector_logo.png",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
groups = {dig_immediate = 2, unbreakable = 1},
|
||||
use_texture_alpha = "clip",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
legacy_wallmounted = true,
|
||||
|
Loading…
Reference in New Issue
Block a user