From cbb519ad0d2a5f45175bae1a610face58646dcf3 Mon Sep 17 00:00:00 2001 From: cale Date: Tue, 2 Feb 2016 13:04:43 +0100 Subject: [PATCH] updated farming mod --- mods/farming/init.lua | 50 ++++++++++++++++++++ mods/farming/init.lua~ | 50 ++++++++++++++++++++ mods/farming/textures/farming_cookie.png | Bin 0 -> 416 bytes mods/farming/textures/farming_sugarcane.png | Bin 0 -> 407 bytes mods/quests/init.lua | 6 +++ mods/quests/init.lua~ | 8 +++- 6 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 mods/farming/textures/farming_cookie.png create mode 100644 mods/farming/textures/farming_sugarcane.png diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 87b7be4..8999660 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -48,6 +48,7 @@ farming.register_plant("wheat", 5, { minetest.override_item("default:plant_grass", {drop = { max_items = 1, items = { + {items = {'farming:sugarcane'},rarity = 20}, {items = {'farming:wheat_seeds'},rarity = 5}, {items = {'default:plant_grass'}}, } @@ -57,6 +58,7 @@ minetest.override_item("default:plant_grass_2", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -65,6 +67,7 @@ minetest.override_item("default:plant_grass_3", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -73,6 +76,7 @@ minetest.override_item("default:plant_grass_4", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -81,10 +85,36 @@ minetest.override_item("default:plant_grass_5", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) +-- other plants + +minetest.register_node("farming:sugarcane", { + description = "Sugarcane", + tiles = {"farming_sugarcane.png"}, + drawtype = "plantlike", + paramtype = "light", + inventory_image = "farming_sugarcane.png", + groups = {crumbly=3, falling_node=1}, + walkable = false, +}) + +minetest.register_abm({ + nodenames = {"farming:sugarcane"}, + neighbors = {"default:dirt", "default:grass"}, + interval = 10.0, + chance = 5, + action = function(pos, node, active_object_count, active_object_count_wider) + pos.y = pos.y + 1 + minetest.set_node(pos, {name = "farming:sugarcane"}) + end, +}) + +-- items + minetest.register_craftitem("farming:flour", { description = "Flour", inventory_image = "farming_flour.png", @@ -119,17 +149,37 @@ minetest.register_craftitem("farming:bowl_with_water", { minetest.register_craftitem("farming:slice_of_bread", { description = "Slice of Bread", inventory_image = "farming_slice_of_bread.png", + on_use = minetest.item_eat(4), +}) + +minetest.register_craftitem("farming:cookie", { + description = "Cookie", + inventory_image = "farming_cookie.png", on_use = minetest.item_eat(5), }) + minetest.register_craft({ type = "shapeless", output = "farming:flour", recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"} }) +minetest.register_craft({ + type = "shapeless", + output = "farming:cookie 5", + recipe = {"farming:sugar", "farming:flour", "farming:bowl_with_water"} +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:sugar 3", + recipe = {"farming:sugarcane"} +}) + + minetest.register_craft({ output = "farming:bowl", recipe = { diff --git a/mods/farming/init.lua~ b/mods/farming/init.lua~ index 87b7be4..8999660 100644 --- a/mods/farming/init.lua~ +++ b/mods/farming/init.lua~ @@ -48,6 +48,7 @@ farming.register_plant("wheat", 5, { minetest.override_item("default:plant_grass", {drop = { max_items = 1, items = { + {items = {'farming:sugarcane'},rarity = 20}, {items = {'farming:wheat_seeds'},rarity = 5}, {items = {'default:plant_grass'}}, } @@ -57,6 +58,7 @@ minetest.override_item("default:plant_grass_2", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -65,6 +67,7 @@ minetest.override_item("default:plant_grass_3", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -73,6 +76,7 @@ minetest.override_item("default:plant_grass_4", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) @@ -81,10 +85,36 @@ minetest.override_item("default:plant_grass_5", {drop = { max_items = 1, items = { {items = {'farming:wheat_seeds'},rarity = 5}, + {items = {'farming:sugarcane'},rarity = 20}, {items = {'default:plant_grass'}}, } }}) +-- other plants + +minetest.register_node("farming:sugarcane", { + description = "Sugarcane", + tiles = {"farming_sugarcane.png"}, + drawtype = "plantlike", + paramtype = "light", + inventory_image = "farming_sugarcane.png", + groups = {crumbly=3, falling_node=1}, + walkable = false, +}) + +minetest.register_abm({ + nodenames = {"farming:sugarcane"}, + neighbors = {"default:dirt", "default:grass"}, + interval = 10.0, + chance = 5, + action = function(pos, node, active_object_count, active_object_count_wider) + pos.y = pos.y + 1 + minetest.set_node(pos, {name = "farming:sugarcane"}) + end, +}) + +-- items + minetest.register_craftitem("farming:flour", { description = "Flour", inventory_image = "farming_flour.png", @@ -119,17 +149,37 @@ minetest.register_craftitem("farming:bowl_with_water", { minetest.register_craftitem("farming:slice_of_bread", { description = "Slice of Bread", inventory_image = "farming_slice_of_bread.png", + on_use = minetest.item_eat(4), +}) + +minetest.register_craftitem("farming:cookie", { + description = "Cookie", + inventory_image = "farming_cookie.png", on_use = minetest.item_eat(5), }) + minetest.register_craft({ type = "shapeless", output = "farming:flour", recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"} }) +minetest.register_craft({ + type = "shapeless", + output = "farming:cookie 5", + recipe = {"farming:sugar", "farming:flour", "farming:bowl_with_water"} +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:sugar 3", + recipe = {"farming:sugarcane"} +}) + + minetest.register_craft({ output = "farming:bowl", recipe = { diff --git a/mods/farming/textures/farming_cookie.png b/mods/farming/textures/farming_cookie.png new file mode 100644 index 0000000000000000000000000000000000000000..5ff20d159f48be6bb61f65ecc7251bc689c9aad7 GIT binary patch literal 416 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BD;OpLJoB7f?vD#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-JoPmLn!_&nv#NzbU;JsOg0!04#ti7}N(!rj#ZOQ8HvA2$@F7}^z zG`)lG;PwxSRwYGTJ4#P-d$f7H%a9TAo4}#>Oemj8vWZE5w$Vyu#&;qnXfO%;xCy3b4A?Rw6;@sGF4voo2RzLge_kBCR4 z@fRMteDnMDtNe%7Y8@t20dZp(~3D{&{$~z&%8()HyZpj6 zM%$>lrso!fImn$`rGNf(gXLU-&QmL#H^;y7wsYI+Q73R}{>A50J$yFn9PZR-XxN^& zT;!u)oX+*x``dlLG#AY7zOXvbJ?^U9Wj{G@rqJV8Zsg7W-Y8dbTk!!f;21nz{an^L HB{Ts5VLhZA literal 0 HcmV?d00001 diff --git a/mods/farming/textures/farming_sugarcane.png b/mods/farming/textures/farming_sugarcane.png new file mode 100644 index 0000000000000000000000000000000000000000..57da0c486dd96971dcae66092192cca9e5cc3a62 GIT binary patch literal 407 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsiHTdA{hh?xM?fLT64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF6Ao-U3d5r?0K9pr5`;3-+e)e<1T<_Lq%VHusn3~P=oUKJ3) z`nS!5kB@J{ihqjiJARx?=f1G$<*TnBr+lc?y|BIc!LwQG*ccq{Gc!ymC|<(skfzkf zB@+6MInQ)!6O+N@ZHFVCq_!7_l@3zfbYx< zyO;jEm>DuVeX>@Mm5=%ou7LU?Pw8EM4osWvCfY8%>iZkE1)rlrc21wMp+8tAr0v1Y zi;GIsc?89lUY8ASvJbb5s=sGm&ggNA{oAqc;`blVb