summaryrefslogtreecommitdiff
path: root/fishing.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2015-12-23 10:13:09 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2015-12-23 10:13:09 +0000
commit2ac5ceadd9ee36c4c7a5dcd43958f251b720958d (patch)
tree90768c1de6e9228efc0533b8fee84d0526547d65 /fishing.lua
parent433ecb1ee6bc9359f179962bcb63fe22789c384c (diff)
Added waterlily to ethereal maps using stable 0.4.13 builds
Diffstat (limited to 'fishing.lua')
-rw-r--r--fishing.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/fishing.lua b/fishing.lua
index f5bd97c..c8d1cbf 100644
--- a/fishing.lua
+++ b/fishing.lua
@@ -67,6 +67,17 @@ minetest.register_craft({
}
})
+-- default ethereal fish
+local fish = {
+ {"ethereal:fish_raw"},
+}
+
+-- xanadu server additional fish
+if minetest.get_modpath("xanadu") then
+ fish[2] = {"mobs:clownfish_raw"}
+ fish[3] = {"mobs:bluefish_raw"}
+end
+
-- Fishing Rod (Baited)
minetest.register_craftitem("ethereal:fishing_rod_baited", {
description = "Baited Fishing Rod",
@@ -84,12 +95,16 @@ minetest.register_craftitem("ethereal:fishing_rod_baited", {
if (node == "default:water_source"
or node == "default:river_water_source")
and math.random(1, 100) < 5 then
+
+ local type = fish[math.random(1, #fish)][1]
local inv = user:get_inventory()
- if inv:room_for_item("main", {name = "ethereal:fish_raw"}) then
- inv:add_item("main", {name = "ethereal:fish_raw"})
+
+ if inv:room_for_item("main", {name = type}) then
+ inv:add_item("main", {name = type})
return {name = "ethereal:fishing_rod"}
else
- minetest.chat_send_player(user:get_player_name(), "Inventory full, Fish Got Away!")
+ minetest.chat_send_player(user:get_player_name(),
+ "Inventory full, Fish Got Away!")
end
end
end,