This commit is contained in:
Oblomov 2024-03-29 20:30:36 -07:00 committed by GitHub
commit 1489baf28c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -2632,6 +2632,16 @@ register_sign("steel", S("Steel Sign"), {
groups = {cracky = 2, attached_node = 1}
})
local place_ladder = function(itemstack, placer, pointed_thing)
local under = minetest.get_node(pointed_thing.under)
local sneaking = placer and placer:get_player_control().sneak
if sneaking and under and under.name:find("^default:ladder_") then
return minetest.item_place(itemstack, placer, pointed_thing, under.param2)
else
return minetest.item_place(itemstack, placer, pointed_thing)
end
end
minetest.register_node("default:ladder_wood", {
description = S("Wooden Ladder"),
drawtype = "signlike",
@ -2650,6 +2660,7 @@ minetest.register_node("default:ladder_wood", {
--wall_bottom = = <default>
--wall_side = = <default>
},
on_place = place_ladder,
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
@ -2673,6 +2684,7 @@ minetest.register_node("default:ladder_steel", {
--wall_bottom = = <default>
--wall_side = = <default>
},
on_place = place_ladder,
groups = {cracky = 2},
sounds = default.node_sound_metal_defaults(),
})