From b237c4642db475d42d442297de395b89a8334ccd Mon Sep 17 00:00:00 2001 From: seventeenthShulker Date: Tue, 26 Sep 2023 13:20:16 +0200 Subject: [PATCH] Revert "Forgot about blackstone" I left it in from another branch, didn't want to force push. This reverts commit 58d2f59192073acf9f55406358bf48244e008b9b. Revert "Walls use `source` parameter for default hardness and blast resistance" I left it in from another branch, didn't want to force push. This reverts commit e8944cc145dc59db53a9368d8ae269edf366e742. Revert "Fix prismarine bricks and dark variant blast res." I left it in from another branch, didn't want to force push. This reverts commit 6125d625bc6ce15644cf8b579599f75da5bffd07. Revert "Un-hardcode blast resistance, hardness for walls," I left it in from another branch, didn't want to force push. This reverts commit 26e873703151bc4bfaf7588ad1e3afa731a05fbd. Revert "All wood-type and nether-type fences now match material's blast resistance" I left it in from another branch, didn't want to force push. This reverts commit a1e20f29162462120fb1c046c2d34f8fcebfb413. --- mods/ITEMS/mcl_bamboo/bamboo_items.lua | 21 ++-------- mods/ITEMS/mcl_blackstone/init.lua | 5 +-- mods/ITEMS/mcl_cherry_blossom/nodes.lua | 13 ++----- mods/ITEMS/mcl_deepslate/init.lua | 5 +-- mods/ITEMS/mcl_fences/init.lua | 21 +--------- mods/ITEMS/mcl_ocean/prismarine.lua | 4 +- mods/ITEMS/mcl_walls/API.md | 4 +- mods/ITEMS/mcl_walls/init.lua | 52 +++++++++---------------- 8 files changed, 32 insertions(+), 93 deletions(-) diff --git a/mods/ITEMS/mcl_bamboo/bamboo_items.lua b/mods/ITEMS/mcl_bamboo/bamboo_items.lua index a7a28257e..6ad8e4f58 100644 --- a/mods/ITEMS/mcl_bamboo/bamboo_items.lua +++ b/mods/ITEMS/mcl_bamboo/bamboo_items.lua @@ -192,23 +192,10 @@ if minetest.get_modpath("mcl_fences") then local wood_groups = { handy = 1, axey = 1, flammable = 2, fence_wood = 1, fire_encouragement = 5, fire_flammability = 20 } local wood_connect = { "group:fence_wood" } - local fence_id = mcl_fences.register_fence( - id, - S("Bamboo Fence"), - "mcl_bamboo_fence_bamboo.png", - wood_groups, - minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, - minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, - wood_connect, node_sound) - - local gate_id = mcl_fences.register_fence_gate( - id, - S("Bamboo Fence Gate"), - "mcl_bamboo_fence_gate_bamboo.png", - wood_groups, - minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, - minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, - node_sound) -- note: about missing params.. will use defaults. + local fence_id = mcl_fences.register_fence(id, S("Bamboo Fence"), "mcl_bamboo_fence_bamboo.png", wood_groups, + 2, 15, wood_connect, node_sound) + local gate_id = mcl_fences.register_fence_gate(id, S("Bamboo Fence Gate"), "mcl_bamboo_fence_gate_bamboo.png", + wood_groups, 2, 15, node_sound) -- note: about missing params.. will use defaults. mcl_bamboo.mcl_log(dump(fence_id)) mcl_bamboo.mcl_log(dump(gate_id)) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index be5bcc5db..c8dafbe6c 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -226,10 +226,7 @@ mcl_stairs.register_stair_and_slab("blackstone_brick_polished", "mcl_blackstone: S("Double Polished Blackstone Brick Slab"), nil) --Wall -mcl_walls.register_wall( - "mcl_blackstone:wall", - S("Blackstone Wall"), - "mcl_blackstone:blackstone") +mcl_walls.register_wall("mcl_blackstone:wall", S("Blackstone Wall"), "mcl_blackstone:blackstone") --lavacooling diff --git a/mods/ITEMS/mcl_cherry_blossom/nodes.lua b/mods/ITEMS/mcl_cherry_blossom/nodes.lua index 84d1a8a1b..6e13cacd9 100644 --- a/mods/ITEMS/mcl_cherry_blossom/nodes.lua +++ b/mods/ITEMS/mcl_cherry_blossom/nodes.lua @@ -66,16 +66,9 @@ mcl_signs.register_sign_custom("mcl_cherry_blossom", "_cherrywood", "mcl_cherry_blossom_sign_inv.png", "mcl_cherry_blossom_sign_inv.png", S("Cherry Sign")) -- Fences & Gates -mcl_fences.register_fence_and_fence_gate( - "cherry_fence", - S("Cherry Fence"), - S("Cherry Gate"), - "mcl_cherry_blossom_planks.png", - {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_blast_resistance, - {"group:fence_wood"}, - mcl_sounds.node_sound_wood_defaults()) +mcl_fences.register_fence_and_fence_gate("cherry_fence", S("Cherry Fence"), S("Cherry Gate"), + "mcl_cherry_blossom_planks.png", {handy=1, axey=1, flammable=2, fence_wood=1, fire_encouragement=5, fire_flammability=20}, 2, 15, + {"group:fence_wood"}, mcl_sounds.node_sound_wood_defaults()) -- Redstone mesecon.register_pressure_plate( diff --git a/mods/ITEMS/mcl_deepslate/init.lua b/mods/ITEMS/mcl_deepslate/init.lua index cbeae2d53..f13c1319d 100644 --- a/mods/ITEMS/mcl_deepslate/init.lua +++ b/mods/ITEMS/mcl_deepslate/init.lua @@ -218,10 +218,7 @@ local function register_deepslate_variant(item, desc, longdesc) end if item ~= "chiseled" then mcl_stairs.register_stair_and_slab_simple("deepslate_"..item, "mcl_deepslate:deepslate_"..item, S(desc.." Stairs"), S(desc.." Slab"), S("Double "..desc.." Slab")) - mcl_walls.register_wall( - "mcl_deepslate:deepslate"..item.."wall", - S(desc.." Wall"), - "mcl_deepslate:deepslate_"..item) + mcl_walls.register_wall("mcl_deepslate:deepslate"..item.."wall", S(desc.." Wall"), "mcl_deepslate:deepslate_"..item) end end diff --git a/mods/ITEMS/mcl_fences/init.lua b/mods/ITEMS/mcl_fences/init.lua index 5555fbfc0..b14d103d2 100644 --- a/mods/ITEMS/mcl_fences/init.lua +++ b/mods/ITEMS/mcl_fences/init.lua @@ -269,16 +269,7 @@ for w=1, #woods do id = wood[1].."_fence" id_gate = wood[1].."_fence_gate" end - mcl_fences.register_fence_and_fence_gate( - id, - wood[2], - wood[3], - wood[4], - wood_groups, - minetest.registered_nodes["mcl_core:wood"]._mcl_hardness, - minetest.registered_nodes["mcl_core:wood"]._mcl_blast_resistance, - wood_connect, - wood_sounds) + mcl_fences.register_fence_and_fence_gate(id, wood[2], wood[3], wood[4], wood_groups, 2, 15, wood_connect, wood_sounds) minetest.register_craft({ output = "mcl_fences:"..id.." 3", @@ -298,15 +289,7 @@ end -- Nether Brick Fence (without fence gate!) -mcl_fences.register_fence( - "nether_brick_fence", - S("Nether Brick Fence"), - "mcl_fences_fence_nether_brick.png", - {pickaxey=1, deco_block=1, fence_nether_brick=1}, - minetest.registered_nodes["mcl_nether:nether_brick"]._mcl_hardness, - minetest.registered_nodes["mcl_nether:nether_brick"]._mcl_blast_resistance, - {"group:fence_nether_brick"}, - mcl_sounds.node_sound_stone_defaults()) +mcl_fences.register_fence("nether_brick_fence", S("Nether Brick Fence"), "mcl_fences_fence_nether_brick.png", {pickaxey=1, deco_block=1, fence_nether_brick=1}, 2, 30, {"group:fence_nether_brick"}, mcl_sounds.node_sound_stone_defaults()) minetest.register_craft({ output = "mcl_fences:nether_brick_fence 6", diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index fff07cb7e..32d17538d 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -52,7 +52,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", { tiles = {"mcl_ocean_prismarine_bricks.png"}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 6, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) @@ -64,7 +64,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", { tiles = {"mcl_ocean_prismarine_dark.png"}, groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), - _mcl_blast_resistance = 6, + _mcl_blast_resistance = 1.5, _mcl_hardness = 1.5, }) diff --git a/mods/ITEMS/mcl_walls/API.md b/mods/ITEMS/mcl_walls/API.md index 63621ade1..8adf6e8b4 100644 --- a/mods/ITEMS/mcl_walls/API.md +++ b/mods/ITEMS/mcl_walls/API.md @@ -2,7 +2,7 @@ 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, hardness, blast_resistance)` +## `mcl_walls.register_wall(nodename, description, craft_material, tiles, invtex, groups, sounds)` Adds a new wall type. This is optimized for stone-based walls, but other materials are theoretically possible, too. @@ -25,8 +25,6 @@ If `craft_material` is not `nil` it also adds a crafting recipe of the following * `inventory_image`: Inventory image (optional if `source` is set) * `groups`: Base group memberships (optional, default is `{pickaxey=1}`) * `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 to the `groups` table: diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index 09a35b549..57212e7dd 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -97,10 +97,8 @@ local full_blocks = { * inventory_image: Inventory image (optional) * groups: Base group memberships (optional, default is {pickaxey=1}) * 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, hardness, blast_resistance) +function mcl_walls.register_wall(nodename, description, source, tiles, inventory_image, groups, sounds) local base_groups = groups if not base_groups then @@ -114,29 +112,15 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory local main_node_groups = table.copy(base_groups) main_node_groups.deco_block = 1 - if source then - -- Default values from `source` node - if not hardness then - hardness = minetest.registered_nodes[source]._mcl_hardness - end - if not blast_resistance 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 - tiles = minetest.registered_nodes[source].tiles - end - end - else - -- Fallback in case no `source` given - if not hardness then - hardness = 2 - end - if not blast_resistance then - blast_resistance = 6 + -- TODO: Stop hardcoding blast resistance + + if not sounds then + sounds = mcl_sounds.node_sound_stone_defaults() + end + + if (not tiles) and source then + if minetest.registered_nodes[source] then + tiles = minetest.registered_nodes[source].tiles end end @@ -185,8 +169,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = take }, sounds = sounds, - _mcl_blast_resistance = blast_resistance, - _mcl_hardness = hardness, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) -- Add entry alias for the Help @@ -213,8 +197,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = {pillar, full_blocks[1]} }, sounds = sounds, - _mcl_blast_resistance = blast_resistance, - _mcl_hardness = hardness, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) -- Add entry alias for the Help if minetest.get_modpath("doc") then @@ -239,8 +223,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory fixed = {pillar, full_blocks[2]} }, sounds = sounds, - _mcl_blast_resistance = blast_resistance, - _mcl_hardness = hardness, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) -- Add entry alias for the Help if minetest.get_modpath("doc") then @@ -271,8 +255,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2}, on_construct = update_wall, sounds = sounds, - _mcl_blast_resistance = blast_resistance, - _mcl_hardness = hardness, + _mcl_blast_resistance = 6, + _mcl_hardness = 2, }) if source then minetest.register_craft({