Vanessa Dannenberg
2018-10-31 44cb8df048e09b64214f59db73a3fd23cfe12e77
technic_worldgen/crafts.lua
@@ -1,22 +1,26 @@
local S = technic.worldgen.gettext
minetest.register_craftitem(":technic:uranium", {
   description = S("Uranium"),
   inventory_image = "technic_uranium.png",
   on_place_on_ground = minetest.craftitem_place_item,
minetest.register_craftitem(":technic:uranium_lump", {
   description = S("Uranium Lump"),
   inventory_image = "technic_uranium_lump.png",
})
minetest.register_alias("technic:uranium", "technic:uranium_lump")
minetest.register_craftitem(":technic:uranium_ingot", {
   description = S("Uranium Ingot"),
   inventory_image = "technic_uranium_ingot.png",
   groups = {uranium_ingot=1},
})
minetest.register_craftitem(":technic:chromium_lump", {
   description = S("Chromium Lump"),
   inventory_image = "technic_chromium_lump.png",
   on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem(":technic:chromium_ingot", {
   description = S("Chromium Ingot"),
   inventory_image = "technic_chromium_ingot.png",
   on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem(":technic:zinc_lump", {
@@ -29,9 +33,19 @@
   inventory_image = "technic_zinc_ingot.png",
})
minetest.register_craftitem(":technic:brass_ingot", {
   description = S("Brass Ingot"),
   inventory_image = "technic_brass_ingot.png",
minetest.register_craftitem(":technic:lead_lump", {
   description = S("Lead Lump"),
   inventory_image = "technic_lead_lump.png",
})
minetest.register_craftitem(":technic:lead_ingot", {
   description = S("Lead Ingot"),
   inventory_image = "technic_lead_ingot.png",
})
minetest.register_craftitem(":technic:sulfur_lump", {
   description = S("Sulfur Lump"),
   inventory_image = "technic_sulfur_lump.png",
})
minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot")
@@ -74,10 +88,10 @@
   })
end
register_block("technic:uranium_block", "technic:uranium")
register_block("technic:uranium_block", "technic:uranium_ingot")
register_block("technic:chromium_block", "technic:chromium_ingot")
register_block("technic:zinc_block", "technic:zinc_ingot")
register_block("technic:brass_block", "technic:brass_ingot")
register_block("technic:lead_block", "technic:lead_ingot")
register_block("technic:cast_iron_block", "technic:cast_iron_ingot")
register_block("technic:carbon_steel_block", "technic:carbon_steel_ingot")
register_block("technic:stainless_steel_block", "technic:stainless_steel_ingot")
@@ -93,6 +107,19 @@
   recipe = "technic:chromium_lump",
   output = "technic:chromium_ingot",
})
minetest.register_craft({
   type = 'cooking',
   recipe = "technic:uranium_lump",
   output = "technic:uranium_ingot",
})
minetest.register_craft({
   type = 'cooking',
   recipe = "technic:lead_lump",
   output = "technic:lead_ingot",
})
minetest.register_craft({
   type = 'cooking',
@@ -114,7 +141,7 @@
   output = "technic:wrought_iron_ingot",
})
local function for_each_registered_craftitem(action)
local function for_each_registered_item(action)
   local already_reg = {}
   for k, _ in pairs(minetest.registered_items) do
      table.insert(already_reg, k)
@@ -122,6 +149,16 @@
   local really_register_craftitem = minetest.register_craftitem
   minetest.register_craftitem = function(name, def)
      really_register_craftitem(name, def)
      action(string.gsub(name, "^:", ""))
   end
   local really_register_tool = minetest.register_tool
   minetest.register_tool = function(name, def)
      really_register_tool(name, def)
      action(string.gsub(name, "^:", ""))
   end
   local really_register_node = minetest.register_node
   minetest.register_node = function(name, def)
      really_register_node(name, def)
      action(string.gsub(name, "^:", ""))
   end
   for _, name in ipairs(already_reg) do
@@ -137,6 +174,9 @@
   "default:sword_steel",
   "doors:door_steel",
   "farming:hoe_steel",
   "glooptest:hammer_steel",
   "glooptest:handsaw_steel",
   "glooptest:reinforced_crystal_glass",
   "mesecons_doors:op_door_steel",
   "mesecons_doors:sig_door_steel",
   "vessels:steel_bottle",
@@ -144,7 +184,7 @@
   steel_to_iron[i] = true
end
for_each_registered_craftitem(function(item_name)
for_each_registered_item(function(item_name)
   local item_def = minetest.registered_items[item_name]
   if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then
      minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) })