added fishing mod (own mod)

This commit is contained in:
cale 2016-01-10 17:41:07 +01:00
parent 95a6075a54
commit 2e455dffd4
7 changed files with 78 additions and 0 deletions

16
mods/fishing/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2016 cd2 (cdqwertz) <cdqwertz@gmail.com>
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)

31
mods/fishing/init.lua Normal file
View File

@ -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",
})

31
mods/fishing/init.lua~ Normal file
View File

@ -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",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B