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)
|
minetest.get_meta(pt2):set_int("right", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
return itemstack
|
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"},
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
use_texture_alpha = "clip",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
drop = name,
|
drop = name,
|
||||||
drawtype = "nodebox",
|
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"},
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
use_texture_alpha = "clip",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
drop = "",
|
drop = "",
|
||||||
drawtype = "nodebox",
|
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]},
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
use_texture_alpha = "clip",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
drop = name,
|
drop = name,
|
||||||
drawtype = "nodebox",
|
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]},
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
use_texture_alpha = "clip",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
drop = "",
|
drop = "",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
@ -404,6 +408,7 @@ function register_trapdoor(name, def)
|
|||||||
def.drawtype = "nodebox"
|
def.drawtype = "nodebox"
|
||||||
def.paramtype = "light"
|
def.paramtype = "light"
|
||||||
def.paramtype2 = "facedir"
|
def.paramtype2 = "facedir"
|
||||||
|
def.use_texture_alpha = "clip"
|
||||||
def.is_ground_content = false
|
def.is_ground_content = false
|
||||||
|
|
||||||
local def_opened = table.copy(def)
|
local def_opened = table.copy(def)
|
||||||
|
7
init.lua
7
init.lua
@ -177,13 +177,13 @@ local protector_formspec = function(meta)
|
|||||||
checkbox_faction = true
|
checkbox_faction = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if factions.get_player_factions(meta:get_string("owner")) ~= nil then
|
local player_factions = factions.get_player_factions(meta:get_string("owner"))
|
||||||
if next(factions.get_player_faction(meta:get_string("owner"))) then
|
|
||||||
|
if player_factions ~= nil and #player_factions >= 1 then
|
||||||
checkbox_faction = true
|
checkbox_faction = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if checkbox_faction then
|
if checkbox_faction then
|
||||||
|
|
||||||
formspec = formspec .. "checkbox[0,5;faction_members;"
|
formspec = formspec .. "checkbox[0,5;faction_members;"
|
||||||
@ -578,6 +578,7 @@ minetest.register_node("protector:protect2", {
|
|||||||
inventory_image = "protector_logo.png",
|
inventory_image = "protector_logo.png",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
groups = {dig_immediate = 2, unbreakable = 1},
|
groups = {dig_immediate = 2, unbreakable = 1},
|
||||||
|
use_texture_alpha = "clip",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
legacy_wallmounted = true,
|
legacy_wallmounted = true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user