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
removal_names = param
end,
end
})
@ -63,7 +63,7 @@ minetest.register_chatcommand("protector_replace", {
end
replace_names = param
end,
end
})
@ -163,8 +163,8 @@ minetest.register_node("protector:protect_hidden", {
-- 1px block inside door hinge near node top
collision_box = {
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,
on_blast = function() end,
})
end
-- Protected Wooden Door
@ -317,7 +316,7 @@ register_door(name, {
tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"},
tiles_top = {"doors_wood_a.png", "doors_brown.png"},
sounds = default.node_sound_wood_defaults(),
sunlight = false,
sunlight = false
})
if protector_crafts then
@ -480,7 +479,7 @@ if protector_crafts then
output = "protector:trapdoor 2",
recipe = {
{"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",
recipe = {
{"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({
output = "protector:chest",
recipe = {
{"mcl_chests:chest", "mcl_core:gold_ingot"},
{"mcl_chests:chest", "mcl_core:gold_ingot"}
}
})
else
@ -745,14 +744,14 @@ if protector_crafts then
recipe = {
{"group:wood", "group:wood", "group:wood"},
{"group:wood", "default:copper_ingot", "group:wood"},
{"group:wood", "group:wood", "group:wood"},
{"group:wood", "group:wood", "group:wood"}
}
})
minetest.register_craft({
output = "protector:chest",
recipe = {
{"default:chest", "default:copper_ingot"},
{"default:chest", "default:copper_ingot"}
}
})
end

View File

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

View File

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