From b857aed8ad03e8fec3ccfbcc65935a8bde660392 Mon Sep 17 00:00:00 2001 From: h-v-smacker Date: Fri, 6 Apr 2018 04:18:52 +0300 Subject: cottonseed oil --- extranodes/init.lua | 50 ++++++++++++++++++++++++ extranodes/textures/technic_cottonseed_oil.png | Bin 0 -> 363 bytes technic/machines/register/extractor_recipes.lua | 6 +++ 3 files changed, 56 insertions(+) create mode 100644 extranodes/textures/technic_cottonseed_oil.png diff --git a/extranodes/init.lua b/extranodes/init.lua index 0ae99c8..8ef074d 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -206,5 +206,55 @@ minetest.register_craft({ recipe = "technic:graphite" }) +-- Cotton seed oil: fuel and fertilizer + +if minetest.get_modpath("farming") then + if minetest.get_modpath("bonemeal") then + minetest.register_craftitem(":technic:cottonseed_oil", { + description = S("Cottonseed Oil"), + inventory_image = "technic_cottonseed_oil.png", + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then + return + end + if minetest.is_protected(pointed_thing.under, user:get_player_name()) then + return + end + if not is_creative(user:get_player_name()) then + itemstack:take_item() + end + bonemeal:on_use(pointed_thing.under, 4) + return itemstack + end, + }) + else + minetest.register_craftitem(":technic:cottonseed_oil", { + description = S("Cottonseed Oil"), + inventory_image = "technic_cottonseed_oil.png", + }) + end + + minetest.register_craft({ + type = "fuel", + recipe = "technic:cottonseed_oil", + burntime = 20, + }) + +end + + +-- -- Additional recipe for straw blocks out of straw mat from cottages (if present) +-- -- not to let the centifuge output go to waste, since farming:straw can be used with a saw... +-- +-- if minetest.get_modpath("cottages") and minetest.get_modpath("farming") then +-- minetest.register_craft({ +-- output = "farming:straw 2", +-- recipe = { +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- { "cottages:straw_mat", "cottages:straw_mat", "cottages:straw_mat" }, +-- } +-- }) +-- end diff --git a/extranodes/textures/technic_cottonseed_oil.png b/extranodes/textures/technic_cottonseed_oil.png new file mode 100644 index 0000000..be4550e Binary files /dev/null and b/extranodes/textures/technic_cottonseed_oil.png differ diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index d957787..c05f049 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -33,6 +33,12 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"ethereal:willow_twig 12", "technic:aspirin_pill"}) end + if minetest.get_modpath("farming") then + -- cottonseed oil: a fuel and a potent fertilizer (irl: pesticide) + -- hemp oil calls for 8 seeds, but extractor recipes are normally twice as potent + table.insert(dye_recipes, {"farming:seed_cotton 4", "technic:cottonseed_oil"}) + end + for _, data in ipairs(dye_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) end -- cgit v1.2.3