2021-08-25 18:01:36 +02:00
|
|
|
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
|
|
|
|
|
2023-03-25 18:27:13 +01:00
|
|
|
minetest.register_tool("exchangeclone:exchange_orb", {
|
2021-08-25 18:01:36 +02:00
|
|
|
description = "Exchange Orb",
|
|
|
|
inventory_image = "ee_exchange_orb.png",
|
|
|
|
on_use = read_orb_charge,
|
|
|
|
})
|
|
|
|
|
2023-03-25 18:27:13 +01:00
|
|
|
local recipe_item_1 = "default:steel_ingot"
|
|
|
|
local recipe_item_2 = "default:diamond"
|
|
|
|
local recipe_item_3 = "default:glass"
|
|
|
|
|
|
|
|
if exchangeclone.mineclone then
|
|
|
|
recipe_item_1 = "mcl_core:iron_ingot"
|
|
|
|
recipe_item_2 = "mcl_core:diamond"
|
|
|
|
recipe_item_3 = "mcl_core:glass"
|
|
|
|
end
|
|
|
|
|
2021-08-25 18:01:36 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "shaped",
|
2023-03-25 18:27:13 +01:00
|
|
|
output = "exchangeclone:exchange_orb",
|
2021-08-25 18:01:36 +02:00
|
|
|
recipe = {
|
2023-03-25 18:27:13 +01:00
|
|
|
{recipe_item_3, recipe_item_2, recipe_item_3},
|
|
|
|
{recipe_item_2, recipe_item_1, recipe_item_2},
|
|
|
|
{recipe_item_3, recipe_item_2, recipe_item_3}
|
2021-08-25 18:01:36 +02:00
|
|
|
}
|
|
|
|
})
|