diff --git a/README.md b/README.md index 7bdbdef..88c2599 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ An in-development mod for [Minetest](http://minetest.net) 0.5.0+ that adds molte Just do `git clone https://gitlab.icynet.eu/evert/melterns.git` in your `minetest/mods` directory. You can also [download the repository](https://gitlab.icynet.eu/evert/melterns/archive/master.zip) but in that case you **must** change the folder name from `melterns-master` to `melterns`! ## Documentation -Documentation on how to use this mod can be found on [this wiki page](https://gitlab.icynet.eu/evert/melterns/wiki). I recommend using a mod that shows you crafting recipes in order to know how to craft the nodes. +Documentation on how to use this mod can be found on [this wiki page](https://gitlab.icynet.eu/evert/melterns/wikis/home). I recommend using a mod that shows you crafting recipes in order to know how to craft the nodes. ## License The MIT License diff --git a/fluidity/mod.conf b/fluidity/mod.conf index 00033fd..5cd35cc 100644 --- a/fluidity/mod.conf +++ b/fluidity/mod.conf @@ -1,4 +1,3 @@ name = fluidity description = Adds Molten versions of commonly occuring metals. Supports default, technic, elepower and moreores. depends = default,fluid_lib,bucket -optional_depends = technic,moreores diff --git a/metal_melter/caster.lua b/metal_melter/caster.lua index 93fd121..0a3abb3 100644 --- a/metal_melter/caster.lua +++ b/metal_melter/caster.lua @@ -219,7 +219,7 @@ local function caster_node_timer(pos, elapsed) local metal_type = "" local dumping = meta:get_int("dump") - if dumping and dumping == 1 then + if dumping == 1 then metal.amount = 0 metal.fluid = "" refresh = true diff --git a/metal_melter/meltable.lua b/metal_melter/meltable.lua index e109592..7c6fc74 100644 --- a/metal_melter/meltable.lua +++ b/metal_melter/meltable.lua @@ -34,10 +34,6 @@ function metal_melter.auto_detect_metal_forms(metal, mod) end end -for metal,_ in pairs(fluidity.molten_metals) do - metal_melter.auto_detect_metal_forms(metal) -end - -- Manually register default blocks, for now metal_melter.register_melt("default:mese", "mese", "block") metal_melter.register_melt("default:obsidian", "obsidian", "block") @@ -48,3 +44,10 @@ metal_melter.register_melt("default:tinblock", "tin", "block") -- Special snowflake metal_melter.register_melt("default:iron_lump", "steel", "lump") + +-- Register melts after all mods have loaded +minetest.register_on_mods_loaded(function () + for metal,_ in pairs(fluidity.molten_metals) do + metal_melter.auto_detect_metal_forms(metal) + end +end) diff --git a/metal_melter/melter.lua b/metal_melter/melter.lua index 80a4366..ee0a62b 100644 --- a/metal_melter/melter.lua +++ b/metal_melter/melter.lua @@ -11,12 +11,12 @@ metal_melter.max_metal = 16000 -- How much metal is given for melting a typename (in millibuckets). metal_melter.spec = { - ingot = 144, + ingot = 144, crystal = 144, - block = 1296, - lump = 288, - cast = 288, - ore = 288 + block = 1296, + lump = 288, + cast = 288, + ore = 288, } local function in_table(t, n) @@ -163,7 +163,7 @@ local function melter_node_timer(pos, elapsed) local metal = fluid_lib.get_buffer_data(pos, "metal") local dumping = meta:get_int("dump") - if dumping and dumping == 1 then + if dumping == 1 then metal.amount = 0 metal.fluid = "" refresh = true @@ -499,6 +499,6 @@ fluid_lib.register_node("metal_melter:metal_melter") fluid_lib.register_node("metal_melter:metal_melter_filled") -- Set a spec -function metal_melter.set_spec(specname, value) +function metal_melter.register_melt_value(specname, value) metal_melter.spec[specname] = value end diff --git a/metal_melter/mod.conf b/metal_melter/mod.conf index 4795c82..276c9d1 100644 --- a/metal_melter/mod.conf +++ b/metal_melter/mod.conf @@ -1,4 +1,4 @@ name = metal_melter description = Melt and cast metals. depends = default,fluidity,bucket,fluid_tanks -optional_depends = pipeworks,elepower_dynamics +optional_depends = pipeworks diff --git a/tinkering/materials.lua b/tinkering/materials.lua index 0b678c8..a80ce0e 100644 --- a/tinkering/materials.lua +++ b/tinkering/materials.lua @@ -283,23 +283,26 @@ tinkering.modifiers = { diamond = {name = "Diamond", default = "default:diamond", modifier = modifiers.diamond} } -if minetest.get_modpath("technic") then - -- From technic - tinkering.materials["lead"] = {name = "Lead", default = "technic:lead_ingot", - color = "#C6C6C6", base = "ingot", cast = true, modifier = modifiers.lead} +-- Add mod-based materials +minetest.register_on_mods_loaded(function () + if minetest.get_modpath("technic") then + -- From technic + tinkering.materials["lead"] = {name = "Lead", default = "technic:lead_ingot", + color = "#C6C6C6", base = "ingot", cast = true, modifier = modifiers.lead} - tinkering.materials["chromium"] = {name = "Chromium", default = "technic:chromium_ingot", - color = "#DFE8E8", base = "ingot", cast = true, modifier = modifiers.chromium} + tinkering.materials["chromium"] = {name = "Chromium", default = "technic:chromium_ingot", + color = "#DFE8E8", base = "ingot", cast = true, modifier = modifiers.chromium} - tinkering.materials["zinc"] = {name = "Zinc", default = "technic:zinc_ingot", - color = "#CEE8EF", base = "ingot", cast = true, modifier = modifiers.zinc} -end + tinkering.materials["zinc"] = {name = "Zinc", default = "technic:zinc_ingot", + color = "#CEE8EF", base = "ingot", cast = true, modifier = modifiers.zinc} + end -if minetest.get_modpath("elepower_dynamics") then - -- From elepower - tinkering.materials["lead"] = {name = "Lead", default = "elepower_dynamics:lead_ingot", - color = "#C6C6C6", base = "ingot", cast = true, modifier = modifiers.lead} + if minetest.get_modpath("elepower_dynamics") then + -- From elepower + tinkering.materials["lead"] = {name = "Lead", default = "elepower_dynamics:lead_ingot", + color = "#C6C6C6", base = "ingot", cast = true, modifier = modifiers.lead} - tinkering.materials["zinc"] = {name = "Zinc", default = "elepower_dynamics:zinc_ingot", - color = "#CEE8EF", base = "ingot", cast = true, modifier = modifiers.zinc} -end + tinkering.materials["zinc"] = {name = "Zinc", default = "elepower_dynamics:zinc_ingot", + color = "#CEE8EF", base = "ingot", cast = true, modifier = modifiers.zinc} + end +end) diff --git a/tinkering/mod.conf b/tinkering/mod.conf index c02c317..69e7d49 100644 --- a/tinkering/mod.conf +++ b/tinkering/mod.conf @@ -1,4 +1,4 @@ name = tinkering description = Combine materials to create tools depends = metal_melter -optional_depends = unified_inventory,technic,moreores +optional_depends = unified_inventory diff --git a/tinkering/tool.lua b/tinkering/tool.lua index 2280570..760c80b 100644 --- a/tinkering/tool.lua +++ b/tinkering/tool.lua @@ -74,7 +74,7 @@ tinkering.components = { function tinkering.create_material_component(data) local desc = data.description local name = data.name - local mod = data.mod_name + local mod = data.mod_name or minetest.get_current_modname() local groups = {tinker_component = 1} groups["tc_"..data.component] = 1 @@ -107,6 +107,10 @@ end --} -- function tinkering.register_tool_type(name, data) + if not data.mod then + data.mod = minetest.get_current_modname() + end + tinkering.tools[name] = data end @@ -388,7 +392,7 @@ function tinkering.register_component(name, data) local comp_desc = data.description:sub(4) -- Register cast - metal_melter.set_spec(name, metal_caster.spec.cast) + metal_melter.register_melt_value(name, metal_caster.spec.cast) metal_caster.register_cast(name, { description = comp_desc, mod_name = mod,