Skip to content

Commit eb5a5b5

Browse files
committedOct 10, 2017
Decorations: Add kelp to cool and temperate shallow ocean
Original texture by tobyplowy, colourised by paramat.
1 parent 3ff2969 commit eb5a5b5

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed
 

Diff for: ‎mods/default/README.txt

+3
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ kilbith (CC BY-SA 3.0):
215215
default_tin_ingot.png
216216
default_tin_lump.png
217217

218+
tobyplowy (CC BY-SA 3.0):
219+
default_kelp.png
220+
218221
Glass breaking sounds (CC BY 3.0):
219222
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
220223
2: http://www.freesound.org/people/Tomlija/sounds/97669/

Diff for: ‎mods/default/license.txt

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Copyright (C) 2010-2016:
4444
GreenXenith
4545
kaeza
4646
kilbith
47+
tobyplowy
4748

4849
You are free to:
4950
Share — copy and redistribute the material in any medium or format.

Diff for: ‎mods/default/mapgen.lua

+31
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,37 @@ function default.register_decorations()
20192019
flags = "place_center_x, place_center_z",
20202020
rotation = "random",
20212021
})
2022+
2023+
-- Kelp
2024+
2025+
minetest.register_decoration({
2026+
deco_type = "simple",
2027+
place_on = {"default:sand"},
2028+
place_offset_y = -1,
2029+
sidelen = 16,
2030+
noise_params = {
2031+
offset = -0.04,
2032+
scale = 0.1,
2033+
spread = {x = 200, y = 200, z = 200},
2034+
seed = 87112,
2035+
octaves = 3,
2036+
persist = 0.7
2037+
},
2038+
biomes = {
2039+
"taiga_ocean",
2040+
"snowy_grassland_ocean",
2041+
"grassland_ocean",
2042+
"coniferous_forest_ocean",
2043+
"deciduous_forest_ocean",
2044+
"sandstone_desert_ocean",
2045+
"cold_desert_ocean"},
2046+
y_min = -10,
2047+
y_max = -5,
2048+
flags = "force_placement",
2049+
decoration = "default:sand_with_kelp",
2050+
param2 = 48,
2051+
param2_max = 96,
2052+
})
20222053
end
20232054

20242055

Diff for: ‎mods/default/nodes.lua

+51
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ default:acacia_bush_stem
149149
default:acacia_bush_leaves
150150
default:acacia_bush_sapling
151151
152+
default:sand_with_kelp
153+
152154
Corals
153155
------
154156
@@ -1449,6 +1451,55 @@ minetest.register_node("default:acacia_bush_sapling", {
14491451
end,
14501452
})
14511453

1454+
minetest.register_node("default:sand_with_kelp", {
1455+
description = "Kelp On Sand",
1456+
drawtype = "plantlike_rooted",
1457+
tiles = {"default_sand.png"},
1458+
special_tiles = {{name = "default_kelp.png", tileable_vertical = true}},
1459+
inventory_image = "default_kelp.png",
1460+
paramtype2 = "leveled",
1461+
groups = {snappy = 3},
1462+
node_placement_prediction = "",
1463+
1464+
on_place = function(itemstack, placer, pointed_thing)
1465+
-- Call on_rightclick if the pointed node defines it
1466+
if pointed_thing.type == "node" and placer and
1467+
not placer:get_player_control().sneak then
1468+
local node_ptu = minetest.get_node(pointed_thing.under)
1469+
local def_ptu = minetest.registered_nodes[node_ptu.name]
1470+
if def_ptu and def_ptu.on_rightclick then
1471+
return def_ptu.on_rightclick(pointed_thing.under, node_ptu, placer,
1472+
itemstack, pointed_thing)
1473+
end
1474+
end
1475+
1476+
local pos = pointed_thing.above
1477+
local height = math.random(4, 6)
1478+
local pos_top = {x = pos.x, y = pos.y + height, z = pos.z}
1479+
local node_top = minetest.get_node(pos_top)
1480+
local def_top = minetest.registered_nodes[node_top.name]
1481+
local player_name = placer:get_player_name()
1482+
1483+
if def_top and def_top.liquidtype == "source" and
1484+
minetest.get_item_group(node_top.name, "water") > 0 then
1485+
if not minetest.is_protected(pos, player_name) and
1486+
not minetest.is_protected(pos_top, player_name) then
1487+
minetest.set_node(pos, {name = "default:sand_with_kelp",
1488+
param2 = height * 16})
1489+
if not (creative and creative.is_enabled_for
1490+
and creative.is_enabled_for(player_name)) then
1491+
itemstack:take_item()
1492+
end
1493+
else
1494+
minetest.chat_send_player(player_name, "Node is protected")
1495+
minetest.record_protection_violation(pos, player_name)
1496+
end
1497+
end
1498+
1499+
return itemstack
1500+
end
1501+
})
1502+
14521503

14531504
--
14541505
-- Corals

Diff for: ‎mods/default/textures/default_kelp.png

312 Bytes
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.