Added MineClone2 support
This commit is contained in:
parent
5f6a6a201f
commit
7a6f598d19
7 changed files with 95 additions and 26 deletions
|
|
@ -56,6 +56,7 @@ Change log:
|
||||||
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
|
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
|
||||||
- 2.7 - Remove protection field entity when protector has been dug
|
- 2.7 - Remove protection field entity when protector has been dug
|
||||||
- 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark.
|
- 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark.
|
||||||
|
- 2.9 - Added MineClone2 compatibility (missing default switches to alternate recipes etc.)
|
||||||
|
|
||||||
Lucky Blocks: 10
|
Lucky Blocks: 10
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ minetest.register_chatcommand("protector_remove", {
|
||||||
end
|
end
|
||||||
|
|
||||||
removal_names = param
|
removal_names = param
|
||||||
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -64,7 +63,6 @@ minetest.register_chatcommand("protector_replace", {
|
||||||
end
|
end
|
||||||
|
|
||||||
replace_names = param
|
replace_names = param
|
||||||
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -106,7 +104,6 @@ minetest.register_abm({
|
||||||
meta:set_string("owner", names[2])
|
meta:set_string("owner", names[2])
|
||||||
meta:set_string("infotext", S("Protection (owned by @1)", names[2]))
|
meta:set_string("infotext", S("Protection (owned by @1)", names[2]))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
default
|
default?
|
||||||
intllib?
|
intllib?
|
||||||
lucky_block?
|
lucky_block?
|
||||||
mesecons_mvps?
|
mesecons_mvps?
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
local S = protector.intllib
|
local S = protector.intllib
|
||||||
local F = minetest.formspec_escape
|
local F = minetest.formspec_escape
|
||||||
|
|
||||||
|
-- MineClone2 support
|
||||||
|
local mcl = not minetest.registered_items["default:steel_ingot"]
|
||||||
|
|
||||||
-- 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
|
||||||
|
|
@ -310,6 +313,14 @@ register_door(name, {
|
||||||
sunlight = false,
|
sunlight = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if mcl then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = name,
|
||||||
|
recipe = {
|
||||||
|
{"mcl_doors:wooden_door", "mcl_core:gold_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = name,
|
output = name,
|
||||||
recipe = {
|
recipe = {
|
||||||
|
|
@ -325,6 +336,7 @@ minetest.register_craft({
|
||||||
{"doors:door_wood", "default:copper_ingot"}
|
{"doors:door_wood", "default:copper_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- Protected Steel Door
|
-- Protected Steel Door
|
||||||
|
|
||||||
|
|
@ -343,6 +355,14 @@ register_door(name, {
|
||||||
sunlight = false,
|
sunlight = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if mcl then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = name,
|
||||||
|
recipe = {
|
||||||
|
{"mcl_doors:iron_door", "mcl_core:gold_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = name,
|
output = name,
|
||||||
recipe = {
|
recipe = {
|
||||||
|
|
@ -358,6 +378,7 @@ minetest.register_craft({
|
||||||
{"doors:door_steel", "default:copper_ingot"}
|
{"doors:door_steel", "default:copper_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
----trapdoor----
|
----trapdoor----
|
||||||
|
|
||||||
|
|
@ -434,12 +455,19 @@ register_trapdoor("protector:trapdoor", {
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if mcl then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'protector:trapdoor 2',
|
output = "protector:trapdoor",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
{"mcl_doors:trapdoor", "mcl_core:gold_ingot"}
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
}
|
||||||
{'', '', ''},
|
})
|
||||||
|
else
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "protector:trapdoor 2",
|
||||||
|
recipe = {
|
||||||
|
{"group:wood", "default:copper_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -449,6 +477,7 @@ minetest.register_craft({
|
||||||
{"doors:trapdoor", "default:copper_ingot"}
|
{"doors:trapdoor", "default:copper_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- Protected Steel Trapdoor
|
-- Protected Steel Trapdoor
|
||||||
|
|
||||||
|
|
@ -465,11 +494,19 @@ register_trapdoor("protector:trapdoor_steel", {
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if mcl then
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "protector:trapdoor_steel",
|
||||||
|
recipe = {
|
||||||
|
{"mcl_doors:iron_trapdoor", "mcl_core:gold_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'protector:trapdoor_steel',
|
output = 'protector:trapdoor_steel',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:copper_ingot', 'default:steel_ingot'},
|
{"default:copper_ingot", "default:steel_ingot"},
|
||||||
{'default:steel_ingot', 'default:steel_ingot'},
|
{"default:steel_ingot", "default:steel_ingot"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -479,6 +516,7 @@ minetest.register_craft({
|
||||||
{"doors:trapdoor_steel", "default:copper_ingot"}
|
{"doors:trapdoor_steel", "default:copper_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- Protected Chest
|
-- Protected Chest
|
||||||
|
|
||||||
|
|
@ -675,18 +713,27 @@ end)
|
||||||
|
|
||||||
-- Protected Chest recipes
|
-- Protected Chest recipes
|
||||||
|
|
||||||
|
if mcl then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'protector:chest',
|
output = "protector:chest",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{"mcl_chests:chest", "mcl_core:gold_ingot"},
|
||||||
{'group:wood', 'default:copper_ingot', 'group:wood'},
|
}
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
})
|
||||||
|
else
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "protector:chest",
|
||||||
|
recipe = {
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
|
{"group:wood", "default:copper_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'protector:chest',
|
output = "protector:chest",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:chest', 'default:copper_ingot', ''},
|
{"default:chest", "default:copper_ingot"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
|
||||||
2
hud.lua
2
hud.lua
|
|
@ -48,9 +48,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
})
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
player:hud_change(hud[name].id, "text", hud_text)
|
player:hud_change(hud[name].id, "text", hud_text)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
22
init.lua
22
init.lua
|
|
@ -1,4 +1,13 @@
|
||||||
|
|
||||||
|
-- default support (for use with MineClone2 and other [games]
|
||||||
|
default = default or {
|
||||||
|
node_sound_stone_defaults = function(table) end,
|
||||||
|
node_sound_wood_defaults = function(table) end,
|
||||||
|
gui_bg = "",
|
||||||
|
gui_bg_img = "",
|
||||||
|
gui_slots = "",
|
||||||
|
}
|
||||||
|
|
||||||
-- Load support for intllib.
|
-- Load support for intllib.
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||||
local S = dofile(MP .. "/intllib.lua")
|
local S = dofile(MP .. "/intllib.lua")
|
||||||
|
|
@ -441,6 +450,8 @@ minetest.register_node("protector:protect", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- default recipe and alternative for MineClone2
|
||||||
|
if minetest.registered_items["default:stone"] then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "protector:protect",
|
output = "protector:protect",
|
||||||
recipe = {
|
recipe = {
|
||||||
|
|
@ -449,7 +460,16 @@ minetest.register_craft({
|
||||||
{"default:stone", "default:stone", "default:stone"},
|
{"default:stone", "default:stone", "default:stone"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
else
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "protector:protect",
|
||||||
|
recipe = {
|
||||||
|
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
|
||||||
|
{"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
|
||||||
|
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- protection logo
|
-- protection logo
|
||||||
minetest.register_node("protector:protect2", {
|
minetest.register_node("protector:protect2", {
|
||||||
|
|
|
||||||
12
tool.lua
12
tool.lua
|
|
@ -141,11 +141,17 @@ minetest.register_craftitem("protector:tool", {
|
||||||
})
|
})
|
||||||
|
|
||||||
-- tool recipe
|
-- tool recipe
|
||||||
|
local df = "default:steel_ingot"
|
||||||
|
if not minetest.registered_items[df] then
|
||||||
|
df = "mcl_core:iron_ingot"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "protector:tool",
|
output = "protector:tool",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
{df, df, df},
|
||||||
{"default:steel_ingot", "protector:protect", "default:steel_ingot"},
|
{df, "protector:protect", df},
|
||||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
{df, df, df},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue