Doors: minor update

This commit is contained in:
MoNTE48 2021-02-19 22:13:49 +01:00
parent c520af1138
commit da31e7c91c
3 changed files with 23 additions and 12 deletions

View File

@ -1 +1,3 @@
default
mesecons?
mesecons_mvps?

View File

@ -1,3 +1,5 @@
local mvps = mesecon and mesecon.register_mvps_stopper
--
-- Doors
--
@ -96,6 +98,11 @@ doors.register("door_steel", {
}
})
if mvps then
mesecon.register_mvps_stopper("doors:door_steel_a")
mesecon.register_mvps_stopper("doors:door_steel_b")
end
doors.register("door_grill", {
tiles = {{name = "doors_door_grill.png", backface_culling = true}},
description = "Grilled Door",
@ -112,6 +119,11 @@ doors.register("door_grill", {
}
})
if mvps then
mesecon.register_mvps_stopper("doors:door_grill_a")
mesecon.register_mvps_stopper("doors:door_grill_b")
end
-- Aliases
local doors_aliases = {
@ -191,6 +203,11 @@ doors.register_trapdoor("doors:trapdoor_steel", {
groups = {cracky = 1, level = 2, door = 1}
})
if mvps then
mesecon.register_mvps_stopper("doors:trapdoor_steel")
mesecon.register_mvps_stopper("doors:trapdoor_steel_open")
end
--
-- Fencegates
--

View File

@ -15,6 +15,7 @@ if translator and not minetest.is_singleplayer() then
end
local table_copy = table.copy
local vnew = vector.new
-- returns an object to a door object or nil
function doors.get(pos)
@ -192,8 +193,8 @@ local function on_place_node(place_to, newnode,
{name = oldnode.name, param1 = oldnode.param1, param2 = oldnode.param2}
local pointed_thing_copy = {
type = pointed_thing.type,
above = vector.new(pointed_thing.above),
under = vector.new(pointed_thing.under),
above = vnew(pointed_thing.above),
under = vnew(pointed_thing.under),
ref = pointed_thing.ref
}
callback(place_to_copy, newnode_copy, placer,
@ -355,11 +356,6 @@ function doors.register(name, def)
end
}}
def.after_dig_node = function(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.check_for_falling({x = pos.x, y = pos.y + 1, z = pos.z})
end
def.on_rotate = function()
return false
end
@ -374,10 +370,6 @@ function doors.register(name, def)
end
end
def.on_destruct = function(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
end
def.drawtype = "mesh"
def.paramtype = "light"
def.paramtype2 = "facedir"
@ -467,7 +459,7 @@ function doors.register_trapdoor(name, def)
local pn = placer:get_player_name()
local meta = minetest.get_meta(pos)
meta:set_string("owner", pn)
meta:set_string("infotext", S(def.description) .. "\n" .. S("Owned by @1", S(pn)))
meta:set_string("infotext", def.description .. "\n" .. S("Owned by @1", S(pn)))
return minetest.is_creative_enabled(pn)
end