Add back *some* changes that I reverted; and fix typo "Cherry Gate"

This commit is contained in:
seventeenthShulker 2024-08-03 20:26:39 +02:00 committed by the-real-herowl
parent 8b9666137d
commit f8fcd9954f
9 changed files with 45 additions and 27 deletions

View file

@ -208,7 +208,7 @@ if minetest.get_modpath("mcl_fences") then
wood_groups, wood_groups,
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,
minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance,
node_sound) -- note: about missing params.. will use defaults. node_sound)
mcl_bamboo.mcl_log(dump(fence_id)) mcl_bamboo.mcl_log(dump(fence_id))
mcl_bamboo.mcl_log(dump(gate_id)) mcl_bamboo.mcl_log(dump(gate_id))

View file

@ -19,6 +19,6 @@ Cherry Slab=Dalle en cerisier
Double Cherry Slab=Double Dalle en cerisier Double Cherry Slab=Double Dalle en cerisier
Cherry Sign=Panneau de cerisier Cherry Sign=Panneau de cerisier
Cherry Fence=Barrière en cerisier Cherry Fence=Barrière en cerisier
Cherry Gate=Portillion en cerisier Cherry Fence Gate=Portillion en cerisier
Cherry Pressure Plate=Plaque de pression en cerisier Cherry Pressure Plate=Plaque de pression en cerisier
Cherry Button=Bouton de Cerisier Cherry Button=Bouton de Cerisier

View file

@ -19,6 +19,6 @@ Cherry Slab=Laje de Cerejeira
Double Cherry Slab=Laje Dupla de Cerejeira Double Cherry Slab=Laje Dupla de Cerejeira
Cherry Sign=Placa de Cerejeira Cherry Sign=Placa de Cerejeira
Cherry Fence=Cerca de Cerejeira Cherry Fence=Cerca de Cerejeira
Cherry Gate=Portão de Cerejeira Cherry Fence Gate=Portão de Cerejeira
Cherry Pressure Plate=Placa de Pressão de Cerejeira Cherry Pressure Plate=Placa de Pressão de Cerejeira
Cherry Button=Botão de Cerejeira Cherry Button=Botão de Cerejeira

View file

@ -19,6 +19,6 @@ Cherry Slab=Вишнёвая плита
Double Cherry Slab=Двойная вишнёвая плита Double Cherry Slab=Двойная вишнёвая плита
Cherry Sign=Вишнёвая табличка Cherry Sign=Вишнёвая табличка
Cherry Fence=Вишнёвый забор Cherry Fence=Вишнёвый забор
Cherry Gate=Вишнёвая калитка Cherry Fence Gate=Вишнёвая калитка
Cherry Pressure Plate=Вишнёвая нажимная плита Cherry Pressure Plate=Вишнёвая нажимная плита
Cherry Button=Вишнёвая кнопка Cherry Button=Вишнёвая кнопка

View file

@ -19,6 +19,6 @@ Cherry Slab=
Double Cherry Slab= Double Cherry Slab=
Cherry Sign= Cherry Sign=
Cherry Fence= Cherry Fence=
Cherry Gate= Cherry Fence Gate=
Cherry Pressure Plate= Cherry Pressure Plate=
Cherry Button= Cherry Button=

View file

@ -69,7 +69,7 @@ mcl_signs.register_sign_custom("mcl_cherry_blossom", "_cherrywood",
mcl_fences.register_fence_and_fence_gate( mcl_fences.register_fence_and_fence_gate(
"cherry_fence", "cherry_fence",
S("Cherry Fence"), S("Cherry Fence"),
S("Cherry Gate"), S("Cherry Fence Gate"),
"mcl_cherry_blossom_planks.png", "mcl_cherry_blossom_planks.png",
{handy=1, axey=1, flammable=2, fence_wood=1, fire_encouragement=5, fire_flammability=20}, {handy=1, axey=1, flammable=2, fence_wood=1, fire_encouragement=5, fire_flammability=20},
minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, minetest.registered_nodes["mcl_core:wood"]._mcl_hardness,

View file

@ -52,7 +52,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", {
tiles = {"mcl_ocean_prismarine_bricks.png"}, tiles = {"mcl_ocean_prismarine_bricks.png"},
groups = {pickaxey=1, building_block=1, material_stone=1}, groups = {pickaxey=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 1.5, _mcl_blast_resistance = 6,
_mcl_hardness = 1.5, _mcl_hardness = 1.5,
}) })
@ -64,7 +64,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", {
tiles = {"mcl_ocean_prismarine_dark.png"}, tiles = {"mcl_ocean_prismarine_dark.png"},
groups = {pickaxey=1, building_block=1, material_stone=1}, groups = {pickaxey=1, building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 1.5, _mcl_blast_resistance = 6,
_mcl_hardness = 1.5, _mcl_hardness = 1.5,
}) })

View file

