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 0000000..152742c Binary files /dev/null and b/mods/fishing/textures/fishing_cooked_fish.png differ diff --git a/mods/fishing/textures/fishing_fish.png b/mods/fishing/textures/fishing_fish.png new file mode 100644 index 0000000..f8f85e9 Binary files /dev/null and b/mods/fishing/textures/fishing_fish.png differ diff --git a/mods/fishing/textures/fishing_fishing_rod.png b/mods/fishing/textures/fishing_fishing_rod.png new file mode 100644 index 0000000..f6f3de5 Binary files /dev/null and b/mods/fishing/textures/fishing_fishing_rod.png differ 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 0000000..47c2558 Binary files /dev/null and b/mods/fishing/textures/fishing_fishing_rod_wield.png differ