summaryrefslogtreecommitdiff
path: root/extranodes/cottonseed_oil.lua
diff options
context:
space:
mode:
authorh-v-smacker <hans-von-smacker+github@gmail.com>2018-10-25 12:31:10 +0300
committerh-v-smacker <hans-von-smacker+github@gmail.com>2018-10-25 12:31:10 +0300
commita707a4526f52a75bacc9df8a9391afaede6ed145 (patch)
tree0382b80a5f4df93245f16bfcfb26b303a73aa8d3 /extranodes/cottonseed_oil.lua
parent5ab3fa092c1c2b5460e9853e5577c0237958e2c2 (diff)
extranodes cleanup
Diffstat (limited to 'extranodes/cottonseed_oil.lua')
-rw-r--r--extranodes/cottonseed_oil.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/extranodes/cottonseed_oil.lua b/extranodes/cottonseed_oil.lua
new file mode 100644
index 0000000..25c0f9a
--- /dev/null
+++ b/extranodes/cottonseed_oil.lua
@@ -0,0 +1,37 @@
+local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
+
+-- 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