summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-27 00:47:59 -0500
committercheapie <no-email-for-you@example.com>2024-04-27 00:47:59 -0500
commitd376cbf90e59105955e6d02cc62f32ba4ae33cff (patch)
tree35359ce744094a4233d5845c3fadeb05f82bec43
parent97e3dfb5eb40acc1c77048169b1f7b17448459ab (diff)
downloadcelevator-d376cbf90e59105955e6d02cc62f32ba4ae33cff.tar
celevator-d376cbf90e59105955e6d02cc62f32ba4ae33cff.tar.gz
celevator-d376cbf90e59105955e6d02cc62f32ba4ae33cff.tar.bz2
celevator-d376cbf90e59105955e6d02cc62f32ba4ae33cff.tar.xz
celevator-d376cbf90e59105955e6d02cc62f32ba4ae33cff.zip
Add decorative buffers in two styles
-rw-r--r--decorations.lua117
-rw-r--r--init.lua1
-rw-r--r--textures/celevator_buffer_oil_lower_sides.pngbin0 -> 897 bytes
-rw-r--r--textures/celevator_buffer_oil_lower_top.pngbin0 -> 572 bytes
-rw-r--r--textures/celevator_buffer_oil_upper.pngbin0 -> 761 bytes
-rw-r--r--textures/celevator_buffer_rubber_sides.pngbin0 -> 566 bytes
-rw-r--r--textures/celevator_buffer_rubber_top.pngbin0 -> 611 bytes
7 files changed, 118 insertions, 0 deletions
diff --git a/decorations.lua b/decorations.lua
new file mode 100644
index 0000000..abf2a50
--- /dev/null
+++ b/decorations.lua
@@ -0,0 +1,117 @@
+minetest.register_node("celevator:buffer_rubber",{
+ description = "Elevator Elastomeric Buffer",
+ groups = {
+ choppy = 1,
+ bouncy = 60,
+ },
+ paramtype = "light",
+ tiles = {
+ "celevator_buffer_rubber_top.png",
+ "celevator_cabinet_sides.png",
+ "celevator_buffer_rubber_sides.png",
+ },
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.2,-0.5,-0.2,0.2,-0.45,0.2},
+ {-0.0625,-0.43,-0.0625,0.0625,0.1875,0.0625},
+ {-0.125,0.1875,-0.125,-0.0625,0.35,0.125},
+ {0.0625,0.1875,-0.125,0.125,0.35,0.125},
+ {-0.0625,0.1875,-0.125,0.0625,0.35,-0.0625,},
+ {-0.0625,0.1875,0.0625,0.0625,0.35,0.125,},
+ {-0.125,-0.45,-0.125,0.125,-0.43,0.125},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25,-0.5,-0.25,0.25,-0.4,0.25},
+ {-0.15,-0.4,-0.15,0.15,0.4,0.15},
+ },
+ },
+ collision_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25,-0.5,-0.25,0.25,-0.4,0.25},
+ {-0.15,-0.4,-0.15,0.15,0.4,0.15},
+ },
+ },
+})
+
+minetest.register_node("celevator:buffer_oil",{
+ description = "Elevator Oil-Filled Buffer",
+ groups = {
+ choppy = 1,
+ },
+ paramtype = "light",
+ tiles = {
+ "celevator_buffer_oil_lower_top.png",
+ "celevator_cabinet_sides.png",
+ "celevator_buffer_oil_lower_sides.png",
+ },
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.2,-0.5,-0.2,0.2,-0.4375,0.2},
+ {-0.094,-0.4375,-0.094,0.094,0.5,0.094},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.25,-0.5,-0.25,0.25,1.35,0.25},
+ },
+ },
+ after_place_node = function(pos,placer)
+ local node = minetest.get_node(pos)
+ local toppos = {x=pos.x,y=pos.y + 1,z=pos.z}
+ local topnode = minetest.get_node(toppos)
+ local placername = placer:get_player_name()
+ if topnode.name ~= "air" then
+ if placer:is_player() then
+ minetest.chat_send_player(placername,"Can't place buffer - no room for the top half!")
+ end
+ minetest.set_node(pos,{name="air"})
+ return true
+ end
+ if minetest.is_protected(toppos,placername) and not minetest.check_player_privs(placername,{protection_bypass=true}) then
+ if placer:is_player() then
+ minetest.chat_send_player(placername,"Can't place buffer - top half is protected!")
+ minetest.record_protection_violation(toppos,placername)
+ end
+ minetest.set_node(pos,{name="air"})
+ return true
+ end
+ node.name = "celevator:buffer_oil_top"
+ minetest.set_node(toppos,node)
+ end,
+ on_destruct = function(pos)
+ pos.y = pos.y + 1
+ local topnode = minetest.get_node(pos)
+ if topnode.name == "celevator:buffer_oil_top" then
+ minetest.set_node(pos,{name="air"})
+ end
+ end,
+})
+
+minetest.register_node("celevator:buffer_oil_top",{
+ description = "Elevator Oil-Filled Buffer (top half - you hacker you!)",
+ groups = {
+ choppy = 1,
+ not_in_creative_inventory = 1,
+ },
+ drop = "",
+ paramtype = "light",
+ tiles = {
+ "celevator_buffer_oil_upper.png",
+ },
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.063,-0.5,-0.063,0.063,0.3,0.063},
+ },
+ },
+})
diff --git a/init.lua b/init.lua
index e2cf1a0..fb96693 100644
--- a/init.lua
+++ b/init.lua
@@ -9,6 +9,7 @@ local components = {
"pilantern",
"fs1switch",
"dispatcher",
+ "decorations",
}
if minetest.get_modpath("laptop") then
diff --git a/textures/celevator_buffer_oil_lower_sides.png b/textures/celevator_buffer_oil_lower_sides.png
new file mode 100644
index 0000000..303eeec
--- /dev/null
+++ b/textures/celevator_buffer_oil_lower_sides.png
Binary files differ
diff --git a/textures/celevator_buffer_oil_lower_top.png b/textures/celevator_buffer_oil_lower_top.png
new file mode 100644
index 0000000..6e9f091
--- /dev/null
+++ b/textures/celevator_buffer_oil_lower_top.png
Binary files differ
diff --git a/textures/celevator_buffer_oil_upper.png b/textures/celevator_buffer_oil_upper.png
new file mode 100644
index 0000000..55a00b9
--- /dev/null
+++ b/textures/celevator_buffer_oil_upper.png
Binary files differ
diff --git a/textures/celevator_buffer_rubber_sides.png b/textures/celevator_buffer_rubber_sides.png
new file mode 100644
index 0000000..8f3d0ea
--- /dev/null
+++ b/textures/celevator_buffer_rubber_sides.png
Binary files differ
diff --git a/textures/celevator_buffer_rubber_top.png b/textures/celevator_buffer_rubber_top.png
new file mode 100644
index 0000000..fcf1a34
--- /dev/null
+++ b/textures/celevator_buffer_rubber_top.png
Binary files differ