added 'protector_crafts' setting, doors/chest immediate_dig set for mineclone2 fix

This commit is contained in:
tenplus1 2021-10-21 19:34:20 +01:00
parent 421ac3eca0
commit 7a3c173252
3 changed files with 128 additions and 112 deletions

@ -61,7 +61,7 @@ Change log:
- 3.1 - Ability to hide protection blocks using /protector_hide and /protector_show , italian local added (thanks Hamlet)
- 3.2 - Defaults to Minetest translation if found, otherwise intllib fallback if loaded, locale files updated for both. Added 'protector_msg' setting for player text.
- 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22.
- 3.4 - Player flip and hurt functions moved to minetest.register_protection_violation function (thanks hlqkj)
- 3.4 - Player flip and hurt functions moved to minetest.register_protection_violation function (thanks hlqkj), added 'protector_crafts' setting, changed wood doors n chests to immediate_dig for mineclone2 fix.
Lucky Blocks: 10

@ -9,6 +9,9 @@ local F = minetest.formspec_escape
-- MineClone2 support
local mcl = not minetest.registered_items["default:steel_ingot"]
-- Are crafts enabled?
local protector_crafts = minetest.settings:get_bool("protector_crafts") ~= false
-- Registers a door
function register_door(name, def)
def.groups.not_in_creative_inventory = 1
@ -308,7 +311,7 @@ register_door(name, {
description = S("Protected Wooden Door"),
inventory_image = "doors_wood.png^protector_logo.png",
groups = {
snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,
snappy = 1, choppy = 2, dig_immediate = 2,
unbreakable = 1, --door = 1
},
tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"},
@ -317,6 +320,7 @@ register_door(name, {
sunlight = false,
})
if protector_crafts then
if mcl then
minetest.register_craft({
output = name,
@ -341,6 +345,7 @@ minetest.register_craft({
}
})
end
end
-- Protected Steel Door
@ -359,6 +364,7 @@ register_door(name, {
sunlight = false,
})
if protector_crafts then
if mcl then
minetest.register_craft({
output = name,
@ -383,6 +389,7 @@ minetest.register_craft({
}
})
end
end
----trapdoor----
@ -454,12 +461,13 @@ register_trapdoor("protector:trapdoor", {
tile_front = "doors_trapdoor.png^protector_logo.png",
tile_side = "doors_trapdoor_side.png",
groups = {
snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,
snappy = 1, choppy = 2, dig_immediate = 2,
unbreakable = 1, --door = 1
},
sounds = default.node_sound_wood_defaults(),
})
if protector_crafts then
if mcl then
minetest.register_craft({
output = "protector:trapdoor",
@ -483,6 +491,7 @@ minetest.register_craft({
}
})
end
end
-- Protected Steel Trapdoor
@ -499,6 +508,7 @@ register_trapdoor("protector:trapdoor_steel", {
sounds = default.node_sound_wood_defaults(),
})
if protector_crafts then
if mcl then
minetest.register_craft({
output = "protector:trapdoor_steel",
@ -522,6 +532,7 @@ minetest.register_craft({
}
})
end
end
-- Protected Chest
@ -533,7 +544,7 @@ minetest.register_node("protector:chest", {
"default_chest_side.png", "default_chest_front.png^protector_logo.png"
},
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2, unbreakable = 1},
groups = {dig_immediate = 2, unbreakable = 1},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
@ -720,6 +731,7 @@ end)
-- Protected Chest recipes
if protector_crafts then
if mcl then
minetest.register_craft({
output = "protector:chest",
@ -744,3 +756,4 @@ minetest.register_craft({
}
})
end
end

@ -28,5 +28,8 @@ protector_hud_interval (Protector HUD Interval) int 5
# Enables craft recipe for protection block
protector_recipe (Enable Protector recipe) bool true
# Enables craft recipes for protected doors and chest
protector_crafts (Enable Protector door/chest recipes) bool true
# Enables protection messages in player chat
protector_msg (Enable Protector Messages) bool true