From 2e455dffd440726f6603c7e168e47448a54ab971 Mon Sep 17 00:00:00 2001 From: cale Date: Sun, 10 Jan 2016 17:41:07 +0100 Subject: [PATCH] added fishing mod (own mod) --- mods/fishing/LICENSE.txt | 16 +++++++++ mods/fishing/init.lua | 31 ++++++++++++++++++ mods/fishing/init.lua~ | 31 ++++++++++++++++++ mods/fishing/textures/fishing_cooked_fish.png | Bin 0 -> 253 bytes mods/fishing/textures/fishing_fish.png | Bin 0 -> 252 bytes mods/fishing/textures/fishing_fishing_rod.png | Bin 0 -> 332 bytes .../textures/fishing_fishing_rod_wield.png | Bin 0 -> 360 bytes 7 files changed, 78 insertions(+) create mode 100644 mods/fishing/LICENSE.txt create mode 100644 mods/fishing/init.lua create mode 100644 mods/fishing/init.lua~ create mode 100644 mods/fishing/textures/fishing_cooked_fish.png create mode 100644 mods/fishing/textures/fishing_fish.png create mode 100644 mods/fishing/textures/fishing_fishing_rod.png create mode 100644 mods/fishing/textures/fishing_fishing_rod_wield.png diff --git a/mods/fishing/LICENSE.txt b/mods/fishing/LICENSE.txt new file mode 100644 index 0000000..6f6a256 --- /dev/null +++ b/mods/fishing/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/fishing/init.lua b/mods/fishing/init.lua new file mode 100644 index 0000000..9035d06 --- /dev/null +++ b/mods/fishing/init.lua @@ -0,0 +1,31 @@ +minetest.register_craftitem("fishing:fishing_rod", { + description = "Fishing rod", + inventory_image = "fishing_fishing_rod.png", + wield_image = "fishing_fishing_rod_wield.png", + liquids_pointable = true, + range = 10.0, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.above then + if minetest.get_node(pointed_thing.under).name == "default:water_source" then + if math.random(10) == 2 then + user:get_inventory():add_item("main", "fishing:fish") + end + end + end + return itemstack + end, +}) + +minetest.register_craft({ + output = "fishing:fishing_rod", + recipe = { + {"default:log_3", "default:string", ""}, + {"default:log_3", "default:string", ""}, + {"default:log_3", "default:string", ""}, + } +}) + +minetest.register_craftitem("fishing:fish", { + description = "Fish", + inventory_image = "fishing_fish.png", +}) diff --git a/mods/fishing/init.lua~ b/mods/fishing/init.lua~ new file mode 100644 index 0000000..9035d06 --- /dev/null +++ b/mods/fishing/init.lua~ @@ -0,0 +1,31 @@ +minetest.register_craftitem("fishing:fishing_rod", { + description = "Fishing rod", + inventory_image = "fishing_fishing_rod.png", + wield_image = "fishing_fishing_rod_wield.png", + liquids_pointable = true, + range = 10.0, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.above then + if minetest.get_node(pointed_thing.under).name == "default:water_source" then + if math.random(10) == 2 then + user:get_inventory():add_item("main", "fishing:fish") + end + end + end + return itemstack + end, +}) + +minetest.register_craft({ + output = "fishing:fishing_rod", + recipe = { + {"default:log_3", "default:string", ""}, + {"default:log_3", "default:string", ""}, + {"default:log_3", "default:string", ""}, + } +}) + +minetest.register_craftitem("fishing:fish", { + description = "Fish", + inventory_image = "fishing_fish.png", +}) diff --git a/mods/fishing/textures/fishing_cooked_fish.png b/mods/fishing/textures/fishing_cooked_fish.png new file mode 100644 index 0000000000000000000000000000000000000000..152742cefcb26035f83a778d958aef105e0f98e2 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*OmPNBNw->;*03J%YZ_XC9V-A&iT2ysd*&~&PAz-C8;S2 z<(VZJ3hti10pX2&;y^{Io-U3d7N?UFBv^ZnXv_+m^x^;K@A5n#@H9Al!HY!2B@-JP z8y|uM&E;&8F9b|D6mZzZ!BP$)ImchJ#whmjCR8Y{ kPG?lsS3jP?q|V5|kkX^5e<3ZP2xuXLr>mdKI;Vst0GJI@3jhEB literal 0 HcmV?d00001 diff --git a/mods/fishing/textures/fishing_fish.png b/mods/fishing/textures/fishing_fish.png new file mode 100644 index 0000000000000000000000000000000000000000..f8f85e90de309f5c6087c076ad283c9992a0d41a GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNw-hQikW=SfG$(iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8afFr;B5V#p&b(3D%w?8d3ZH9{7J={+_V`5G-+JTl6APammES z#>R)A+rRUapO;MyFxzx2;INB_F;Bu}p9`!8>4zD1eg3$sA>x43iI+cej=yA$QS9SQ ms8GCgxp88+LxD*n(8kHOQ`&t;ucLK6T?3{@Ba literal 0 HcmV?d00001 diff --git a/mods/fishing/textures/fishing_fishing_rod.png b/mods/fishing/textures/fishing_fishing_rod.png new file mode 100644 index 0000000000000000000000000000000000000000..f6f3de56f4cf9a78670064e8fc75eb72038dd1d7 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNw;2O47Z9i-AItC9V-A&iT2ysd*&~&PAz-C8;S2 z<(VZJ3hti10pX2&;y^`PJY5_^EKVQ2V90gIK;+oRdav~N4_*k`w9R%F%)fY&xxve7^ty literal 0 HcmV?d00001 diff --git a/mods/fishing/textures/fishing_fishing_rod_wield.png b/mods/fishing/textures/fishing_fishing_rod_wield.png new file mode 100644 index 0000000000000000000000000000000000000000..47c25586d8773e76a147c486478335b77cb48230 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPNBNw-+db9F_Q$Qif64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF3Lo-U3d7N?UF76=$96`QS(`y@YG$!;)&yPfmCB7=gl&wS=)WIju$9$Z>+m(wDQmY+5PbnCO;)4Ox`j* zc;s`$LU!5AM#e=q@7$XzC|2il_)58&ZRQ{@*TMW>E9z$3%^@8hQ@jihX$AX~gbN5@ZGf=L8oS tC4Gf#zZG-6wxsRg?zq^qZekV#gJD3j1B;y4XQ1C0JYD@<);T3K0RVw^fuaBa literal 0 HcmV?d00001