From 3d26b33e5bad60ebb4fe459e011abefe130dbc3b Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 12 Oct 2016 01:49:31 +0100 Subject: [PATCH] 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. --- mods/default/README.txt | 5 +++ mods/default/functions.lua | 16 +++++++ mods/default/nodes.lua | 40 +++++++++++++++++- mods/default/textures/default_coral_brown.png | Bin 0 -> 401 bytes .../default/textures/default_coral_orange.png | Bin 0 -> 358 bytes .../textures/default_coral_skeleton.png | Bin 0 -> 256 bytes 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 mods/default/textures/default_coral_brown.png create mode 100644 mods/default/textures/default_coral_orange.png create mode 100644 mods/default/textures/default_coral_skeleton.png diff --git a/mods/default/README.txt b/mods/default/README.txt index 4d7744f7..bf7481b6 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -178,6 +178,11 @@ asl97 (CC BY-SA 3.0): KevDoy (CC BY-SA 3.0) heart.png +Pithydon (CC BY-SA 3.0) + default_coral_brown.png + default_coral_orange.png + default_coral_skeleton.png + Glass breaking sounds (CC BY 3.0): 1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ 2: http://www.freesound.org/people/Tomlija/sounds/97669/ diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 7770feb0..0e0ab843 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -471,3 +471,19 @@ function default.intersects_protection(minp, maxp, player_name, interval) return false end + + +-- +-- Coral death near air +-- + +minetest.register_abm({ + nodenames = {"default:coral_brown", "default:coral_orange"}, + neighbors = {"air"}, + interval = 17, + chance = 5, + catch_up = false, + action = function(pos, node) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index b6ae52cb..b575704a 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -111,8 +111,8 @@ default:mese default:stone_with_diamond default:diamondblock -Plantlife (non-cubic) ---------------------- +Plantlife +--------- default:cactus default:papyrus @@ -131,6 +131,13 @@ default:dry_grass_3 default:dry_grass_4 default:dry_grass_5 +Corals +------ + +default:coral_brown +default:coral_orange +default:coral_skeleton + Liquids ------- (1. Source 2. Flowing) @@ -1208,6 +1215,35 @@ for i = 2, 5 do }) end + +-- +-- Corals +-- + +minetest.register_node("default:coral_brown", { + description = "Brown Coral", + tiles = {"default_coral_brown.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_orange", { + description = "Orange Coral", + tiles = {"default_coral_orange.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_skeleton", { + description = "Coral Skeleton", + tiles = {"default_coral_skeleton.png"}, + groups = {cracky = 3}, + sounds = default.node_sound_stone_defaults(), +}) + + -- -- Liquids -- diff --git a/mods/default/textures/default_coral_brown.png b/mods/default/textures/default_coral_brown.png new file mode 100644 index 0000000000000000000000000000000000000000..8a775fe06cc4c1bc49a787db0525df58262c6241 GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}LV!<*tB0YQkFiRKg=U1gR+OE7 zvb}DSy-|XbUb?ekj)z&1hk1#gO_i@jnZJ2MnBC&m&}E%*8@t2T^u%nNl)Pz5^1f-& zduL?qoRze5R_6Yh$p;r^9bb@hVrj;eC0S=ymfYM}ww<39WI1PnM`SSr1Gg{;GcwGY zBLNg-FY)wsWq-gXBA~$a_|B^~pwJOd7sn8Z%e?*3la46x9FaLLP_59yI_-PQ@B2kR z!opXw2G-tS<4c;Ccu6;4;q}%jQ>xakh;W#hagcBQf@uGwM$0-UAN8ckLP}1RvocCf zAMqBxR`0PQ?UPo*-X_(+geP|A0&8~_F3FNfkesPtvHtMpHZ}2QQ#{QVrpDhB<2z#aJT{nLNnv-) swEZt`yzW$fzoSTO@pI9A$J@Rzdwt-2>UP-04d@>RPgg&ebxsLQ09q}YHvj+t literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_coral_orange.png b/mods/default/textures/default_coral_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..cefac6273c13f54ce5d40c118169bda4496ff562 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!M}SX=Ylav@u`ENIEJK|lL!UD9 zG*yO$Dhv~~7}n@AT=Eh<<0o?0SM;lw*wbL%JE2l<1I4}sazBpX{TC$sHd^w36vxjP zxxcYuzfvWX=iOQjG?TNyBeIx*fm;}a85w5HkpK#^mw5WRvOi!G5m08)_nhJc6x!(N z;us=vS+vhH>4*Wxfekm4?l`1r{P=I5TXn@%Xv2N=jXUkN7-bLidgM-!HYzf(QMmdKI;Vst0Mz?~ A4*&oF literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_coral_skeleton.png b/mods/default/textures/default_coral_skeleton.png new file mode 100644 index 0000000000000000000000000000000000000000..fa48f1512fcb84622b7834ffd9bc5f5ec6065394 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDUy>tD8EUp_qCJkw?tPz`5+M`SSr1Gg{;GcwGYBLNg-FY)wsWq-gXB4EX@Jp0Kd zpis4^i(?4Kb>5zXyoVJ8Sj<-*=