mirror of
https://github.com/minetest-mods/more_chests.git
synced 2025-01-09 08:50:18 +01:00
parent
f1cfa9d7f3
commit
9526aec1cd
@ -10,17 +10,16 @@ local cobble = gen_def({
|
|||||||
side = "default_cobble.png",
|
side = "default_cobble.png",
|
||||||
front = "cobblechest_front.png"
|
front = "cobblechest_front.png"
|
||||||
},
|
},
|
||||||
pipeworks_enabled = true,
|
pipeworks_enabled = true
|
||||||
recipe = {
|
|
||||||
{"group:wood", "default:cobble", "group:wood"},
|
|
||||||
{"default:cobble", "default:steel_ingot", "default:cobble"},
|
|
||||||
{"group:wood", "default:cobble", "group:wood"}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("more_chests:cobble", cobble)
|
minetest.register_node("more_chests:cobble", cobble)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:cobble",
|
output = "more_chests:cobble",
|
||||||
recipe = cobble.recipe,
|
recipe = {
|
||||||
|
{"group:wood", "default:cobble", "group:wood"},
|
||||||
|
{"default:cobble", "default:steel_ingot", "default:cobble"},
|
||||||
|
{"group:wood", "default:cobble", "group:wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -12,11 +12,6 @@ local dropbox = gen_def({
|
|||||||
front = "dropbox_front.png"
|
front = "dropbox_front.png"
|
||||||
},
|
},
|
||||||
pipeworks_enabled = true,
|
pipeworks_enabled = true,
|
||||||
recipe = {
|
|
||||||
{"group:wood", "", "group:wood"},
|
|
||||||
{"group:wood", "default:steel_ingot", "group:wood"},
|
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
|
||||||
},
|
|
||||||
allow_metadata_inventory_move = false,
|
allow_metadata_inventory_move = false,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
@ -41,5 +36,9 @@ local dropbox = gen_def({
|
|||||||
minetest.register_node("more_chests:dropbox", dropbox)
|
minetest.register_node("more_chests:dropbox", dropbox)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:dropbox",
|
output = "more_chests:dropbox",
|
||||||
recipe = dropbox.recipe,
|
recipe = {
|
||||||
|
{"group:wood", "", "group:wood"},
|
||||||
|
{"group:wood", "default:steel_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -3,6 +3,7 @@ local S = minetest.get_translator("more_chests")
|
|||||||
|
|
||||||
-- TODO model open
|
-- TODO model open
|
||||||
|
|
||||||
|
-- normal fridge
|
||||||
local fridge = gen_def({
|
local fridge = gen_def({
|
||||||
description = S("Fridge"),
|
description = S("Fridge"),
|
||||||
type = "fridge",
|
type = "fridge",
|
||||||
@ -11,20 +12,19 @@ local fridge = gen_def({
|
|||||||
side = "fridge_side.png",
|
side = "fridge_side.png",
|
||||||
front = "fridge_front.png",
|
front = "fridge_front.png",
|
||||||
},
|
},
|
||||||
recipe = {
|
|
||||||
{"", "default:steel_ingot", ""},
|
|
||||||
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
|
|
||||||
{"", "default:steel_ingot", ""}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("more_chests:fridge", fridge)
|
minetest.register_node("more_chests:fridge", fridge)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:fridge",
|
output = "more_chests:fridge",
|
||||||
recipe = fridge.recipe,
|
recipe = {
|
||||||
|
{"", "default:steel_ingot", ""},
|
||||||
|
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
|
||||||
|
{"", "default:steel_ingot", ""}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- big fridge
|
||||||
local big_fridge = gen_def({
|
local big_fridge = gen_def({
|
||||||
description = S("Big Fridge"),
|
description = S("Big Fridge"),
|
||||||
type = "fridge",
|
type = "fridge",
|
||||||
@ -36,15 +36,14 @@ local big_fridge = gen_def({
|
|||||||
side = "fridge_side.png",
|
side = "fridge_side.png",
|
||||||
front = "fridge_front.png",
|
front = "fridge_front.png",
|
||||||
},
|
},
|
||||||
recipe = {
|
|
||||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
|
||||||
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
|
|
||||||
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("more_chests:big_fridge", big_fridge)
|
minetest.register_node("more_chests:big_fridge", big_fridge)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:big_fridge",
|
output = "more_chests:big_fridge",
|
||||||
recipe = big_fridge.recipe,
|
recipe = {
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
{"default:steel_ingot", "default:ice", "default:steel_ingot"},
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -28,11 +28,6 @@ local secret = gen_def({
|
|||||||
},
|
},
|
||||||
formspec = open,
|
formspec = open,
|
||||||
pipeworks_enabled = true,
|
pipeworks_enabled = true,
|
||||||
recipe = {
|
|
||||||
{"group:wood", "default:cobble", "group:wood"},
|
|
||||||
{"group:wood", "default:steel_ingot", "group:wood"},
|
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
secret.on_receive_fields = function(pos, formname, fields, sender)
|
secret.on_receive_fields = function(pos, formname, fields, sender)
|
||||||
@ -50,5 +45,9 @@ end
|
|||||||
minetest.register_node("more_chests:secret", secret)
|
minetest.register_node("more_chests:secret", secret)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:secret",
|
output = "more_chests:secret",
|
||||||
recipe = secret.recipe,
|
recipe = {
|
||||||
|
{"group:wood", "default:cobble", "group:wood"},
|
||||||
|
{"group:wood", "default:steel_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -44,11 +44,6 @@ local shared = gen_def({
|
|||||||
formspec = get_formspec(""),
|
formspec = get_formspec(""),
|
||||||
pipeworks_enabled = true,
|
pipeworks_enabled = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
recipe = {
|
|
||||||
{"group:wood", "default:leaves", "group:wood"},
|
|
||||||
{"group:wood", "default:steel_ingot", "group:wood"},
|
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
|
||||||
},
|
|
||||||
allow_metadata_inventory_move = actions.get_allow_metadata_inventory_move{"shared chest", check_privs=check_privs},
|
allow_metadata_inventory_move = actions.get_allow_metadata_inventory_move{"shared chest", check_privs=check_privs},
|
||||||
allow_metadata_inventory_put = actions.get_allow_metadata_inventory_put{"shared chest", check_privs=check_privs},
|
allow_metadata_inventory_put = actions.get_allow_metadata_inventory_put{"shared chest", check_privs=check_privs},
|
||||||
allow_metadata_inventory_take = actions.get_allow_metadata_inventory_take{"shared chest", check_privs=check_privs},
|
allow_metadata_inventory_take = actions.get_allow_metadata_inventory_take{"shared chest", check_privs=check_privs},
|
||||||
@ -68,5 +63,9 @@ end
|
|||||||
minetest.register_node("more_chests:shared", shared)
|
minetest.register_node("more_chests:shared", shared)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:shared",
|
output = "more_chests:shared",
|
||||||
recipe = shared.recipe,
|
recipe = {
|
||||||
|
{"group:wood", "default:leaves", "group:wood"},
|
||||||
|
{"group:wood", "default:steel_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local gen_def = dofile(minetest.get_modpath("more_chests") .. "/utils/base.lua")
|
local gen_def = dofile(minetest.get_modpath("more_chests") .. "/utils/base.lua")
|
||||||
local S = minetest.get_translator("more_chests")
|
local S = minetest.get_translator("more_chests")
|
||||||
|
|
||||||
local function register_toolbox(description, type, side_tile, recipe)
|
local function register_toolbox(description, material, side_tile, craft_item)
|
||||||
local def = gen_def({
|
local def = gen_def({
|
||||||
description = description,
|
description = description,
|
||||||
type = "toolbox",
|
type = "toolbox",
|
||||||
@ -9,26 +9,25 @@ local function register_toolbox(description, type, side_tile, recipe)
|
|||||||
-- node_box = {-0.5, -0.5, -0.5, 1.5, 0.5, 0.5}, -- makes it two blocks wide
|
-- node_box = {-0.5, -0.5, -0.5, 1.5, 0.5, 0.5}, -- makes it two blocks wide
|
||||||
tiles = {
|
tiles = {
|
||||||
side = side_tile,
|
side = side_tile,
|
||||||
front = "toolbox_" .. type .. "_front.png",
|
front = "toolbox_" .. material .. "_front.png",
|
||||||
top = "toolbox_" .. type .. "_top.png",
|
top = "toolbox_" .. material .. "_top.png",
|
||||||
},
|
},
|
||||||
recipe = recipe,
|
|
||||||
})
|
})
|
||||||
minetest.register_node("more_chests:toolbox_" .. type, def)
|
minetest.register_node("more_chests:toolbox_" .. material, def)
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "morechests:toolbox_" .. material,
|
||||||
|
recipe = {
|
||||||
|
{craft_item, craft_item, craft_item},
|
||||||
|
{craft_item, "group:pickaxe", craft_item},
|
||||||
|
{craft_item, craft_item, craft_item}
|
||||||
|
}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function gen_recipe(craft_item)
|
|
||||||
return {
|
|
||||||
{craft_item, craft_item, craft_item},
|
|
||||||
{craft_item, "group:pickaxe", craft_item},
|
|
||||||
{craft_item, craft_item, craft_item}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
register_toolbox(S("Wooden Toolbox"), "wood", "default_wood.png", gen_recipe("default:wood"))
|
register_toolbox(S("Wooden Toolbox"), "wood", "default_wood.png", "default:wood")
|
||||||
register_toolbox(S("Aspen Wood Toolbox"), "aspen", "default_aspen_wood.png", gen_recipe("default:aspen_wood"))
|
register_toolbox(S("Aspen Wood Toolbox"), "aspen", "default_aspen_wood.png", "default:aspen_wood")
|
||||||
register_toolbox(S("Acacia Wood Toolbox"), "acacia", "default_acacia_wood.png", gen_recipe("default:acacia_wood"))
|
register_toolbox(S("Acacia Wood Toolbox"), "acacia", "default_acacia_wood.png", "default:acacia_wood")
|
||||||
register_toolbox(S("Junglewood Toolbox"), "jungle", "default_junglewood.png", gen_recipe("default:junglewood"))
|
register_toolbox(S("Junglewood Toolbox"), "jungle", "default_junglewood.png", "default:junglewood")
|
||||||
register_toolbox(S("Pine Wood Toolbox"), "pine", "default_pine_wood.png", gen_recipe("default:pine_wood"))
|
register_toolbox(S("Pine Wood Toolbox"), "pine", "default_pine_wood.png", "default:pine_wood")
|
||||||
|
register_toolbox(S("Steel Toolbox"), "steel", "default_steel_block.png", "default:steel_ingot")
|
||||||
register_toolbox(S("Steel Toolbox"), "steel", "default_steel_block.png", gen_recipe("default:steel_ingot"))
|
|
||||||
|
@ -11,11 +11,6 @@ local wifi = gen_def({
|
|||||||
front = {name="wifi_front_animated.png", animation={type="vertical_frames",
|
front = {name="wifi_front_animated.png", animation={type="vertical_frames",
|
||||||
aspect_w=16, aspect_h=16, length=2.0}}
|
aspect_w=16, aspect_h=16, length=2.0}}
|
||||||
},
|
},
|
||||||
recipe = {
|
|
||||||
{"group:wood", "default:mese", "group:wood"},
|
|
||||||
{"group:wood", "default:steel_ingot", "group:wood"},
|
|
||||||
{"group:wood", "group:wood", "group:wood"}
|
|
||||||
},
|
|
||||||
allow_metadata_inventory_move = false,
|
allow_metadata_inventory_move = false,
|
||||||
allow_metadata_inventory_put = false,
|
allow_metadata_inventory_put = false,
|
||||||
allow_metadata_inventory_take = false,
|
allow_metadata_inventory_take = false,
|
||||||
@ -26,7 +21,11 @@ wifi.can_dig = function(pos, player) return true end
|
|||||||
minetest.register_node("more_chests:wifi", wifi)
|
minetest.register_node("more_chests:wifi", wifi)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "more_chests:wifi",
|
output = "more_chests:wifi",
|
||||||
recipe = wifi.recipe,
|
recipe = {
|
||||||
|
{"group:wood", "default:mese", "group:wood"},
|
||||||
|
{"group:wood", "default:steel_ingot", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
@ -34,7 +34,6 @@ function generate_chest_def(def)
|
|||||||
oddly_breakable_by_hand=2
|
oddly_breakable_by_hand=2
|
||||||
},
|
},
|
||||||
sounds = def.sounds or default.node_sound_wood_defaults(),
|
sounds = def.sounds or default.node_sound_wood_defaults(),
|
||||||
recipe = def.recipe, -- TODO this is buggy, reason why all models except from toolbox have their own extra call to minetest.register_craft - TODO possibily other similar bugs?
|
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
|
Loading…
Reference in New Issue
Block a user