2017-03-26 16:17:48 +02:00
|
|
|
--[[
|
2017-03-28 20:22:28 +02:00
|
|
|
Minetest Mod Storage Drawers - A Mod adding storage drawers
|
2017-03-26 16:17:48 +02:00
|
|
|
|
2020-01-11 16:05:58 +01:00
|
|
|
Copyright (C) 2017-2020 Linus Jahn <lnj@kaidan.im>
|
2017-03-26 16:17:48 +02:00
|
|
|
|
|
|
|
MIT License
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
]]
|
|
|
|
|
2017-04-11 13:02:31 +02:00
|
|
|
local MP = core.get_modpath(core.get_current_modname())
|
2022-12-23 21:38:06 +01:00
|
|
|
|
|
|
|
local S = minetest.get_translator('drawers')
|
|
|
|
local NS = minetest.get_translator('drawers')
|
2017-04-11 13:02:31 +02:00
|
|
|
|
2017-03-26 16:17:48 +02:00
|
|
|
drawers = {}
|
2017-04-01 19:13:09 +02:00
|
|
|
drawers.drawer_visuals = {}
|
2024-02-21 14:25:09 +01:00
|
|
|
drawers.mcl_loaded = core.get_modpath("mcl_core") and mcl_core
|
2017-03-26 16:17:48 +02:00
|
|
|
|
2019-05-18 23:10:53 +02:00
|
|
|
drawers.WOOD_ITEMSTRING = "group:wood"
|
2017-04-10 16:40:52 +02:00
|
|
|
if core.get_modpath("default") and default then
|
2017-04-01 16:28:03 +02:00
|
|
|
drawers.WOOD_SOUNDS = default.node_sound_wood_defaults()
|
|
|
|
drawers.CHEST_ITEMSTRING = "default:chest"
|
2024-02-21 14:25:09 +01:00
|
|
|
elseif drawers.mcl_loaded then -- MineClone 2
|
2017-04-01 16:28:03 +02:00
|
|
|
drawers.CHEST_ITEMSTRING = "mcl_chests:chest"
|
2017-04-10 16:40:52 +02:00
|
|
|
if core.get_modpath("mcl_sounds") and mcl_sounds then
|
2017-04-01 16:28:03 +02:00
|
|
|
drawers.WOOD_SOUNDS = mcl_sounds.node_sound_wood_defaults()
|
2017-03-29 19:12:55 +02:00
|
|
|
end
|
2017-03-28 20:22:28 +02:00
|
|
|
else
|
2017-04-01 16:28:03 +02:00
|
|
|
drawers.CHEST_ITEMSTRING = "chest"
|
2017-03-28 20:22:28 +02:00
|
|
|
end
|
|
|
|
|
2017-03-28 21:48:37 +02:00
|
|
|
|
2017-06-07 11:17:00 +02:00
|
|
|
drawers.enable_1x1 = not core.settings:get_bool("drawers_disable_1x1")
|
|
|
|
drawers.enable_1x2 = not core.settings:get_bool("drawers_disable_1x2")
|
|
|
|
drawers.enable_2x2 = not core.settings:get_bool("drawers_disable_2x2")
|
2017-04-09 22:31:31 +02:00
|
|
|
|
2019-05-18 23:16:07 +02:00
|
|
|
drawers.CONTROLLER_RANGE = 14
|
2017-04-17 16:04:16 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- GUI
|
|
|
|
--
|
|
|
|
|
|
|
|
drawers.gui_bg = "bgcolor[#080808BB;true]"
|
|
|
|
drawers.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
2024-02-21 14:25:09 +01:00
|
|
|
function drawers.inventory_list(posy)
|
|
|
|
local hotbar_row_posy = posy + 1.25
|
|
|
|
local inventory_list= "list[current_player;main;0.5,"..posy..";8,1;]" ..
|
|
|
|
"list[current_player;main;0.5,"..hotbar_row_posy..";8,3;8]"
|
|
|
|
if drawers.mcl_loaded then -- MCL2
|
|
|
|
hotbar_row_posy = posy + 3.25
|
|
|
|
inventory_list = "list[current_player;main;0,"..posy..";9,3;9]" ..
|
|
|
|
"list[current_player;main;0,"..hotbar_row_posy..";9,1;]"
|
|
|
|
end
|
|
|
|
return inventory_list
|
2018-09-10 19:57:23 +02:00
|
|
|
end
|
2017-04-17 16:04:16 +02:00
|
|
|
|
2017-04-01 16:28:03 +02:00
|
|
|
--
|
2017-04-17 16:04:16 +02:00
|
|
|
-- Load API
|
2017-04-01 16:28:03 +02:00
|
|
|
--
|
2017-03-26 16:17:48 +02:00
|
|
|
|
2017-04-11 13:02:31 +02:00
|
|
|
dofile(MP .. "/lua/helpers.lua")
|
|
|
|
dofile(MP .. "/lua/visual.lua")
|
|
|
|
dofile(MP .. "/lua/api.lua")
|
2018-06-16 09:03:48 +02:00
|
|
|
dofile(MP .. "/lua/controller.lua")
|
2017-03-26 16:17:48 +02:00
|
|
|
|
|
|
|
|
2017-04-01 16:28:03 +02:00
|
|
|
--
|
|
|
|
-- Register drawers
|
|
|
|
--
|
2017-03-26 16:17:48 +02:00
|
|
|
|
2017-04-10 16:40:52 +02:00
|
|
|
if core.get_modpath("default") and default then
|
|
|
|
drawers.register_drawer("drawers:wood", {
|
|
|
|
description = S("Wooden"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_wood_front_1.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_wood_front_2.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_wood_front_4.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = drawers.WOOD_ITEMSTRING
|
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:acacia_wood", {
|
|
|
|
description = S("Acacia Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_acacia_wood_front_1.png",
|
|
|
|
"drawers_acacia_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_acacia_wood_front_2.png",
|
|
|
|
"drawers_acacia_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_acacia_wood_front_4.png",
|
|
|
|
"drawers_acacia_wood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal mcl chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = "default:acacia_wood"
|
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:aspen_wood", {
|
|
|
|
description = S("Aspen Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_aspen_wood_front_1.png",
|
|
|
|
"drawers_aspen_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_aspen_wood_front_2.png",
|
|
|
|
"drawers_aspen_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_aspen_wood_front_4.png",
|
|
|
|
"drawers_aspen_wood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = "default:aspen_wood"
|
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:junglewood", {
|
|
|
|
description = S("Junglewood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_junglewood_front_1.png",
|
|
|
|
"drawers_junglewood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_junglewood_front_2.png",
|
|
|
|
"drawers_junglewood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_junglewood_front_4.png",
|
|
|
|
"drawers_junglewood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal mcl chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = "default:junglewood"
|
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:pine_wood", {
|
|
|
|
description = S("Pine Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_pine_wood_front_1.png",
|
|
|
|
"drawers_pine_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_pine_wood_front_2.png",
|
|
|
|
"drawers_pine_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_pine_wood_front_4.png",
|
|
|
|
"drawers_pine_wood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = "default:pine_wood"
|
|
|
|
})
|
2024-02-21 14:25:09 +01:00
|
|
|
elseif drawers.mcl_loaded then
|
2017-04-10 16:40:52 +02:00
|
|
|
drawers.register_drawer("drawers:oakwood", {
|
|
|
|
description = S("Oak Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_oak_wood_front_1.png",
|
|
|
|
"drawers_oak_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_oak_wood_front_2.png",
|
|
|
|
"drawers_oak_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_oak_wood_front_4.png",
|
|
|
|
"drawers_oak_wood.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = drawers.WOOD_ITEMSTRING,
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:acaciawood", {
|
|
|
|
description = S("Acacia Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_acacia_wood_mcl_front_1.png",
|
|
|
|
"drawers_acacia_wood_mcl.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_acacia_wood_mcl_front_2.png",
|
|
|
|
"drawers_acacia_wood_mcl.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_acacia_wood_mcl_front_4.png",
|
|
|
|
"drawers_acacia_wood_mcl.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = "mcl_core:acaciawood",
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:birchwood", {
|
|
|
|
description = S("Birch Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_birch_wood_front_1.png",
|
|
|
|
"drawers_birch_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_birch_wood_front_2.png",
|
|
|
|
"drawers_birch_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_birch_wood_front_4.png",
|
|
|
|
"drawers_birch_wood.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = "mcl_core:birchwood",
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:darkwood", {
|
|
|
|
description = S("Dark Oak Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_dark_oak_wood_front_1.png",
|
|
|
|
"drawers_dark_oak_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_dark_oak_wood_front_2.png",
|
|
|
|
"drawers_dark_oak_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_dark_oak_wood_front_4.png",
|
|
|
|
"drawers_dark_oak_wood.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = "mcl_core:darkwood",
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:junglewood", {
|
|
|
|
description = S("Junglewood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_junglewood_mcl_front_1.png",
|
|
|
|
"drawers_junglewood_mcl.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_junglewood_mcl_front_2.png",
|
|
|
|
"drawers_junglewood_mcl.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_junglewood_mcl_front_4.png",
|
|
|
|
"drawers_junglewood_mcl.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = "mcl_core:junglewood",
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
drawers.register_drawer("drawers:sprucewood", {
|
|
|
|
description = S("Spruce Wood"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_spruce_wood_front_1.png",
|
|
|
|
"drawers_spruce_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_spruce_wood_front_2.png",
|
|
|
|
"drawers_spruce_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_spruce_wood_front_4.png",
|
|
|
|
"drawers_spruce_wood.png"),
|
2018-10-12 03:25:41 +02:00
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2017-04-10 16:40:52 +02:00
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 36, -- 4 * 9 normal mcl chest size
|
2018-10-12 03:25:41 +02:00
|
|
|
material = "mcl_core:sprucewood",
|
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
2017-04-10 16:40:52 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- backwards compatibility
|
|
|
|
core.register_alias("drawers:wood1", "drawers:oakwood1")
|
|
|
|
core.register_alias("drawers:wood2", "drawers:oakwood2")
|
|
|
|
core.register_alias("drawers:wood4", "drawers:oakwood4")
|
|
|
|
else
|
|
|
|
drawers.register_drawer("drawers:wood", {
|
|
|
|
description = S("Wooden"),
|
|
|
|
tiles1 = drawers.node_tiles_front_other("drawers_wood_front_1.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
tiles2 = drawers.node_tiles_front_other("drawers_wood_front_2.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
tiles4 = drawers.node_tiles_front_other("drawers_wood_front_4.png",
|
|
|
|
"drawers_wood.png"),
|
|
|
|
groups = {choppy = 3, oddly_breakable_by_hand = 2},
|
|
|
|
sounds = drawers.WOOD_SOUNDS,
|
2020-10-14 18:34:29 +02:00
|
|
|
drawer_stack_max_factor = 32, -- 4 * 8 normal chest size
|
2017-04-10 16:40:52 +02:00
|
|
|
material = drawers.WOOD_ITEMSTRING
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-04-17 16:04:16 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Register drawer upgrades
|
|
|
|
--
|
|
|
|
|
|
|
|
if core.get_modpath("default") and default then
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_steel", {
|
|
|
|
description = S("Steel Drawer Upgrade (x2)"),
|
|
|
|
inventory_image = "drawers_upgrade_steel.png",
|
|
|
|
groups = {drawer_upgrade = 100},
|
|
|
|
recipe_item = "default:steel_ingot"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_gold", {
|
|
|
|
description = S("Gold Drawer Upgrade (x3)"),
|
|
|
|
inventory_image = "drawers_upgrade_gold.png",
|
|
|
|
groups = {drawer_upgrade = 200},
|
|
|
|
recipe_item = "default:gold_ingot"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_obsidian", {
|
2020-01-11 16:05:58 +01:00
|
|
|
description = S("Obsidian Drawer Upgrade (x4)"),
|
2017-04-17 16:04:16 +02:00
|
|
|
inventory_image = "drawers_upgrade_obsidian.png",
|
2020-01-11 16:05:58 +01:00
|
|
|
groups = {drawer_upgrade = 300},
|
2017-04-17 16:04:16 +02:00
|
|
|
recipe_item = "default:obsidian"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_diamond", {
|
|
|
|
description = S("Diamond Drawer Upgrade (x8)"),
|
|
|
|
inventory_image = "drawers_upgrade_diamond.png",
|
|
|
|
groups = {drawer_upgrade = 700},
|
|
|
|
recipe_item = "default:diamond"
|
|
|
|
})
|
2024-02-21 14:25:09 +01:00
|
|
|
elseif drawers.mcl_loaded then
|
2017-04-17 16:04:16 +02:00
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_iron", {
|
|
|
|
description = S("Iron Drawer Upgrade (x2)"),
|
|
|
|
inventory_image = "drawers_upgrade_iron.png",
|
|
|
|
groups = {drawer_upgrade = 100},
|
|
|
|
recipe_item = "mcl_core:iron_ingot"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_gold", {
|
|
|
|
description = S("Gold Drawer Upgrade (x3)"),
|
|
|
|
inventory_image = "drawers_upgrade_gold.png",
|
|
|
|
groups = {drawer_upgrade = 200},
|
|
|
|
recipe_item = "mcl_core:gold_ingot"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_obsidian", {
|
2020-01-11 16:05:58 +01:00
|
|
|
description = S("Obsidian Drawer Upgrade (x4)"),
|
2017-04-17 16:04:16 +02:00
|
|
|
inventory_image = "drawers_upgrade_obsidian.png",
|
2020-01-11 16:05:58 +01:00
|
|
|
groups = {drawer_upgrade = 300},
|
2017-04-17 16:04:16 +02:00
|
|
|
recipe_item = "mcl_core:obsidian"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_diamond", {
|
|
|
|
description = S("Diamond Drawer Upgrade (x8)"),
|
|
|
|
inventory_image = "drawers_upgrade_diamond.png",
|
|
|
|
groups = {drawer_upgrade = 700},
|
|
|
|
recipe_item = "mcl_core:diamond"
|
|
|
|
})
|
|
|
|
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_emerald", {
|
|
|
|
description = S("Emerald Drawer Upgrade (x13)"),
|
|
|
|
inventory_image = "drawers_upgrade_emerald.png",
|
|
|
|
groups = {drawer_upgrade = 1200},
|
|
|
|
recipe_item = "mcl_core:emerald"
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2020-01-11 16:22:23 +01:00
|
|
|
if core.get_modpath("moreores") then
|
|
|
|
drawers.register_drawer_upgrade("drawers:upgrade_mithril", {
|
|
|
|
description = S("Mithril Drawer Upgrade (x13)"),
|
|
|
|
inventory_image = "drawers_upgrade_mithril.png",
|
|
|
|
groups = {drawer_upgrade = 1200},
|
|
|
|
recipe_item = "moreores:mithril_ingot"
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2018-09-11 17:52:07 +02:00
|
|
|
--
|
|
|
|
-- Register drawer trim
|
|
|
|
--
|
|
|
|
|
2024-02-21 14:25:09 +01:00
|
|
|
if drawers.mcl_loaded then
|
2018-10-12 04:11:16 +02:00
|
|
|
core.register_node("drawers:trim", {
|
|
|
|
description = S("Wooden Trim"),
|
|
|
|
tiles = {"drawers_trim.png"},
|
2019-05-18 23:02:00 +02:00
|
|
|
groups = {drawer_connector = 1, handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1},
|
2024-02-28 13:45:05 +01:00
|
|
|
is_ground_content = false,
|
2018-10-12 04:11:16 +02:00
|
|
|
_mcl_blast_resistance = 15,
|
|
|
|
_mcl_hardness = 2,
|
|
|
|
})
|
|
|
|
else
|
|
|
|
core.register_node("drawers:trim", {
|
|
|
|
description = S("Wooden Trim"),
|
|
|
|
tiles = {"drawers_trim.png"},
|
2019-05-18 23:02:00 +02:00
|
|
|
groups = {drawer_connector = 1, choppy = 3, oddly_breakable_by_hand = 2},
|
2024-02-28 13:45:05 +01:00
|
|
|
is_ground_content = false,
|
2018-10-12 04:11:16 +02:00
|
|
|
})
|
|
|
|
end
|
2018-09-11 17:52:07 +02:00
|
|
|
|
|
|
|
core.register_craft({
|
|
|
|
output = "drawers:trim 6",
|
|
|
|
recipe = {
|
|
|
|
{"group:stick", "group:wood", "group:stick"},
|
|
|
|
{"group:wood", "group:wood", "group:wood"},
|
|
|
|
{"group:stick", "group:wood", "group:stick"}
|
|
|
|
}
|
|
|
|
})
|
2017-04-17 16:04:16 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Register drawer upgrade template
|
|
|
|
--
|
|
|
|
|
|
|
|
core.register_craftitem("drawers:upgrade_template", {
|
|
|
|
description = S("Drawer Upgrade Template"),
|
|
|
|
inventory_image = "drawers_upgrade_template.png"
|
|
|
|
})
|
|
|
|
|
|
|
|
core.register_craft({
|
|
|
|
output = "drawers:upgrade_template 4",
|
|
|
|
recipe = {
|
|
|
|
{"group:stick", "group:stick", "group:stick"},
|
|
|
|
{"group:stick", "group:drawer", "group:stick"},
|
|
|
|
{"group:stick", "group:stick", "group:stick"}
|
|
|
|
}
|
|
|
|
})
|
2020-10-14 18:34:29 +02:00
|
|
|
|