tidy
This commit is contained in:
parent
add28c4114
commit
d46cba5061
3 changed files with 12 additions and 20 deletions
|
|
@ -73,7 +73,7 @@ minetest.register_chatcommand("protector_replace", {
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"protector:protect", "protector:protect2", "protector:protect_hidden"},
|
nodenames = {"protector:protect", "protector:protect2", "protector:protect_hidden"},
|
||||||
interval = 6,
|
interval = 5,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
|
||||||
|
|
@ -81,9 +81,7 @@ minetest.register_abm({
|
||||||
|
|
||||||
if removal_names == "" and replace_names == "" then return end
|
if removal_names == "" and replace_names == "" then return end
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos) ; if not meta then return end
|
||||||
|
|
||||||
if not meta then return end
|
|
||||||
|
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
|
|
||||||
|
|
@ -166,7 +164,7 @@ minetest.register_node("protector:protect_hidden", {
|
||||||
groups = {not_in_creative_inventory = 1, unbreakable = 1},
|
groups = {not_in_creative_inventory = 1, unbreakable = 1},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
on_blast = function() end,
|
on_blast = function() end,
|
||||||
-- 1px block inside door hinge near node top
|
-- 1px block to stop falling nodes replacing protector
|
||||||
collision_box = {
|
collision_box = {
|
||||||
type = "fixed", fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}
|
type = "fixed", fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ local function register_door(name, def)
|
||||||
|
|
||||||
if minetest.registered_nodes[nu.name]
|
if minetest.registered_nodes[nu.name]
|
||||||
and minetest.registered_nodes[nu.name].on_rightclick then
|
and minetest.registered_nodes[nu.name].on_rightclick then
|
||||||
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
|
return minetest.registered_nodes[nu.name].on_rightclick(
|
||||||
|
ptu, nu, placer, itemstack)
|
||||||
end
|
end
|
||||||
|
|
||||||
local pt = pointed_thing.above
|
local pt = pointed_thing.above
|
||||||
|
|
@ -66,14 +67,10 @@ local function register_door(name, def)
|
||||||
local p2 = minetest.dir_to_facedir(placer:get_look_dir())
|
local p2 = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
local pt3 = {x = pt.x, y = pt.y, z = pt.z}
|
local pt3 = {x = pt.x, y = pt.y, z = pt.z}
|
||||||
|
|
||||||
if p2 == 0 then
|
if p2 == 0 then pt3.x = pt3.x - 1
|
||||||
pt3.x = pt3.x - 1
|
elseif p2 == 1 then pt3.z = pt3.z + 1
|
||||||
elseif p2 == 1 then
|
elseif p2 == 2 then pt3.x = pt3.x + 1
|
||||||
pt3.z = pt3.z + 1
|
elseif p2 == 3 then pt3.z = pt3.z - 1
|
||||||
elseif p2 == 2 then
|
|
||||||
pt3.x = pt3.x + 1
|
|
||||||
elseif p2 == 3 then
|
|
||||||
pt3.z = pt3.z - 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_item_group(minetest.get_node(pt3).name, "prot_door") == 0 then
|
if minetest.get_item_group(minetest.get_node(pt3).name, "prot_door") == 0 then
|
||||||
|
|
@ -346,7 +343,7 @@ register_door(name, {
|
||||||
description = S("Protected Steel Door"),
|
description = S("Protected Steel Door"),
|
||||||
inventory_image = "doors_steel.png^protector_logo.png",
|
inventory_image = "doors_steel.png^protector_logo.png",
|
||||||
groups = {
|
groups = {
|
||||||
snappy = 1, bendy = 2, cracky = 1,
|
snappy = 1, cracky = 1,
|
||||||
level = (mcl and 0 or 2), pickaxey = 2, unbreakable = 1
|
level = (mcl and 0 or 2), pickaxey = 2, unbreakable = 1
|
||||||
},
|
},
|
||||||
tiles_bottom = {"doors_steel_b.png^protector_logo.png", "doors_grey.png"},
|
tiles_bottom = {"doors_steel_b.png^protector_logo.png", "doors_grey.png"},
|
||||||
|
|
@ -485,7 +482,7 @@ register_trapdoor("protector:trapdoor_steel", {
|
||||||
tile_front = "doors_trapdoor_steel.png^protector_logo.png",
|
tile_front = "doors_trapdoor_steel.png^protector_logo.png",
|
||||||
tile_side = "doors_trapdoor_steel_side.png",
|
tile_side = "doors_trapdoor_steel_side.png",
|
||||||
groups = {
|
groups = {
|
||||||
snappy = 1, bendy = 2, cracky = 1, melty = 2, level = (mcl and 0 or 2),
|
snappy = 1, bendy = 2, cracky = 1, level = (mcl and 0 or 2),
|
||||||
unbreakable = 1, pickaxey = 2
|
unbreakable = 1, pickaxey = 2
|
||||||
},
|
},
|
||||||
_mcl_hardness = 1,
|
_mcl_hardness = 1,
|
||||||
|
|
|
||||||
5
init.lua
5
init.lua
|
|
@ -97,9 +97,7 @@ local function is_member(meta, name)
|
||||||
|
|
||||||
for _, f in ipairs(player_factions) do
|
for _, f in ipairs(player_factions) do
|
||||||
|
|
||||||
if factions.player_is_in_faction(f, owner) then
|
if factions.player_is_in_faction(f, owner) then return true end
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -226,7 +224,6 @@ local function protector_formspec(meta)
|
||||||
-- username add button
|
-- username add button
|
||||||
.."button[" .. (i % 4 * 2 + 1.25) .. ","
|
.."button[" .. (i % 4 * 2 + 1.25) .. ","
|
||||||
.. math_floor(i / 4 + 3) .. ";.75,.5;protector_submit;+]"
|
.. math_floor(i / 4 + 3) .. ";.75,.5;protector_submit;+]"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return formspec
|
return formspec
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue