From b9cf10bd3da4e87a2c93b04d015668dddece1c07 Mon Sep 17 00:00:00 2001 From: Evert Date: Wed, 4 Apr 2018 18:31:12 +0300 Subject: [PATCH] Fix casting, change iron to steel --- README.md | 2 +- metal_melter/caster.lua | 7 ++++--- tinkering/materials.lua | 4 ++-- tinkering/register.lua | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6b0bfb0..831baa4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository is technically a modpack, in which all mods need to be enabled. ### fluidity ![](fluidity/screenshot.png) -Fluidity adds molten metals to the game. Supports metals from [default](https://github.com/minetest/minetest_game), [technic](https://github.com/minetest-mods/technic) and [moreores](https://github.com/minetest-mods/technic). +Fluidity adds molten metals to the game. Supports metals from [default](https://github.com/minetest/minetest_game), [technic](https://github.com/minetest-mods/technic) and [moreores](https://github.com/minetest-mods/moreores). ### metal_melter ![](metal_melter/screenshot.png) diff --git a/metal_melter/caster.lua b/metal_melter/caster.lua index 4bfd5d9..3940e56 100644 --- a/metal_melter/caster.lua +++ b/metal_melter/caster.lua @@ -203,7 +203,7 @@ end -- Get the corresponding cast for an item local function get_cast_for(item) - local typename, castname = item:match(":([%a_]+)_(%a+)$") + local typename, castname = item:match("(%a+)_([%a_]+)$") if not typename or not castname then return nil end @@ -312,14 +312,15 @@ local function caster_node_timer(pos, elapsed) end end end - elseif castname:find("_ingot") or castname:find("_crystal") or castname:find("_lump") and metal_type == "gold" then + else -- Create a new cast local result_cost = metal_caster.spec.cast local coolant_cost = result_cost / 4 if metal_count >= result_cost and coolant_count >= coolant_cost then local mtype, ctype = get_cast_for(castname) if mtype then - local stack = ItemStack("metal_melter:"..ctype) + local cmod = metal_caster.casts[ctype].mod or "metal_melter" + local stack = ItemStack(cmod..":"..ctype) local output_stack = inv:get_stack("output", 1) local cast_stack = inv:get_stack("cast", 1) if output_stack:item_fits(stack) then diff --git a/tinkering/materials.lua b/tinkering/materials.lua index bda000f..f977803 100644 --- a/tinkering/materials.lua +++ b/tinkering/materials.lua @@ -30,7 +30,7 @@ local modifiers = { {name = "stonebound", description = "Stonebound"} } }, - iron = { + steel = { cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2}, crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, snappy = {times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, @@ -240,7 +240,7 @@ tinkering.materials = { obsidian = {name = "Obsidian", default = "default:obsidian", color = "#2C384E", base = "node", cast = true, modifier = modifiers.obsidian}, -- Metals - iron = {name = "Iron", default = "default:steel_ingot", color = "#FFF", base = "ingot", cast = true, modifier = modifiers.iron}, + steel = {name = "Steel", default = "default:steel_ingot", color = "#FFF", base = "ingot", cast = true, modifier = modifiers.steel}, copper = {name = "Copper", default = "default:copper_ingot", color = "#E87945", base = "ingot", cast = true, modifier = modifiers.copper}, tin = {name = "Tin", default = "default:tin_ingot", color = "#C1C1C1", base = "ingot", cast = true, modifier = modifiers.tin}, gold = {name = "Gold", default = "default:gold_ingot", color = "#FFFF54", base = "ingot", cast = true, modifier = modifiers.gold}, diff --git a/tinkering/register.lua b/tinkering/register.lua index 4dde796..f35194f 100644 --- a/tinkering/register.lua +++ b/tinkering/register.lua @@ -365,7 +365,8 @@ for i,v in pairs(components) do name = v.description:sub(4).." Cast", mod = "tinkering", result = "%s:%s_"..i, - cost = metal_caster.spec.cast + cost = metal_caster.spec.cast, + typenames = {i} }) end