Xpanes: Register steel bar door and steel bar trapdoor
authorTumeniNodes <tumeninodes@gmail.com>
Sun, 22 Sep 2019 22:05:38 +0000 (18:05 -0400)
committerParamat <paramat@users.noreply.github.com>
Sun, 22 Sep 2019 22:05:38 +0000 (23:05 +0100)
Register using the 'doors' mod API.

mods/xpanes/README.txt
mods/xpanes/init.lua
mods/xpanes/license.txt
mods/xpanes/mod.conf
mods/xpanes/textures/xpanes_door_steel_bar.png [new file with mode: 0644]
mods/xpanes/textures/xpanes_item_steel_bar.png [new file with mode: 0644]
mods/xpanes/textures/xpanes_trapdoor_steel_bar.png [new file with mode: 0644]
mods/xpanes/textures/xpanes_trapdoor_steel_bar_side.png [new file with mode: 0644]

index 47161da538a0356658586034eac67900fc8c1b01..2e0afe49102d110330cda2ae5233d600b67ff882 100644 (file)
@@ -22,3 +22,9 @@ paramat (CC BY-SA 3.0):
 
 Krock (CC0 1.0):
   xpanes_edge.png
+
+TumeniNodes (CC BY-SA 3.0):
+  xpanes_door_steel_bar.png
+  xpanes_item_steel_bar.png
+  xpanes_trapdoor_steel_bar.png
+  xpanes_trapdoor_steel_bar_side.png
index d978beebd7d4912a73db09223bf39f8f8b3b5bda..8dcbb5fa100ec877fb3709f57da2a29ca8cd3c1b 100644 (file)
@@ -202,3 +202,45 @@ minetest.register_lbm({
                end
        end
 })
+
+-- Register steel bar doors and trapdoors
+
+if minetest.get_modpath("doors") then
+
+       doors.register("xpanes:door_steel_bar", {
+               tiles = {{name = "xpanes_door_steel_bar.png", backface_culling = true}},
+               description = S("Steel Bar Door"),
+               inventory_image = "xpanes_item_steel_bar.png",
+               protected = true,
+               groups = {cracky = 1, level = 2},
+               sounds = default.node_sound_metal_defaults(),
+               sound_open = "doors_steel_door_open",
+               sound_close = "doors_steel_door_close",
+               recipe = {
+                       {"xpanes:bar_flat", "xpanes:bar_flat"},
+                       {"xpanes:bar_flat", "xpanes:bar_flat"},
+                       {"xpanes:bar_flat", "xpanes:bar_flat"},
+               },
+       })
+
+       doors.register_trapdoor("xpanes:trapdoor_steel_bar", {
+               description = S("Steel Bar Trapdoor"),
+               inventory_image = "xpanes_trapdoor_steel_bar.png",
+               wield_image = "xpanes_trapdoor_steel_bar.png",
+               tile_front = "xpanes_trapdoor_steel_bar.png",
+               tile_side = "xpanes_trapdoor_steel_bar_side.png",
+               protected = true,
+               groups = {cracky = 1, level = 2, door = 1},
+               sounds = default.node_sound_metal_defaults(),
+               sound_open = "doors_steel_door_open",
+               sound_close = "doors_steel_door_close",
+       })
+
+       minetest.register_craft({
+               output = "xpanes:trapdoor_steel_bar",
+               recipe = {
+                       {"xpanes:bar_flat", "xpanes:bar_flat"},
+                       {"xpanes:bar_flat", "xpanes:bar_flat"},
+               }
+       })
+end
index dff722745f2af5f58466ff36e263d102cd970c76..7e922b9a3b7d9557ee7975f8badf610596b05dbd 100644 (file)
@@ -34,6 +34,7 @@ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
 Copyright (C) 2014-2016 xyz
 Copyright (C) 2013-2016 Gambit
 Copyright (C) 2016 paramat
+Copyright (C) 2019 TumeniNodes
 
 You are free to:
 Share — copy and redistribute the material in any medium or format.
index bc043614d9b635684d7d922abd933d859b348283..dcb071679ab5bb6a2abb1c1d98f28f9d589279f9 100644 (file)
@@ -1,3 +1,4 @@
 name = xpanes
 description = Minetest Game mod: xpanes
 depends = default
+optional_depends = doors
diff --git a/mods/xpanes/textures/xpanes_door_steel_bar.png b/mods/xpanes/textures/xpanes_door_steel_bar.png
new file mode 100644 (file)
index 0000000..435af14
Binary files /dev/null and b/mods/xpanes/textures/xpanes_door_steel_bar.png differ
diff --git a/mods/xpanes/textures/xpanes_item_steel_bar.png b/mods/xpanes/textures/xpanes_item_steel_bar.png
new file mode 100644 (file)
index 0000000..d1ddadd
Binary files /dev/null and b/mods/xpanes/textures/xpanes_item_steel_bar.png differ
diff --git a/mods/xpanes/textures/xpanes_trapdoor_steel_bar.png b/mods/xpanes/textures/xpanes_trapdoor_steel_bar.png
new file mode 100644 (file)
index 0000000..de4b494
Binary files /dev/null and b/mods/xpanes/textures/xpanes_trapdoor_steel_bar.png differ
diff --git a/mods/xpanes/textures/xpanes_trapdoor_steel_bar_side.png b/mods/xpanes/textures/xpanes_trapdoor_steel_bar_side.png
new file mode 100644 (file)
index 0000000..a71231e
Binary files /dev/null and b/mods/xpanes/textures/xpanes_trapdoor_steel_bar_side.png differ