diff options
author | cheapie <no-email-for-you@example.com> | 2021-01-31 17:42:57 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2021-01-31 17:42:57 -0600 |
commit | 21868b05ee0677736bc9d9611994905d95faf2af (patch) | |
tree | 7610da73022d6ae8f3da486b68edfafa0348a720 | |
parent | 7a1f0ce12303a384c2e95cc14a85ec6cd7160c02 (diff) | |
download | handdryer-21868b05ee0677736bc9d9611994905d95faf2af.tar handdryer-21868b05ee0677736bc9d9611994905d95faf2af.tar.gz handdryer-21868b05ee0677736bc9d9611994905d95faf2af.tar.bz2 handdryer-21868b05ee0677736bc9d9611994905d95faf2af.tar.xz handdryer-21868b05ee0677736bc9d9611994905d95faf2af.zip |
Add recessed model and switch to right-click instead of punch
-rw-r--r-- | init.lua | 44 | ||||
-rw-r--r-- | textures/handdryer_ra_front.png | bin | 0 -> 14157 bytes |
2 files changed, 43 insertions, 1 deletions
@@ -23,7 +23,40 @@ minetest.register_node("handdryer:a",{ "handdryer_metal.png", "handdryer_a_front.png", }, - on_punch = function(pos) + on_rightclick = function(pos) + local hash = minetest.hash_node_position(pos) + local handle = sounds[hash] + if handle then + minetest.sound_stop(handle) + end + sounds[hash] = minetest.sound_play("handdryer_a_ra_run",{pos=pos,gain=0.75,max_hear_distance=20}) + end, +}) + +minetest.register_node("handdryer:ra",{ + description = "Recessed Hand Dryer", + groups = {cracky=3}, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + node_box = { + type = "fixed", + fixed = { + {-0.3, -0.45, 0.45, 0.3, 0.25, 0.5}, --Body + {-0.202, -0.094, 0.35, -0.077, 0.1085, 0.45}, --Outlet + {0.125, -0.045, 0.4, 0.22, 0.045, 0.45}, --Button + }, + }, + tiles = { + "handdryer_a_xa5_sides.png", + "handdryer_a_xa5_bottom.png^[transformFY", + "handdryer_a_xa5_sides.png^[transformR270", + "handdryer_a_xa5_sides.png^[transformR90", + "handdryer_metal.png", + "handdryer_ra_front.png", + }, + on_rightclick = function(pos) local hash = minetest.hash_node_position(pos) local handle = sounds[hash] if handle then @@ -103,6 +136,15 @@ minetest.register_craft({ }) minetest.register_craft({ + output = "handdryer:ra", + recipe = { + {"default:steel_ingot","default:steel_ingot","mesecons_button:button_off"}, + {"homedecor:motor","homedecor:fan_blades","default:steel_ingot"}, + {"default:steel_ingot","homedecor:heating_element","default:steel_ingot"}, + }, +}) + +minetest.register_craft({ output = "handdryer:xa5", recipe = { {"default:steel_ingot","default:steel_ingot","homedecor:ic"}, diff --git a/textures/handdryer_ra_front.png b/textures/handdryer_ra_front.png Binary files differnew file mode 100644 index 0000000..9768526 --- /dev/null +++ b/textures/handdryer_ra_front.png |