mirror of
https://github.com/enchant97/minetest_element_exchange.git
synced 2024-08-20 13:04:07 +02:00
22 lines
660 B
Lua
22 lines
660 B
Lua
|
function read_orb_charge(itemstack, user, pointed_thing)
|
||
|
local stored = itemstack:get_meta():get_int("stored_charge") or 0
|
||
|
minetest.chat_send_player(user:get_player_name(), "Current Charge: "..stored)
|
||
|
return itemstack
|
||
|
end
|
||
|
|
||
|
minetest.register_tool("element_exchange:exchange_orb", {
|
||
|
description = "Exchange Orb",
|
||
|
inventory_image = "ee_exchange_orb.png",
|
||
|
on_use = read_orb_charge,
|
||
|
})
|
||
|
|
||
|
minetest.register_craft({
|
||
|
type = "shaped",
|
||
|
output = "element_exchange:exchange_orb",
|
||
|
recipe = {
|
||
|
{"", "default:diamond",""},
|
||
|
{"default:diamond", "default:gold", "default:diamond"},
|
||
|
{"", "default:diamond", ""}
|
||
|
}
|
||
|
})
|