summaryrefslogtreecommitdiff
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
parent433ecb1ee6bc9359f179962bcb63fe22789c384c (diff)
Added waterlily to ethereal maps using stable 0.4.13 builds
-rw-r--r--fishing.lua21
-rw-r--r--schematics/waterlily.lua50
-rw-r--r--textures/flowers_waterlily.pngbin0 -> 259 bytes
3 files changed, 67 insertions, 4 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,
diff --git a/schematics/waterlily.lua b/schematics/waterlily.lua
index 028cb66..d6bfaa3 100644
--- a/schematics/waterlily.lua
+++ b/schematics/waterlily.lua
@@ -16,6 +16,54 @@ ethereal.waterlily = {
},
}
+if minetest.registered_nodes["flowers:waterlily"] then
+
minetest.override_item("flowers:waterlily", {
walkable = true,
-}) \ No newline at end of file
+})
+
+else
+
+minetest.register_node(":flowers:waterlily", {
+ description = "Waterlily",
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ tiles = {"flowers_waterlily.png"},
+ inventory_image = "flowers_waterlily.png",
+ wield_image = "flowers_waterlily.png",
+ liquids_pointable = true,
+ walkable = true,
+ buildable_to = true,
+ groups = {snappy = 3, flower = 1},
+ sounds = default.node_sound_leaves_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5}
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
+ },
+
+ after_place_node = function(pos, placer, itemstack, pointed_thing)
+ local find_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
+ {x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:water_source")
+ local find_river_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
+ {x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:river_water_source")
+ if #find_water ~= 0 then
+ minetest.set_node(pos, {name = "default:water_source"})
+ pos.y = pos.y + 1
+ minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
+ elseif #find_river_water ~= 0 then
+ minetest.set_node(pos, {name = "default:river_water_source"})
+ pos.y = pos.y + 1
+ minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
+ else
+ minetest.remove_node(pos)
+ return true
+ end
+ end
+})
+
+end
diff --git a/textures/flowers_waterlily.png b/textures/flowers_waterlily.png
new file mode 100644
index 0000000..1f504f7
--- /dev/null
+++ b/textures/flowers_waterlily.png
Binary files differ