mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-21 06:43:17 -04:00
Merge 9ab3bdd10d
into a9ac480dcd
This commit is contained in:
commit
5dde0f750f
2 changed files with 4 additions and 81 deletions
|
@ -370,84 +370,7 @@ minetest.register_craft({
|
|||
|
||||
----trapdoor----
|
||||
|
||||
local function update_door(pos, node)
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
|
||||
local function punch(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local state = meta:get_int("state")
|
||||
local me = minetest.get_node(pos)
|
||||
local tmp_node
|
||||
local tmp_node2
|
||||
if state == 1 then
|
||||
state = 0
|
||||
minetest.sound_play("door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
|
||||
tmp_node = {name="doors:trapdoor", param1=me.param1, param2=me.param2}
|
||||
else
|
||||
state = 1
|
||||
minetest.sound_play("door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
|
||||
tmp_node = {name="doors:trapdoor_open", param1=me.param1, param2=me.param2}
|
||||
end
|
||||
update_door(pos, tmp_node)
|
||||
meta:set_int("state", state)
|
||||
end
|
||||
|
||||
minetest.register_node("doors:trapdoor", {
|
||||
description = "Trapdoor",
|
||||
inventory_image = "door_trapdoor.png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"door_trapdoor.png", "door_trapdoor.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "doors:trapdoor",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
|
||||
},
|
||||
on_creation = function(pos)
|
||||
state = 0
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
punch(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("doors:trapdoor_open", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor.png", "door_trapdoor.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
pointable = true,
|
||||
stack_max = 0,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
|
||||
climbable = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "doors:trapdoor",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5}
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
punch(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'doors:trapdoor 2',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
if Shadowninja.has_complaint then
|
||||
crazyginger72.doesnt_care_about_minetest = true
|
||||
return "I hate you!"
|
||||
end
|
BIN
mods/doors/textures/door_td_lock.png
Normal file
BIN
mods/doors/textures/door_td_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 337 B |
Loading…
Add table
Reference in a new issue