From 2025505b647e3c021311d0e866aa39075275b7ae Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 1 Apr 2017 04:20:02 +0200 Subject: [PATCH] 8 potato grow stages instead of 3 --- mods/ITEMS/mcl_farming/potatoes.lua | 108 ++++++++++-------- .../mcl_farming/textures/farming_potato_1.png | Bin 200 -> 0 bytes .../mcl_farming/textures/farming_potato_2.png | Bin 270 -> 0 bytes .../mcl_farming/textures/farming_potato_3.png | Bin 374 -> 0 bytes .../textures/mcl_farming_potatoes_stage_0.png | Bin 0 -> 346 bytes .../textures/mcl_farming_potatoes_stage_1.png | Bin 0 -> 393 bytes .../textures/mcl_farming_potatoes_stage_2.png | Bin 0 -> 476 bytes .../textures/mcl_farming_potatoes_stage_3.png | Bin 0 -> 569 bytes 8 files changed, 59 insertions(+), 49 deletions(-) delete mode 100644 mods/ITEMS/mcl_farming/textures/farming_potato_1.png delete mode 100644 mods/ITEMS/mcl_farming/textures/farming_potato_2.png delete mode 100644 mods/ITEMS/mcl_farming/textures/farming_potato_3.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_0.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_1.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_2.png create mode 100644 mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_3.png diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 6c69fb30d..cca74036a 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -1,48 +1,54 @@ -minetest.register_node("mcl_farming:potato_1", { - description = "Premature Potato Plant (First Stage)", - _doc_items_entry_name = "Premature Potato Plant", - _doc_items_longdesc = "Potato plants are plants which grow on farmland under sunlight in 3 stages. On hydrated farmland, they grow a bit faster. They can be harvested at any time but will only yield a profit when mature.", - paramtype = "light", - paramtype2 = "meshoptions", - sunlight_propagates = true, - place_param2 = 3, - walkable = false, - drawtype = "plantlike", - drop = "mcl_farming:potato_item", - tiles = {"farming_potato_1.png"}, - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} - }, - }, - groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1,dig_by_piston=1}, - sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 0, -}) +-- Premature potato plants -minetest.register_node("mcl_farming:potato_2", { - description = "Premature Potato Plant (Second Stage)", - _doc_items_create_entry = false, - paramtype = "light", - paramtype2 = "meshoptions", - sunlight_propagates = true, - place_param2 = 3, - walkable = false, - drawtype = "plantlike", - drop = "mcl_farming:potato_item", - tiles = {"farming_potato_2.png"}, - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} - }, - }, - groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1,dig_by_piston=1}, - sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 0, -}) +for i=1, 7 do + local texture, selbox + if i < 3 then + texture = "mcl_farming_potatoes_stage_0.png" + selbox = { -0.5, -0.5, -0.5, 0.5, -5/16, 0.5 } + elseif i < 5 then + texture = "mcl_farming_potatoes_stage_1.png" + selbox = { -0.5, -0.5, -0.5, 0.5, -2/16, 0.5 } + else + texture = "mcl_farming_potatoes_stage_2.png" + selbox = { -0.5, -0.5, -0.5, 0.5, 2/16, 0.5 } + end + local create, name, longdesc + if i==1 then + create = true + name = "Premature Potato Plant" + longdesc = "Potato plants are plants which grow on farmland under sunlight in 8 stages. On hydrated farmland, they grow a bit faster. They can be harvested at any time but will only yield a profit when mature." + else + create = false + if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_farming:potato_1", "nodes", "mcl_farming:potato_"..i) + end + end + + minetest.register_node("mcl_farming:potato_"..i, { + description = string.format("Premature Potato Plant (Stage %d)", i), + _doc_items_create_entry = create, + _doc_items_entry_name = name, + _doc_items_longdesc = longdesc, + paramtype = "light", + paramtype2 = "meshoptions", + sunlight_propagates = true, + place_param2 = 3, + walkable = false, + drawtype = "plantlike", + drop = "mcl_farming:potato_item", + tiles = { texture }, + selection_box = { + type = "fixed", + fixed = { selbox }, + }, + groups = {dig_immediate=3, not_in_creative_inventory=1,attached_node=1,dig_by_water=1,dig_by_piston=1}, + sounds = mcl_sounds.node_sound_leaves_defaults(), + _mcl_blast_resistance = 0, + }) +end + +-- Mature plant minetest.register_node("mcl_farming:potato", { description = "Mature Potato Plant", _doc_items_longdesc = "Mature potato plants are ready to be harvested for potatoes. They won't grow any further.", @@ -52,7 +58,7 @@ minetest.register_node("mcl_farming:potato", { place_param2 = 3, walkable = false, drawtype = "plantlike", - tiles = {"farming_potato_3.png"}, + tiles = {"mcl_farming_potatoes_stage_3.png"}, drop = { items = { { items = {'mcl_farming:potato_item 1'} }, @@ -62,7 +68,13 @@ minetest.register_node("mcl_farming:potato", { { items = {'mcl_farming:potato_item_poison 1'}, rarity = 50 } } }, - groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1,dig_by_piston=1}, + selection_box = { + type = "fixed", + fixed = { + { -0.5, -0.5, -0.5, 0.5, 1/16, 0.5 } + } + }, + groups = {dig_immediate=3, not_in_creative_inventory=1,attached_node=1,dig_by_water=1,dig_by_piston=1}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) @@ -114,8 +126,6 @@ minetest.register_craft({ cooktime = 10, }) -mcl_farming:add_plant("plant_potato", "mcl_farming:potato", {"mcl_farming:potato_1", "mcl_farming:potato_2"}, 50, 20) +mcl_farming:add_plant("plant_potato", "mcl_farming:potato", {"mcl_farming:potato_1", "mcl_farming:potato_2", "mcl_farming:potato_3", "mcl_farming:potato_4", "mcl_farming:potato_5", "mcl_farming:potato_6", "mcl_farming:potato_7"}, 50, 20) + -if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_farming:potato_1", "nodes", "mcl_farming:potato_2") -end diff --git a/mods/ITEMS/mcl_farming/textures/farming_potato_1.png b/mods/ITEMS/mcl_farming/textures/farming_potato_1.png deleted file mode 100644 index 8763320c7e6c4b4dec214340f6e06e1302073189..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmV;(05|`MP)g&m4G{t0&tgXOVPj-37Sj@VGIT%IhHS`wtOXB(2-5+v zYL?s#+reXHyaY0004WQchC?VHc5}I$hew~m#e{3qtfdgTiZrW+OD@?Ygxswy z5$EhaLC!ZY59MGdU%?+fKE5CLpCd1S4)geHdv0PV0NcQ}fRzBz6tG6Y>NjFEg{?vm zBNWGcnQCyX!h&}>Hd7PS6Mlnqbukz=M(k>g7FkrGaPbZySilT0EMH#@$ zS8KPD(EtDd diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_0.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_0.png new file mode 100644 index 0000000000000000000000000000000000000000..c8e33cd70a6e7a45cdb13efcedb14d9e347cb06f GIT binary patch literal 346 zcmZ9{KT85}90u@5`<6`{^i~)@;;1fXO6<8zStq4d*0Kd|{n4JXR&(7o((=>6;quYm5 z9=AL$ecS?Pnr7ngTL)k>a+x_yy*yT}GC!S?oj!f{9e~qNHO2YNY|Ige`B)P`Se4`X zz(c9%=aR$J9mt~JA>7zTt{A`VVnozp1&?4qad|w8LS*9L8qkvV_D83+17Orp3PxEs zDpF~+q8k;2DHIKo7^G01M2Vu37#pXsL{zIY>+2s_S}xbC>;FMS66qJ*4<0`OfU0EV IvqZ7^1KjdhRsaA1 literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_1.png new file mode 100644 index 0000000000000000000000000000000000000000..2386a859ec7b1b197def9748ca89ec4878ee166e GIT binary patch literal 393 zcmY+*y-OQ$0LJmJN$wKVsL;}gFA&5A!3w|g0?OfV2^Y{wVvGm5OIBo=(722xh*)12A(9lLBrtpe;k-)9SC@4xl#GW5pcD z;j)T@S8N8@4{#K4EmcS#CC72L|DJybO6+v95B=)TXffV*cNxq}^>M&!n~9kB!d>F_ zRu~gg>%g#SM69NhT&7xbd#mq#`m!q?bp@k`I!6QS{ft~zDWOhT>Xh@L!n+-x`a&(- zl)v<)JnNZUnw2{m2bbO+Hkh(LE$efqLEaRGu=-c|JwzjwihNdPuYCnx+p$4=Bx~oj z+~<7O&eJNCwiXd?5sD?knrPG1_GZzl2{FFmuX_f@Cq_Puet81wBT$P#2{#Kx6XIa; O!2&R2Nn!lvVtU& zJ%W507^>757#dm_7=AG@Ff_biU???UV0e|lz+g3lfkC`r&aOZk1_lPX0G|-o|Ns9p zJQ85oBgSw{oMDGJ!&-5sseDY`ysX)*|NsAw<8+wFz`(#*666=m;PC858i;_2(k{*alGnVruiziKrD1H(E`7sn8d^LP6$@*Xk}aGu*T<$lOZ2EmdB z7oCP9Olu<;6cr8G;?MNfih8`|c%r;>&*z^!e{L5>PYAoaMNsC~)&`Z^$u$?v792|5 zySMfx=L>CZ^+G?UK858mTbJIvabVTFGly($N3P9MIQ8pOHsjnRmKuE~&hoAY(Zri>+he{)h=UbTjF_|;>i>Kx{{ZRSA zu)Lq=S^T-#4GatnswJ)wB`Jv|saDBFsfi`23`Pcq=DG$Zx(0?J1}0VprdFnA+6G2e z1_u8**Z)S*kei>9nN|taU<}q^Y-M0>WoV*pU}$Avu&3u&2m=EHgQu&X%Q~loCIF+4 Boj(8o literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_3.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_potatoes_stage_3.png new file mode 100644 index 0000000000000000000000000000000000000000..02ea97b20706a59153b3a76c3954a584e6ea7bc2 GIT binary patch literal 569 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I7G?$phQ^Te;|vT8Ea{HEjtmSN`?>!lvVtU& zJ%W507^>757#dm_7=AG@Ff_biU???UV0e|lz+g3lfkC`r&aOZk1_lPL0G|-o|Ns9p zJdk2IAkDBshM`NGVTZQWGEaswVTN^*i#J(MZBt_C6Fqo7;{X5uFRJD37#J8BOM?7@ z862M7NCR<_yxmEaloasFw)t>0k> zk(T+Q0v9%B?@s@I^O)+#yf;%;-&NIn!LyU0Pvn%xMiE6T^;5Dr7cW0yl3~{V&+ye3XE$XSzixm-?ifUkuyj4`HEI(9QL|)f@$LWpLwitiOI=XXFTR@ zUs*CWv^am3mGhSFv}nG~=XUMe`TE!NO|Rc(F^C_3_xA3~n=i9}Jp6HS|38ig!Z&=a zw~PLlZew6zP%UwdC`m~yNwrEYN=+