fix collision box of gate slots

This commit is contained in:
flux 2022-05-07 17:26:09 -07:00 committed by SmallJoker
parent fc78d926bc
commit b97c7caa07

View File

@ -12,7 +12,7 @@ local get_material_properties = function(material)
composition_def = minetest.registered_nodes[material.craft_material] composition_def = minetest.registered_nodes[material.craft_material]
burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
end end
local tiles = material.tile local tiles = material.tile
if tiles == nil then if tiles == nil then
tiles = composition_def.tile tiles = composition_def.tile
@ -24,7 +24,7 @@ local get_material_properties = function(material)
if desc == nil then if desc == nil then
desc = composition_def.description desc = composition_def.description
end end
return composition_def, burn_time, tiles, desc return composition_def, burn_time, tiles, desc
end end
@ -49,24 +49,27 @@ castle_gates.register_gate_slot = function(material)
paramtype2 = "facedir", paramtype2 = "facedir",
groups = composition_def.groups, groups = composition_def.groups,
sounds = composition_def.sounds, sounds = composition_def.sounds,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- body {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- body
{-0.5, -0.5, -0.75, 0.5, 0.5, -1.5}, -- bracket {-0.5, -0.5, -0.75, 0.5, 0.5, -1.5}, -- bracket
} },
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 1.5}, -- body fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- body
{-0.5, -0.5, -0.75, 0.5, 0.5, -1.5}, -- bracket
},
}, },
}) })
minetest.register_node(mod_name..":"..material.name.."_gate_slot_reverse", { minetest.register_node(mod_name..":"..material.name.."_gate_slot_reverse", {
drawtype = "nodebox", drawtype = "nodebox",
description = S("@1 Gate Slot Reverse", desc), description = S("@1 Gate Slot Reverse", desc),
_doc_items_longdesc = castle_gates.doc.gate_slot_reverse_longdesc, _doc_items_longdesc = castle_gates.doc.gate_slot_reverse_longdesc,
_doc_items_usagehelp = castle_gates.doc.gate_slot_reverse_usagehelp, _doc_items_usagehelp = castle_gates.doc.gate_slot_reverse_usagehelp,
tiles = tile, tiles = tile,
@ -74,21 +77,21 @@ castle_gates.register_gate_slot = function(material)
paramtype2 = "facedir", paramtype2 = "facedir",
groups = composition_def.groups, groups = composition_def.groups,
sounds = composition_def.sounds, sounds = composition_def.sounds,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body {-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body
} }
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body fixed = {-0.5, -0.5, -1.25, 0.5, 0.5, 0.5}, -- body
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = mod_name..":"..material.name.."_gate_slot 2", output = mod_name..":"..material.name.."_gate_slot 2",
recipe = { recipe = {
@ -96,7 +99,7 @@ castle_gates.register_gate_slot = function(material)
{material.craft_material,"",material.craft_material}, {material.craft_material,"",material.craft_material},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = mod_name..":"..material.name.."_gate_slot", output = mod_name..":"..material.name.."_gate_slot",
type = "shapeless", type = "shapeless",
@ -107,7 +110,7 @@ castle_gates.register_gate_slot = function(material)
type = "shapeless", type = "shapeless",
recipe = {mod_name..":"..material.name.."_gate_slot"}, recipe = {mod_name..":"..material.name.."_gate_slot"},
}) })
if burn_time > 0 then if burn_time > 0 then
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
@ -118,7 +121,7 @@ castle_gates.register_gate_slot = function(material)
type = "fuel", type = "fuel",
recipe = mod_name..":"..material.name.."_gate_slot_reverse", recipe = mod_name..":"..material.name.."_gate_slot_reverse",
burntime = burn_time * 2, burntime = burn_time * 2,
}) })
end end
end end