tidy code

This commit is contained in:
tenplus1 2021-12-08 08:15:08 +00:00
parent 7a3c173252
commit df561350d6
5 changed files with 21 additions and 23 deletions

View File

@ -29,7 +29,7 @@ minetest.register_chatcommand("protector_remove", {
end end
removal_names = param removal_names = param
end, end
}) })
@ -63,7 +63,7 @@ minetest.register_chatcommand("protector_replace", {
end end
replace_names = param replace_names = param
end, end
}) })
@ -163,8 +163,8 @@ minetest.register_node("protector:protect_hidden", {
-- 1px block inside door hinge near node top -- 1px block inside door hinge near node top
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}, fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}
}, }
}) })

View File

@ -300,7 +300,6 @@ function register_door(name, def)
sunlight_propagates = def.sunlight, sunlight_propagates = def.sunlight,
on_blast = function() end, on_blast = function() end,
}) })
end end
-- Protected Wooden Door -- Protected Wooden Door
@ -317,7 +316,7 @@ register_door(name, {
tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"}, tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"},
tiles_top = {"doors_wood_a.png", "doors_brown.png"}, tiles_top = {"doors_wood_a.png", "doors_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
sunlight = false, sunlight = false
}) })
if protector_crafts then if protector_crafts then
@ -480,7 +479,7 @@ if protector_crafts then
output = "protector:trapdoor 2", output = "protector:trapdoor 2",
recipe = { recipe = {
{"group:wood", "default:copper_ingot", "group:wood"}, {"group:wood", "default:copper_ingot", "group:wood"},
{"group:wood", "group:wood", "group:wood"}, {"group:wood", "group:wood", "group:wood"}
} }
}) })
@ -521,7 +520,7 @@ if protector_crafts then
output = "protector:trapdoor_steel", output = "protector:trapdoor_steel",
recipe = { recipe = {
{"default:copper_ingot", "default:steel_ingot"}, {"default:copper_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:steel_ingot"}
} }
}) })
@ -736,7 +735,7 @@ if protector_crafts then
minetest.register_craft({ minetest.register_craft({
output = "protector:chest", output = "protector:chest",
recipe = { recipe = {
{"mcl_chests:chest", "mcl_core:gold_ingot"}, {"mcl_chests:chest", "mcl_core:gold_ingot"}
} }
}) })
else else
@ -745,14 +744,14 @@ if protector_crafts then
recipe = { recipe = {
{"group:wood", "group:wood", "group:wood"}, {"group:wood", "group:wood", "group:wood"},
{"group:wood", "default:copper_ingot", "group:wood"}, {"group:wood", "default:copper_ingot", "group:wood"},
{"group:wood", "group:wood", "group:wood"}, {"group:wood", "group:wood", "group:wood"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "protector:chest", output = "protector:chest",
recipe = { recipe = {
{"default:chest", "default:copper_ingot"}, {"default:chest", "default:copper_ingot"}
} }
}) })
end end

View File

@ -155,7 +155,6 @@ local protector_formspec = function(meta)
local formspec = "size[8,7]" local formspec = "size[8,7]"
.. default.gui_bg .. default.gui_bg
.. default.gui_bg_img .. default.gui_bg_img
.. default.gui_slots
.. "label[2.5,0;" .. F(S("-- Protector interface --")) .. "]" .. "label[2.5,0;" .. F(S("-- Protector interface --")) .. "]"
.. "label[0,1;" .. F(S("PUNCH node to show protected area")) .. "]" .. "label[0,1;" .. F(S("PUNCH node to show protected area")) .. "]"
.. "label[0,2;" .. F(S("Members:")) .. "]" .. "label[0,2;" .. F(S("Members:")) .. "]"
@ -489,7 +488,7 @@ minetest.register_node("protector:protect", {
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5 ,-0.5, -0.5, 0.5, 0.5, 0.5}, {-0.5 ,-0.5, -0.5, 0.5, 0.5, 0.5}
} }
}, },
@ -558,7 +557,7 @@ if protector_recipe then
recipe = { recipe = {
{"default:stone", "default:stone", "default:stone"}, {"default:stone", "default:stone", "default:stone"},
{"default:stone", "default:gold_ingot", "default:stone"}, {"default:stone", "default:gold_ingot", "default:stone"},
{"default:stone", "default:stone", "default:stone"}, {"default:stone", "default:stone", "default:stone"}
} }
}) })
else else
@ -568,7 +567,7 @@ if protector_recipe then
recipe = { recipe = {
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"}, {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"}, {"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"}, {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"}
} }
}) })
end end
@ -594,7 +593,7 @@ minetest.register_node("protector:protect2", {
type = "wallmounted", type = "wallmounted",
wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5}, wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5},
wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5}, wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5},
wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375}, wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375}
}, },
selection_box = {type = "wallmounted"}, selection_box = {type = "wallmounted"},
@ -755,7 +754,7 @@ minetest.register_entity("protector:display", {
if self.timer > protector_show then if self.timer > protector_show then
self.object:remove() self.object:remove()
end end
end, end
}) })
@ -765,7 +764,7 @@ minetest.register_entity("protector:display", {
local x = protector_radius local x = protector_radius
minetest.register_node("protector:display_node", { minetest.register_node("protector:display_node", {
tiles = {"protector_display.png"}, tiles = {"protector_display.png"},
use_texture_alpha = "clip", -- true, use_texture_alpha = "clip",
walkable = false, walkable = false,
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
@ -781,15 +780,15 @@ minetest.register_node("protector:display_node", {
-- bottom -- bottom
{-(x+.55), -(x+.55), -(x+.55), (x+.55), -(x+.45), (x+.55)}, {-(x+.55), -(x+.55), -(x+.55), (x+.55), -(x+.45), (x+.55)},
-- middle (surround protector) -- middle (surround protector)
{-.55,-.55,-.55, .55,.55,.55}, {-.55,-.55,-.55, .55,.55,.55}
}, }
}, },
selection_box = { selection_box = {
type = "regular", type = "regular",
}, },
paramtype = "light", paramtype = "light",
groups = {dig_immediate = 3, not_in_creative_inventory = 1}, groups = {dig_immediate = 3, not_in_creative_inventory = 1},
drop = "", drop = ""
}) })

View File

@ -13,6 +13,6 @@ if minetest.get_modpath("lucky_block") then
{"dro", {"protector:trapdoor_steel"}, 1}, {"dro", {"protector:trapdoor_steel"}, 1},
{"dro", {"protector:tool"}, 1}, {"dro", {"protector:tool"}, 1},
{"dro", {"protector:chest"}, 1}, {"dro", {"protector:chest"}, 1},
{"exp"}, {"exp"}
}) })
end end

View File

@ -164,6 +164,6 @@ minetest.register_craft({
recipe = { recipe = {
{df, df, df}, {df, df, df},
{df, "protector:protect", df}, {df, "protector:protect", df},
{df, df, df}, {df, df, df}
} }
}) })