From 95a6075a54091b7e3ffa751466e5f7aa73f7793c Mon Sep 17 00:00:00 2001 From: cale Date: Sun, 10 Jan 2016 12:14:08 +0100 Subject: [PATCH] added farming mod (own mod not from minetest_game) --- mods/classes/textures/classes_lock_pick.png | Bin 0 -> 262 bytes mods/classes/textures/classes_stick.png | Bin 0 -> 253 bytes .../textures/default_treasure_chest.png | Bin 495 -> 283 bytes mods/farming/LICENSE.txt | 16 ++++++ mods/farming/init.lua | 50 ++++++++++++++++++ mods/farming/init.lua~ | 50 ++++++++++++++++++ mods/farming/textures/farming_flour.png | Bin 0 -> 241 bytes mods/farming/textures/farming_wheat_1.png | Bin 0 -> 214 bytes mods/farming/textures/farming_wheat_2.png | Bin 0 -> 219 bytes mods/farming/textures/farming_wheat_3.png | Bin 0 -> 226 bytes mods/farming/textures/farming_wheat_4.png | Bin 0 -> 233 bytes mods/farming/textures/farming_wheat_5.png | Bin 0 -> 299 bytes mods/farming/textures/farming_wheat_seeds.png | Bin 0 -> 203 bytes 13 files changed, 116 insertions(+) create mode 100644 mods/classes/textures/classes_lock_pick.png create mode 100644 mods/classes/textures/classes_stick.png create mode 100644 mods/farming/LICENSE.txt create mode 100644 mods/farming/init.lua create mode 100644 mods/farming/init.lua~ create mode 100644 mods/farming/textures/farming_flour.png create mode 100644 mods/farming/textures/farming_wheat_1.png create mode 100644 mods/farming/textures/farming_wheat_2.png create mode 100644 mods/farming/textures/farming_wheat_3.png create mode 100644 mods/farming/textures/farming_wheat_4.png create mode 100644 mods/farming/textures/farming_wheat_5.png create mode 100644 mods/farming/textures/farming_wheat_seeds.png diff --git a/mods/classes/textures/classes_lock_pick.png b/mods/classes/textures/classes_lock_pick.png new file mode 100644 index 0000000000000000000000000000000000000000..b574824b1dea606cf4f7735faa76129627e731d8 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNsQb=%E)1_CO)Y64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF3+PZ!4!i_^&o5*!7OP8|HN-Y4_t`~e_v=}SwoQ{FjCH|LF{ zXVJl?lXL(3%iZW)G&6%)%;(*o{~sT_^PF|5WQ;7X^ObI^a`Q5IY}z1k)`C|d%s7nM w<6=)D!^&BKJPPi{cNmIH4+{(JoVAjP!8IgIPi<={6VPS`Pgg&ebxsLQ0K7C+9RL6T literal 0 HcmV?d00001 diff --git a/mods/classes/textures/classes_stick.png b/mods/classes/textures/classes_stick.png new file mode 100644 index 0000000000000000000000000000000000000000..d5d963f11324ece6129c77fda58764d82ae671da GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNsP=nfD^5KA@0fiEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8aflr;B5V#p&b(iAV)ywHNlgB$O>@rRzkpUq9~C^K53R@-Rb?>0$|o nzO)^TPqNyUGZ&c#vobIQ?DdLznYn%=&_V`JS3j3^P6{DL)$-bb}N zUs-WcMDt!pxA2_ZDhy|iRkZisZJKtw)HzfwF1)4RnSqf-z=47BQ=YPa>WBLu3>|z= zZ#NGRzp4G1L0%Ce_kRxil@)uBCT008_L?V|ty010qNS#tmY3ljhU3ljkVnw%H_000McNliru z-wYiJ6BS9CMz)b#Cw~EHNkl1J2xKQ*RudEB1O3Q;V*fZ-V`4Jn)dNYV zgo5rF;~Y#kG))0T7o zZxZ`$*R^A9fu2w}ugm1{7F)EWIAVw*G8O5IX+e461`RtYLVpz|mj*=5)$QqN47m=J zJ3xDS8goJqL|7)7jYTztEcHmOjD93V1v)dsVvK;(f+uxzZ0O_>W9;6nFsOQ~L3Xu! zCnyWDSgRT|P{qB2m7CpL6zLJE85=n3N8ShYnd=sbdbN|<+-A)(lAMBdTHq?)$o(`O zgt^TD9b{OsSbz4cyl7$rN8`ZCW>!5UGMZ?FKw}yyQd;DQj>6nugZllc+ck^04Sg-n zbs^J;opz!{c0jtJ(70_eb@8?#gKmmHIJ}d$cG)<`l(NOG_wmO^&>bB$uOh6sc@TBu nozMY1Hhln#Rc0000 diff --git a/mods/farming/LICENSE.txt b/mods/farming/LICENSE.txt new file mode 100644 index 0000000..6f6a256 --- /dev/null +++ b/mods/farming/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2016 cd2 (cdqwertz) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License for Media +----------------- + +CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz) diff --git a/mods/farming/init.lua b/mods/farming/init.lua new file mode 100644 index 0000000..06cf4b9 --- /dev/null +++ b/mods/farming/init.lua @@ -0,0 +1,50 @@ +farming = {} + +function farming.register_plant(name, steps, def) + for i = 1, steps, 1 do + minetest.register_node(":farming:"..name.."_"..tostring(i), { + description = def.description .. " " .. tostring(i), + tiles = {def.texture.."_"..tostring(i)..".png"}, + drawtype = "plantlike", + paramtype = "light", + drop = def.drop .. " " .. tostring(i), + groups = {crumbly=3}, + walkable = false, + }) + minetest.register_abm({ + nodenames = {"farming:"..name.."_"..tostring(i)}, + neighbors = {"default:dirt", "default:grass"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if i < steps then + minetest.set_node(pos, {name = "farming:"..name.."_"..tostring(i+1)}) + end + end, + }) + end + minetest.register_craftitem(def.drop, { + description = def.drop_description, + inventory_image = def.drop_texture, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.set_node(pointed_thing.above, {name="farming:"..name.."_1"}) + itemstack:take_item() + end + return itemstack + end, + }) +end + +farming.register_plant("wheat", 5, { + description = "Wheat", + texture = "farming_wheat", + drop = "farming:wheat_seeds", + drop_description = "Wheat Seeds", + drop_texture = "farming_wheat_seeds.png", +}) + +minetest.register_craftitem("farming:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) diff --git a/mods/farming/init.lua~ b/mods/farming/init.lua~ new file mode 100644 index 0000000..06cf4b9 --- /dev/null +++ b/mods/farming/init.lua~ @@ -0,0 +1,50 @@ +farming = {} + +function farming.register_plant(name, steps, def) + for i = 1, steps, 1 do + minetest.register_node(":farming:"..name.."_"..tostring(i), { + description = def.description .. " " .. tostring(i), + tiles = {def.texture.."_"..tostring(i)..".png"}, + drawtype = "plantlike", + paramtype = "light", + drop = def.drop .. " " .. tostring(i), + groups = {crumbly=3}, + walkable = false, + }) + minetest.register_abm({ + nodenames = {"farming:"..name.."_"..tostring(i)}, + neighbors = {"default:dirt", "default:grass"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if i < steps then + minetest.set_node(pos, {name = "farming:"..name.."_"..tostring(i+1)}) + end + end, + }) + end + minetest.register_craftitem(def.drop, { + description = def.drop_description, + inventory_image = def.drop_texture, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.set_node(pointed_thing.above, {name="farming:"..name.."_1"}) + itemstack:take_item() + end + return itemstack + end, + }) +end + +farming.register_plant("wheat", 5, { + description = "Wheat", + texture = "farming_wheat", + drop = "farming:wheat_seeds", + drop_description = "Wheat Seeds", + drop_texture = "farming_wheat_seeds.png", +}) + +minetest.register_craftitem("farming:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) diff --git a/mods/farming/textures/farming_flour.png b/mods/farming/textures/farming_flour.png new file mode 100644 index 0000000000000000000000000000000000000000..79a6f1075dff5c11edb8d8d087690bfcf250d4e1 GIT binary patch literal 241 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNwL%C;tkmYM_v0iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8affr;B5V#p&b(3D(641`KXBlfLK8|IMGQy;3SM^t6k|=lAmO zB_)6$FYey&`5EF0w|n?5#2#|-Fh0X-V7ALfS?}!r`aS6hPX&$?F#5bP0l+XkK0Gvu^ literal 0 HcmV?d00001 diff --git a/mods/farming/textures/farming_wheat_1.png b/mods/farming/textures/farming_wheat_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4216aed1aaf733b3d2c1b8afdb45a43d26dbc982 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsk&9DSCg)?Z7EnmC#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-J9H_|7)5S3);&5_;1nc4ik)EbN11`6N8gR}H$Lp&;{r~Y}$|=LZ t%Y{!E)S@K3PUxf*E^F+2#8}S2(54_7x%A!cnLv{mJYD@<);T3K0RZsuKx+U1 literal 0 HcmV?d00001 diff --git a/mods/farming/textures/farming_wheat_2.png b/mods/farming/textures/farming_wheat_2.png new file mode 100644 index 0000000000000000000000000000000000000000..56e94f6e203ee5af208c684804d1d3215e5061df GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsk&9E-XoGs)Q=pJ!iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8c$Zr;B4q#Np%w3D(64B0Wuk23&3jH6R?33tLzHu{SGJ3o?CV z)G<>&pIsk&9DKXh90^JD`wciEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8c$7r;B4q#Np%w3D(64B0Wuk23#*#c7;v-e_ZXH$pt>?(gPQY z8P*+f>55AEcu=0{$_K-qnbK4YVhGl<5%c}!zj{{9* N@O1TaS?83{1OPt(MB4xW literal 0 HcmV?d00001 diff --git a/mods/farming/textures/farming_wheat_4.png b/mods/farming/textures/farming_wheat_4.png new file mode 100644 index 0000000000000000000000000000000000000000..73b3902e2e765369566438ffc3d86bb7604acd4c GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsk&9DaXlK36dZ3VGiEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8afbr;B4q#Np%w3D(64B0Wuk4z2|y&PVHmz8dguSv-@?s)Q|` zV}elslOvY9?9`$noz~o2IGsb2bK=Cgyza6FuNnf`ACxj|<(_^~L!$J+gdzrp%O|DE US@&DE0}W^JboFyt=akR{0K2e7r~m)} literal 0 HcmV?d00001 diff --git a/mods/farming/textures/farming_wheat_5.png b/mods/farming/textures/farming_wheat_5.png new file mode 100644 index 0000000000000000000000000000000000000000..af88af5ee46741177b286d020c178f59b67cf797 GIT binary patch literal 299 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pIsk&9D-L+0@Nmp~!O64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF5fo-U3d5r^MSy~xWTDByB&n%b1bEKf6>V&7#?KHa*t+xolV zNH6|7T$6enzZ&E#8^*-z6*9qxgl!RAQs9Y7(;64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiAh&PZ!4!i_^&o5+(QY{TFvK~4(Na%gMWe*w6-g%q oI-P2`I{El(xHO9n8hqztI4$RSHA{F`0Z==Gr>mdKI;Vst08?^0hX4Qo literal 0 HcmV?d00001