2023-11-19 01:48:35 +01:00
|
|
|
local S = minetest.get_translator()
|
|
|
|
|
2023-06-21 23:45:22 +02:00
|
|
|
local function read_orb_charge(itemstack, player, pointed_thing)
|
|
|
|
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
|
|
|
|
if click_test ~= false then
|
|
|
|
return click_test
|
|
|
|
end
|
2023-10-04 02:08:07 +02:00
|
|
|
|
|
|
|
local stored = exchangeclone.get_orb_itemstack_energy(itemstack)
|
2023-11-20 18:17:17 +01:00
|
|
|
minetest.chat_send_player(player:get_player_name(), S("Current Charge: @1", exchangeclone.format_number(stored)))
|
2021-08-25 18:01:36 +02:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
2023-03-25 18:27:13 +01:00
|
|
|
minetest.register_tool("exchangeclone:exchange_orb", {
|
2023-11-19 01:48:35 +01:00
|
|
|
description = S("Exchange Orb").."\n"..S("Current Charge: @1", 0),
|
2023-05-23 16:53:45 +02:00
|
|
|
inventory_image = "exchangeclone_exchange_orb.png",
|
2023-09-12 16:46:59 +02:00
|
|
|
color = "#000000",
|
2023-06-21 23:45:22 +02:00
|
|
|
on_secondary_use = read_orb_charge,
|
|
|
|
on_place = read_orb_charge,
|
2023-09-25 16:41:23 +02:00
|
|
|
groups = {exchange_orb = 1, disable_repair = 1, fire_immune = 1}
|
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",
|
2023-03-27 00:19:19 +02:00
|
|
|
groups = {},
|
2021-08-25 18:01:36 +02:00
|
|
|
recipe = {
|
2023-12-18 23:57:30 +01:00
|
|
|
{exchangeclone.itemstrings.diamond, exchangeclone.itemstrings.iron, exchangeclone.itemstrings.diamond},
|
|
|
|
{exchangeclone.itemstrings.iron, "exchangeclone:philosophers_stone", exchangeclone.itemstrings.iron},
|
|
|
|
{exchangeclone.itemstrings.diamond, exchangeclone.itemstrings.iron, exchangeclone.itemstrings.diamond}
|
2023-05-23 16:53:45 +02:00
|
|
|
},
|
|
|
|
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
2021-08-25 18:01:36 +02:00
|
|
|
})
|
2023-11-19 01:48:35 +01:00
|
|
|
minetest.register_craft({ -- Making it fuel so MineClone hoppers will work with (de)constructors
|
2023-03-27 00:19:19 +02:00
|
|
|
type = "fuel",
|
|
|
|
recipe = "exchangeclone:exchange_orb",
|
2023-11-19 01:48:35 +01:00
|
|
|
burntime = 24000 --Basically 30 coal blocks...
|
2023-03-27 00:19:19 +02:00
|
|
|
})
|