From 3c7f26d93721d8d86ca5d9e894e8652b1e2a8672 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 24 Nov 2022 23:56:07 +0100 Subject: Add support for attached facedir/4dir nodes (#11432) --- games/devtest/mods/testnodes/properties.lua | 56 ++++++++++++++++++++- .../textures/testnodes_attached4_bottom.png | Bin 0 -> 123 bytes .../textures/testnodes_attached4_side.png | Bin 0 -> 111 bytes .../testnodes/textures/testnodes_attached4_top.png | Bin 0 -> 100 bytes .../textures/testnodes_attachedf_bottom.png | Bin 0 -> 274 bytes .../textures/testnodes_attachedf_side.png | Bin 0 -> 188 bytes .../testnodes/textures/testnodes_attachedf_top.png | Bin 0 -> 170 bytes 7 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attached4_bottom.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attached4_side.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attached4_top.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attachedf_bottom.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attachedf_side.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_attachedf_top.png (limited to 'games/devtest') diff --git a/games/devtest/mods/testnodes/properties.lua b/games/devtest/mods/testnodes/properties.lua index 4dabe21fc..c51db810c 100644 --- a/games/devtest/mods/testnodes/properties.lua +++ b/games/devtest/mods/testnodes/properties.lua @@ -57,7 +57,6 @@ minetest.register_node("testnodes:attached", { }, groups = { attached_node = 1, dig_immediate = 3 }, }) - -- This node attaches to the side of a node and drops as item -- when the node it attaches to is gone. minetest.register_node("testnodes:attached_wallmounted", { @@ -73,6 +72,61 @@ minetest.register_node("testnodes:attached_wallmounted", { groups = { attached_node = 1, dig_immediate = 3 }, }) +-- Wallmounted node that always attaches to the floor +minetest.register_node("testnodes:attached_wallmounted_floor", { + description = S("Floor-Attached Wallmounted Node"), + paramtype2 = "wallmounted", + tiles = { + "testnodes_attached_top.png", + "testnodes_attached_bottom.png", + "testnodes_attached_side.png", + }, + groups = { attached_node = 3, dig_immediate = 3 }, + color = "#FF8080", +}) + +-- This node attaches to the ceiling and drops as item +-- when the ceiling is gone. +minetest.register_node("testnodes:attached_top", { + description = S("Ceiling-Attached Node"), + tiles = { + "testnodes_attached_bottom.png", + "testnodes_attached_top.png", + "testnodes_attached_side.png^[transformR180", + }, + groups = { attached_node = 4, dig_immediate = 3 }, +}) + +-- Same as wallmounted attached, but for facedir +minetest.register_node("testnodes:attached_facedir", { + description = S("Facedir Attached Node"), + paramtype2 = "facedir", + tiles = { + "testnodes_attachedf_side.png^[transformR180", + "testnodes_attachedf_side.png", + "testnodes_attachedf_side.png^[transformR90", + "testnodes_attachedf_side.png^[transformR270", + "testnodes_attachedf_bottom.png", + "testnodes_attachedf_top.png", + }, + groups = { attached_node = 2, dig_immediate = 3 }, +}) + +-- Same as facedir attached, but for 4dir +minetest.register_node("testnodes:attached_4dir", { + description = S("4dir Attached Node"), + paramtype2 = "4dir", + tiles = { + "testnodes_attached4_side.png^[transformR180", + "testnodes_attached4_side.png", + "testnodes_attached4_side.png^[transformR90", + "testnodes_attached4_side.png^[transformR270", + "testnodes_attached4_bottom.png", + "testnodes_attached4_top.png", + }, + groups = { attached_node = 2, dig_immediate = 3 }, +}) + -- Jump disabled minetest.register_node("testnodes:nojump", { description = S("Non-jumping Node").."\n".. diff --git a/games/devtest/mods/testnodes/textures/testnodes_attached4_bottom.png b/games/devtest/mods/testnodes/textures/testnodes_attached4_bottom.png new file mode 100644 index 000000000..b7a7a2fdb Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attached4_bottom.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_attached4_side.png b/games/devtest/mods/testnodes/textures/testnodes_attached4_side.png new file mode 100644 index 000000000..869e0736a Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attached4_side.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_attached4_top.png b/games/devtest/mods/testnodes/textures/testnodes_attached4_top.png new file mode 100644 index 000000000..94219bcf5 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attached4_top.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_attachedf_bottom.png b/games/devtest/mods/testnodes/textures/testnodes_attachedf_bottom.png new file mode 100644 index 000000000..6c53d59de Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attachedf_bottom.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_attachedf_side.png b/games/devtest/mods/testnodes/textures/testnodes_attachedf_side.png new file mode 100644 index 000000000..f79001b57 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attachedf_side.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_attachedf_top.png b/games/devtest/mods/testnodes/textures/testnodes_attachedf_top.png new file mode 100644 index 000000000..7a7ed1c18 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_attachedf_top.png differ -- cgit v1.2.3