emeraldbank/bank.lua

61 lines
1.7 KiB
Lua
Raw Permalink Normal View History

2021-10-13 14:23:40 +02:00
-- Copyright (C) 2021, 2024 Sandro del Toro
2021-10-13 14:23:40 +02:00
-- This file is part of Emeraldbank Minetest Mod.
-- Emeraldbank is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of the
-- License, or (at your option) any later version.
2021-10-13 14:23:40 +02:00
-- Emeraldbank is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
2021-10-13 14:23:40 +02:00
-- You should have received a copy of the GNU Affero General Public License
2021-10-13 14:23:40 +02:00
-- along with Emeraldbank. If not, see <https://www.gnu.org/licenses/>.
local S = core.get_translator(core.get_current_modname())
local bankcraft = core.settings:get_bool("emeraldbank.bank_craft") or true
2021-10-13 14:23:40 +02:00
-- register bank node
2023-08-25 18:21:23 +02:00
core.register_node("emeraldbank:bank", {
2021-10-13 14:23:40 +02:00
description = S("Emerald Bank"),
_doc_items_longdesc = S("This block can keep your emeralds."),
is_ground_content = false,
tiles = {
"default_steel_block.png",
"default_steel_block.png",
"default_steel_block.png^mcl_core_emerald.png"
},
stack_max = 64,
groups = {pickaxey=1, handy=1, building_block=1},
2021-10-13 14:23:40 +02:00
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 5,
_mcl_hardness = 1,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
2023-08-25 17:06:28 +02:00
atm.showform(clicker)
2021-10-13 14:23:40 +02:00
end,
})
2023-08-25 18:21:23 +02:00
minetest.register_alias("atm:atm", "emeraldbank:bank")
2021-10-13 14:23:40 +02:00
if bankcraft then
core.register_craft({
output = "emeraldbank:bank",
recipe = {
2023-08-27 08:39:49 +02:00
{"", "mcl_core:emerald", ""},
{"", "mcl_core:ironblock", ""},
{"", "", ""},
2021-10-13 14:23:40 +02:00
}
})
end