@ -2,7 +2,7 @@
This API allows you to add more walls (like the cobblestone wall) to VoxeLibre. This API allows you to add more walls (like the cobblestone wall) to VoxeLibre.
## `mcl_walls.register_wall(nodename, description, craft_material, tiles, invtex, groups, sounds)` ## `mcl_walls.register_wall(nodename, description, craft_material, tiles, invtex, groups, sounds, hardness, blast_resistance)`
Adds a new wall type. This is optimized for stone-based walls, but other materials are theoretically possible, too. Adds a new wall type. This is optimized for stone-based walls, but other materials are theoretically possible, too.
@ -25,6 +25,8 @@ If `craft_material` is not `nil` it also adds a crafting recipe of the following
* `inventory_image`: Inventory image (optional if `source` is set) * `inventory_image`: Inventory image (optional if `source` is set)
* `groups`: Base group memberships (optional, default is `{pickaxey=1}`) * `groups`: Base group memberships (optional, default is `{pickaxey=1}`)
* `sounds`: Sound table (optional, by default default uses stone sounds) * `sounds`: Sound table (optional, by default default uses stone sounds)
* `hardness`: Hardness of node (optional, default matches `source` node or fallback value 2)
* `blast_resistance`: Blast resistance of node (optional, default matches `source` node or fallback value 6)
The following groups will automatically be added to the nodes (where applicable), you do not need to add them The following groups will automatically be added to the nodes (where applicable), you do not need to add them
to the `groups` table: to the `groups` table:

View file

@ -97,8 +97,10 @@ local full_blocks = {
* inventory_image: Inventory image (optional) * inventory_image: Inventory image (optional)
* groups: Base group memberships (optional, default is {pickaxey=1}) * groups: Base group memberships (optional, default is {pickaxey=1})
* sounds: Sound table (optional, default is stone) * sounds: Sound table (optional, default is stone)
* hardness: Hardness of node (optional, default matches `source` node or fallback value 2)
* blast_resistance: Blast resistance of node (optional, default matches `source` node or fallback value 6)
]] ]]
function mcl_walls.register_wall(nodename, description, source, tiles, inventory_image, groups, sounds) function mcl_walls.register_wall(nodename, description, source, tiles, inventory_image, groups, sounds, hardness, blast_resistance)
local base_groups = groups local base_groups = groups
if not base_groups then if not base_groups then
@ -112,17 +114,31 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory
local main_node_groups = table.copy(base_groups) local main_node_groups = table.copy(base_groups)
main_node_groups.deco_block = 1 main_node_groups.deco_block = 1
-- TODO: Stop hardcoding blast resistance if source then
-- Default values from `source` node
if not sounds then if not hardness then
sounds = mcl_sounds.node_sound_stone_defaults() hardness = minetest.registered_nodes[source]._mcl_hardness
end end
if not blast_resistance then
if (not tiles) and source then blast_resistance = minetest.registered_nodes[source]._mcl_blast_resistance
end
if not sounds then
sounds = minetest.registered_nodes[source].sounds
end
if not tiles then
if minetest.registered_nodes[source] then if minetest.registered_nodes[source] then
tiles = minetest.registered_nodes[source].tiles tiles = minetest.registered_nodes[source].tiles
end end
end end
else
-- Fallback in case no `source` given
if not hardness then
hardness = 2
end
if not blast_resistance then
blast_resistance = 6
end
end
for i = 0, 15 do for i = 0, 15 do
local need = {} local need = {}
@ -169,8 +185,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory
fixed = take fixed = take
}, },
sounds = sounds, sounds = sounds,
_mcl_blast_resistance = 6, _mcl_blast_resistance = blast_resistance,
_mcl_hardness = 2, _mcl_hardness = hardness,
}) })
-- Add entry alias for the Help -- Add entry alias for the Help
@ -197,8 +213,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory
fixed = {pillar, full_blocks[1]} fixed = {pillar, full_blocks[1]}
}, },
sounds = sounds, sounds = sounds,
_mcl_blast_resistance = 6, _mcl_blast_resistance = blast_resistance,
_mcl_hardness = 2, _mcl_hardness = hardness,
}) })
-- Add entry alias for the Help -- Add entry alias for the Help
if minetest.get_modpath("doc") then if minetest.get_modpath("doc") then
@ -223,8 +239,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory
fixed = {pillar, full_blocks[2]} fixed = {pillar, full_blocks[2]}
}, },
sounds = sounds, sounds = sounds,
_mcl_blast_resistance = 6, _mcl_blast_resistance = blast_resistance,
_mcl_hardness = 2, _mcl_hardness = hardness,
}) })
-- Add entry alias for the Help -- Add entry alias for the Help
if minetest.get_modpath("doc") then if minetest.get_modpath("doc") then
@ -255,8 +271,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory
collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2}, collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2},
on_construct = update_wall, on_construct = update_wall,
sounds = sounds, sounds = sounds,
_mcl_blast_resistance = 6, _mcl_blast_resistance = blast_resistance,
_mcl_hardness = 2, _mcl_hardness = hardness,
}) })
if source then if source then
minetest.register_craft({ minetest.register_craft({