From 45532ebe6d1de88345f06895c26bbdd7ffdb91a1 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 30 Jul 2023 18:25:48 +0100 Subject: [PATCH 01/36] Add gui to list craft recipes for some stones --- mods/ITEMS/mcl_stonecutter/init.lua | 123 ++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index e75884990..a68f5cf84 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -7,6 +7,71 @@ local S = minetest.get_translator(minetest.get_current_modname()) +local recipes = { + {"mcl_core:cobble", "mcl_stairs:slab_cobble", "mcl_walls:cobble", "mcl_stairs:stair_cobble"}, + {"mcl_core:granite", "mcl_stairs:slab_granite", "mcl_walls:granite", "mcl_stairs:stair_granite", "mcl_core:granite_smooth", "mcl_stairs:stair_granite_smooth", "mcl_stairs:slab_granite_smooth"}, + {"mcl_core:diorite", "mcl_stairs:slab_diorite", "mcl_walls:diorite", "mcl_stairs:stair_diorite", "mcl_core:diorite_smooth", "mcl_stairs:stair_diorite_smooth", "mcl_stairs:slab_diorite_smooth"}, +} + + +local FMT = { + item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", + item_image = "item_image[%f,%f;%f,%f;%s]", +} + +local function show_stonecutter_formspec(items, input) + local cut_items = {} + + local x_len = 0 + local y_len = 0.5 + + if items ~= nil then + for index, value in pairs(items) do + x_len = x_len + 1 + if x_len > 5 then + y_len = y_len + 1 + x_len = 1 + end + local test = string.format(FMT.item_image_button,x_len+1,y_len,1,1, value, value, "") + cut_items[index] = test + end + end + + 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("Stonecutter"))).."]".. + "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;]".. + mcl_formspec.get_itemslot_bg(0,7.74,9,1).. + "list[context;input;0.5,1.7;1,1;]".. + mcl_formspec.get_itemslot_bg(0.5,1.7,1,1).. + "list[context;output;7.5,1.7;1,1;]".. + mcl_formspec.get_itemslot_bg(7.5,1.7,1,1).. + table.concat(cut_items).. + "listring[context;output]".. + "listring[current_player;main]".. + "listring[context;input]".. + "listring[current_player;main]" + + return formspec +end + +local function update_stonecutter_slots(meta) + local inv = meta:get_inventory() + local input = inv:get_stack("input", 1) + local name = input:get_name() + + local new_output + for index, value in pairs(recipes) do + if name == value[1] then + meta:set_string("formspec", show_stonecutter_formspec(recipes[index])) + end + end +end + + minetest.register_node("mcl_stonecutter:stonecutter", { description = S("Stone Cutter"), _tt_help = S("Used to cut stone like materials."), @@ -46,6 +111,64 @@ minetest.register_node("mcl_stonecutter:stonecutter", { _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, sounds = mcl_sounds.node_sound_stone_defaults(), + + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + else + return stack:get_count() + end + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if from_list == "output" and to_list == "input" then + local inv = meta:get_inventory() + for i=1, inv:get_size("input") do + if i ~= to_index then + local istack = inv:get_stack("input", i) + istack:set_count(math.max(0, istack:get_count() - count)) + inv:set_stack("input", i, istack) + end + end + end + update_stonecutter_slots(meta) + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + elseif listname == "output" then + return 0 + else + return stack:get_count() + end + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + update_stonecutter_slots(meta) + end, + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("input", 1) + inv:set_size("output", 1) + local form = show_stonecutter_formspec() + meta:set_string("formspec", form) + end, + + on_rightclick = function(pos, node, player, itemstack) + local name = player:get_player_name() + if not player:get_player_control().sneak then + local meta = minetest.get_meta(pos) + --show_stonecutter_formspec(name, "main", player) + update_stonecutter_slots(meta) + --meta:set_string("formspec", show_stonecutter_formspec(items[1])) + end + end, }) minetest.register_craft({ From 2af08c3188f4247ec6825461208ddf79b8c17a53 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 30 Jul 2023 21:58:42 +0100 Subject: [PATCH 02/36] clear formspec on taking input item --- mods/ITEMS/mcl_stonecutter/init.lua | 34 +++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index a68f5cf84..34ead2100 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -5,7 +5,7 @@ -- TO-DO: -- * Add GUI -local S = minetest.get_translator(minetest.get_current_modname()) +local S = minetest.get_translator("mcl_stonecutter") local recipes = { {"mcl_core:cobble", "mcl_stairs:slab_cobble", "mcl_walls:cobble", "mcl_stairs:stair_cobble"}, @@ -16,12 +16,10 @@ local recipes = { local FMT = { item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", - item_image = "item_image[%f,%f;%f,%f;%s]", } local function show_stonecutter_formspec(items, input) local cut_items = {} - local x_len = 0 local y_len = 0.5 @@ -32,7 +30,7 @@ local function show_stonecutter_formspec(items, input) y_len = y_len + 1 x_len = 1 end - local test = string.format(FMT.item_image_button,x_len+1,y_len,1,1, value, value, "") + local test = string.format(FMT.item_image_button,x_len+1,y_len,1,1, value, "item_button", value) cut_items[index] = test end end @@ -64,10 +62,14 @@ local function update_stonecutter_slots(meta) local name = input:get_name() local new_output - for index, value in pairs(recipes) do - if name == value[1] then - meta:set_string("formspec", show_stonecutter_formspec(recipes[index])) + if not input:is_empty() then + for index, value in pairs(recipes) do + if name == value[1] then + meta:set_string("formspec", show_stonecutter_formspec(recipes[index])) + end end + else + meta:set_string("formspec", show_stonecutter_formspec(nil)) end end @@ -150,7 +152,12 @@ minetest.register_node("mcl_stonecutter:stonecutter", { local meta = minetest.get_meta(pos) update_stonecutter_slots(meta) end, - + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if listname == "input" then + update_stonecutter_slots(meta) + end + end, on_construct = function(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -159,7 +166,6 @@ minetest.register_node("mcl_stonecutter:stonecutter", { local form = show_stonecutter_formspec() meta:set_string("formspec", form) end, - on_rightclick = function(pos, node, player, itemstack) local name = player:get_player_name() if not player:get_player_control().sneak then @@ -169,6 +175,16 @@ minetest.register_node("mcl_stonecutter:stonecutter", { --meta:set_string("formspec", show_stonecutter_formspec(items[1])) end end, + on_receive_fields = function(pos, formname, fields, sender) + local sender_name = sender:get_player_name() + if minetest.is_protected(pos, sender_name) then + minetest.record_protection_violation(pos, sender_name) + return + end + if fields.item_button then + print(fields.item_button) + end + end, }) minetest.register_craft({ From 752372752197c5f05130c438c89e3e8b1d8eaafa Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 30 Jul 2023 22:41:19 +0100 Subject: [PATCH 03/36] take output from stonecutter --- mods/ITEMS/mcl_stonecutter/init.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 34ead2100..88da2d2f8 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -13,7 +13,6 @@ local recipes = { {"mcl_core:diorite", "mcl_stairs:slab_diorite", "mcl_walls:diorite", "mcl_stairs:stair_diorite", "mcl_core:diorite_smooth", "mcl_stairs:stair_diorite_smooth", "mcl_stairs:slab_diorite_smooth"}, } - local FMT = { item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", } @@ -61,7 +60,7 @@ local function update_stonecutter_slots(meta) local input = inv:get_stack("input", 1) local name = input:get_name() - local new_output + local new_output = ItemStack(meta:get_string("cut_stone")) if not input:is_empty() then for index, value in pairs(recipes) do if name == value[1] then @@ -71,8 +70,12 @@ local function update_stonecutter_slots(meta) else meta:set_string("formspec", show_stonecutter_formspec(nil)) end -end + if new_output then + new_output:set_count(2) + inv:set_stack("output", 1, new_output) + end +end minetest.register_node("mcl_stonecutter:stonecutter", { description = S("Stone Cutter"), @@ -154,9 +157,14 @@ minetest.register_node("mcl_stonecutter:stonecutter", { end, on_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) - if listname == "input" then - update_stonecutter_slots(meta) + if listname == "output" then + local inv = meta:get_inventory() + local input = inv:get_stack("input", 1) + input:take_item() + inv:set_stack("input", 1, input) + meta:set_string("cut_stone", nil) end + update_stonecutter_slots(meta) end, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -170,9 +178,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { local name = player:get_player_name() if not player:get_player_control().sneak then local meta = minetest.get_meta(pos) - --show_stonecutter_formspec(name, "main", player) update_stonecutter_slots(meta) - --meta:set_string("formspec", show_stonecutter_formspec(items[1])) end end, on_receive_fields = function(pos, formname, fields, sender) @@ -182,7 +188,9 @@ minetest.register_node("mcl_stonecutter:stonecutter", { return end if fields.item_button then - print(fields.item_button) + local meta = minetest.get_meta(pos) + meta:set_string("cut_stone", fields.item_button) + update_stonecutter_slots(meta) end end, }) From 47990eec2bd3106eb5d931c7ac3747e0a1cebd01 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Mon, 31 Jul 2023 08:56:02 +0100 Subject: [PATCH 04/36] begin adding check if item canbe cut --- mods/ITEMS/mcl_stonecutter/init.lua | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 88da2d2f8..801dd32c0 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -13,6 +13,31 @@ local recipes = { {"mcl_core:diorite", "mcl_stairs:slab_diorite", "mcl_walls:diorite", "mcl_stairs:stair_diorite", "mcl_core:diorite_smooth", "mcl_stairs:stair_diorite_smooth", "mcl_stairs:slab_diorite_smooth"}, } +local compaitble_items = { + "mcl_core:cobble", + "mcl_core:mossycobble", + "mcl_core:stone", + "mcl_core:stone_smooth", + "mcl_core:granite", + "mcl_core:granite_smooth", + "mcl_core:diorite", + "mcl_core:diorite_smooth", + "mcl_core:andesite", + "mcl_core:andesite_smooth", + "mcl_core:stonebrick", + "mcl_core:stonebrickmossy", + "mcl_core:sandstone", + "mcl_core:redsandstone", + "mcl_ocean:prismarine", + "mcl_ocean:prismarine_brick", + "mcl_ocean:prismarine_dark", + "mcl_mud:mud_bricks", + "mcl_nether:quartzblock", + "mcl_nether:quartz_smooth", + "mcl_end:purpur_block", + "mcl_end:end_bricks", +} + local FMT = { item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", } @@ -55,10 +80,30 @@ local function show_stonecutter_formspec(items, input) return formspec end +local function get_item_string_name(input) + local colonIndex = string.find(input, ":") + if colonIndex then + input = string.sub(input, colonIndex + 1) + else + return input + end + local whitespaceIndex = string.find(input, "%s") + if whitespaceIndex then + return string.sub(input, 1, whitespaceIndex - 1) + else + return input + end +end + local function update_stonecutter_slots(meta) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() + local name_stripped = get_item_string_name(input:to_string()) + if name_stripped ~= "" then + local itemdef = minetest.registered_items["mcl_stairs:stair_"..name_stripped] + print(itemdef) + end local new_output = ItemStack(meta:get_string("cut_stone")) if not input:is_empty() then @@ -162,8 +207,8 @@ minetest.register_node("mcl_stonecutter:stonecutter", { local input = inv:get_stack("input", 1) input:take_item() inv:set_stack("input", 1, input) - meta:set_string("cut_stone", nil) end + meta:set_string("cut_stone", nil) update_stonecutter_slots(meta) end, on_construct = function(pos) From 9da07af3700e6a8da5fa73aac95b7bbe5375ffa2 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 1 Aug 2023 09:14:09 +0100 Subject: [PATCH 05/36] Check if item can be made into stairs, slabs and walls --- mods/ITEMS/mcl_stonecutter/init.lua | 60 +++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 801dd32c0..f46603aa0 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -7,12 +7,6 @@ local S = minetest.get_translator("mcl_stonecutter") -local recipes = { - {"mcl_core:cobble", "mcl_stairs:slab_cobble", "mcl_walls:cobble", "mcl_stairs:stair_cobble"}, - {"mcl_core:granite", "mcl_stairs:slab_granite", "mcl_walls:granite", "mcl_stairs:stair_granite", "mcl_core:granite_smooth", "mcl_stairs:stair_granite_smooth", "mcl_stairs:slab_granite_smooth"}, - {"mcl_core:diorite", "mcl_stairs:slab_diorite", "mcl_walls:diorite", "mcl_stairs:stair_diorite", "mcl_core:diorite_smooth", "mcl_stairs:stair_diorite_smooth", "mcl_stairs:slab_diorite_smooth"}, -} - local compaitble_items = { "mcl_core:cobble", "mcl_core:mossycobble", @@ -28,14 +22,19 @@ local compaitble_items = { "mcl_core:stonebrickmossy", "mcl_core:sandstone", "mcl_core:redsandstone", + "mcl_core:brick_block", "mcl_ocean:prismarine", "mcl_ocean:prismarine_brick", "mcl_ocean:prismarine_dark", "mcl_mud:mud_bricks", "mcl_nether:quartzblock", "mcl_nether:quartz_smooth", + "mcl_nether:red_nether_brick", + "mcl_nether:nether_brick", "mcl_end:purpur_block", "mcl_end:end_bricks", + "mcl_blackstone:blackstone", + "mcl_blackstone:blackstone_polished" } local FMT = { @@ -95,23 +94,54 @@ local function get_item_string_name(input) end end +local function is_input_in_table(element) + for _, value in ipairs(compaitble_items) do + if value == element then + return true + end + end + return false +end + local function update_stonecutter_slots(meta) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() local name_stripped = get_item_string_name(input:to_string()) - if name_stripped ~= "" then - local itemdef = minetest.registered_items["mcl_stairs:stair_"..name_stripped] - print(itemdef) - end - + local cuttable_recipes = {} local new_output = ItemStack(meta:get_string("cut_stone")) - if not input:is_empty() then - for index, value in pairs(recipes) do - if name == value[1] then - meta:set_string("formspec", show_stonecutter_formspec(recipes[index])) + + + print(name) + if is_input_in_table(name) then + if name_stripped ~= "" then + local stair = "mcl_stairs:stair_"..name_stripped + local slab = "mcl_stairs:slab_"..name_stripped + local wall = "mcl_walls:"..name_stripped + local smooth = "mcl_core:"..name_stripped.."_smooth" + if minetest.registered_items[slab] ~= nil then + table.insert(cuttable_recipes, slab) + end + if minetest.registered_items[stair] ~= nil then + table.insert(cuttable_recipes, stair) + end + if minetest.registered_items[wall] ~= nil then + table.insert(cuttable_recipes, wall) + end + if minetest.registered_items[smooth] ~= nil then + local smooth_stair = "mcl_stairs:stair_"..name_stripped.."_smooth" + local smooth_slab = "mcl_stairs:slab_"..name_stripped.."_smooth" + + table.insert(cuttable_recipes, smooth) + if minetest.registered_items[smooth_slab] ~= nil then + table.insert(cuttable_recipes, smooth_slab) + end + if minetest.registered_items[smooth_stair] ~= nil then + table.insert(cuttable_recipes, smooth_stair) + end end end + meta:set_string("formspec", show_stonecutter_formspec(cuttable_recipes)) else meta:set_string("formspec", show_stonecutter_formspec(nil)) end From 07d2759ae4e9331d9be404f41fbef50e131c5994 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 1 Aug 2023 18:05:01 +0100 Subject: [PATCH 06/36] Check if item is a slab or not --- mods/ITEMS/mcl_stonecutter/init.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index f46603aa0..bd74a8256 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -109,10 +109,8 @@ local function update_stonecutter_slots(meta) local name = input:get_name() local name_stripped = get_item_string_name(input:to_string()) local cuttable_recipes = {} - local new_output = ItemStack(meta:get_string("cut_stone")) + local new_output = meta:get_string("cut_stone") - - print(name) if is_input_in_table(name) then if name_stripped ~= "" then local stair = "mcl_stairs:stair_"..name_stripped @@ -145,10 +143,14 @@ local function update_stonecutter_slots(meta) else meta:set_string("formspec", show_stonecutter_formspec(nil)) end - - if new_output then - new_output:set_count(2) - inv:set_stack("output", 1, new_output) + if new_output = '' then + cut_item = ItemStack(new_output) + if string.find(new_output, "mcl_stairs:slab_") then + cut_item:set_count(2) + else + cut_item:set_count(1) + end + inv:set_stack("output", 1, cut_item) end end From 356045b3e325fbb881c93b33c2f54708dee82b07 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 1 Aug 2023 18:17:48 +0100 Subject: [PATCH 07/36] Add comments and drop items when destroyed --- mods/ITEMS/mcl_stonecutter/init.lua | 56 +++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index bd74a8256..59334914f 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -7,6 +7,7 @@ local S = minetest.get_translator("mcl_stonecutter") +-- compatible items for the stonecutter local compaitble_items = { "mcl_core:cobble", "mcl_core:mossycobble", @@ -41,11 +42,13 @@ local FMT = { item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", } +-- formspecs local function show_stonecutter_formspec(items, input) local cut_items = {} local x_len = 0 local y_len = 0.5 + -- This loops through all the items that can be made and inserted into the formspec if items ~= nil then for index, value in pairs(items) do x_len = x_len + 1 @@ -79,6 +82,7 @@ local function show_stonecutter_formspec(items, input) return formspec end +-- Strips the start of the item like "mcl_core:" and removes any numbers or whitespaces after it local function get_item_string_name(input) local colonIndex = string.find(input, ":") if colonIndex then @@ -94,6 +98,7 @@ local function get_item_string_name(input) end end +-- Simply checks if the item is compaitble with the stonecutter local function is_input_in_table(element) for _, value in ipairs(compaitble_items) do if value == element then @@ -103,20 +108,25 @@ local function is_input_in_table(element) return false end +-- Updates the formspec local function update_stonecutter_slots(meta) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() - local name_stripped = get_item_string_name(input:to_string()) - local cuttable_recipes = {} local new_output = meta:get_string("cut_stone") + -- Checks if input is in the array if is_input_in_table(name) then + local cuttable_recipes = {} + local name_stripped = get_item_string_name(input:to_string()) if name_stripped ~= "" then + -- Strings for the possible items it can craft into local stair = "mcl_stairs:stair_"..name_stripped local slab = "mcl_stairs:slab_"..name_stripped local wall = "mcl_walls:"..name_stripped local smooth = "mcl_core:"..name_stripped.."_smooth" + + -- Goes through and checks if the item exists and inserts it into the table if minetest.registered_items[slab] ~= nil then table.insert(cuttable_recipes, slab) end @@ -143,7 +153,9 @@ local function update_stonecutter_slots(meta) else meta:set_string("formspec", show_stonecutter_formspec(nil)) end - if new_output = '' then + + -- Checks if the chosen item is a slab or not, if it's a slab set the output to be a stack of 2 + if new_output ~= '' then cut_item = ItemStack(new_output) if string.find(new_output, "mcl_stairs:slab_") then cut_item:set_count(2) @@ -154,6 +166,18 @@ local function update_stonecutter_slots(meta) end end +-- Only drop the items that were in the input slot +local function drop_stonecutter_items(pos, meta) + local inv = meta:get_inventory() + for i=1, inv:get_size("input") do + local stack = inv:get_stack("input", i) + if not stack:is_empty() then + local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} + minetest.add_item(p, stack) + end + end +end + minetest.register_node("mcl_stonecutter:stonecutter", { description = S("Stone Cutter"), _tt_help = S("Used to cut stone like materials."), @@ -194,6 +218,13 @@ minetest.register_node("mcl_stonecutter:stonecutter", { _mcl_hardness = 3.5, sounds = mcl_sounds.node_sound_stone_defaults(), + after_dig_node = function(pos, oldnode, oldmetadata, digger) + local meta = minetest.get_meta(pos) + local meta2 = meta:to_table() + meta:from_table(oldmetadata) + drop_stonecutter_items(pos, meta) + meta:from_table(meta2) + end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) local name = player:get_player_name() if minetest.is_protected(pos, name) then @@ -203,6 +234,25 @@ minetest.register_node("mcl_stonecutter:stonecutter", { return stack:get_count() end end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + elseif to_list == "output" then + return 0 + elseif from_list == "output" and to_list == "input" then + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if inv:get_stack(to_list, to_index):is_empty() then + return count + else + return 0 + end + else + return count + end + end, on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) local meta = minetest.get_meta(pos) if from_list == "output" and to_list == "input" then From 7fcc2e3be3bdc8c40a6203ec2112b8e3f6d858a7 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 1 Aug 2023 22:39:24 +0100 Subject: [PATCH 08/36] Minor output fixes --- mods/ITEMS/mcl_stonecutter/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 59334914f..2977538e0 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -2,8 +2,6 @@ --||||| STONECUTTER ||||| --||||||||||||||||||||||| --- TO-DO: --- * Add GUI local S = minetest.get_translator("mcl_stonecutter") @@ -163,6 +161,8 @@ local function update_stonecutter_slots(meta) cut_item:set_count(1) end inv:set_stack("output", 1, cut_item) + else + inv:set_stack("output", 1, "") end end From 0e60231c2e7fb9f8d9a7ae22dfd1590d3a6d4123 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 1 Aug 2023 22:48:45 +0100 Subject: [PATCH 09/36] Only reset output if input is empty --- mods/ITEMS/mcl_stonecutter/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 2977538e0..44a25d2dc 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -289,8 +289,12 @@ minetest.register_node("mcl_stonecutter:stonecutter", { local input = inv:get_stack("input", 1) input:take_item() inv:set_stack("input", 1, input) + if input:get_count() == 0 then + meta:set_string("cut_stone", nil) + end + else + meta:set_string("cut_stone", nil) end - meta:set_string("cut_stone", nil) update_stonecutter_slots(meta) end, on_construct = function(pos) From 5f0ad98daefe5f8606d79e595ac6982d44d52eb8 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 12:45:32 +0100 Subject: [PATCH 10/36] Use node group for items that can be used in the stonecutter --- mods/ITEMS/mcl_blackstone/init.lua | 4 +-- mods/ITEMS/mcl_copper/nodes.lua | 32 +++++++++++----------- mods/ITEMS/mcl_core/nodes_base.lua | 38 +++++++++++++------------- mods/ITEMS/mcl_end/building.lua | 6 ++--- mods/ITEMS/mcl_mud/init.lua | 2 +- mods/ITEMS/mcl_nether/init.lua | 8 +++--- mods/ITEMS/mcl_ocean/prismarine.lua | 6 ++--- mods/ITEMS/mcl_stonecutter/init.lua | 42 ++--------------------------- 8 files changed, 50 insertions(+), 88 deletions(-) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index 138e02191..e1bf751cd 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -12,7 +12,7 @@ minetest.register_node("mcl_blackstone:blackstone", { tiles = {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1, stonecuttable=1, stonecuttable=1}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -103,7 +103,7 @@ minetest.register_node("mcl_blackstone:blackstone_polished", { tiles = {"mcl_blackstone_polished.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=1}, _mcl_blast_resistance = 6, _mcl_hardness = 2, }) diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index af5a49a1c..b7b78a542 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -30,7 +30,7 @@ minetest.register_node("mcl_copper:block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -43,7 +43,7 @@ minetest.register_node("mcl_copper:waxed_block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -55,7 +55,7 @@ minetest.register_node("mcl_copper:block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -69,7 +69,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -81,7 +81,7 @@ minetest.register_node("mcl_copper:block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -95,7 +95,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -107,7 +107,7 @@ minetest.register_node("mcl_copper:block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1}, + groups = {pickaxey = 2, building_block = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -120,7 +120,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -132,7 +132,7 @@ minetest.register_node("mcl_copper:block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -145,7 +145,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -157,7 +157,7 @@ minetest.register_node("mcl_copper:block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -171,7 +171,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -183,7 +183,7 @@ minetest.register_node("mcl_copper:block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -197,7 +197,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -209,7 +209,7 @@ minetest.register_node("mcl_copper:block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1}, + groups = {pickaxey = 2, building_block = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -222,7 +222,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index f36d5cabd..3f269def4 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -27,7 +27,7 @@ minetest.register_node("mcl_core:stone", { tiles = {"default_stone.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, drop = "mcl_core:cobble", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, @@ -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}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -272,7 +272,7 @@ minetest.register_node("mcl_core:stonebrickmossy", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_core_stonebrick_mossy.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -284,7 +284,7 @@ minetest.register_node("mcl_core:stone_smooth", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_stairs_stone_slab_top.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -297,7 +297,7 @@ minetest.register_node("mcl_core:granite", { tiles = {"mcl_core_granite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -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}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=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}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, 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}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -345,7 +345,7 @@ minetest.register_node("mcl_core:diorite", { tiles = {"mcl_core_diorite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=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}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -586,7 +586,7 @@ minetest.register_node("mcl_core:sandstone", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -598,7 +598,7 @@ minetest.register_node("mcl_core:sandstonesmooth", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -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}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -649,7 +649,7 @@ minetest.register_node("mcl_core:redsandstone", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -661,7 +661,7 @@ minetest.register_node("mcl_core:redsandstonesmooth", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -715,7 +715,7 @@ minetest.register_node("mcl_core:brick_block", { tiles = {"default_brick.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -768,7 +768,7 @@ minetest.register_node("mcl_core:cobble", { tiles = {"default_cobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -780,7 +780,7 @@ minetest.register_node("mcl_core:mossycobble", { tiles = {"default_mossycobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 82f6e76e4..f96c10633 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -13,7 +13,7 @@ minetest.register_node("mcl_end:end_stone", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_end_end_stone.png"}, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = mcl_end.check_detach_chorus_plant, _mcl_blast_resistance = 9, @@ -26,7 +26,7 @@ minetest.register_node("mcl_end:end_bricks", { tiles = {"mcl_end_end_bricks.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 9, _mcl_hardness = 3, @@ -38,7 +38,7 @@ minetest.register_node("mcl_end:purpur_block", { tiles = {"mcl_end_purpur_block.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_mud/init.lua b/mods/ITEMS/mcl_mud/init.lua index 64ff36c09..b7542e0d5 100644 --- a/mods/ITEMS/mcl_mud/init.lua +++ b/mods/ITEMS/mcl_mud/init.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_mud:mud_bricks", { _doc_items_longdesc = S("Decorative block crafted from packed mud."), _doc_items_hidden = false, tiles = {"mcl_mud_bricks.png"}, - groups = {handy=1, pickaxey=1, building_block=1}, + groups = {handy=1, pickaxey=1, building_block=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 548bd90d5..81b6d352c 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -176,7 +176,7 @@ minetest.register_node("mcl_nether:nether_brick", { stack_max = 64, tiles = {"mcl_nether_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -189,7 +189,7 @@ minetest.register_node("mcl_nether:red_nether_brick", { stack_max = 64, tiles = {"mcl_nether_red_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -219,7 +219,7 @@ minetest.register_node("mcl_nether:quartz_block", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index fff07cb7e..e3b899a49 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_ocean:prismarine", { is_ground_content = false, -- Texture should have 22 frames for smooth transitions. tiles = {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -50,7 +50,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_bricks.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -62,7 +62,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_dark.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 44a25d2dc..a8d3f4d14 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -7,33 +7,6 @@ local S = minetest.get_translator("mcl_stonecutter") -- compatible items for the stonecutter local compaitble_items = { - "mcl_core:cobble", - "mcl_core:mossycobble", - "mcl_core:stone", - "mcl_core:stone_smooth", - "mcl_core:granite", - "mcl_core:granite_smooth", - "mcl_core:diorite", - "mcl_core:diorite_smooth", - "mcl_core:andesite", - "mcl_core:andesite_smooth", - "mcl_core:stonebrick", - "mcl_core:stonebrickmossy", - "mcl_core:sandstone", - "mcl_core:redsandstone", - "mcl_core:brick_block", - "mcl_ocean:prismarine", - "mcl_ocean:prismarine_brick", - "mcl_ocean:prismarine_dark", - "mcl_mud:mud_bricks", - "mcl_nether:quartzblock", - "mcl_nether:quartz_smooth", - "mcl_nether:red_nether_brick", - "mcl_nether:nether_brick", - "mcl_end:purpur_block", - "mcl_end:end_bricks", - "mcl_blackstone:blackstone", - "mcl_blackstone:blackstone_polished" } local FMT = { @@ -96,16 +69,6 @@ local function get_item_string_name(input) end end --- Simply checks if the item is compaitble with the stonecutter -local function is_input_in_table(element) - for _, value in ipairs(compaitble_items) do - if value == element then - return true - end - end - return false -end - -- Updates the formspec local function update_stonecutter_slots(meta) local inv = meta:get_inventory() @@ -114,7 +77,7 @@ local function update_stonecutter_slots(meta) local new_output = meta:get_string("cut_stone") -- Checks if input is in the array - if is_input_in_table(name) then + if minetest.get_item_group(name, "stonecuttable") > 0 then local cuttable_recipes = {} local name_stripped = get_item_string_name(input:to_string()) if name_stripped ~= "" then @@ -154,7 +117,7 @@ local function update_stonecutter_slots(meta) -- Checks if the chosen item is a slab or not, if it's a slab set the output to be a stack of 2 if new_output ~= '' then - cut_item = ItemStack(new_output) + local cut_item = ItemStack(new_output) if string.find(new_output, "mcl_stairs:slab_") then cut_item:set_count(2) else @@ -306,7 +269,6 @@ minetest.register_node("mcl_stonecutter:stonecutter", { meta:set_string("formspec", form) end, on_rightclick = function(pos, node, player, itemstack) - local name = player:get_player_name() if not player:get_player_control().sneak then local meta = minetest.get_meta(pos) update_stonecutter_slots(meta) From ca37ce5744ba8bd4b35d610e57e3b87d0cd55c30 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 12:49:27 +0100 Subject: [PATCH 11/36] Remove hardcoded one element array --- mods/ITEMS/mcl_stonecutter/init.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index a8d3f4d14..b532c68c5 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -5,14 +5,6 @@ local S = minetest.get_translator("mcl_stonecutter") --- compatible items for the stonecutter -local compaitble_items = { -} - -local FMT = { - item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]", -} - -- formspecs local function show_stonecutter_formspec(items, input) local cut_items = {} @@ -27,7 +19,7 @@ local function show_stonecutter_formspec(items, input) y_len = y_len + 1 x_len = 1 end - local test = string.format(FMT.item_image_button,x_len+1,y_len,1,1, value, "item_button", value) + local test = string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, value, "item_button", value) cut_items[index] = test end end From 01d43bb33aa2c483887aafadbd58741fb7f6baa7 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 13:07:32 +0100 Subject: [PATCH 12/36] Remove unused meta on drop items --- mods/ITEMS/mcl_stonecutter/init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index b532c68c5..77ca5c066 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -26,7 +26,7 @@ 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("Stonecutter"))).."]".. + "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).. @@ -175,10 +175,8 @@ minetest.register_node("mcl_stonecutter:stonecutter", { after_dig_node = function(pos, oldnode, oldmetadata, digger) local meta = minetest.get_meta(pos) - local meta2 = meta:to_table() meta:from_table(oldmetadata) drop_stonecutter_items(pos, meta) - meta:from_table(meta2) end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) local name = player:get_player_name() From a9f26fb3547cbe79811ef6c7736b84c2ffc36aa4 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 20:14:58 +0100 Subject: [PATCH 13/36] use item groups to determine the cuttable items --- mods/ITEMS/mcl_blackstone/init.lua | 58 ++++++-- mods/ITEMS/mcl_copper/nodes.lua | 64 ++++---- mods/ITEMS/mcl_core/nodes_base.lua | 40 ++--- mods/ITEMS/mcl_end/building.lua | 8 +- mods/ITEMS/mcl_mud/init.lua | 2 +- mods/ITEMS/mcl_nether/init.lua | 12 +- mods/ITEMS/mcl_ocean/prismarine.lua | 6 +- mods/ITEMS/mcl_stairs/register.lua | 223 +++++++++++++++++++++++----- mods/ITEMS/mcl_stonecutter/init.lua | 67 +++------ mods/ITEMS/mcl_walls/register.lua | 30 ++-- 10 files changed, 338 insertions(+), 172 deletions(-) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index e1bf751cd..c46fba97b 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -12,7 +12,7 @@ minetest.register_node("mcl_blackstone:blackstone", { tiles = {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1, stonecuttable=1, stonecuttable=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1, stonecuttable=21}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -73,7 +73,7 @@ minetest.register_node("mcl_blackstone:basalt_polished", { on_place = mcl_util.rotate_axis, on_rotate = on_rotate, is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=19}, _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -85,7 +85,7 @@ minetest.register_node("mcl_blackstone:basalt", { on_place = mcl_util.rotate_axis, on_rotate = on_rotate, is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=19}, _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -103,7 +103,7 @@ minetest.register_node("mcl_blackstone:blackstone_polished", { tiles = {"mcl_blackstone_polished.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=21, stonecutter_output=21}, _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -112,7 +112,7 @@ minetest.register_node("mcl_blackstone:blackstone_chiseled_polished", { tiles = {"mcl_blackstone_chiseled_polished.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=21}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -121,7 +121,7 @@ minetest.register_node("mcl_blackstone:blackstone_brick_polished", { tiles = {"mcl_blackstone_polished_bricks.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=21}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -131,7 +131,7 @@ minetest.register_node("mcl_blackstone:quartz_brick", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), - groups = {cracky = 3, pickaxey=1, material_stone=1}, + groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=14}, _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -193,16 +193,50 @@ minetest.registered_nodes["mcl_fire:fire"].on_construct=function(pos) end --slabs/stairs -mcl_stairs.register_stair_and_slab_simple("blackstone", "mcl_blackstone:blackstone", S("Blackstone Stair"), S("Blackstone Slab"), S("Double Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_polished", "mcl_blackstone:blackstone_polished", S("Polished Blackstone Stair"), S("Polished Blackstone Slab"), S("Polished Double Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", S("Chiseled Polished Blackstone Stair"), S("Chiseled Polished Blackstone Slab"), S("Double Chiseled Polished Blackstone Slab")) -mcl_stairs.register_stair_and_slab_simple("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", S("Polished Blackstone Brick Stair"), S("Polished Blackstone Brick Slab"), S("Double Polished Blackstone Brick Slab")) +mcl_stairs.register_stair_and_slab("blackstone", "mcl_blackstone:blackstone", + {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, + S("Blackstone Stairs"), + S("Blackstone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Blackstone Slab"), nil) + +mcl_stairs.register_stair_and_slab("blackstone_polished", "mcl_blackstone:blackstone_polished", + {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {"mcl_blackstone_polished.png"}, + S("Polished Blackstone Stairs"), + S("Polished Blackstone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Polished Blackstone Slab"), nil) + +mcl_stairs.register_stair_and_slab("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", + {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {"mcl_blackstone_chiseled_polished.png"}, + S("Chiseled Polished Blackstone Stairs"), + S("Chiseled Polished Blackstone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Chiseled Polished Blackstone Slab"), nil) + +mcl_stairs.register_stair_and_slab("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", + {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {"mcl_blackstone_polished_bricks.png"}, + S("Polished Blackstone Brick Stair Stairs"), + S("Polished Blackstone Brick Stair Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Polished Blackstone Brick Stair Slab"), nil) --Wall mcl_walls.register_wall( "mcl_blackstone:wall", S("Blackstone Wall"), - "mcl_blackstone:blackstone" + "mcl_blackstone:blackstone", + { + "mcl_blackstone_top.png", + "mcl_blackstone_top.png", + "mcl_blackstone_side.png" + }, + "", + { cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21 } ) --lavacooling diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index b7b78a542..f131d9967 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -30,7 +30,7 @@ minetest.register_node("mcl_copper:block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=22}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -43,7 +43,7 @@ minetest.register_node("mcl_copper:waxed_block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=23}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -55,7 +55,7 @@ minetest.register_node("mcl_copper:block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=24}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -69,7 +69,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=25}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -81,7 +81,7 @@ minetest.register_node("mcl_copper:block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=26}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -95,7 +95,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=27}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -107,7 +107,7 @@ minetest.register_node("mcl_copper:block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, stonecuttable=28}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -120,7 +120,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=29}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -132,7 +132,7 @@ minetest.register_node("mcl_copper:block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=22, stonecutter_output=22}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -145,7 +145,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=23, stonecutter_output=23}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -157,7 +157,7 @@ minetest.register_node("mcl_copper:block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=24, stonecutter_output=24}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -171,7 +171,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=25, stonecutter_output=25}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -183,7 +183,7 @@ minetest.register_node("mcl_copper:block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=26, stonecutter_output=26}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -197,7 +197,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=27, stonecutter_output=27}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -209,7 +209,7 @@ minetest.register_node("mcl_copper:block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, stonecuttable=28, stonecutter_output=28}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -222,7 +222,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=1}, + groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=29, stonecutter_output=29}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -230,112 +230,112 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { }) mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 22}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Slab of Cut Copper"), nil, nil, nil, S("Double Slab of Cut Copper")) mcl_stairs.register_slab("waxed_copper_cut", "mcl_copper:waxed_block_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 23}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Waxed Slab of Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Cut Copper")) mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 24}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Slab of Exposed Cut Copper"), nil, nil, nil, S("Double Slab of Exposed Cut Copper")) mcl_stairs.register_slab("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 25}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Waxed Slab of Exposed Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Exposed Cut Copper")) mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 26}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Slab of Weathered Cut Copper"), nil, nil, nil, S("Double Slab of Weathered Cut Copper")) mcl_stairs.register_slab("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 27}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Waxed Slab of Weathered Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Weathered Cut Copper")) mcl_stairs.register_slab("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", - {pickaxey = 2}, + {pickaxey = 2, stonecutter_output = 28}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Slab of Oxidized Cut Copper"), nil, nil, nil, S("Double Slab of Oxidized Cut Copper")) mcl_stairs.register_slab("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 29}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Waxed Slab of Oxidized Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Oxidized Cut Copper")) mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 22}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Stairs of Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 23}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Waxed Stairs of Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 24}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Stairs of Exposed Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 25}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Waxed Stairs of Exposed Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cut", - {pickaxey = 2, oxidizable = 1}, + {pickaxey = 2, oxidizable = 1, stonecutter_output = 26}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Stairs of Weathered Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 27}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Waxed Stairs of Weathered Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", - {pickaxey = 2}, + {pickaxey = 2, stonecutter_output = 28}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Stairs of Oxidized Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut", - {pickaxey = 2, waxed = 1}, + {pickaxey = 2, waxed = 1, stonecutter_output = 29}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Waxed Stairs of Oxidized Cut Copper"), nil, 6, nil, diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 3f269def4..41fecbde3 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}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1, stonecutter_output=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}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecutter_output=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -272,7 +272,7 @@ minetest.register_node("mcl_core:stonebrickmossy", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_core_stonebrick_mossy.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=3}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -297,7 +297,7 @@ minetest.register_node("mcl_core:granite", { tiles = {"mcl_core_granite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=4}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -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=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=4, stonecutter_output=4}, 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=1}, + 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=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=5, stonecutter_output=5}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -345,7 +345,7 @@ minetest.register_node("mcl_core:diorite", { tiles = {"mcl_core_diorite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=6}, 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=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=6, stonecutter_output=6}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -586,7 +586,7 @@ minetest.register_node("mcl_core:sandstone", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -598,7 +598,7 @@ minetest.register_node("mcl_core:sandstonesmooth", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9, stonecutter_output=9}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -610,7 +610,7 @@ minetest.register_node("mcl_core:sandstonecarved", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_carved.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecutter_output=9}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9, stonecutter_output=9}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -649,7 +649,7 @@ minetest.register_node("mcl_core:redsandstone", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=10}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -661,7 +661,7 @@ minetest.register_node("mcl_core:redsandstonesmooth", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=10, stonecutter_output=10}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -673,7 +673,7 @@ minetest.register_node("mcl_core:redsandstonecarved", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_carved.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecutter_output=10}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=1, stonecutter_output=10}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -715,7 +715,7 @@ minetest.register_node("mcl_core:brick_block", { tiles = {"default_brick.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=16}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -768,7 +768,7 @@ minetest.register_node("mcl_core:cobble", { tiles = {"default_cobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1, stonecuttable=7}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -780,7 +780,7 @@ minetest.register_node("mcl_core:mossycobble", { tiles = {"default_mossycobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=8}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index f96c10633..b3a6adf30 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -13,7 +13,7 @@ minetest.register_node("mcl_end:end_stone", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_end_end_stone.png"}, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=20}, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = mcl_end.check_detach_chorus_plant, _mcl_blast_resistance = 9, @@ -26,7 +26,7 @@ minetest.register_node("mcl_end:end_bricks", { tiles = {"mcl_end_end_bricks.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=20, stonecutter_output=20}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 9, _mcl_hardness = 3, @@ -38,7 +38,7 @@ minetest.register_node("mcl_end:purpur_block", { tiles = {"mcl_end_purpur_block.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecuttable=15}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -52,7 +52,7 @@ minetest.register_node("mcl_end:purpur_pillar", { is_ground_content = false, on_place = mcl_util.rotate_axis, tiles = {"mcl_end_purpur_pillar_top.png", "mcl_end_purpur_pillar_top.png", "mcl_end_purpur_pillar.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecutter_output=15}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 6, diff --git a/mods/ITEMS/mcl_mud/init.lua b/mods/ITEMS/mcl_mud/init.lua index b7542e0d5..5a99ff754 100644 --- a/mods/ITEMS/mcl_mud/init.lua +++ b/mods/ITEMS/mcl_mud/init.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_mud:mud_bricks", { _doc_items_longdesc = S("Decorative block crafted from packed mud."), _doc_items_hidden = false, tiles = {"mcl_mud_bricks.png"}, - groups = {handy=1, pickaxey=1, building_block=1, stonecuttable=1}, + groups = {handy=1, pickaxey=1, building_block=1, stonecuttable=30}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 81b6d352c..396bb1926 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -176,7 +176,7 @@ minetest.register_node("mcl_nether:nether_brick", { stack_max = 64, tiles = {"mcl_nether_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=17}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -189,7 +189,7 @@ minetest.register_node("mcl_nether:red_nether_brick", { stack_max = 64, tiles = {"mcl_nether_red_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=18}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -219,7 +219,7 @@ minetest.register_node("mcl_nether:quartz_block", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=14}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -231,7 +231,7 @@ minetest.register_node("mcl_nether:quartz_chiseled", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecutter_output=14}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -245,7 +245,7 @@ minetest.register_node("mcl_nether:quartz_pillar", { is_ground_content = false, on_place = mcl_util.rotate_axis, tiles = {"mcl_nether_quartz_pillar_top.png", "mcl_nether_quartz_pillar_top.png", "mcl_nether_quartz_pillar_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecutter_output=14}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 0.8, @@ -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=1}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=14, stonecutter_output=14}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index e3b899a49..e1a0a3a98 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_ocean:prismarine", { is_ground_content = false, -- Texture should have 22 frames for smooth transitions. tiles = {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=11}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -50,7 +50,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_bricks.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=12}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -62,7 +62,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_dark.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=13}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index eee4c5dc2..706f12cd2 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -30,167 +30,318 @@ for w=1, #woods do wood[5]) end -mcl_stairs.register_stair_and_slab_simple("stone_rough", "mcl_core:stone", S("Stone Stairs"), S("Stone Slab"), S("Double Stone Slab")) + +mcl_stairs.register_slab("stone_rough", "mcl_core:stone", + {pickaxey=1, material_stone=1, stonecutter_output=1}, + {"default_stone.png"}, + S("Stone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Stone Slab")) +mcl_stairs.register_stair("stone_rough", "group:stone", + {pickaxey=1, material_stone=1,stonecutter_output=1}, + {"default_stone.png"}, + S("Stone Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("stone", "mcl_core:stone_smooth", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=2}, {"mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_side.png"}, S("Polished Stone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Polished Stone Slab")) -mcl_stairs.register_stair_and_slab_simple("andesite", "mcl_core:andesite", S("Andesite Stairs"), S("Andesite Slab"), S("Double Andesite Slab")) -mcl_stairs.register_stair_and_slab_simple("granite", "mcl_core:granite", S("Granite Stairs"), S("Granite Slab"), S("Double Granite Slab")) -mcl_stairs.register_stair_and_slab_simple("diorite", "mcl_core:diorite", S("Diorite Stairs"), S("Diorite Slab"), S("Double Diorite Slab")) +mcl_stairs.register_stair("andesite", "mcl_core:andesite", + {pickaxey=1, material_stone=1,stonecutter_output=5}, + {"mcl_core_andesite.png"}, + S("Andesite Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) +mcl_stairs.register_slab("andesite", "mcl_core:andesite", + {pickaxey=1, material_stone=1, stonecutter_output=5}, + {"mcl_core_andesite.png"}, + S("Andesite Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Andesite Slab")) -mcl_stairs.register_stair_and_slab_simple("cobble", "mcl_core:cobble", S("Cobblestone Stairs"), S("Cobblestone Slab"), S("Double Cobblestone Slab")) -mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", S("Mossy Cobblestone Stairs"), S("Mossy Cobblestone Slab"), S("Double Mossy Cobblestone Slab")) +mcl_stairs.register_stair("granite", "mcl_core:granite", + {pickaxey=1, material_stone=1,stonecutter_output=4}, + {"mcl_core_granite.png"}, + S("Granite Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) +mcl_stairs.register_slab("granite", "mcl_core:granite", + {pickaxey=1, material_stone=1, stonecutter_output=4}, + {"mcl_core_granite.png"}, + S("Granite Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Granite Slab")) -mcl_stairs.register_stair_and_slab_simple("brick_block", "mcl_core:brick_block", S("Brick Stairs"), S("Brick Slab"), S("Double Brick Slab")) +mcl_stairs.register_stair("diorite", "mcl_core:diorite", + {pickaxey=1, material_stone=1,stonecutter_output=6}, + {"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", + {pickaxey=1, material_stone=1, stonecutter_output=6}, + {"mcl_core_diorite.png"}, + S("Diorite Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Diorite Slab")) +mcl_stairs.register_stair("cobble", "mcl_core:cobble", + {pickaxey=1, material_stone=1,stonecutter_output=7}, + {"default_cobble.png"}, + S("Cobblestone Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) +mcl_stairs.register_slab("cobble", "mcl_core:cobble", + {pickaxey=1, material_stone=1, stonecutter_output=7}, + {"default_cobble.png"}, + S("Cobblestone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Cobblestone Slab")) + +mcl_stairs.register_stair("mossycobble", "mcl_core:mossycobble", + {pickaxey=1, material_stone=1,stonecutter_output=8}, + {"default_mossycobble.png"}, + S("Mossy Cobblestone Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) +mcl_stairs.register_slab("mossycobble", "mcl_core:mossycobble", + {pickaxey=1, material_stone=1, stonecutter_output=8}, + {"default_mossycobble.png"}, + S("Mossy Cobblestone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Mossy Cobblestone Slab")) + +mcl_stairs.register_stair("brick_block", "mcl_core:brick_block", + {pickaxey=1, material_stone=1,stonecutter_output=16}, + {"default_brick.png"}, + S("Brick Stairs"), + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) +mcl_stairs.register_slab("brick_block", "mcl_core:brick_block", + {pickaxey=1, material_stone=1, stonecutter_output=16}, + {"default_brick.png"}, + S("Brick Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Brick Slab")) mcl_stairs.register_stair("sandstone", "group:normal_sandstone", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=9}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:sandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("sandstone", "group:normal_sandstone", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=9}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Sandstone Slab"), "mcl_core:sandstone") --fixme: extra parameter from previous release -mcl_stairs.register_stair_and_slab_simple("sandstonesmooth2", "mcl_core:sandstonesmooth2", S("Smooth Sandstone Stairs"), S("Smooth Sandstone Slab"), S("Double Smooth Sandstone Slab")) + +mcl_stairs.register_stair("sandstonesmooth2", "mcl_core:sandstonesmooth2", + {pickaxey=1, material_stone=1, stonecutter_output=9}, + {"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}, + {"mcl_core_sandstone_top.png"}, + S("Smooth Sandstone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Smooth Sandstone Slab")) mcl_stairs.register_stair("redsandstone", "group:red_sandstone", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=10}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:redsandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("redsandstone", "group:red_sandstone", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=10}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Red Sandstone Slab"), "mcl_core:redsandstone") --fixme: extra parameter from previous release -mcl_stairs.register_stair_and_slab_simple("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", S("Smooth Red Sandstone Stairs"), S("Smooth Red Sandstone Slab"), S("Double Smooth Red Sandstone Slab")) + +mcl_stairs.register_stair("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", + {pickaxey=1, material_stone=1, stonecutter_output=10}, + {"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}, + {"mcl_core_red_sandstone_top.png"}, + S("Smooth Red Sandstone Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Smooth Red Sandstone Slab")) -- Intentionally not group:stonebrick because of mclx_stairs mcl_stairs.register_stair("stonebrick", "mcl_core:stonebrick", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=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}, + {pickaxey=1, material_stone=1, stonecutter_output=1}, {"default_stone_brick.png"}, S("Stone Bricks Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Stone Bricks Slab"), "mcl_core:stonebrick") --fixme: extra parameter from previous release mcl_stairs.register_stair("quartzblock", "group:quartz_block", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=14}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_nether:quartz_block") --fixme: extra parameter from previous release mcl_stairs.register_slab("quartzblock", "group:quartz_block", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=14}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Quartz Slab"), "mcl_nether:quartz_block") --fixme: extra parameter from previous release -mcl_stairs.register_stair_and_slab_simple("quartz_smooth", "mcl_nether:quartz_smooth", S("Smooth Quartz Stairs"), S("Smooth Quartz Slab"), S("Double Smooth Quartz Slab")) +mcl_stairs.register_stair("quartz_smooth", "mcl_nether:quartz_smooth", + {pickaxey=1, material_stone=1, stonecutter_output=14}, + {"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}, + {"mcl_nether_quartz_block_bottom.png"}, + S("Smooth Quartz Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Smooth Quartz Slab")) mcl_stairs.register_stair_and_slab("nether_brick", "mcl_nether:nether_brick", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=17}, {"mcl_nether_nether_brick.png"}, S("Nether Brick Stairs"), S("Nether Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Nether Brick Slab"), nil) mcl_stairs.register_stair_and_slab("red_nether_brick", "mcl_nether:red_nether_brick", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=18}, {"mcl_nether_red_nether_brick.png"}, S("Red Nether Brick Stairs"), S("Red Nether Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Red Nether Brick Slab"), nil) -mcl_stairs.register_stair_and_slab_simple("end_bricks", "mcl_end:end_bricks", S("End Stone Brick Stairs"), S("End Stone Brick Slab"), S("Double End Stone Brick Slab")) +mcl_stairs.register_stair_and_slab("end_bricks", "mcl_end:end_bricks", + {pickaxey=1, material_stone=1, stonecutter_output=20}, + {"mcl_end_end_bricks.png"}, + S("End Stone Brick Stairs"), + S("End Stone Brick Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double End Stone Brick Slab"), nil) mcl_stairs.register_stair("purpur_block", "group:purpur_block", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=15}, {"mcl_end_purpur_block.png"}, S("Purpur Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("purpur_block", "group:purpur_block", - {pickaxey=1, material_stone=1}, + {pickaxey=1, material_stone=1, stonecutter_output=15}, {"mcl_end_purpur_block.png"}, S("Purpur Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Purpur Slab")) -mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", S("Prismarine Stairs"), S("Prismarine Slab"), S("Double Prismarine Slab")) +mcl_stairs.register_stair("prismarine", "mcl_ocean:prismarine", + {pickaxey=1, material_stone=1, stonecutter_output=11}, + {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, + S("Prismarine Stairs"), + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil) +mcl_stairs.register_slab("prismarine", "mcl_ocean:prismarine", + {pickaxey=1, material_stone=1, stonecutter_output=11}, + {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, + S("Prismarine Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Prismarine Slab")) -mcl_stairs.register_stair_and_slab_simple("mud_brick", "mcl_mud:mud_bricks", S("Mud Brick Stair"), S("Mud Brick Slab"), S("Double Mud Brick Slab")) +mcl_stairs.register_stair("prismarine_brick", "mcl_ocean:prismarine_brick", + {pickaxey=1, material_stone=1, stonecutter_output=12}, + {"mcl_ocean_prismarine_bricks.png"}, + S("prismarine Brick Stairs"), + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil) +mcl_stairs.register_slab("prismarine_brick", "mcl_ocean:prismarine_brick", + {pickaxey=1, material_stone=1, stonecutter_output=12}, + {"mcl_ocean_prismarine_bricks.png"}, + S("prismarine Brick Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double prismarine_brick Slab")) -mcl_stairs.register_stair_and_slab_simple("prismarine_brick", "mcl_ocean:prismarine_brick", S("Prismarine Brick Stairs"), S("Prismarine Brick Slab"), S("Double Prismarine Brick Slab")) -mcl_stairs.register_stair_and_slab_simple("prismarine_dark", "mcl_ocean:prismarine_dark", S("Dark Prismarine Stairs"), S("Dark Prismarine Slab"), S("Double Dark Prismarine Slab")) +mcl_stairs.register_stair("prismarine_dark", "mcl_ocean:prismarine_dark", + {pickaxey=1, material_stone=1, stonecutter_output=13}, + {"mcl_ocean_prismarine_dark.png"}, + S("prismarine Brick Stairs"), + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil) +mcl_stairs.register_slab("prismarine_dark", "mcl_ocean:prismarine_dark", + {pickaxey=1, material_stone=1, stonecutter_output=13}, + {"mcl_ocean_prismarine_dark.png"}, + S("Dark Prismarine Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Dark Prismarine Slab")) + +mcl_stairs.register_stair_and_slab("mud_brick", "mcl_mud:mud_bricks", + {pickaxey=1, material_stone=1, stonecutter_output=30}, + {"mcl_mud_bricks.png"}, + S("Mud Brick Stairs"), + S("Mud Brick Slab"), + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Mud Brick Slab"), nil) mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", - {pickaxey=1}, + {pickaxey=1, stonecutter_output=5}, {"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}, + {pickaxey=1, stonecutter_output=5}, {"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}, + {pickaxey=1, stonecutter_output=4}, {"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}, + {pickaxey=1, stonecutter_output=4}, {"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}, + {pickaxey=1, stonecutter_output=6}, {"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}, + {pickaxey=1, stonecutter_output=6}, {"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, "woodlike") mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy", - {pickaxey=1}, + {pickaxey=1, stonecutter_output=3}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("stonebrickmossy", "mcl_core:stonebrickmossy", - {pickaxey=1}, + {pickaxey=1, stonecutter_output=3}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 77ca5c066..1fd37cdc6 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -45,60 +45,41 @@ local function show_stonecutter_formspec(items, input) return formspec end --- Strips the start of the item like "mcl_core:" and removes any numbers or whitespaces after it -local function get_item_string_name(input) - local colonIndex = string.find(input, ":") - if colonIndex then - input = string.sub(input, colonIndex + 1) - else - return input +local function check(item_name) + if string.match(item_name, "mcl_walls") then + if string.match(item_name, "%d") then + return true + end + return false end - local whitespaceIndex = string.find(input, "%s") - if whitespaceIndex then - return string.sub(input, 1, whitespaceIndex - 1) - else - return input - end + if string.match(item_name, "_outer") then + return true + elseif string.match(item_name, "_inner") then + return true + elseif string.match(item_name, "_top") then + return true + elseif string.match(item_name, "_double") then + return true + end + return false end + -- Updates the formspec local function update_stonecutter_slots(meta) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() local new_output = meta:get_string("cut_stone") + local compat_item = minetest.get_item_group(name, "stonecuttable") - -- Checks if input is in the array - if minetest.get_item_group(name, "stonecuttable") > 0 then + -- Checks if input is in the group + if compat_item > 0 then local cuttable_recipes = {} - local name_stripped = get_item_string_name(input:to_string()) - if name_stripped ~= "" then - -- Strings for the possible items it can craft into - local stair = "mcl_stairs:stair_"..name_stripped - local slab = "mcl_stairs:slab_"..name_stripped - local wall = "mcl_walls:"..name_stripped - local smooth = "mcl_core:"..name_stripped.."_smooth" - - -- Goes through and checks if the item exists and inserts it into the table - if minetest.registered_items[slab] ~= nil then - table.insert(cuttable_recipes, slab) - end - if minetest.registered_items[stair] ~= nil then - table.insert(cuttable_recipes, stair) - end - if minetest.registered_items[wall] ~= nil then - table.insert(cuttable_recipes, wall) - end - if minetest.registered_items[smooth] ~= nil then - local smooth_stair = "mcl_stairs:stair_"..name_stripped.."_smooth" - local smooth_slab = "mcl_stairs:slab_"..name_stripped.."_smooth" - - table.insert(cuttable_recipes, smooth) - if minetest.registered_items[smooth_slab] ~= nil then - table.insert(cuttable_recipes, smooth_slab) - end - if minetest.registered_items[smooth_stair] ~= nil then - table.insert(cuttable_recipes, smooth_stair) + 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 then + table.insert(cuttable_recipes, item_name) end end end diff --git a/mods/ITEMS/mcl_walls/register.lua b/mods/ITEMS/mcl_walls/register.lua index 96a1b9b9f..241c5ecc1 100644 --- a/mods/ITEMS/mcl_walls/register.lua +++ b/mods/ITEMS/mcl_walls/register.lua @@ -1,17 +1,17 @@ local S = minetest.get_translator(minetest.get_current_modname()) -mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble", {"mcl_walls_cobble_wall_top.png", "default_cobble.png", "mcl_walls_cobble_wall_side.png"}) -mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble", {"mcl_walls_cobble_mossy_wall_top.png", "default_mossycobble.png", "mcl_walls_cobble_mossy_wall_side.png"}) -mcl_walls.register_wall("mcl_walls:andesite", S("Andesite Wall"), "mcl_core:andesite") -mcl_walls.register_wall("mcl_walls:granite", S("Granite Wall"), "mcl_core:granite") -mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorite") -mcl_walls.register_wall("mcl_walls:brick", S("Brick Wall"), "mcl_core:brick_block") -mcl_walls.register_wall("mcl_walls:sandstone", S("Sandstone Wall"), "mcl_core:sandstone") -mcl_walls.register_wall("mcl_walls:redsandstone", S("Red Sandstone Wall"), "mcl_core:redsandstone") -mcl_walls.register_wall("mcl_walls:stonebrick", S("Stone Brick Wall"), "mcl_core:stonebrick") -mcl_walls.register_wall("mcl_walls:stonebrickmossy", S("Mossy Stone Brick Wall"), "mcl_core:stonebrickmossy") -mcl_walls.register_wall("mcl_walls:prismarine", S("Prismarine Wall"), "mcl_ocean:prismarine") -mcl_walls.register_wall("mcl_walls:endbricks", S("End Stone Brick Wall"), "mcl_end:end_bricks") -mcl_walls.register_wall("mcl_walls:netherbrick", S("Nether Brick Wall"), "mcl_nether:nether_brick") -mcl_walls.register_wall("mcl_walls:rednetherbrick", S("Red Nether Brick Wall"), "mcl_nether:red_nether_brick") -mcl_walls.register_wall("mcl_walls:mudbrick", S("Mud Brick Wall"), "mcl_mud:mud_bricks") \ No newline at end of file +mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble", {"mcl_walls_cobble_wall_top.png", "default_cobble.png", "mcl_walls_cobble_wall_side.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=7}) +mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble", {"mcl_walls_cobble_mossy_wall_top.png", "default_mossycobble.png", "mcl_walls_cobble_mossy_wall_side.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=8}) +mcl_walls.register_wall("mcl_walls:andesite", S("Andesite Wall"), "mcl_core:andesite", {"mcl_core_andesite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=5}) +mcl_walls.register_wall("mcl_walls:granite", S("Granite Wall"), "mcl_core:granite", {"mcl_core_granite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=4}) +mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorite", {"mcl_core_diorite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=6}) +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: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}) +mcl_walls.register_wall("mcl_walls:netherbrick", S("Nether Brick Wall"), "mcl_nether:nether_brick", {"mcl_nether_nether_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=17}) +mcl_walls.register_wall("mcl_walls:rednetherbrick", S("Red Nether Brick Wall"), "mcl_nether:red_nether_brick", {"mcl_nether_red_nether_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=18}) +mcl_walls.register_wall("mcl_walls:mudbrick", S("Mud Brick Wall"), "mcl_mud:mud_bricks", {"mcl_mud_bricks.png"}, "", {handy=1, pickaxey=1, material_stone=1, stonecutter_output=30}) \ No newline at end of file From 524c9c1bcc9cb36f6e9582d5d907d91f57885fd6 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 21:42:34 +0100 Subject: [PATCH 14/36] Dupe glitch fizes and remove item label --- mods/ITEMS/mcl_stonecutter/README.md | 2 +- mods/ITEMS/mcl_stonecutter/init.lua | 35 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md index c6316a5a2..3b6e23e05 100644 --- a/mods/ITEMS/mcl_stonecutter/README.md +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -5,7 +5,7 @@ Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, License of code --------------- See the main MineClone 2 README.md file. -Author: PrairieWind +Author: PrairieWind, ChrisPHP, cora License of media ---------------- diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 1fd37cdc6..2794da561 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -19,8 +19,7 @@ local function show_stonecutter_formspec(items, input) y_len = y_len + 1 x_len = 1 end - local test = string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, value, "item_button", value) - cut_items[index] = test + table.insert(cut_items,string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, value, value, "")) end end @@ -66,11 +65,11 @@ end -- Updates the formspec -local function update_stonecutter_slots(meta) +local function update_stonecutter_slots(pos,str) + local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() - local new_output = meta:get_string("cut_stone") local compat_item = minetest.get_item_group(name, "stonecuttable") -- Checks if input is in the group @@ -89,9 +88,9 @@ local function update_stonecutter_slots(meta) end -- Checks if the chosen item is a slab or not, if it's a slab set the output to be a stack of 2 - if new_output ~= '' then - local cut_item = ItemStack(new_output) - if string.find(new_output, "mcl_stairs:slab_") then + if minetest.get_item_group(str, "stonecutter_output") > 0 then + local cut_item = ItemStack(str) + if string.match(str, "mcl_stairs:slab_") then cut_item:set_count(2) else cut_item:set_count(1) @@ -112,6 +111,7 @@ local function drop_stonecutter_items(pos, meta) minetest.add_item(p, stack) end end + minetest.set_node(pos,{name="air"}) end minetest.register_node("mcl_stonecutter:stonecutter", { @@ -199,7 +199,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { end end end - update_stonecutter_slots(meta) + update_stonecutter_slots(pos) end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) local name = player:get_player_name() @@ -213,8 +213,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { end end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - local meta = minetest.get_meta(pos) - update_stonecutter_slots(meta) + update_stonecutter_slots(pos) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) @@ -229,7 +228,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { else meta:set_string("cut_stone", nil) end - update_stonecutter_slots(meta) + update_stonecutter_slots(pos) end, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -241,8 +240,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { end, on_rightclick = function(pos, node, player, itemstack) if not player:get_player_control().sneak then - local meta = minetest.get_meta(pos) - update_stonecutter_slots(meta) + update_stonecutter_slots(pos) end end, on_receive_fields = function(pos, formname, fields, sender) @@ -251,10 +249,13 @@ minetest.register_node("mcl_stonecutter:stonecutter", { minetest.record_protection_violation(pos, sender_name) return end - if fields.item_button then - local meta = minetest.get_meta(pos) - meta:set_string("cut_stone", fields.item_button) - update_stonecutter_slots(meta) + if fields then + for field_name, value in pairs(fields) do + local item_name = tostring(field_name) + if item_name then + update_stonecutter_slots(pos, item_name) + end + end end end, }) From 5dda3033a5b1316dd528abb0eca66cdff0f5c0c4 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 6 Aug 2023 22:17:18 +0100 Subject: [PATCH 15/36] Prevent input from being a selectable option --- mods/ITEMS/mcl_stonecutter/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 2794da561..5db74d3ac 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -44,6 +44,8 @@ local function show_stonecutter_formspec(items, input) return formspec end + +--Checks for the string for the different stair and wall positions that shouldn't be craftable local function check(item_name) if string.match(item_name, "mcl_walls") then if string.match(item_name, "%d") then @@ -77,7 +79,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 then + if check(item_name) == false and name ~= item_name then table.insert(cuttable_recipes, item_name) end end From 40fb043de2c4f894cb6e3e2b80f1dd90f5aa7f14 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Mon, 7 Aug 2023 08:45:03 +0100 Subject: [PATCH 16/36] 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}) From 559f5003224d830ff4a6dc27927bbf4106d8566c Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Tue, 8 Aug 2023 07:57:49 +0100 Subject: [PATCH 17/36] Update readme for stonecutter --- mods/ITEMS/mcl_stonecutter/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md index 3b6e23e05..e5888ea0b 100644 --- a/mods/ITEMS/mcl_stonecutter/README.md +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -2,6 +2,15 @@ mcl_stonecutter =============== Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, etc. Also used as the Stone Mason Villager's jobsite. +### Adding recipes + +* To add a new compatible input the item needs to be in the group "stonecuttable". +* It's output item needs to be in the group "stonecutter_output". +* "stonecuttable" and "stonecutter_output" need to have the same number. +* Items like polished granite should only be able to make it's polished variants +while normal granite can make both. These inputs and outputs need to be in the group + "stonecutter_stage". + License of code --------------- See the main MineClone 2 README.md file. From 12568a6749abafa034b484d2c85ecd4bff7630a5 Mon Sep 17 00:00:00 2001 From: ChrisPHP Date: Sun, 20 Aug 2023 17:02:55 +0100 Subject: [PATCH 18/36] use on_destruct instead of after dig node --- mods/ITEMS/mcl_stonecutter/init.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 11f4f5556..128891516 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -107,6 +107,7 @@ end -- Only drop the items that were in the input slot local function drop_stonecutter_items(pos, meta) + local meta = minetest.get_meta(pos) local inv = meta:get_inventory() for i=1, inv:get_size("input") do local stack = inv:get_stack("input", i) @@ -115,7 +116,6 @@ local function drop_stonecutter_items(pos, meta) minetest.add_item(p, stack) end end - minetest.set_node(pos,{name="air"}) end minetest.register_node("mcl_stonecutter:stonecutter", { @@ -157,12 +157,7 @@ minetest.register_node("mcl_stonecutter:stonecutter", { _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, sounds = mcl_sounds.node_sound_stone_defaults(), - - after_dig_node = function(pos, oldnode, oldmetadata, digger) - local meta = minetest.get_meta(pos) - meta:from_table(oldmetadata) - drop_stonecutter_items(pos, meta) - end, + on_destruct = drop_stonecutter_items, allow_metadata_inventory_take = function(pos, listname, index, stack, player) local name = player:get_player_name() if minetest.is_protected(pos, name) then From b252e577ec1541a41b132a9249b5bcf9f3ea5228 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 17:01:37 +0100 Subject: [PATCH 19/36] Implement recipe registering API --- mods/ITEMS/mcl_stonecutter/init.lua | 107 ++++++++++++---------------- 1 file changed, 47 insertions(+), 60 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 128891516..8f4f24aa1 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -5,6 +5,30 @@ local S = minetest.get_translator("mcl_stonecutter") +mcl_stonecutter = {} +mcl_stonecutter.registered_recipes = {} + +-- API +-- input - string - name of a registered item +-- output - string - name of a registered item +-- count - int - number of the output - +-- - defaults to 1 +-- - non-int rounded down +function mcl_stonecutter.register_recipe(input, output, count) + if not (minetest.registered_items[input] and minetest.registered_items[output]) then + error("Input or output is not a registered item") + end + local n = count + if type(count) ~= "number" then + n = 1 + end + n = math.floor(n) + if not mcl_stonecutter.registered_recipes[input] then + mcl_stonecutter.registered_recipes[input] = {} + end + mcl_stonecutter.registered_recipes[input][output] = n +end + -- formspecs local function show_stonecutter_formspec(items, input) local cut_items = {} @@ -13,13 +37,13 @@ local function show_stonecutter_formspec(items, input) -- This loops through all the items that can be made and inserted into the formspec if items ~= nil then - for index, value in pairs(items) do + for name, count in pairs(items) do x_len = x_len + 1 if x_len > 5 then y_len = y_len + 1 x_len = 1 end - table.insert(cut_items,string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, value, value, "")) + table.insert(cut_items,string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, name, name, tostring(count))) end end @@ -43,66 +67,28 @@ local function show_stonecutter_formspec(items, input) return formspec end - ---Checks for the string for the different stair and wall positions that shouldn't be craftable -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 - end - if string.match(item_name, "_outer") then - return true - elseif string.match(item_name, "_inner") then - return true - elseif string.match(item_name, "_top") then - return true - 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 - - -- Updates the formspec -local function update_stonecutter_slots(pos,str) +local function update_stonecutter_slots(pos, str) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local input = inv:get_stack("input", 1) local name = input:get_name() - local compat_item = minetest.get_item_group(name, "stonecuttable") + local recipes = mcl_stonecutter.registered_recipes[name] - -- Checks if input is in the group - if compat_item > 0 then - 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, name) == false and name ~= item_name then - table.insert(cuttable_recipes, item_name) - end - end + if recipes then + meta:set_string("formspec", show_stonecutter_formspec(recipes)) + if str then + local recipe = recipes[str] + if not recipe then return end + local cut_item = ItemStack(str) + cut_item:set_count(recipe) + inv:set_stack("output", 1, cut_item) + else + inv:set_stack("output", 1, "") end - meta:set_string("formspec", show_stonecutter_formspec(cuttable_recipes)) else meta:set_string("formspec", show_stonecutter_formspec(nil)) end - - -- Checks if the chosen item is a slab or not, if it's a slab set the output to be a stack of 2 - if minetest.get_item_group(str, "stonecutter_output") > 0 then - local cut_item = ItemStack(str) - if string.match(str, "mcl_stairs:slab_") then - cut_item:set_count(2) - else - cut_item:set_count(1) - end - inv:set_stack("output", 1, cut_item) - else - inv:set_stack("output", 1, "") - end end -- Only drop the items that were in the input slot @@ -114,6 +100,7 @@ local function drop_stonecutter_items(pos, meta) if not stack:is_empty() then local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} minetest.add_item(p, stack) +-- inv:set_stack("input", i, ItemStack()) end end end @@ -127,18 +114,18 @@ minetest.register_node("mcl_stonecutter:stonecutter", { "mcl_stonecutter_bottom.png", "mcl_stonecutter_side.png", "mcl_stonecutter_side.png", - {name="mcl_stonecutter_saw.png", + {name="mcl_stonecutter_saw.png", animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, + type="vertical_frames", + aspect_w=16, + aspect_h=16, length=1 }}, - {name="mcl_stonecutter_saw.png", + {name="mcl_stonecutter_saw.png", animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, + type="vertical_frames", + aspect_w=16, + aspect_h=16, length=1 }} }, From 19cea45c17e7a2af516df1db0f7b1da5e2668e8f Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:13:16 +0100 Subject: [PATCH 20/36] Stonecutter fixes and improvements -improved stonecutter API, making it more robust -fixed a dupe bug --- mods/ITEMS/mcl_stonecutter/init.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 8f4f24aa1..b32cf14fe 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -15,8 +15,12 @@ mcl_stonecutter.registered_recipes = {} -- - defaults to 1 -- - non-int rounded down function mcl_stonecutter.register_recipe(input, output, count) - if not (minetest.registered_items[input] and minetest.registered_items[output]) then - error("Input or output is not a registered item") + if mcl_stonecutter.registered_recipes[input] and mcl_stonecutter.registered_recipes[input][output] then return end + if not minetest.registered_items[input] then + error("Input is not a registered item: ".. input) + end + if not minetest.registered_items[output] then + error("Output is not a registered item: ".. output) end local n = count if type(count) ~= "number" then @@ -27,6 +31,21 @@ function mcl_stonecutter.register_recipe(input, output, count) mcl_stonecutter.registered_recipes[input] = {} end mcl_stonecutter.registered_recipes[input][output] = n + + local fallthrough = mcl_stonecutter.registered_recipes[output] + if fallthrough then + for o, c in pairs(fallthrough) do + mcl_stonecutter.register_recipe(input, o, c) + end + end + + for i, recipes in pairs(mcl_stonecutter.registered_recipes) do + for name, c in pairs(recipes) do + if name == input then + mcl_stonecutter.register_recipe(i, output, c*n) + end + end + end end -- formspecs @@ -88,6 +107,7 @@ local function update_stonecutter_slots(pos, str) end else meta:set_string("formspec", show_stonecutter_formspec(nil)) + inv:set_stack("output", 1, "") end end From ead2e772c28d4a037770d3f029de072ffd2de68f Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:16:05 +0100 Subject: [PATCH 21/36] First batch of stonecutter recipes under new API -core blocks -stairs -slabs -walls --- mods/ITEMS/mcl_core/mod.conf | 2 +- mods/ITEMS/mcl_core/nodes_base.lua | 13 +++++++++++++ mods/ITEMS/mcl_stairs/api.lua | 5 +++++ mods/ITEMS/mcl_stairs/mod.conf | 2 +- mods/ITEMS/mcl_stairs/register.lua | 18 +++++++++--------- mods/ITEMS/mcl_walls/init.lua | 2 ++ mods/ITEMS/mcl_walls/mod.conf | 2 +- 7 files changed, 32 insertions(+), 12 deletions(-) diff --git a/mods/ITEMS/mcl_core/mod.conf b/mods/ITEMS/mcl_core/mod.conf index 45018df75..d96f159b5 100644 --- a/mods/ITEMS/mcl_core/mod.conf +++ b/mods/ITEMS/mcl_core/mod.conf @@ -1,4 +1,4 @@ name = mcl_core description = Core items of MineClone 2: Basic biome blocks (dirt, sand, stones, etc.), derived items, glass, sugar cane, cactus, barrier, mining tools, hand, craftitems, and misc. items which don't really fit anywhere else. -depends = mcl_autogroup, mcl_init, mcl_sounds, mcl_particles, mcl_util, mcl_worlds, doc_items, mcl_enchanting, mcl_colors +depends = mcl_autogroup, mcl_init, mcl_sounds, mcl_particles, mcl_util, mcl_worlds, doc_items, mcl_enchanting, mcl_colors, mcl_stonecutter optional_depends = doc diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index c6613802a..dbf746d7c 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -1124,6 +1124,19 @@ minetest.register_node("mcl_core:snowblock", { _mcl_silk_touch_drop = true, }) +-- Stonecutter recipes +mcl_stonecutter.register_recipe("mcl_core:stone", "mcl_core:stonebrick") +mcl_stonecutter.register_recipe("mcl_core:stone", "mcl_core:stonebrickcarved") +mcl_stonecutter.register_recipe("mcl_core:stonebrick", "mcl_core:stonebrickcarved") +mcl_stonecutter.register_recipe("mcl_core:granite", "mcl_core:granite_smooth") +mcl_stonecutter.register_recipe("mcl_core:andesite", "mcl_core:andesite_smooth") +mcl_stonecutter.register_recipe("mcl_core:diorite", "mcl_core:diorite_smooth") +mcl_stonecutter.register_recipe("mcl_core:sandstone", "mcl_core:sandstonesmooth") +mcl_stonecutter.register_recipe("mcl_core:sandstone", "mcl_core:sandstonecarved") +mcl_stonecutter.register_recipe("mcl_core:redsandstone", "mcl_core:redsandstonesmooth") +mcl_stonecutter.register_recipe("mcl_core:redsandstone", "mcl_core:redsandstonecarved") + + -- Add entry aliases for the Help if minetest.get_modpath("doc") then doc.add_entry_alias("nodes", "mcl_core:stone_with_redstone", "nodes", "mcl_core:stone_with_redstone_lit") diff --git a/mods/ITEMS/mcl_stairs/api.lua b/mods/ITEMS/mcl_stairs/api.lua index 6167d7e06..bebe7ba99 100644 --- a/mods/ITEMS/mcl_stairs/api.lua +++ b/mods/ITEMS/mcl_stairs/api.lua @@ -173,6 +173,9 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript {recipeitem, recipeitem, recipeitem}, }, }) + + -- Stonecutter recipe + mcl_stonecutter.register_recipe(recipeitem, "mcl_stairs:stair_".. subname) end mcl_stairs.cornerstair.add("mcl_stairs:stair_"..subname, corner_stair_texture_override) @@ -343,6 +346,8 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti }, }) + mcl_stonecutter.register_recipe(recipeitem, lower_slab, 2) + end -- Help alias for the upper slab diff --git a/mods/ITEMS/mcl_stairs/mod.conf b/mods/ITEMS/mcl_stairs/mod.conf index 2fb3180b2..b3e0e2aa7 100644 --- a/mods/ITEMS/mcl_stairs/mod.conf +++ b/mods/ITEMS/mcl_stairs/mod.conf @@ -1,2 +1,2 @@ name = mcl_stairs -depends = mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_ocean, mcl_mud +depends = mcl_core, mcl_sounds, mcl_nether, mcl_end, mcl_ocean, mcl_mud, mcl_stonecutter diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index a669f2a22..228af97af 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -37,7 +37,7 @@ mcl_stairs.register_slab("stone_rough", "mcl_core:stone", S("Stone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Stone Slab")) -mcl_stairs.register_stair("stone_rough", "group:stone", +mcl_stairs.register_stair("stone_rough", "mcl_core:stone", {pickaxey=1, material_stone=1,stonecutter_output=1}, {"default_stone.png"}, S("Stone Stairs"), @@ -122,13 +122,13 @@ mcl_stairs.register_slab("brick_block", "mcl_core:brick_block", mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Brick Slab")) -mcl_stairs.register_stair("sandstone", "group:normal_sandstone", +mcl_stairs.register_stair("sandstone", "mcl_core:sandstone", {pickaxey=1, material_stone=1, stonecutter_output=9}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:sandstone") --fixme: extra parameter from previous release -mcl_stairs.register_slab("sandstone", "group:normal_sandstone", +mcl_stairs.register_slab("sandstone", "mcl_core:sandstone", {pickaxey=1, material_stone=1, stonecutter_output=9}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Slab"), @@ -147,13 +147,13 @@ mcl_stairs.register_slab("sandstonesmooth2", "mcl_core:sandstonesmooth2", mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Smooth Sandstone Slab")) -mcl_stairs.register_stair("redsandstone", "group:red_sandstone", +mcl_stairs.register_stair("redsandstone", "mcl_core:redsandstone", {pickaxey=1, material_stone=1, stonecutter_output=10}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:redsandstone") --fixme: extra parameter from previous release -mcl_stairs.register_slab("redsandstone", "group:red_sandstone", +mcl_stairs.register_slab("redsandstone", "mcl_core:redsandstone", {pickaxey=1, material_stone=1, stonecutter_output=10}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Slab"), @@ -186,13 +186,13 @@ mcl_stairs.register_slab("stonebrick", "mcl_core:stonebrick", mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Stone Bricks Slab"), "mcl_core:stonebrick") --fixme: extra parameter from previous release -mcl_stairs.register_stair("quartzblock", "group:quartz_block", +mcl_stairs.register_stair("quartzblock", "mcl_nether:quartz_block", {pickaxey=1, material_stone=1, stonecutter_output=14}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_nether:quartz_block") --fixme: extra parameter from previous release -mcl_stairs.register_slab("quartzblock", "group:quartz_block", +mcl_stairs.register_slab("quartzblock", "mcl_nether:quartz_block", {pickaxey=1, material_stone=1, stonecutter_output=14}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Slab"), @@ -234,13 +234,13 @@ mcl_stairs.register_stair_and_slab("end_bricks", "mcl_end:end_bricks", mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double End Stone Brick Slab"), nil) -mcl_stairs.register_stair("purpur_block", "group:purpur_block", +mcl_stairs.register_stair("purpur_block", "mcl_end:purpur_block", {pickaxey=1, material_stone=1, stonecutter_output=15}, {"mcl_end_purpur_block.png"}, S("Purpur Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) -mcl_stairs.register_slab("purpur_block", "group:purpur_block", +mcl_stairs.register_slab("purpur_block", "mcl_end:purpur_block", {pickaxey=1, material_stone=1, stonecutter_output=15}, {"mcl_end_purpur_block.png"}, S("Purpur Slab"), diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index caf8b34fe..09a35b549 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -282,6 +282,8 @@ function mcl_walls.register_wall(nodename, description, source, tiles, inventory {source, source, source}, } }) + + mcl_stonecutter.register_recipe(source, nodename) end end diff --git a/mods/ITEMS/mcl_walls/mod.conf b/mods/ITEMS/mcl_walls/mod.conf index b6b221007..b099e4c1d 100644 --- a/mods/ITEMS/mcl_walls/mod.conf +++ b/mods/ITEMS/mcl_walls/mod.conf @@ -1,3 +1,3 @@ name = mcl_walls -depends = mcl_core, mcl_end, mcl_ocean, mcl_nether, mcl_sounds, mcl_mud +depends = mcl_core, mcl_end, mcl_ocean, mcl_nether, mcl_sounds, mcl_mud, mcl_stonecutter optional_depends = doc From d46b9071a05b6d0b82c0476f65d913632a680f7e Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:17:36 +0100 Subject: [PATCH 22/36] Added nether and end stonecutter recipes --- mods/ITEMS/mcl_end/building.lua | 2 ++ mods/ITEMS/mcl_end/mod.conf | 2 +- mods/ITEMS/mcl_nether/init.lua | 4 ++++ mods/ITEMS/mcl_nether/mod.conf | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index b3a6adf30..fec0df475 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -211,3 +211,5 @@ minetest.register_craft({ }, }) +mcl_stonecutter.register_recipe("mcl_end:end_stone", "mcl_end:end_bricks") +mcl_stonecutter.register_recipe("mcl_end:purpur_block", "mcl_end:purpur_pillar") diff --git a/mods/ITEMS/mcl_end/mod.conf b/mods/ITEMS/mcl_end/mod.conf index 021417e86..3547074cf 100644 --- a/mods/ITEMS/mcl_end/mod.conf +++ b/mods/ITEMS/mcl_end/mod.conf @@ -1,2 +1,2 @@ name = mcl_end -depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures \ No newline at end of file +depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures, mcl_stonecutter diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index f66877707..10a7b4dc5 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -415,5 +415,9 @@ minetest.register_craft({ } }) +-- TODO register stonecutter recipe for chiseled nether brick when it is added +mcl_stonecutter.register_recipe("mcl_nether:quartz_block", "mcl_nether:quartz_chiseled") +mcl_stonecutter.register_recipe("mcl_nether:quartz_block", "mcl_nether:quartz_pillar") + dofile(minetest.get_modpath(minetest.get_current_modname()).."/nether_wart.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/lava.lua") diff --git a/mods/ITEMS/mcl_nether/mod.conf b/mods/ITEMS/mcl_nether/mod.conf index f5ffa61ac..afeca9967 100644 --- a/mods/ITEMS/mcl_nether/mod.conf +++ b/mods/ITEMS/mcl_nether/mod.conf @@ -1,3 +1,3 @@ name = mcl_nether -depends = mcl_core, mcl_sounds, mcl_util, walkover, doc_items, mcl_colors +depends = mcl_core, mcl_sounds, mcl_util, walkover, doc_items, mcl_colors, mcl_stonecutter optional_depends = doc, screwdriver From 6ebd3ccb7db073648c8df819ca2b48531e34c753 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:18:39 +0100 Subject: [PATCH 23/36] Third batch of stonecutter recipes -deepslate -blackstone -quartz bricks --- mods/ITEMS/mcl_blackstone/init.lua | 9 ++++++++- mods/ITEMS/mcl_blackstone/mod.conf | 2 +- mods/ITEMS/mcl_deepslate/init.lua | 6 ++++++ mods/ITEMS/mcl_deepslate/mod.conf | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index c46fba97b..ab8ecd2fa 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -12,7 +12,7 @@ minetest.register_node("mcl_blackstone:blackstone", { tiles = {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1, stonecuttable=21}, + groups = {cracky = 3, pickaxey=1, material_stone=1, cobble=1}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -400,3 +400,10 @@ minetest.register_craft({ { "group:soul_block" }, } }) + +-- stonecutter recipes +mcl_stonecutter.register_recipe("mcl_blackstone:basalt", "mcl_blackstone:basalt_polished") +mcl_stonecutter.register_recipe("mcl_blackstone:blackstone", "mcl_blackstone:blackstone_polished") +mcl_stonecutter.register_recipe("mcl_blackstone:blackstone_polished", "mcl_blackstone:blackstone_chiseled_polished") +mcl_stonecutter.register_recipe("mcl_blackstone:blackstone_polished", "mcl_blackstone:blackstone_brick_polished") +mcl_stonecutter.register_recipe("mcl_nether:quartz_block", "mcl_blackstone:quartz_brick") diff --git a/mods/ITEMS/mcl_blackstone/mod.conf b/mods/ITEMS/mcl_blackstone/mod.conf index 8728f5b01..14a482067 100644 --- a/mods/ITEMS/mcl_blackstone/mod.conf +++ b/mods/ITEMS/mcl_blackstone/mod.conf @@ -1,3 +1,3 @@ name = mcl_blackstone author = debian044 -depends = mcl_core, screwdriver, mcl_stairs, mclx_stairs, mcl_walls, mclx_fences, mcl_torches, mcl_fire +depends = mcl_core, screwdriver, mcl_stairs, mclx_stairs, mcl_walls, mclx_fences, mcl_torches, mcl_fire, mcl_stonecutter, mcl_nether diff --git a/mods/ITEMS/mcl_deepslate/init.lua b/mods/ITEMS/mcl_deepslate/init.lua index b4549159f..0abb0c579 100644 --- a/mods/ITEMS/mcl_deepslate/init.lua +++ b/mods/ITEMS/mcl_deepslate/init.lua @@ -243,6 +243,10 @@ for i = 1, 3 do output = "mcl_deepslate:deepslate_"..deepslate_variants[i+1][1].." 4", recipe = { { s, s }, { s, s } } }) + mcl_stonecutter.register_recipe( + "mcl_deepslate:deepslate_"..deepslate_variants[i][1], + "mcl_deepslate:deepslate_"..deepslate_variants[i+1][1] + ) end for _, p in pairs({ "bricks", "tiles" }) do @@ -275,3 +279,5 @@ minetest.register_craft({ { "mcl_stairs:slab_deepslate_cobbled" }, }, }) + +mcl_stonecutter.register_recipe("mcl_deepslate:deepslate_cobbled", "mcl_deepslate:deepslate_chiseled") diff --git a/mods/ITEMS/mcl_deepslate/mod.conf b/mods/ITEMS/mcl_deepslate/mod.conf index 7e9a44cfc..e542c3fb0 100644 --- a/mods/ITEMS/mcl_deepslate/mod.conf +++ b/mods/ITEMS/mcl_deepslate/mod.conf @@ -1,4 +1,4 @@ name = mcl_deepslate author = NO11 -depends = mcl_raw_ores, mcl_core, mcl_sounds, mcl_dye, mcl_util, screwdriver, mobs_mc, walkover, mcl_walls, mcl_stairs, mcl_brewing, mcl_mobitems, mcl_furnaces, mcl_farming, mcl_worlds +depends = mcl_raw_ores, mcl_core, mcl_sounds, mcl_dye, mcl_util, screwdriver, mobs_mc, walkover, mcl_walls, mcl_stairs, mcl_brewing, mcl_mobitems, mcl_furnaces, mcl_farming, mcl_worlds, mcl_stonecutter optional_depends = mcl_copper From 0c7b4d473c408ded017e0669f37b15941f7e9f34 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:19:09 +0100 Subject: [PATCH 24/36] Copper blocks stonecutter recipes --- mods/ITEMS/mcl_copper/crafting.lua | 6 ++++++ mods/ITEMS/mcl_copper/mod.conf | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_copper/crafting.lua b/mods/ITEMS/mcl_copper/crafting.lua index 41084afb3..6754534db 100644 --- a/mods/ITEMS/mcl_copper/crafting.lua +++ b/mods/ITEMS/mcl_copper/crafting.lua @@ -59,6 +59,12 @@ for _, w in ipairs(waxable_blocks) do }) end +local cuttable_blocks = { "block", "waxed_block", "block_exposed", "waxed_block_exposed", "block_weathered", "waxed_block_weathered", "block_oxidized", "waxed_block_oxidized" } + +for _, w in ipairs(cuttable_blocks) do + mcl_stonecutter.register_recipe("mcl_copper:"..w, "mcl_copper:"..w.."_cut") +end + minetest.register_craft({ output = "mcl_copper:copper_ingot 9", recipe = { diff --git a/mods/ITEMS/mcl_copper/mod.conf b/mods/ITEMS/mcl_copper/mod.conf index a48ee56f7..64937b2e1 100644 --- a/mods/ITEMS/mcl_copper/mod.conf +++ b/mods/ITEMS/mcl_copper/mod.conf @@ -1,4 +1,4 @@ name = mcl_copper author = NO11 -depends = mcl_core, mcl_sounds, mcl_stairs, mcl_util, mcl_oxidation +depends = mcl_core, mcl_sounds, mcl_stairs, mcl_util, mcl_oxidation, mcl_stonecutter description = Adds Copper Ore, blocks and items. From fd17bf1a29c3644e93aeeb0b3922de7b617e0923 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:27:42 +0100 Subject: [PATCH 25/36] Removed old implementation groups --- mods/ITEMS/mcl_blackstone/init.lua | 22 +++---- mods/ITEMS/mcl_copper/nodes.lua | 64 +++++++++---------- mods/ITEMS/mcl_core/nodes_base.lua | 44 ++++++------- mods/ITEMS/mcl_end/building.lua | 8 +-- mods/ITEMS/mcl_mud/init.lua | 4 +- mods/ITEMS/mcl_nether/init.lua | 12 ++-- mods/ITEMS/mcl_ocean/prismarine.lua | 6 +- mods/ITEMS/mcl_stairs/register.lua | 98 ++++++++++++++--------------- mods/ITEMS/mcl_walls/register.lua | 30 ++++----- 9 files changed, 144 insertions(+), 144 deletions(-) diff --git a/mods/ITEMS/mcl_blackstone/init.lua b/mods/ITEMS/mcl_blackstone/init.lua index ab8ecd2fa..e42554f59 100644 --- a/mods/ITEMS/mcl_blackstone/init.lua +++ b/mods/ITEMS/mcl_blackstone/init.lua @@ -73,7 +73,7 @@ minetest.register_node("mcl_blackstone:basalt_polished", { on_place = mcl_util.rotate_axis, on_rotate = on_rotate, is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=19}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -85,7 +85,7 @@ minetest.register_node("mcl_blackstone:basalt", { on_place = mcl_util.rotate_axis, on_rotate = on_rotate, is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=19}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 4.2, _mcl_hardness = 1.25, }) @@ -103,7 +103,7 @@ minetest.register_node("mcl_blackstone:blackstone_polished", { tiles = {"mcl_blackstone_polished.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecuttable=21, stonecutter_output=21}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 6, _mcl_hardness = 2, }) @@ -112,7 +112,7 @@ minetest.register_node("mcl_blackstone:blackstone_chiseled_polished", { tiles = {"mcl_blackstone_chiseled_polished.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=21}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -121,7 +121,7 @@ minetest.register_node("mcl_blackstone:blackstone_brick_polished", { tiles = {"mcl_blackstone_polished_bricks.png"}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=21}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 6, _mcl_hardness = 1.5, }) @@ -131,7 +131,7 @@ minetest.register_node("mcl_blackstone:quartz_brick", { sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), - groups = {cracky = 3, pickaxey=1, material_stone=1, stonecutter_output=14}, + groups = {cracky = 3, pickaxey=1, material_stone=1}, _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, }) @@ -194,7 +194,7 @@ end --slabs/stairs mcl_stairs.register_stair_and_slab("blackstone", "mcl_blackstone:blackstone", - {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {cracky=3, pickaxey=1, material_stone=1}, {"mcl_blackstone_top.png", "mcl_blackstone_top.png", "mcl_blackstone_side.png"}, S("Blackstone Stairs"), S("Blackstone Slab"), @@ -202,7 +202,7 @@ mcl_stairs.register_stair_and_slab("blackstone", "mcl_blackstone:blackstone", S("Double Blackstone Slab"), nil) mcl_stairs.register_stair_and_slab("blackstone_polished", "mcl_blackstone:blackstone_polished", - {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {cracky=3, pickaxey=1, material_stone=1}, {"mcl_blackstone_polished.png"}, S("Polished Blackstone Stairs"), S("Polished Blackstone Slab"), @@ -210,7 +210,7 @@ mcl_stairs.register_stair_and_slab("blackstone_polished", "mcl_blackstone:blacks S("Double Polished Blackstone Slab"), nil) mcl_stairs.register_stair_and_slab("blackstone_chiseled_polished", "mcl_blackstone:blackstone_chiseled_polished", - {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {cracky=3, pickaxey=1, material_stone=1}, {"mcl_blackstone_chiseled_polished.png"}, S("Chiseled Polished Blackstone Stairs"), S("Chiseled Polished Blackstone Slab"), @@ -218,7 +218,7 @@ mcl_stairs.register_stair_and_slab("blackstone_chiseled_polished", "mcl_blacksto S("Double Chiseled Polished Blackstone Slab"), nil) mcl_stairs.register_stair_and_slab("blackstone_brick_polished", "mcl_blackstone:blackstone_brick_polished", - {cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21}, + {cracky=3, pickaxey=1, material_stone=1}, {"mcl_blackstone_polished_bricks.png"}, S("Polished Blackstone Brick Stair Stairs"), S("Polished Blackstone Brick Stair Slab"), @@ -236,7 +236,7 @@ mcl_walls.register_wall( "mcl_blackstone_side.png" }, "", - { cracky=3, pickaxey=1, material_stone=1, stonecutter_output=21 } + { cracky=3, pickaxey=1, material_stone=1 } ) --lavacooling diff --git a/mods/ITEMS/mcl_copper/nodes.lua b/mods/ITEMS/mcl_copper/nodes.lua index f131d9967..af5a49a1c 100644 --- a/mods/ITEMS/mcl_copper/nodes.lua +++ b/mods/ITEMS/mcl_copper/nodes.lua @@ -30,7 +30,7 @@ minetest.register_node("mcl_copper:block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=22}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -43,7 +43,7 @@ minetest.register_node("mcl_copper:waxed_block", { _doc_items_longdesc = S("A block of copper is mostly a decorative block."), tiles = {"mcl_copper_block.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=23}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 3, @@ -55,7 +55,7 @@ minetest.register_node("mcl_copper:block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=24}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -69,7 +69,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", { _doc_items_longdesc = S("Exposed copper is a decorative block."), tiles = {"mcl_copper_exposed.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=25}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -81,7 +81,7 @@ minetest.register_node("mcl_copper:block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=26}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -95,7 +95,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", { _doc_items_longdesc = S("Weathered copper is a decorative block."), tiles = {"mcl_copper_weathered.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=27}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -107,7 +107,7 @@ minetest.register_node("mcl_copper:block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, stonecuttable=28}, + groups = {pickaxey = 2, building_block = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -120,7 +120,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", { _doc_items_longdesc = S("Oxidized copper is a decorative block."), tiles = {"mcl_copper_oxidized.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=29}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -132,7 +132,7 @@ minetest.register_node("mcl_copper:block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=22, stonecutter_output=22}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -145,7 +145,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", { _doc_items_longdesc = S("Cut copper is a decorative block."), tiles = {"mcl_copper_block_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=23, stonecutter_output=23}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -157,7 +157,7 @@ minetest.register_node("mcl_copper:block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=24, stonecutter_output=24}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -171,7 +171,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", { _doc_items_longdesc = S("Exposed cut copper is a decorative block."), tiles = {"mcl_copper_exposed_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=25, stonecutter_output=25}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -183,7 +183,7 @@ minetest.register_node("mcl_copper:block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, oxidizable = 1, stonecuttable=26, stonecutter_output=26}, + groups = {pickaxey = 2, building_block = 1, oxidizable = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -197,7 +197,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", { _doc_items_longdesc = S("Weathered cut copper is a decorative block."), tiles = {"mcl_copper_weathered_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=27, stonecutter_output=27}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -209,7 +209,7 @@ minetest.register_node("mcl_copper:block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, stonecuttable=28, stonecutter_output=28}, + groups = {pickaxey = 2, building_block = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -222,7 +222,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { _doc_items_longdesc = S("Oxidized cut copper is a decorative block."), tiles = {"mcl_copper_oxidized_cut.png"}, is_ground_content = false, - groups = {pickaxey = 2, building_block = 1, waxed = 1, stonecuttable=29, stonecutter_output=29}, + groups = {pickaxey = 2, building_block = 1, waxed = 1}, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 5, @@ -230,112 +230,112 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", { }) mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 22}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Slab of Cut Copper"), nil, nil, nil, S("Double Slab of Cut Copper")) mcl_stairs.register_slab("waxed_copper_cut", "mcl_copper:waxed_block_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 23}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Waxed Slab of Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Cut Copper")) mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 24}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Slab of Exposed Cut Copper"), nil, nil, nil, S("Double Slab of Exposed Cut Copper")) mcl_stairs.register_slab("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 25}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Waxed Slab of Exposed Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Exposed Cut Copper")) mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 26}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Slab of Weathered Cut Copper"), nil, nil, nil, S("Double Slab of Weathered Cut Copper")) mcl_stairs.register_slab("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 27}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Waxed Slab of Weathered Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Weathered Cut Copper")) mcl_stairs.register_slab("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", - {pickaxey = 2, stonecutter_output = 28}, + {pickaxey = 2}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Slab of Oxidized Cut Copper"), nil, nil, nil, S("Double Slab of Oxidized Cut Copper")) mcl_stairs.register_slab("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 29}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Waxed Slab of Oxidized Cut Copper"), nil, nil, nil, S("Waxed Double Slab of Oxidized Cut Copper")) mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 22}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Stairs of Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 23}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, S("Waxed Stairs of Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 24}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Stairs of Exposed Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 25}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, S("Waxed Stairs of Exposed Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cut", - {pickaxey = 2, oxidizable = 1, stonecutter_output = 26}, + {pickaxey = 2, oxidizable = 1}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Stairs of Weathered Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 27}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"}, S("Waxed Stairs of Weathered Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", - {pickaxey = 2, stonecutter_output = 28}, + {pickaxey = 2}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Stairs of Oxidized Cut Copper"), nil, 6, nil, "woodlike") mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut", - {pickaxey = 2, waxed = 1, stonecutter_output = 29}, + {pickaxey = 2, waxed = 1}, {"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, S("Waxed Stairs of Oxidized Cut Copper"), nil, 6, nil, diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index dbf746d7c..db2561082 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -27,7 +27,7 @@ minetest.register_node("mcl_core:stone", { tiles = {"default_stone.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, drop = "mcl_core:cobble", sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, @@ -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, stonecutter_stage=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=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, stonecutter_stage=1}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -272,7 +272,7 @@ minetest.register_node("mcl_core:stonebrickmossy", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_core_stonebrick_mossy.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1, stonecuttable=3}, + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -284,7 +284,7 @@ minetest.register_node("mcl_core:stone_smooth", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_stairs_stone_slab_top.png"}, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), is_ground_content = false, _mcl_blast_resistance = 6, @@ -297,7 +297,7 @@ minetest.register_node("mcl_core:granite", { tiles = {"mcl_core_granite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=4}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -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, stonecutter_stage=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=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}, 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, stonecutter_stage=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -345,7 +345,7 @@ minetest.register_node("mcl_core:diorite", { tiles = {"mcl_core_diorite.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable=6}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=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, stonecutter_stage=1}, + groups = {pickaxey=1, stone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -586,7 +586,7 @@ minetest.register_node("mcl_core:sandstone", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecuttable=9}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -598,7 +598,7 @@ minetest.register_node("mcl_core:sandstonesmooth", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_smooth.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}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -610,7 +610,7 @@ minetest.register_node("mcl_core:sandstonecarved", { tiles = {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_carved.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1, stonecutter_output=9}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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, stonecutter_stage=1}, + groups = {pickaxey=1, sandstone=1, normal_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -649,7 +649,7 @@ minetest.register_node("mcl_core:redsandstone", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, is_ground_content = true, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=10}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -661,7 +661,7 @@ minetest.register_node("mcl_core:redsandstonesmooth", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_smooth.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecuttable=10, stonecutter_output=10}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -673,7 +673,7 @@ minetest.register_node("mcl_core:redsandstonecarved", { tiles = {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_carved.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1, stonecutter_output=10}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -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=10, stonecutter_output=10, stonecutter_stage=1}, + groups = {pickaxey=1, sandstone=1, red_sandstone=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -715,7 +715,7 @@ minetest.register_node("mcl_core:brick_block", { tiles = {"default_brick.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=16}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -768,7 +768,7 @@ minetest.register_node("mcl_core:cobble", { tiles = {"default_cobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1, stonecuttable=7}, + groups = {pickaxey=1, building_block=1, material_stone=1, cobble=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -780,7 +780,7 @@ minetest.register_node("mcl_core:mossycobble", { tiles = {"default_mossycobble.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=8}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index fec0df475..7a3cdfd1d 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -13,7 +13,7 @@ minetest.register_node("mcl_end:end_stone", { _doc_items_longdesc = doc.sub.items.temp.build, tiles = {"mcl_end_end_stone.png"}, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=20}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = mcl_end.check_detach_chorus_plant, _mcl_blast_resistance = 9, @@ -26,7 +26,7 @@ minetest.register_node("mcl_end:end_bricks", { tiles = {"mcl_end_end_bricks.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=20, stonecutter_output=20}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 9, _mcl_hardness = 3, @@ -38,7 +38,7 @@ minetest.register_node("mcl_end:purpur_block", { tiles = {"mcl_end_purpur_block.png"}, is_ground_content = false, stack_max = 64, - groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecuttable=15}, + groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -52,7 +52,7 @@ minetest.register_node("mcl_end:purpur_pillar", { is_ground_content = false, on_place = mcl_util.rotate_axis, tiles = {"mcl_end_purpur_pillar_top.png", "mcl_end_purpur_pillar_top.png", "mcl_end_purpur_pillar.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1, stonecutter_output=15}, + groups = {pickaxey=1, building_block=1, material_stone=1, purpur_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 6, diff --git a/mods/ITEMS/mcl_mud/init.lua b/mods/ITEMS/mcl_mud/init.lua index 5a99ff754..3c3e66a99 100644 --- a/mods/ITEMS/mcl_mud/init.lua +++ b/mods/ITEMS/mcl_mud/init.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_mud:mud_bricks", { _doc_items_longdesc = S("Decorative block crafted from packed mud."), _doc_items_hidden = false, tiles = {"mcl_mud_bricks.png"}, - groups = {handy=1, pickaxey=1, building_block=1, stonecuttable=30}, + groups = {handy=1, pickaxey=1, building_block=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 3, _mcl_hardness = 1.5, @@ -62,4 +62,4 @@ minetest.register_craft({ {"mcl_mud:packed_mud", "mcl_mud:packed_mud"}, {"mcl_mud:packed_mud", "mcl_mud:packed_mud"} } -}) \ No newline at end of file +}) diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 10a7b4dc5..252768df5 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -176,7 +176,7 @@ minetest.register_node("mcl_nether:nether_brick", { stack_max = 64, tiles = {"mcl_nether_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=17}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -189,7 +189,7 @@ minetest.register_node("mcl_nether:red_nether_brick", { stack_max = 64, tiles = {"mcl_nether_red_nether_brick.png"}, is_ground_content = false, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=18}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 2, @@ -219,7 +219,7 @@ minetest.register_node("mcl_nether:quartz_block", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecuttable=14}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -231,7 +231,7 @@ minetest.register_node("mcl_nether:quartz_chiseled", { stack_max = 64, is_ground_content = false, tiles = {"mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_top.png", "mcl_nether_quartz_chiseled_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecutter_output=14}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, @@ -245,7 +245,7 @@ minetest.register_node("mcl_nether:quartz_pillar", { is_ground_content = false, on_place = mcl_util.rotate_axis, tiles = {"mcl_nether_quartz_pillar_top.png", "mcl_nether_quartz_pillar_top.png", "mcl_nether_quartz_pillar_side.png"}, - groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1, stonecutter_output=14}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), on_rotate = on_rotate, _mcl_blast_resistance = 0.8, @@ -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=31, stonecutter_output=31}, + groups = {pickaxey=1, quartz_block=1,building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 0.8, _mcl_hardness = 0.8, diff --git a/mods/ITEMS/mcl_ocean/prismarine.lua b/mods/ITEMS/mcl_ocean/prismarine.lua index e1a0a3a98..fff07cb7e 100644 --- a/mods/ITEMS/mcl_ocean/prismarine.lua +++ b/mods/ITEMS/mcl_ocean/prismarine.lua @@ -38,7 +38,7 @@ minetest.register_node("mcl_ocean:prismarine", { is_ground_content = false, -- Texture should have 22 frames for smooth transitions. tiles = {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=11}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -50,7 +50,7 @@ minetest.register_node("mcl_ocean:prismarine_brick", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_bricks.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=12}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, @@ -62,7 +62,7 @@ minetest.register_node("mcl_ocean:prismarine_dark", { stack_max = 64, is_ground_content = false, tiles = {"mcl_ocean_prismarine_dark.png"}, - groups = {pickaxey=1, building_block=1, material_stone=1, stonecuttable=13}, + groups = {pickaxey=1, building_block=1, material_stone=1}, sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 6, _mcl_hardness = 1.5, diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index 228af97af..546be8112 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -32,141 +32,141 @@ end mcl_stairs.register_slab("stone_rough", "mcl_core:stone", - {pickaxey=1, material_stone=1, stonecutter_output=1}, + {pickaxey=1, material_stone=1}, {"default_stone.png"}, S("Stone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Stone Slab")) mcl_stairs.register_stair("stone_rough", "mcl_core:stone", - {pickaxey=1, material_stone=1,stonecutter_output=1}, + {pickaxey=1, material_stone=1}, {"default_stone.png"}, S("Stone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("stone", "mcl_core:stone_smooth", - {pickaxey=1, material_stone=1, stonecutter_output=2}, + {pickaxey=1, material_stone=1}, {"mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_side.png"}, S("Polished Stone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Polished Stone Slab")) mcl_stairs.register_stair("andesite", "mcl_core:andesite", - {pickaxey=1, material_stone=1,stonecutter_output=5}, + {pickaxey=1, material_stone=1}, {"mcl_core_andesite.png"}, S("Andesite Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("andesite", "mcl_core:andesite", - {pickaxey=1, material_stone=1, stonecutter_output=5}, + {pickaxey=1, material_stone=1}, {"mcl_core_andesite.png"}, S("Andesite Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Andesite Slab")) mcl_stairs.register_stair("granite", "mcl_core:granite", - {pickaxey=1, material_stone=1,stonecutter_output=4}, + {pickaxey=1, material_stone=1}, {"mcl_core_granite.png"}, S("Granite Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("granite", "mcl_core:granite", - {pickaxey=1, material_stone=1, stonecutter_output=4}, + {pickaxey=1, material_stone=1}, {"mcl_core_granite.png"}, S("Granite Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Granite Slab")) mcl_stairs.register_stair("diorite", "mcl_core:diorite", - {pickaxey=1, material_stone=1,stonecutter_output=6}, + {pickaxey=1, material_stone=1}, {"mcl_core_diorite.png"}, S("Granite Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("diorite", "mcl_core:diorite", - {pickaxey=1, material_stone=1, stonecutter_output=6}, + {pickaxey=1, material_stone=1}, {"mcl_core_diorite.png"}, S("Diorite Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Diorite Slab")) mcl_stairs.register_stair("cobble", "mcl_core:cobble", - {pickaxey=1, material_stone=1,stonecutter_output=7}, + {pickaxey=1, material_stone=1}, {"default_cobble.png"}, S("Cobblestone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("cobble", "mcl_core:cobble", - {pickaxey=1, material_stone=1, stonecutter_output=7}, + {pickaxey=1, material_stone=1}, {"default_cobble.png"}, S("Cobblestone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Cobblestone Slab")) mcl_stairs.register_stair("mossycobble", "mcl_core:mossycobble", - {pickaxey=1, material_stone=1,stonecutter_output=8}, + {pickaxey=1, material_stone=1}, {"default_mossycobble.png"}, S("Mossy Cobblestone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("mossycobble", "mcl_core:mossycobble", - {pickaxey=1, material_stone=1, stonecutter_output=8}, + {pickaxey=1, material_stone=1}, {"default_mossycobble.png"}, S("Mossy Cobblestone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Mossy Cobblestone Slab")) mcl_stairs.register_stair("brick_block", "mcl_core:brick_block", - {pickaxey=1, material_stone=1,stonecutter_output=16}, + {pickaxey=1, material_stone=1}, {"default_brick.png"}, S("Brick Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8) mcl_stairs.register_slab("brick_block", "mcl_core:brick_block", - {pickaxey=1, material_stone=1, stonecutter_output=16}, + {pickaxey=1, material_stone=1}, {"default_brick.png"}, S("Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Brick Slab")) mcl_stairs.register_stair("sandstone", "mcl_core:sandstone", - {pickaxey=1, material_stone=1, stonecutter_output=9}, + {pickaxey=1, material_stone=1}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:sandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("sandstone", "mcl_core:sandstone", - {pickaxey=1, material_stone=1, stonecutter_output=9}, + {pickaxey=1, material_stone=1}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, 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, stonecutter_stage=1}, + {pickaxey=1, material_stone=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, stonecutter_stage=1}, + {pickaxey=1, material_stone=1}, {"mcl_core_sandstone_top.png"}, S("Smooth Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Smooth Sandstone Slab")) mcl_stairs.register_stair("redsandstone", "mcl_core:redsandstone", - {pickaxey=1, material_stone=1, stonecutter_output=10}, + {pickaxey=1, material_stone=1}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_core:redsandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("redsandstone", "mcl_core:redsandstone", - {pickaxey=1, material_stone=1, stonecutter_output=10}, + {pickaxey=1, material_stone=1}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, 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, stonecutter_stage=1}, + {pickaxey=1, material_stone=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, stonecutter_stage=1}, + {pickaxey=1, material_stone=1}, {"mcl_core_red_sandstone_top.png"}, S("Smooth Red Sandstone Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, @@ -174,52 +174,52 @@ 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, stonecutter_stage=1}, + {pickaxey=1, material_stone=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, stonecutter_stage=1}, + {pickaxey=1, material_stone=1}, {"default_stone_brick.png"}, S("Stone Bricks Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Stone Bricks Slab"), "mcl_core:stonebrick") --fixme: extra parameter from previous release mcl_stairs.register_stair("quartzblock", "mcl_nether:quartz_block", - {pickaxey=1, material_stone=1, stonecutter_output=14}, + {pickaxey=1, material_stone=1}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Stairs"), mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, nil, "mcl_nether:quartz_block") --fixme: extra parameter from previous release mcl_stairs.register_slab("quartzblock", "mcl_nether:quartz_block", - {pickaxey=1, material_stone=1, stonecutter_output=14}, + {pickaxey=1, material_stone=1}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, 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=31}, + {pickaxey=1, material_stone=1}, {"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=31}, + {pickaxey=1, material_stone=1}, {"mcl_nether_quartz_block_bottom.png"}, S("Smooth Quartz Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Smooth Quartz Slab")) mcl_stairs.register_stair_and_slab("nether_brick", "mcl_nether:nether_brick", - {pickaxey=1, material_stone=1, stonecutter_output=17}, + {pickaxey=1, material_stone=1}, {"mcl_nether_nether_brick.png"}, S("Nether Brick Stairs"), S("Nether Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Nether Brick Slab"), nil) mcl_stairs.register_stair_and_slab("red_nether_brick", "mcl_nether:red_nether_brick", - {pickaxey=1, material_stone=1, stonecutter_output=18}, + {pickaxey=1, material_stone=1}, {"mcl_nether_red_nether_brick.png"}, S("Red Nether Brick Stairs"), S("Red Nether Brick Slab"), @@ -227,7 +227,7 @@ mcl_stairs.register_stair_and_slab("red_nether_brick", "mcl_nether:red_nether_br S("Double Red Nether Brick Slab"), nil) mcl_stairs.register_stair_and_slab("end_bricks", "mcl_end:end_bricks", - {pickaxey=1, material_stone=1, stonecutter_output=20}, + {pickaxey=1, material_stone=1}, {"mcl_end_end_bricks.png"}, S("End Stone Brick Stairs"), S("End Stone Brick Slab"), @@ -235,59 +235,59 @@ mcl_stairs.register_stair_and_slab("end_bricks", "mcl_end:end_bricks", S("Double End Stone Brick Slab"), nil) mcl_stairs.register_stair("purpur_block", "mcl_end:purpur_block", - {pickaxey=1, material_stone=1, stonecutter_output=15}, + {pickaxey=1, material_stone=1}, {"mcl_end_purpur_block.png"}, S("Purpur Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("purpur_block", "mcl_end:purpur_block", - {pickaxey=1, material_stone=1, stonecutter_output=15}, + {pickaxey=1, material_stone=1}, {"mcl_end_purpur_block.png"}, S("Purpur Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Purpur Slab")) mcl_stairs.register_stair("prismarine", "mcl_ocean:prismarine", - {pickaxey=1, material_stone=1, stonecutter_output=11}, + {pickaxey=1, material_stone=1}, {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, S("Prismarine Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("prismarine", "mcl_ocean:prismarine", - {pickaxey=1, material_stone=1, stonecutter_output=11}, + {pickaxey=1, material_stone=1}, {{name="mcl_ocean_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}}, S("Prismarine Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Prismarine Slab")) mcl_stairs.register_stair("prismarine_brick", "mcl_ocean:prismarine_brick", - {pickaxey=1, material_stone=1, stonecutter_output=12}, + {pickaxey=1, material_stone=1}, {"mcl_ocean_prismarine_bricks.png"}, S("prismarine Brick Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("prismarine_brick", "mcl_ocean:prismarine_brick", - {pickaxey=1, material_stone=1, stonecutter_output=12}, + {pickaxey=1, material_stone=1}, {"mcl_ocean_prismarine_bricks.png"}, S("prismarine Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double prismarine_brick Slab")) mcl_stairs.register_stair("prismarine_dark", "mcl_ocean:prismarine_dark", - {pickaxey=1, material_stone=1, stonecutter_output=13}, + {pickaxey=1, material_stone=1}, {"mcl_ocean_prismarine_dark.png"}, S("prismarine Brick Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("prismarine_dark", "mcl_ocean:prismarine_dark", - {pickaxey=1, material_stone=1, stonecutter_output=13}, + {pickaxey=1, material_stone=1}, {"mcl_ocean_prismarine_dark.png"}, S("Dark Prismarine Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Dark Prismarine Slab")) mcl_stairs.register_stair_and_slab("mud_brick", "mcl_mud:mud_bricks", - {pickaxey=1, material_stone=1, stonecutter_output=30}, + {pickaxey=1, material_stone=1}, {"mcl_mud_bricks.png"}, S("Mud Brick Stairs"), S("Mud Brick Slab"), @@ -295,53 +295,53 @@ 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, stonecutter_stage=1}, + {pickaxey=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, stonecutter_stage=1}, + {pickaxey=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, stonecutter_stage=1}, + {pickaxey=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, stonecutter_stage=1}, + {pickaxey=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, stonecutter_stage=1}, + {pickaxey=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, stonecutter_stage=1}, + {pickaxey=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, "woodlike") mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy", - {pickaxey=1, stonecutter_output=3}, + {pickaxey=1}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Stairs"), mcl_sounds.node_sound_stone_defaults(), 6, 1.5, nil) mcl_stairs.register_slab("stonebrickmossy", "mcl_core:stonebrickmossy", - {pickaxey=1, stonecutter_output=3}, + {pickaxey=1}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Slab"), mcl_sounds.node_sound_stone_defaults(), 6, 2, diff --git a/mods/ITEMS/mcl_walls/register.lua b/mods/ITEMS/mcl_walls/register.lua index 2307f2bfe..c2859935e 100644 --- a/mods/ITEMS/mcl_walls/register.lua +++ b/mods/ITEMS/mcl_walls/register.lua @@ -1,17 +1,17 @@ local S = minetest.get_translator(minetest.get_current_modname()) -mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble", {"mcl_walls_cobble_wall_top.png", "default_cobble.png", "mcl_walls_cobble_wall_side.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=7}) -mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble", {"mcl_walls_cobble_mossy_wall_top.png", "default_mossycobble.png", "mcl_walls_cobble_mossy_wall_side.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=8}) -mcl_walls.register_wall("mcl_walls:andesite", S("Andesite Wall"), "mcl_core:andesite", {"mcl_core_andesite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=5}) -mcl_walls.register_wall("mcl_walls:granite", S("Granite Wall"), "mcl_core:granite", {"mcl_core_granite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=4}) -mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorite", {"mcl_core_diorite.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=6}) -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, 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}) -mcl_walls.register_wall("mcl_walls:netherbrick", S("Nether Brick Wall"), "mcl_nether:nether_brick", {"mcl_nether_nether_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=17}) -mcl_walls.register_wall("mcl_walls:rednetherbrick", S("Red Nether Brick Wall"), "mcl_nether:red_nether_brick", {"mcl_nether_red_nether_brick.png"}, "", {pickaxey=1, material_stone=1, stonecutter_output=18}) -mcl_walls.register_wall("mcl_walls:mudbrick", S("Mud Brick Wall"), "mcl_mud:mud_bricks", {"mcl_mud_bricks.png"}, "", {handy=1, pickaxey=1, material_stone=1, stonecutter_output=30}) \ No newline at end of file +mcl_walls.register_wall("mcl_walls:cobble", S("Cobblestone Wall"), "mcl_core:cobble", {"mcl_walls_cobble_wall_top.png", "default_cobble.png", "mcl_walls_cobble_wall_side.png"}) +mcl_walls.register_wall("mcl_walls:mossycobble", S("Mossy Cobblestone Wall"), "mcl_core:mossycobble", {"mcl_walls_cobble_mossy_wall_top.png", "default_mossycobble.png", "mcl_walls_cobble_mossy_wall_side.png"}) +mcl_walls.register_wall("mcl_walls:andesite", S("Andesite Wall"), "mcl_core:andesite") +mcl_walls.register_wall("mcl_walls:granite", S("Granite Wall"), "mcl_core:granite") +mcl_walls.register_wall("mcl_walls:diorite", S("Diorite Wall"), "mcl_core:diorite") +mcl_walls.register_wall("mcl_walls:brick", S("Brick Wall"), "mcl_core:brick_block") +mcl_walls.register_wall("mcl_walls:sandstone", S("Sandstone Wall"), "mcl_core:sandstone") +mcl_walls.register_wall("mcl_walls:redsandstone", S("Red Sandstone Wall"), "mcl_core:redsandstone") +mcl_walls.register_wall("mcl_walls:stonebrick", S("Stone Brick Wall"), "mcl_core:stonebrick") +mcl_walls.register_wall("mcl_walls:stonebrickmossy", S("Mossy Stone Brick Wall"), "mcl_core:stonebrickmossy") +mcl_walls.register_wall("mcl_walls:prismarine", S("Prismarine Wall"), "mcl_ocean:prismarine") +mcl_walls.register_wall("mcl_walls:endbricks", S("End Stone Brick Wall"), "mcl_end:end_bricks") +mcl_walls.register_wall("mcl_walls:netherbrick", S("Nether Brick Wall"), "mcl_nether:nether_brick") +mcl_walls.register_wall("mcl_walls:rednetherbrick", S("Red Nether Brick Wall"), "mcl_nether:red_nether_brick") +mcl_walls.register_wall("mcl_walls:mudbrick", S("Mud Brick Wall"), "mcl_mud:mud_bricks") From c183da7714e207409d38f42a86a46bf8a5458930 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 13 Nov 2023 21:49:57 +0100 Subject: [PATCH 26/36] Updated README --- mods/ITEMS/mcl_stonecutter/README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md index e5888ea0b..cd6b5a95a 100644 --- a/mods/ITEMS/mcl_stonecutter/README.md +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -4,17 +4,18 @@ Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, ### Adding recipes -* To add a new compatible input the item needs to be in the group "stonecuttable". -* It's output item needs to be in the group "stonecutter_output". -* "stonecuttable" and "stonecutter_output" need to have the same number. -* Items like polished granite should only be able to make it's polished variants -while normal granite can make both. These inputs and outputs need to be in the group - "stonecutter_stage". +* To add a new custom stonecutter recipe, use `mcl_stonecutter.register_recipe(input, output, count)` +* `input` must be a name of a registered item +* `output` must also be a name of a registered item +* `count` should be a number denoting output count, this defaults to 1 for `nil` and invalid values + * a number with a fraction passed as count will be rounded down +* Stairs, slabs and walls get their recipes registered automatically +* Recipe chains are followed automatically, so any recipes taking `output` of another recipe as input will also be taking `input` of that recipe as their input License of code --------------- See the main MineClone 2 README.md file. -Author: PrairieWind, ChrisPHP, cora +Author: PrairieWind, ChrisPHP, cora, Herowl License of media ---------------- From 2128dd4c15bcd6d94e0f14a60e2be06c10c5a1f6 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 19 Nov 2023 01:23:57 +0100 Subject: [PATCH 27/36] Add basic table ordered keys iterator --- mods/CORE/mcl_util/init.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index e894eebd7..17c4bfc14 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -22,6 +22,30 @@ function table.update_nil(t, ...) return t end +---Works the same as `pairs`, but order returned by keys +--- +---Taken from https://www.lua.org/pil/19.3.html +---@generic T: table, K, V, C +---@param t T +---@param f? fun(a: C, b: C):boolean +---@return fun():K, V +function table.pairs_by_keys(t, f) + local a = {} + for n in pairs(t) do table.insert(a, n) end + table.sort(a, f) + + local i = 0 -- iterator variable + local function iter() -- iterator function + i = i + 1 + if a[i] == nil then + return nil + else + return a[i], t[a[i]] + end + end + return iter +end + local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default", false) local LOG_MODULE = "[MCL2]" function mcl_util.mcl_log(message, module, bypass_default_logger) From a001f847861d913440604530d028dbf0a807f93b Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 19 Nov 2023 01:24:54 +0100 Subject: [PATCH 28/36] Add utility functions to clean inventory lists --- mods/CORE/mcl_util/init.lua | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 17c4bfc14..ec50bc3fb 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1137,3 +1137,53 @@ function mcl_util.get_colorwallmounted_rotation(pos) end end end + +---Move items from one inventory list to another, drop items that do not fit in provided pos and direction. +---@param src_inv mt.InvRef +---@param src_listname string +---@param out_inv mt.InvRef +---@param out_listname string +---@param pos mt.Vector Position to throw items at +---@param dir? mt.Vector Direction to throw items in +---@param insta_collect? boolean Enable instant collection, let players collect dropped items instantly. Default `false` +function mcl_util.move_list(src_inv, src_listname, out_inv, out_listname, pos, dir, insta_collect) + local src_list = src_inv:get_list(src_listname) + + if not src_list then return end + for i, stack in ipairs(src_list) do + if out_inv:room_for_item(out_listname, stack) then + out_inv:add_item(out_listname, stack) + else + local p = vector.copy(pos) + p.x = p.x + (math.random(1, 3) * 0.2) + p.z = p.z + (math.random(1, 3) * 0.2) + + local obj = minetest.add_item(p, stack) + if obj then + if dir then + local v = vector.copy(dir) + v.x = v.x * 4 + v.y = v.y * 4 + 2 + v.z = v.z * 4 + obj:set_velocity(v) + minetest.log("error", vector.to_string(v)) + end + if not insta_collect then + obj:get_luaentity()._insta_collect = false + end + end + end + + stack:clear() + src_inv:set_stack(src_listname, i, stack) + end +end + +---Move items from a player's inventory list to its main inventory list, drop items that do not fit in front of him. +---@param player mt.PlayerObjectRef +---@param src_listname string +function mcl_util.move_player_list(player, src_listname) + mcl_util.move_list(player:get_inventory(), src_listname, player:get_inventory(), "main", + vector.offset(player:get_pos(), 0, 1.2, 0), + player:get_look_dir(), false) +end From 4836418cf6d90b0b43d12a699703b8583414e017 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 19 Nov 2023 01:42:12 +0100 Subject: [PATCH 29/36] Rework Stonecutter --- mods/ITEMS/mcl_stonecutter/README.md | 6 +- mods/ITEMS/mcl_stonecutter/init.lua | 466 ++++++++++++++++----------- mods/ITEMS/mcl_stonecutter/mod.conf | 2 +- 3 files changed, 284 insertions(+), 190 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/README.md b/mods/ITEMS/mcl_stonecutter/README.md index cd6b5a95a..7fd31aa97 100644 --- a/mods/ITEMS/mcl_stonecutter/README.md +++ b/mods/ITEMS/mcl_stonecutter/README.md @@ -12,10 +12,14 @@ Adds the stonecutter block. Used to cut stone like materials into stairs, slabs, * Stairs, slabs and walls get their recipes registered automatically * Recipe chains are followed automatically, so any recipes taking `output` of another recipe as input will also be taking `input` of that recipe as their input +### Displaying the Stonecutter menu + +* To display the stonecutter formspec to a player use `mcl_stonecutter.show_stonecutter_form(player)` + License of code --------------- See the main MineClone 2 README.md file. -Author: PrairieWind, ChrisPHP, cora, Herowl +Author: PrairieWind, ChrisPHP, cora, Herowl, AFCMS License of media ---------------- diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index b32cf14fe..26ec0d419 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -2,35 +2,65 @@ --||||| STONECUTTER ||||| --||||||||||||||||||||||| +-- The stonecutter is implemented just like the crafting table, meaning the node doesn't have any state. +-- Instead it trigger the display of a per-player menu. The input and output slots, the wanted item are stored into the player meta. +-- +-- Player inventory lists: +-- * stonecutter_input (1) +-- * stonecutter_output (1) +-- Player meta: +-- * stonecutter_selected (string, wanted item name) + local S = minetest.get_translator("mcl_stonecutter") +local C = minetest.colorize +local show_formspec = minetest.show_formspec + +local formspec_name = "mcl_stonecutter:stonecutter" mcl_stonecutter = {} + + +---Table of registered recipes +--- +---```lua +---mcl_stonecutter.registered_recipes = { +--- ["mcl_core:input_item"] = { +--- ["mcl_core:output_item"] = 1, +--- ["mcl_core:output_item2"] = 2, +--- }, +---} +---``` +---@type table> mcl_stonecutter.registered_recipes = {} --- API --- input - string - name of a registered item --- output - string - name of a registered item --- count - int - number of the output - --- - defaults to 1 --- - non-int rounded down + +---Registers a recipe for the stonecutter +---@param input string Name of a registered item +---@param output string Name of a registered item +---@param count? integer Number of the output, defaults to `1` function mcl_stonecutter.register_recipe(input, output, count) - if mcl_stonecutter.registered_recipes[input] and mcl_stonecutter.registered_recipes[input][output] then return end + if mcl_stonecutter.registered_recipes[input] and mcl_stonecutter.registered_recipes[input][output] then + minetest.log("warning", + "[mcl_stonecutter] Recipe already registered: [" .. input .. "] -> [" .. output .. " " .. count .. "]") + return + end + if not minetest.registered_items[input] then - error("Input is not a registered item: ".. input) + error("Input is not a registered item: " .. input) end + if not minetest.registered_items[output] then - error("Output is not a registered item: ".. output) + error("Output is not a registered item: " .. output) end - local n = count - if type(count) ~= "number" then - n = 1 - end - n = math.floor(n) + + count = count or 1 + if not mcl_stonecutter.registered_recipes[input] then mcl_stonecutter.registered_recipes[input] = {} end - mcl_stonecutter.registered_recipes[input][output] = n + + mcl_stonecutter.registered_recipes[input][output] = count local fallthrough = mcl_stonecutter.registered_recipes[output] if fallthrough then @@ -42,88 +72,239 @@ function mcl_stonecutter.register_recipe(input, output, count) for i, recipes in pairs(mcl_stonecutter.registered_recipes) do for name, c in pairs(recipes) do if name == input then - mcl_stonecutter.register_recipe(i, output, c*n) + mcl_stonecutter.register_recipe(i, output, c * count) end end end end --- formspecs -local function show_stonecutter_formspec(items, input) - local cut_items = {} - local x_len = 0 - local y_len = 0.5 +---Minetest currently (5.7) doesn't prevent using `:` characters in field names +---But using them prevent the buttons from beeing styled with `style[]` elements +---https://github.com/minetest/minetest/issues/14013 - -- This loops through all the items that can be made and inserted into the formspec - if items ~= nil then - for name, count in pairs(items) do - x_len = x_len + 1 - if x_len > 5 then - y_len = y_len + 1 - x_len = 1 - end - table.insert(cut_items,string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",x_len+1,y_len,1,1, name, name, tostring(count))) - end +---@param itemname string +local function itenname_to_fieldname(itemname) + return string.gsub(itemname, ":", "__") +end + +---@param fieldname string +local function fieldname_to_itemname(fieldname) + return string.gsub(fieldname, "__", ":") +end + +---Build the formspec for the stonecutter with given output button +---@param player mt.PlayerObjectRef +---@param items? table +local function build_stonecutter_formspec(player, items) + local meta = player:get_meta() + local selected = meta:get_string("stonecutter_selected") + + items = items or {} + + -- Buttons are 3.5 / 4 = 0.875 wide + local c = 0 + local items_content = "style_type[item_image_button;noclip=false;content_offset=0]" .. + (selected ~= "" and "style[" .. itenname_to_fieldname(selected) .. ";border=false;bgimg=mcl_inventory_button9_pressed.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]" or "") + + for name, count in table.pairs_by_keys(items) do + c = c + 1 + local x = ((c - 1) % 4) * 0.875 + local y = (math.floor((c - 1) / 4)) * 0.875 + + items_content = items_content .. + string.format("item_image_button[%f,%f;0.875,0.875;%s;%s;]", x, y, + name, itenname_to_fieldname(name), tostring(count)) end - 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[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;]".. - mcl_formspec.get_itemslot_bg(0,7.74,9,1).. - "list[context;input;0.5,1.7;1,1;]".. - mcl_formspec.get_itemslot_bg(0.5,1.7,1,1).. - "list[context;output;7.5,1.7;1,1;]".. - mcl_formspec.get_itemslot_bg(7.5,1.7,1,1).. - table.concat(cut_items).. - "listring[context;output]".. - "listring[current_player;main]".. - "listring[context;input]".. - "listring[current_player;main]" + local formspec = table.concat({ + "formspec_version[4]", + "size[11.75,10.425]", + "label[0.375,0.375;" .. C(mcl_formspec.label_color, S("Stone Cutter")) .. "]", + + -- Pattern input slot + mcl_formspec.get_itemslot_bg_v4(1.625, 2, 1, 1), + "list[current_player;stonecutter_input;1.625,2;1,1;]", + + -- Container background + "image[4.075,0.7;3.6,3.6;mcl_inventory_background9.png;2]", + + -- Style for item image buttons + "style_type[item_image_button;noclip=false;content_offset=0]", + + -- Scroll Container with buttons if needed + "scroll_container[4.125,0.75;3.5,3.5;scroll;vertical;0.875]", + items_content, + "scroll_container_end[]", + + -- Scrollbar + -- TODO: style the scrollbar correctly when possible + "scrollbaroptions[min=0;max=" .. + math.max(math.floor(#items / 4) + 1 - 4, 0) .. ";smallstep=1;largesteps=1]", + "scrollbar[7.625,0.7;0.75,3.6;vertical;scroll;0]", + + -- Output slot + mcl_formspec.get_itemslot_bg_v4(9.75, 2, 1, 1, 0.2), + "list[current_player;stonecutter_output;9.75,2;1,1;]", + + -- Player inventory + "label[0.375,4.7;" .. C(mcl_formspec.label_color, S("Inventory")) .. "]", + mcl_formspec.get_itemslot_bg_v4(0.375, 5.1, 9, 3), + "list[current_player;main;0.375,5.1;9,3;9]", + + mcl_formspec.get_itemslot_bg_v4(0.375, 9.05, 9, 1), + "list[current_player;main;0.375,9.05;9,1;]", + + "listring[current_player;stonecutter_output]", + "listring[current_player;main]", + "listring[current_player;stonecutter_input]", + "listring[current_player;main]", + }) return formspec end --- Updates the formspec -local function update_stonecutter_slots(pos, str) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local input = inv:get_stack("input", 1) - local name = input:get_name() - local recipes = mcl_stonecutter.registered_recipes[name] + +---Display stonecutter menu to a player +---@param player mt.PlayerObjectRef +function mcl_stonecutter.show_stonecutter_form(player) + show_formspec(player:get_player_name(), formspec_name, + build_stonecutter_formspec(player, + mcl_stonecutter.registered_recipes[player:get_inventory():get_stack("stonecutter_input", 1):get_name()])) +end + +---Change the selected output item. +---@param player mt.PlayerObjectRef +---@param item_name? string The item name of the output +function set_selected_item(player, item_name) + player:get_meta():set_string("stonecutter_selected", item_name and item_name or "") +end + +minetest.register_on_joinplayer(function(player) + local inv = player:get_inventory() + + inv:set_size("stonecutter_input", 1) + inv:set_size("stonecutter_output", 1) + + set_selected_item(player, nil) + + --The player might have items remaining in the slots from the previous join; this is likely + --when the server has been shutdown and the server didn't clean up the player inventories. + mcl_util.move_player_list(player, "stonecutter_input") + mcl_util.move_player_list(player, "stonecutter_output") +end) + +minetest.register_on_leaveplayer(function(player) + set_selected_item(player, nil) + + mcl_util.move_player_list(player, "stonecutter_input") + mcl_util.move_player_list(player, "stonecutter_output") +end) + +---Update content of the stonecutter output slot with the input slot and the selected item +---@param player mt.PlayerObjectRef +function update_stonecutter_slots(player) + local meta = player:get_meta() + local inv = player:get_inventory() + + local input = inv:get_stack("stonecutter_input", 1) + local recipes = mcl_stonecutter.registered_recipes[input:get_name()] + local output_item = meta:get_string("stonecutter_selected") if recipes then - meta:set_string("formspec", show_stonecutter_formspec(recipes)) - if str then - local recipe = recipes[str] - if not recipe then return end - local cut_item = ItemStack(str) - cut_item:set_count(recipe) - inv:set_stack("output", 1, cut_item) + if output_item then + local recipe = recipes[output_item] + if recipe then + local cut_item = ItemStack(output_item) + cut_item:set_count(recipe) + inv:set_stack("stonecutter_output", 1, cut_item) + else + inv:set_stack("stonecutter_output", 1, nil) + end else - inv:set_stack("output", 1, "") + inv:set_stack("stonecutter_output", 1, nil) end else - meta:set_string("formspec", show_stonecutter_formspec(nil)) - inv:set_stack("output", 1, "") + inv:set_stack("stonecutter_output", 1, nil) + end + + mcl_stonecutter.show_stonecutter_form(player) +end + +--Drop items in slots and reset selected item on closing +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= formspec_name then return end + + if fields.quit then + mcl_util.move_player_list(player, "stonecutter_input") + mcl_util.move_player_list(player, "stonecutter_output") + return + end + + for field_name, value in pairs(fields) do + if field_name ~= "scroll" then + local itemname = fieldname_to_itemname(field_name) + player:get_meta():set_string("stonecutter_selected", itemname) + set_selected_item(player, itemname) + update_stonecutter_slots(player) + mcl_stonecutter.show_stonecutter_form(player) + break + end + end +end) + + +minetest.register_allow_player_inventory_action(function(player, action, inventory, inventory_info) + if action == "move" then + if inventory_info.to_list == "stonecutter_output" then + return 0 + end + + if inventory_info.from_list == "stonecutter_output" and inventory_info.to_list == "stonecutter_input" then + if inventory:get_stack(inventory_info.to_list, inventory_info.to_index):is_empty() then + return inventory_info.count + else + return 0 + end + end + elseif action == "put" then + if inventory_info.to_list == "stonecutter_output" then + return 0 + end + end +end) + +function remove_from_input(player, inventory) + local meta = player:get_meta() + local selected = meta:get_string("stonecutter_selected") + local istack = inventory:get_stack("stonecutter_input", 1) + + -- selected should normally never be nil, but just in case + if selected then + istack:set_count(math.max(0, istack:get_count() - 1)) + inventory:set_stack("stonecutter_input", 1, istack) end end --- Only drop the items that were in the input slot -local function drop_stonecutter_items(pos, meta) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i=1, inv:get_size("input") do - local stack = inv:get_stack("input", i) - if not stack:is_empty() then - local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5} - minetest.add_item(p, stack) --- inv:set_stack("input", i, ItemStack()) +minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info) + if action == "move" then + if inventory_info.to_list == "stonecutter_input" or inventory_info.from_list == "stonecutter_input" then + update_stonecutter_slots(player) + return + elseif inventory_info.from_list == "stonecutter_output" then + remove_from_input(player, inventory) + update_stonecutter_slots(player) + end + elseif action == "put" then + if inventory_info.listname == "stonecutter_input" or inventory_info.listname == "stonecutter_input" then + update_stonecutter_slots(player) + end + elseif action == "take" then + if inventory_info.listname == "stonecutter_output" then + remove_from_input(player, inventory) + update_stonecutter_slots(player) end end -end +end) minetest.register_node("mcl_stonecutter:stonecutter", { description = S("Stone Cutter"), @@ -134,134 +315,43 @@ minetest.register_node("mcl_stonecutter:stonecutter", { "mcl_stonecutter_bottom.png", "mcl_stonecutter_side.png", "mcl_stonecutter_side.png", - {name="mcl_stonecutter_saw.png", - animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, - length=1 - }}, - {name="mcl_stonecutter_saw.png", - animation={ - type="vertical_frames", - aspect_w=16, - aspect_h=16, - length=1 - }} + { + name = "mcl_stonecutter_saw.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1 + } + }, + { + name = "mcl_stonecutter_saw.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1 + } + } }, use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = { pickaxey=1, material_stone=1 }, + groups = { pickaxey = 1, material_stone = 1 }, node_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5}, -- NodeBox1 - {-0.4375, 0.0625, 0, 0.4375, 0.5, 0}, -- NodeBox2 + { -0.5, -0.5, -0.5, 0.5, 0.0625, 0.5 }, -- NodeBox1 + { -0.4375, 0.0625, 0, 0.4375, 0.5, 0 }, -- NodeBox2 } }, _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, sounds = mcl_sounds.node_sound_stone_defaults(), - on_destruct = drop_stonecutter_items, - allow_metadata_inventory_take = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - else - return stack:get_count() - end - end, - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - elseif to_list == "output" then - return 0 - elseif from_list == "output" and to_list == "input" then - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - if inv:get_stack(to_list, to_index):is_empty() then - return count - else - return 0 - end - else - return count - end - end, - on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - if from_list == "output" and to_list == "input" then - local inv = meta:get_inventory() - for i=1, inv:get_size("input") do - if i ~= to_index then - local istack = inv:get_stack("input", i) - istack:set_count(math.max(0, istack:get_count() - count)) - inv:set_stack("input", i, istack) - end - end - end - update_stonecutter_slots(pos) - end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 - elseif listname == "output" then - return 0 - else - return stack:get_count() - end - end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) - update_stonecutter_slots(pos) - end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) - local meta = minetest.get_meta(pos) - if listname == "output" then - local inv = meta:get_inventory() - local input = inv:get_stack("input", 1) - input:take_item() - inv:set_stack("input", 1, input) - if input:get_count() == 0 then - meta:set_string("cut_stone", nil) - end - else - meta:set_string("cut_stone", nil) - end - update_stonecutter_slots(pos) - end, - on_construct = function(pos) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("input", 1) - inv:set_size("output", 1) - local form = show_stonecutter_formspec() - meta:set_string("formspec", form) - end, on_rightclick = function(pos, node, player, itemstack) if not player:get_player_control().sneak then - update_stonecutter_slots(pos) - end - end, - on_receive_fields = function(pos, formname, fields, sender) - local sender_name = sender:get_player_name() - if minetest.is_protected(pos, sender_name) then - minetest.record_protection_violation(pos, sender_name) - return - end - if fields then - for field_name, value in pairs(fields) do - local item_name = tostring(field_name) - if item_name then - update_stonecutter_slots(pos, item_name) - end - end + mcl_stonecutter.show_stonecutter_form(player) end end, }) diff --git a/mods/ITEMS/mcl_stonecutter/mod.conf b/mods/ITEMS/mcl_stonecutter/mod.conf index d9781e474..cc36848e5 100644 --- a/mods/ITEMS/mcl_stonecutter/mod.conf +++ b/mods/ITEMS/mcl_stonecutter/mod.conf @@ -1,4 +1,4 @@ name = mcl_stonecutter author = PrairieWind description = This mod adds a stonecutter, which is used to cut stone like materials, and used as the jobsite for the Stone Mason Villager. -depends = mcl_sounds +depends = mcl_sounds, mcl_util From e324a1a74b30a771ffefdb13399629bd42450dc0 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 22 Nov 2023 09:11:50 +0100 Subject: [PATCH 30/36] Make inventory use the util functions --- mods/HUD/mcl_inventory/init.lua | 68 +++++---------------------------- 1 file changed, 9 insertions(+), 59 deletions(-) diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index cf484101c..c2555581c 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -3,56 +3,6 @@ mcl_inventory = {} dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/creative.lua") dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/survival.lua") ---local mod_player = minetest.get_modpath("mcl_player") ---local mod_craftguide = minetest.get_modpath("mcl_craftguide") - ----Returns a single itemstack in the given inventory to the main inventory, or drop it when there's no space left. ----@param itemstack mt.ItemStack ----@param dropper mt.ObjectRef ----@param pos mt.Vector ----@param inv mt.InvRef -local function return_item(itemstack, dropper, pos, inv) - if dropper:is_player() then - -- Return to main inventory - if inv:room_for_item("main", itemstack) then - inv:add_item("main", itemstack) - else - -- Drop item on the ground - local v = dropper:get_look_dir() - local p = vector.offset(pos, 0, 1.2, 0) - p.x = p.x + (math.random(1, 3) * 0.2) - p.z = p.z + (math.random(1, 3) * 0.2) - local obj = minetest.add_item(p, itemstack) - if obj then - v.x = v.x * 4 - v.y = v.y * 4 + 2 - v.z = v.z * 4 - obj:set_velocity(v) - obj:get_luaentity()._insta_collect = false - end - end - else - -- Fallback for unexpected cases - minetest.add_item(pos, itemstack) - end - return itemstack -end - ----Return items in the given inventory list (name) to the main inventory, or drop them if there is no space left. ----@param player mt.PlayerObjectRef ----@param name string -local function return_fields(player, name) - local inv = player:get_inventory() - - local list = inv:get_list(name) - if not list then return end - for i, stack in ipairs(list) do - return_item(stack, player, player:get_pos(), inv) - stack:clear() - inv:set_stack(name, i, stack) - end -end - ---@param player mt.PlayerObjectRef ---@param armor_change_only? boolean local function set_inventory(player, armor_change_only) @@ -72,9 +22,9 @@ end -- Drop items in craft grid and reset inventory on closing minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.quit then - return_fields(player, "craft") - return_fields(player, "enchanting_lapis") - return_fields(player, "enchanting_item") + mcl_util.move_player_list(player, "craft") + mcl_util.move_player_list(player, "enchanting_lapis") + mcl_util.move_player_list(player, "enchanting_item") if not minetest.is_creative_enabled(player:get_player_name()) and (formname == "" or formname == "main") then set_inventory(player) end @@ -88,9 +38,9 @@ end -- Drop crafting grid items on leaving minetest.register_on_leaveplayer(function(player) - return_fields(player, "craft") - return_fields(player, "enchanting_lapis") - return_fields(player, "enchanting_item") + mcl_util.move_player_list(player, "craft") + mcl_util.move_player_list(player, "enchanting_lapis") + mcl_util.move_player_list(player, "enchanting_item") end) minetest.register_on_joinplayer(function(player) @@ -116,9 +66,9 @@ minetest.register_on_joinplayer(function(player) items remaining in the crafting grid from the previous join; this is likely when the server has been shutdown and the server didn't clean up the player inventories. ]] - return_fields(player, "craft") - return_fields(player, "enchanting_item") - return_fields(player, "enchanting_lapis") + mcl_util.move_player_list(player, "craft") + mcl_util.move_player_list(player, "enchanting_lapis") + mcl_util.move_player_list(player, "enchanting_item") end) ---@param player mt.PlayerObjectRef From af2f58248f26aabeb7ae5afa3e6a5ea488822cc7 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Thu, 23 Nov 2023 03:14:22 +0100 Subject: [PATCH 31/36] Added the ability to stonecut up to full stack --- mods/ITEMS/mcl_stonecutter/init.lua | 44 +++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 26ec0d419..02dc02925 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -92,6 +92,20 @@ local function fieldname_to_itemname(fieldname) return string.gsub(fieldname, "__", ":") end +-- Get the player configured stack size when taking items from creative inventory +---@param player mt.PlayerObjectRef +---@return integer +local function get_stack_size(player) + return player:get_meta():get_int("mcl_stonecutter:switch_stack") +end + +-- Set the player configured stack size when taking items from creative inventory +---@param player mt.PlayerObjectRef +---@param n integer +local function set_stack_size(player, n) + player:get_meta():set_int("mcl_stonecutter:switch_stack", n) +end + ---Build the formspec for the stonecutter with given output button ---@param player mt.PlayerObjectRef ---@param items? table @@ -142,6 +156,11 @@ local function build_stonecutter_formspec(player, items) math.max(math.floor(#items / 4) + 1 - 4, 0) .. ";smallstep=1;largesteps=1]", "scrollbar[7.625,0.7;0.75,3.6;vertical;scroll;0]", + -- Switch stack size button + "image_button[9.75,0.75;1,1;mcl_stonecutter_saw.png^[verticalframe:3:1;__switch_stack;]", + "label[10.25,1.5;" .. C("#FFFFFF", tostring(get_stack_size(player))) .. "]", + "tooltip[__switch_stack;" .. S("Switch stack size") .. "]", + -- Output slot mcl_formspec.get_itemslot_bg_v4(9.75, 2, 1, 1, 0.2), "list[current_player;stonecutter_output;9.75,2;1,1;]", @@ -209,13 +228,16 @@ function update_stonecutter_slots(player) local input = inv:get_stack("stonecutter_input", 1) local recipes = mcl_stonecutter.registered_recipes[input:get_name()] local output_item = meta:get_string("stonecutter_selected") + local stack_size = meta:get_int("mcl_stonecutter:switch_stack") if recipes then if output_item then local recipe = recipes[output_item] if recipe then local cut_item = ItemStack(output_item) - cut_item:set_count(recipe) + local count = math.min(math.floor(stack_size/recipe), input:get_count()) * recipe + if count < recipe then count = recipe end + cut_item:set_count(count) inv:set_stack("stonecutter_output", 1, cut_item) else inv:set_stack("stonecutter_output", 1, nil) @@ -240,6 +262,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) return end + if fields.__switch_stack then + local switch = 1 + if get_stack_size(player) == 1 then + switch = 64 + end + set_stack_size(player, switch) + update_stonecutter_slots(player) + mcl_stonecutter.show_stonecutter_form(player) + return + end + for field_name, value in pairs(fields) do if field_name ~= "scroll" then local itemname = fieldname_to_itemname(field_name) @@ -277,10 +310,15 @@ function remove_from_input(player, inventory) local meta = player:get_meta() local selected = meta:get_string("stonecutter_selected") local istack = inventory:get_stack("stonecutter_input", 1) + local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] + local stack_size = meta:get_int("mcl_stonecutter:switch_stack") -- selected should normally never be nil, but just in case - if selected then - istack:set_count(math.max(0, istack:get_count() - 1)) + if selected and recipes then + local recipe = recipes[selected] + local count = math.floor(stack_size/recipe) + if count < 1 then count = 1 end + istack:set_count(math.max(0, istack:get_count() - count)) inventory:set_stack("stonecutter_input", 1, istack) end end From a6025b751a476e3a6b829d8eff394fddfee244a3 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Thu, 23 Nov 2023 03:42:49 +0100 Subject: [PATCH 32/36] Uneven crafts support -taking part of the resulting stack now produces well-defined results -stonecutter won't allow amount undivisible by recipe count anymore --- mods/ITEMS/mcl_stonecutter/init.lua | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 02dc02925..8e33470de 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -299,14 +299,37 @@ minetest.register_allow_player_inventory_action(function(player, action, invento return 0 end end + + if inventory_info.from_list == "stonecutter_output" then + local selected = player:get_meta():get_string("stonecutter_selected") + local istack = inventory:get_stack("stonecutter_input", 1) + local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] + if not selected or not recipes then return 0 end + local recipe = recipes[selected] + local remainder = inventory_info.count % recipe + if remainder ~= 0 then + return 0 + end + end elseif action == "put" then if inventory_info.to_list == "stonecutter_output" then return 0 end + if inventory_info.from_list == "stonecutter_output" then + local selected = player:get_meta():get_string("stonecutter_selected") + local istack = inventory:get_stack("stonecutter_input", 1) + local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] + if not selected or not recipes then return 0 end + local recipe = recipes[selected] + local remainder = inventory_info.stack:get_count() % recipe + if remainder ~= 0 then + return 0 + end + end end end) -function remove_from_input(player, inventory) +function remove_from_input(player, inventory, crafted_count) local meta = player:get_meta() local selected = meta:get_string("stonecutter_selected") local istack = inventory:get_stack("stonecutter_input", 1) @@ -316,7 +339,7 @@ function remove_from_input(player, inventory) -- selected should normally never be nil, but just in case if selected and recipes then local recipe = recipes[selected] - local count = math.floor(stack_size/recipe) + local count = crafted_count/recipe if count < 1 then count = 1 end istack:set_count(math.max(0, istack:get_count() - count)) inventory:set_stack("stonecutter_input", 1, istack) @@ -329,7 +352,7 @@ minetest.register_on_player_inventory_action(function(player, action, inventory, update_stonecutter_slots(player) return elseif inventory_info.from_list == "stonecutter_output" then - remove_from_input(player, inventory) + remove_from_input(player, inventory, inventory_info.count) update_stonecutter_slots(player) end elseif action == "put" then @@ -338,7 +361,7 @@ minetest.register_on_player_inventory_action(function(player, action, inventory, end elseif action == "take" then if inventory_info.listname == "stonecutter_output" then - remove_from_input(player, inventory) + remove_from_input(player, inventory, inventory_info.stack:get_count()) update_stonecutter_slots(player) end end From bb48e474881c152d38e652eb19f04282a9329c12 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Fri, 24 Nov 2023 01:33:32 +0100 Subject: [PATCH 33/36] Made stonecutter player metadata consistent --- mods/ITEMS/mcl_stonecutter/init.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 8e33470de..e715d8519 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -9,7 +9,8 @@ -- * stonecutter_input (1) -- * stonecutter_output (1) -- Player meta: --- * stonecutter_selected (string, wanted item name) +-- * mcl_stonecutter:selected (string, wanted item name) +-- * mcl_stonecutter:switch_stack (int, wanted craft count: 1 or 64 = once or until full stack) local S = minetest.get_translator("mcl_stonecutter") @@ -111,7 +112,7 @@ end ---@param items? table local function build_stonecutter_formspec(player, items) local meta = player:get_meta() - local selected = meta:get_string("stonecutter_selected") + local selected = meta:get_string("mcl_stonecutter:selected") items = items or {} @@ -195,7 +196,7 @@ end ---@param player mt.PlayerObjectRef ---@param item_name? string The item name of the output function set_selected_item(player, item_name) - player:get_meta():set_string("stonecutter_selected", item_name and item_name or "") + player:get_meta():set_string("mcl_stonecutter:selected", item_name and item_name or "") end minetest.register_on_joinplayer(function(player) @@ -227,7 +228,7 @@ function update_stonecutter_slots(player) local input = inv:get_stack("stonecutter_input", 1) local recipes = mcl_stonecutter.registered_recipes[input:get_name()] - local output_item = meta:get_string("stonecutter_selected") + local output_item = meta:get_string("mcl_stonecutter:selected") local stack_size = meta:get_int("mcl_stonecutter:switch_stack") if recipes then @@ -276,7 +277,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) for field_name, value in pairs(fields) do if field_name ~= "scroll" then local itemname = fieldname_to_itemname(field_name) - player:get_meta():set_string("stonecutter_selected", itemname) + player:get_meta():set_string("mcl_stonecutter:selected", itemname) set_selected_item(player, itemname) update_stonecutter_slots(player) mcl_stonecutter.show_stonecutter_form(player) @@ -301,7 +302,7 @@ minetest.register_allow_player_inventory_action(function(player, action, invento end if inventory_info.from_list == "stonecutter_output" then - local selected = player:get_meta():get_string("stonecutter_selected") + local selected = player:get_meta():get_string("mcl_stonecutter:selected") local istack = inventory:get_stack("stonecutter_input", 1) local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] if not selected or not recipes then return 0 end @@ -316,7 +317,7 @@ minetest.register_allow_player_inventory_action(function(player, action, invento return 0 end if inventory_info.from_list == "stonecutter_output" then - local selected = player:get_meta():get_string("stonecutter_selected") + local selected = player:get_meta():get_string("mcl_stonecutter:selected") local istack = inventory:get_stack("stonecutter_input", 1) local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] if not selected or not recipes then return 0 end @@ -331,7 +332,7 @@ end) function remove_from_input(player, inventory, crafted_count) local meta = player:get_meta() - local selected = meta:get_string("stonecutter_selected") + local selected = meta:get_string("mcl_stonecutter:selected") local istack = inventory:get_stack("stonecutter_input", 1) local recipes = mcl_stonecutter.registered_recipes[istack:get_name()] local stack_size = meta:get_int("mcl_stonecutter:switch_stack") From b4080b62753ae2cd07d3bee72a0a20721ccf6dd1 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sat, 25 Nov 2023 01:04:53 +0100 Subject: [PATCH 34/36] Credits update in mod.conf --- mods/ITEMS/mcl_stonecutter/mod.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_stonecutter/mod.conf b/mods/ITEMS/mcl_stonecutter/mod.conf index cc36848e5..01cf2a75f 100644 --- a/mods/ITEMS/mcl_stonecutter/mod.conf +++ b/mods/ITEMS/mcl_stonecutter/mod.conf @@ -1,4 +1,4 @@ name = mcl_stonecutter -author = PrairieWind +author = PrairieWind, ChrisPHP, cora, Herowl, AFCMS description = This mod adds a stonecutter, which is used to cut stone like materials, and used as the jobsite for the Stone Mason Villager. depends = mcl_sounds, mcl_util From f1c5f0ca1c6b2862acb394ad4672f37f1f7f1e75 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 26 Nov 2023 00:39:55 +0100 Subject: [PATCH 35/36] Fixed duplication bug --- mods/ITEMS/mcl_stonecutter/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index e715d8519..5605db659 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -210,14 +210,14 @@ minetest.register_on_joinplayer(function(player) --The player might have items remaining in the slots from the previous join; this is likely --when the server has been shutdown and the server didn't clean up the player inventories. mcl_util.move_player_list(player, "stonecutter_input") - mcl_util.move_player_list(player, "stonecutter_output") + player:get_inventory():set_list("stonecutter_output", {}) end) minetest.register_on_leaveplayer(function(player) set_selected_item(player, nil) mcl_util.move_player_list(player, "stonecutter_input") - mcl_util.move_player_list(player, "stonecutter_output") + player:get_inventory():set_list("stonecutter_output", {}) end) ---Update content of the stonecutter output slot with the input slot and the selected item @@ -259,7 +259,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.quit then mcl_util.move_player_list(player, "stonecutter_input") - mcl_util.move_player_list(player, "stonecutter_output") + player:get_inventory():set_list("stonecutter_output", {}) return end From 8fd988da113e1196e189d8cead805f8ff4faccc1 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 26 Nov 2023 00:47:02 +0100 Subject: [PATCH 36/36] Increased cut copper recipe output --- mods/ITEMS/mcl_copper/crafting.lua | 4 ++-- mods/ITEMS/mcl_stonecutter/init.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_copper/crafting.lua b/mods/ITEMS/mcl_copper/crafting.lua index 6754534db..f4af0eee3 100644 --- a/mods/ITEMS/mcl_copper/crafting.lua +++ b/mods/ITEMS/mcl_copper/crafting.lua @@ -61,8 +61,8 @@ end local cuttable_blocks = { "block", "waxed_block", "block_exposed", "waxed_block_exposed", "block_weathered", "waxed_block_weathered", "block_oxidized", "waxed_block_oxidized" } -for _, w in ipairs(cuttable_blocks) do - mcl_stonecutter.register_recipe("mcl_copper:"..w, "mcl_copper:"..w.."_cut") +for _, c in ipairs(cuttable_blocks) do + mcl_stonecutter.register_recipe("mcl_copper:"..c, "mcl_copper:"..c.."_cut", 4) end minetest.register_craft({ diff --git a/mods/ITEMS/mcl_stonecutter/init.lua b/mods/ITEMS/mcl_stonecutter/init.lua index 5605db659..5edf424da 100644 --- a/mods/ITEMS/mcl_stonecutter/init.lua +++ b/mods/ITEMS/mcl_stonecutter/init.lua @@ -66,7 +66,7 @@ function mcl_stonecutter.register_recipe(input, output, count) local fallthrough = mcl_stonecutter.registered_recipes[output] if fallthrough then for o, c in pairs(fallthrough) do - mcl_stonecutter.register_recipe(input, o, c) + mcl_stonecutter.register_recipe(input, o, c * count) end end