chest size detection, protector door bedrock detection, dig doors in mcl

This commit is contained in:
tenplus1 2024-09-16 08:10:36 +01:00
commit 97b0da0cf9
2 changed files with 5 additions and 2 deletions

View file

@ -16,6 +16,7 @@ local protector_crafts = minetest.settings:get_bool("protector_crafts") ~= false
-- Registers a door -- Registers a door
function register_door(name, def) function register_door(name, def)
def.groups.not_in_creative_inventory = 1 def.groups.not_in_creative_inventory = 1
def.groups.handy = 1
local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}} local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}
@ -550,6 +551,8 @@ end
-- Protected Chest -- Protected Chest
local chest_size = mcl and (9 * 3) or (8 * 4)
minetest.register_node("protector:chest", { minetest.register_node("protector:chest", {
description = S("Protected Chest"), description = S("Protected Chest"),
tiles = { tiles = {
@ -570,7 +573,7 @@ minetest.register_node("protector:chest", {
meta:set_string("infotext", S("Protected Chest")) meta:set_string("infotext", S("Protected Chest"))
meta:set_string("name", S("Protected Chest")) meta:set_string("name", S("Protected Chest"))
inv:set_size("main", 8 * 4) inv:set_size("main", chest_size)
end, end,
can_dig = function(pos,player) can_dig = function(pos,player)

View file

@ -79,7 +79,7 @@ minetest.register_craftitem("protector:tool", {
end end
-- do not place protector out of map bounds -- do not place protector out of map bounds
if minetest.find_node_near(pos, 1, {"ignore"}) then if minetest.find_node_near(pos, 1, {"ignore", "mcl_core:bedrock"}) then
return return
end end