Skip to content

Commit 3d26b33

Browse files
committed
Default: Add coral nodes and death ABM
Original code by Sofar. Textures by Pithydon. Exposure to air converts live coral to coral skeleton. Live corals drop coral skeleton.
1 parent 7b30c26 commit 3d26b33

File tree

6 files changed

+59
-2
lines changed

6 files changed

+59
-2
lines changed

mods/default/README.txt

+5
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ asl97 (CC BY-SA 3.0):
178178
KevDoy (CC BY-SA 3.0)
179179
heart.png
180180

181+
Pithydon (CC BY-SA 3.0)
182+
default_coral_brown.png
183+
default_coral_orange.png
184+
default_coral_skeleton.png
185+
181186
Glass breaking sounds (CC BY 3.0):
182187
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
183188
2: http://www.freesound.org/people/Tomlija/sounds/97669/

mods/default/functions.lua

+16
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,19 @@ function default.intersects_protection(minp, maxp, player_name, interval)
471471

472472
return false
473473
end
474+
475+
476+
--
477+
-- Coral death near air
478+
--
479+
480+
minetest.register_abm({
481+
nodenames = {"default:coral_brown", "default:coral_orange"},
482+
neighbors = {"air"},
483+
interval = 17,
484+
chance = 5,
485+
catch_up = false,
486+
action = function(pos, node)
487+
minetest.set_node(pos, {name = "default:coral_skeleton"})
488+
end,
489+
})

mods/default/nodes.lua

+38-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ default:mese
111111
default:stone_with_diamond
112112
default:diamondblock
113113
114-
Plantlife (non-cubic)
115-
---------------------
114+
Plantlife
115+
---------
116116
117117
default:cactus
118118
default:papyrus
@@ -131,6 +131,13 @@ default:dry_grass_3
131131
default:dry_grass_4
132132
default:dry_grass_5
133133
134+
Corals
135+
------
136+
137+
default:coral_brown
138+
default:coral_orange
139+
default:coral_skeleton
140+
134141
Liquids
135142
-------
136143
(1. Source 2. Flowing)
@@ -1208,6 +1215,35 @@ for i = 2, 5 do
12081215
})
12091216
end
12101217

1218+
1219+
--
1220+
-- Corals
1221+
--
1222+
1223+
minetest.register_node("default:coral_brown", {
1224+
description = "Brown Coral",
1225+
tiles = {"default_coral_brown.png"},
1226+
groups = {cracky = 3},
1227+
drop = "default:coral_skeleton",
1228+
sounds = default.node_sound_stone_defaults(),
1229+
})
1230+
1231+
minetest.register_node("default:coral_orange", {
1232+
description = "Orange Coral",
1233+
tiles = {"default_coral_orange.png"},
1234+
groups = {cracky = 3},
1235+
drop = "default:coral_skeleton",
1236+
sounds = default.node_sound_stone_defaults(),
1237+
})
1238+
1239+
minetest.register_node("default:coral_skeleton", {
1240+
description = "Coral Skeleton",
1241+
tiles = {"default_coral_skeleton.png"},
1242+
groups = {cracky = 3},
1243+
sounds = default.node_sound_stone_defaults(),
1244+
})
1245+
1246+
12111247
--
12121248
-- Liquids
12131249
--
401 Bytes
Loading
358 Bytes
Loading
256 Bytes
Loading

0 commit comments

Comments
 (0)