Vanessa Dannenberg
2018-10-31 44cb8df048e09b64214f59db73a3fd23cfe12e77
technic/tools/chainsaw.lua
@@ -9,15 +9,19 @@
-- The default trees
local timber_nodenames = {
   ["default:jungletree"] = true,
   ["default:papyrus"]    = true,
   ["default:cactus"]     = true,
   ["default:tree"]       = true,
   ["default:apple"]      = true,
   ["default:pinetree"]   = true,
   ["default:acacia_tree"] = true,
   ["default:aspen_tree"]  = true,
   ["default:jungletree"]  = true,
   ["default:papyrus"]     = true,
   ["default:cactus"]      = true,
   ["default:tree"]        = true,
   ["default:apple"]       = true,
   ["default:pine_tree"]    = true,
}
if chainsaw_leaves then
   timber_nodenames["default:acacia_leaves"] = true
   timber_nodenames["default:aspen_leaves"] = true
   timber_nodenames["default:leaves"] = true
   timber_nodenames["default:jungleleaves"] = true
   timber_nodenames["default:pine_needles"] = true
@@ -344,9 +348,10 @@
      -- Send current charge to digging function so that the
      -- chainsaw will stop after digging a number of nodes
      meta.charge = chainsaw_dig(pointed_thing.under, meta.charge)
      technic.set_RE_wear(itemstack, meta.charge, chainsaw_max_charge)
      itemstack:set_metadata(minetest.serialize(meta))
      if not technic.creative_mode then
         technic.set_RE_wear(itemstack, meta.charge, chainsaw_max_charge)
         itemstack:set_metadata(minetest.serialize(meta))
      end
      return itemstack
   end,
})
@@ -358,8 +363,10 @@
   output = "technic:chainsaw",
   recipe = {
      {"technic:stainless_steel_ingot", trigger,                      "technic:battery"},
      {"technic:fine_copper_wire",      "technic:motor",              "technic:battery"},
      {"basic_materials:copper_wire",      "basic_materials:motor",              "technic:battery"},
      {"",                              "",                           "technic:stainless_steel_ingot"},
   }
   },
   replacements = { {"basic_materials:copper_wire", "basic_materials:empty_spool"}, },
})