From 40fb043de2c4f894cb6e3e2b80f1dd90f5aa7f14 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Mon, 7 Aug 2023 08:45:03 +0100 Subject: [PATCH] Add stage so smooth items can't be reverted --- mods/ITEMS/mcl_core/nodes_base.lua | 16 +++++++-------- mods/ITEMS/mcl_nether/init.lua | 2 +- mods/ITEMS/mcl_stairs/register.lua | 30 ++++++++++++++--------------- mods/ITEMS/mcl_stonecutter/init.lua | 10 ++++++---- mods/ITEMS/mcl_walls/register.lua | 2 +- 5 files changed, 31 insertions(+), 29 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 41fecbde3..c6613802a 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -236,7 +236,7 @@ minetest.register_node("mcl_core:stonebrick", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"default_stone_brick.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1, stonecutter_output=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1, stonecutter_output=1, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -248,7 +248,7 @@ minetest.register_node("mcl_core:stonebrickcarved", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_core_stonebrick_carved.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecutter_output=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecutter_output=1, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -309,7 +309,7 @@ minetest.register_node("mcl_core:granite_smooth", { tiles = {"mcl_core_granite_smooth.png"}, stack_max = 64, is_ground_content = false, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=4, stonecutter_output=4}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=4, stonecutter_output=4, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -321,7 +321,7 @@ minetest.register_node("mcl_core:andesite", { tiles = {"mcl_core_andesite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=5}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=5,}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -333,7 +333,7 @@ minetest.register_node("mcl_core:andesite_smooth", { tiles = {"mcl_core_andesite_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=5, stonecutter_output=5}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=5, stonecutter_output=5, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -357,7 +357,7 @@ minetest.register_node("mcl_core:diorite_smooth", { tiles = {"mcl_core_diorite_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=6, stonecutter_output=6}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=6, stonecutter_output=6, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -623,7 +623,7 @@ minetest.register_node("mcl_core:sandstonesmooth2", { tiles = {"mcl_core_sandstone_top.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9, stonecutter_output=9}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9, stonecutter_output=9, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -685,7 +685,7 @@ minetest.register_node("mcl_core:redsandstonesmooth2", { tiles = {"mcl_core_red_sandstone_top.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1, stonecutter_output=10}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=10, stonecutter_output=10, stonecutter_stage=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 396bb1926..f66877707 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -257,7 +257,7 @@ minetest.register_node("mcl_nether:quartz_smooth", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_block_bottom.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=14, stonecutter_output=14}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=31, stonecutter_output=31}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index 706f12cd2..a669f2a22 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -79,7 +79,7 @@ mcl_stairs.register_stair("diorite", "mcl_core:diorite", {"mcl_core_diorite.png"}, S("Granite Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) -mcl_stairs.register_slab("granite", "mcl_core:diorite", +mcl_stairs.register_slab("diorite", "mcl_core:diorite", {pickaxey=1, material_stone=1, stonecutter_output=6}, {"mcl_core_diorite.png"}, S("Diorite Slab"), @@ -136,12 +136,12 @@ mcl_stairs.register_slab("sandstone", "group:normal_sandstone", S("Double Sandstone Slab"), "mcl_core:sandstone") --fixme: extra parameter from previous release mcl_stairs.register_stair("sandstonesmooth2", "mcl_core:sandstonesmooth2", - {pickaxey=1, material_stone=1, stonecutter_output=9}, + {pickaxey=1, material_stone=1, stonecutter_output=9, stonecutter_stage=1}, {"mcl_core_sandstone_top.png"}, S("Smooth Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("sandstonesmooth2", "mcl_core:sandstonesmooth2", - {pickaxey=1, material_stone=1, stonecutter_output=9}, + {pickaxey=1, material_stone=1, stonecutter_output=9, stonecutter_stage=1}, {"mcl_core_sandstone_top.png"}, S("Smooth Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, @@ -161,12 +161,12 @@ mcl_stairs.register_slab("redsandstone", "group:red_sandstone", S("Double Red Sandstone Slab"), "mcl_core:redsandstone") --fixme: extra parameter from previous release mcl_stairs.register_stair("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", - {pickaxey=1, material_stone=1, stonecutter_output=10}, + {pickaxey=1, material_stone=1, stonecutter_output=10, stonecutter_stage=1}, {"mcl_core_red_sandstone_top.png"}, S("Smooth Red Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", - {pickaxey=1, material_stone=1, stonecutter_output=10}, + {pickaxey=1, material_stone=1, stonecutter_output=10, stonecutter_stage=1}, {"mcl_core_red_sandstone_top.png"}, S("Smooth Red Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, @@ -174,13 +174,13 @@ mcl_stairs.register_slab("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", -- Intentionally not group:stonebrick because of mclx_stairs mcl_stairs.register_stair("stonebrick", "mcl_core:stonebrick", - {pickaxey=1, material_stone=1, stonecutter_output=1}, + {pickaxey=1, material_stone=1, stonecutter_output=1, stonecutter_stage=1}, {"default_stone_brick.png"}, S("Stone Bricks Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil, "mcl_core:stonebrick") --fixme: extra parameter from previous release mcl_stairs.register_slab("stonebrick", "mcl_core:stonebrick", - {pickaxey=1, material_stone=1, stonecutter_output=1}, + {pickaxey=1, material_stone=1, stonecutter_output=1, stonecutter_stage=1}, {"default_stone_brick.png"}, S("Stone Bricks Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, @@ -200,12 +200,12 @@ mcl_stairs.register_slab("quartzblock", "group:quartz_block", S("Double Quartz Slab"), "mcl_nether:quartz_block") --fixme: extra parameter from previous release mcl_stairs.register_stair("quartz_smooth", "mcl_nether:quartz_smooth", - {pickaxey=1, material_stone=1, stonecutter_output=14}, + {pickaxey=1, material_stone=1, stonecutter_output=31}, {"mcl_nether_quartz_block_bottom.png"}, S("Smooth Quartz Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("quartz_smooth", "mcl_nether:quartz_smooth", - {pickaxey=1, material_stone=1, stonecutter_output=14}, + {pickaxey=1, material_stone=1, stonecutter_output=31}, {"mcl_nether_quartz_block_bottom.png"}, S("Smooth Quartz Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, @@ -295,39 +295,39 @@ mcl_stairs.register_stair_and_slab("mud_brick", "mcl_mud:mud_bricks", S("Double Mud Brick Slab"), nil) mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", - {pickaxey=1, stonecutter_output=5}, + {pickaxey=1, stonecutter_output=5, stonecutter_stage=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Slab"), nil, 6, nil, S("Double Polished Andesite Slab")) mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", - {pickaxey=1, stonecutter_output=5}, + {pickaxey=1, stonecutter_output=5, stonecutter_stage=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Stairs"), nil, 6, nil, "woodlike") mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", - {pickaxey=1, stonecutter_output=4}, + {pickaxey=1, stonecutter_output=4, stonecutter_stage=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Slab"), nil, 6, nil, S("Double Polished Granite Slab")) mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", - {pickaxey=1, stonecutter_output=4}, + {pickaxey=1, stonecutter_output=4, stonecutter_stage=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Stairs"), nil, 6, nil, "woodlike") mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", - {pickaxey=1, stonecutter_output=6}, + {pickaxey=1, stonecutter_output=6, stonecutter_stage=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Slab"), nil, 6, nil, S("Double Polished Diorite Slab")) mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", - {pickaxey=1, stonecutter_output=6}, + {pickaxey=1, stonecutter_output=6, stonecutter_stage=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Stairs"), nil, 6, nil, diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 5db74d3ac..11f4f5556 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -26,7 +26,6 @@ local function show_stonecutter_formspec(items, input) local formspec = "size[9,8.75]".. "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "label[1,0.1;"..minetest.formspec_escape(minetest.colorize("#313131", S("Stone Cutter"))).."]".. - "list[context;main;0,0;8,4;]".. "list[current_player;main;0,4.5;9,3;9]".. mcl_formspec.get_itemslot_bg(0,4.5,9,3).. "list[current_player;main;0,7.74;9,1;]".. @@ -46,12 +45,12 @@ end --Checks for the string for the different stair and wall positions that shouldn't be craftable -local function check(item_name) +local function check(item_name, input_name) + print(item_name) if string.match(item_name, "mcl_walls") then if string.match(item_name, "%d") then return true end - return false end if string.match(item_name, "_outer") then return true @@ -62,6 +61,9 @@ local function check(item_name) elseif string.match(item_name, "_double") then return true end + if minetest.get_item_group(item_name, "stonecutter_stage") == 0 and minetest.get_item_group(input_name, "stonecutter_stage") > 0 then + return true + end return false end @@ -79,7 +81,7 @@ local function update_stonecutter_slots(pos,str) local cuttable_recipes = {} for item_name, item_def in pairs(minetest.registered_items) do if item_def.groups and item_def.groups["stonecutter_output"] == compat_item then - if check(item_name) == false and name ~= item_name then + if check(item_name, name) == false and name ~= item_name then table.insert(cuttable_recipes, item_name) end end diff --git a/mods/ITEMS/mcl_walls/register.lua b/mods/ITEMS/mcl_walls/register.lua index 241c5ecc1..2307f2bfe 100644 --- a/mods/ITEMS/mcl_walls/register.lua +++ b/mods/ITEMS/mcl_walls/register.lua @@ -8,7 +8,7 @@ mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorit mcl_walls.register_wall("mcl_walls:brick", S("Brick Wall"), "mcl_core:brick_block", {"default_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=16}) mcl_walls.register_wall("mcl_walls:sandstone", S("Sandstone Wall"), "mcl_core:sandstone", {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=9}) mcl_walls.register_wall("mcl_walls:redsandstone", S("Red Sandstone Wall"), "mcl_core:redsandstone", {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_carved.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=10}) -mcl_walls.register_wall("mcl_walls:stonebrick", S("Stone Brick Wall"), "mcl_core:stonebrick", {"default_stone_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=1}) +mcl_walls.register_wall("mcl_walls:stonebrick", S("Stone Brick Wall"), "mcl_core:stonebrick", {"default_stone_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=1, stonecutter_stage=1}) mcl_walls.register_wall("mcl_walls:stonebrickmossy", S("Mossy Stone Brick Wall"), "mcl_core:stonebrickmossy", {"mcl_core_stonebrick_mossy.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=3}) mcl_walls.register_wall("mcl_walls:prismarine", S("Prismarine Wall"), "mcl_ocean:prismarine",{{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, "", {pickaxey=1, material_stone=1, stonecutter_output=11}) mcl_walls.register_wall("mcl_walls:endbricks", S("End Stone Brick Wall"), "mcl_end:end_bricks", {"mcl_end_end_bricks.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=20})