From 05bb4303b8ef11a5105b74b67d64afd0aa07a073 Mon Sep 17 00:00:00 2001 From: Handful of Frogs Date: Fri, 10 May 2024 11:29:04 +0300 Subject: [PATCH 1/4] fix: iron furnace was unbreakable --- machines/iron_furnace.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/machines/iron_furnace.lua b/machines/iron_furnace.lua index 1acdd17..d07c29b 100644 --- a/machines/iron_furnace.lua +++ b/machines/iron_furnace.lua @@ -293,6 +293,7 @@ if industrialtest.mtgAvailable then return not (inv:get_list("src")[1]:get_count()>0 or inv:get_list("fuel")[1]:get_count()>0 or inv:get_list("dst")[1]:get_count()>0) end elseif industrialtest.mclAvailable then + definition.groups={pickaxey=1} definition.after_dig_node=function(pos,oldnode,oldmeta) industrialtest.internal.mclAfterDigNode(pos,oldmeta,{"src","fuel","dst"}) end From 9c0668b996d40c942fcec4bb69e349d2cdc5557a Mon Sep 17 00:00:00 2001 From: Handful of Frogs Date: Fri, 10 May 2024 11:29:04 +0300 Subject: [PATCH 2/4] feat: mcl hopper compat for common machines --- machines/common.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/machines/common.lua b/machines/common.lua index 23df385..17e2d5a 100644 --- a/machines/common.lua +++ b/machines/common.lua @@ -357,9 +357,29 @@ function industrialtest.internal.registerMachine(config) if config.sounds=="metal" then definition.sounds=mcl_sounds.node_sound_metal_defaults() end - definition.groups={pickaxey=1} + definition.groups={ + pickaxey=1, + container=2 + } definition._mcl_blast_resistance=3.5 definition._mcl_hardness=3.9 + definition._mcl_hoppers_on_try_pull=function(pos, hop_pos, hop_inv, hop_list) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack("dst", 1) + if not stack:is_empty() and hop_inv:room_for_item(hop_list, stack) then + return inv, "dst", 1 + end + return nil, nil, nil + end + definition._mcl_hoppers_on_try_push=function(pos, hop_pos, hop_inv, hop_list) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + return inv, "src", mcl_util.select_stack(hop_inv, hop_list, inv, "src") + end + definition._mcl_hoppers_on_after_push=function(pos) + minetest.get_node_timer(pos):start(1.0) + end end definition.groups._industrialtest_wrenchUnmountable=1 if config.requiresWrench then From d12529ab2fd85a4d0a20c0dec249a947d9bcdffd Mon Sep 17 00:00:00 2001 From: Handful of Frogs Date: Fri, 10 May 2024 11:56:28 +0300 Subject: [PATCH 3/4] feat: iron furnace hopper compat --- machines/iron_furnace.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/machines/iron_furnace.lua b/machines/iron_furnace.lua index d07c29b..bf9c564 100644 --- a/machines/iron_furnace.lua +++ b/machines/iron_furnace.lua @@ -293,13 +293,21 @@ if industrialtest.mtgAvailable then return not (inv:get_list("src")[1]:get_count()>0 or inv:get_list("fuel")[1]:get_count()>0 or inv:get_list("dst")[1]:get_count()>0) end elseif industrialtest.mclAvailable then - definition.groups={pickaxey=1} + definition.groups={ + pickaxey=1, + container=2 + } definition.after_dig_node=function(pos,oldnode,oldmeta) industrialtest.internal.mclAfterDigNode(pos,oldmeta,{"src","fuel","dst"}) end definition.sounds=mcl_sounds.node_sound_metal_defaults() definition._mcl_blast_resistance=3 definition._mcl_hardness=3.5 + definition._mcl_hoppers_on_try_pull = mcl_furnaces.hoppers_on_try_pull + definition._mcl_hoppers_on_try_push = mcl_furnaces.hoppers_on_try_push + definition._mcl_hoppers_on_after_push = function(pos) + minetest.get_node_timer(pos):start(1.0) + end end minetest.register_node("industrialtest:iron_furnace",definition) definition=table.copy(definition) @@ -318,7 +326,9 @@ definition.drop="industrialtest:iron_furnace" definition.on_timer=ironFurnace.activeOnTimer if industrialtest.mclAvailable then definition.groups={ - not_in_creative_inventory=1 + not_in_creative_inventory=1, + pickaxey=1, + container=2 } definition._doc_items_create_entry=false end From 2d4fa3b68b9538c818eac0d52ff1c52dec41d33b Mon Sep 17 00:00:00 2001 From: Handful of Frogs Date: Fri, 10 May 2024 15:52:30 +0300 Subject: [PATCH 4/4] fix: use industrialtest.updateDelay --- machines/common.lua | 2 +- machines/iron_furnace.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/machines/common.lua b/machines/common.lua index 17e2d5a..4102de2 100644 --- a/machines/common.lua +++ b/machines/common.lua @@ -378,7 +378,7 @@ function industrialtest.internal.registerMachine(config) return inv, "src", mcl_util.select_stack(hop_inv, hop_list, inv, "src") end definition._mcl_hoppers_on_after_push=function(pos) - minetest.get_node_timer(pos):start(1.0) + minetest.get_node_timer(pos):start(industrialtest.updateDelay) end end definition.groups._industrialtest_wrenchUnmountable=1 diff --git a/machines/iron_furnace.lua b/machines/iron_furnace.lua index bf9c564..2676300 100644 --- a/machines/iron_furnace.lua +++ b/machines/iron_furnace.lua @@ -306,7 +306,7 @@ elseif industrialtest.mclAvailable then definition._mcl_hoppers_on_try_pull = mcl_furnaces.hoppers_on_try_pull definition._mcl_hoppers_on_try_push = mcl_furnaces.hoppers_on_try_push definition._mcl_hoppers_on_after_push = function(pos) - minetest.get_node_timer(pos):start(1.0) + minetest.get_node_timer(pos):start(industrialtest.updateDelay) end end minetest.register_node("industrialtest:iron_furnace",definition)