From e6f61c31ce73c5617e60712a76a44c4b239ff9d7 Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Tue, 2 Jun 2020 09:13:24 +0200 Subject: [PATCH] Add "Drownable Air" node (`maptools:drowning`) (#18) Co-authored-by: Hugo Locurcio Co-authored-by: BuckarooBanzay --- NODES_ITEMS.md | 1 + nodes.lua | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/NODES_ITEMS.md b/NODES_ITEMS.md index f323156..c75429a 100644 --- a/NODES_ITEMS.md +++ b/NODES_ITEMS.md @@ -23,6 +23,7 @@ as they cannot be removed by hand (they can only be removed with | `maptools:no_interact` | Prevents interacting through the block (opening chests, furnaces, attacking entities, …), but can still be walked through. | | `maptools:damage_{1…5}` | :warning: Damaging blocks which damage players by 1 to 5 HP per second. | | `maptools:kill` | :warning: Instant kill blocks (damages players by 20 HP per second). | +| `maptools:drowning` | :warning: Simulates drowning in water. | | `maptools:light_block` | :warning: Invisible non-solid block, prevents light from passing through. | | `maptools:light_bulb` | :warning: Invisible non-solid block, emitting the maximum amount of light. | diff --git a/nodes.lua b/nodes.lua index 2f9d809..c369aa7 100644 --- a/nodes.lua +++ b/nodes.lua @@ -467,3 +467,18 @@ minetest.register_node("maptools:superapple", { sounds = default.node_sound_defaults(), on_drop = maptools.drop_msg }) + +minetest.register_node("maptools:drowning", { + description = S("Drownable Air"), + range = 12, + stack_max = 10000, + inventory_image = "default_steel_block.png^dye_black.png", + drawtype = "airlike", + paramtype = "light", + pointable = false, + drowning = true, + sunlight_propagates = true, + drop = "", + groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, + on_drop = maptools.drop_msg +})