2019-04-14 00:57:14 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-12-29 11:51:25 -05:00
|
|
|
local math, minetest, nodecore, pairs
|
|
|
|
= math, minetest, nodecore, pairs
|
|
|
|
local math_pow
|
|
|
|
= math.pow
|
2019-04-14 00:57:14 -04:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2020-02-24 06:22:09 -05:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
2019-12-29 11:51:25 -05:00
|
|
|
local toolcaps = nodecore.toolcaps({
|
|
|
|
uses = 0,
|
|
|
|
crumbly = 1,
|
|
|
|
snappy = 1,
|
|
|
|
thumpy = 1
|
|
|
|
})
|
|
|
|
local gcaps = toolcaps.groupcaps
|
|
|
|
for k, v in pairs(nodecore.tool_basetimes) do
|
|
|
|
gcaps[k] = gcaps[k] or {uses = 0, times = {}}
|
|
|
|
for n = 1, 100 do
|
|
|
|
gcaps[k].times[n] = gcaps[k].times[n] or (10 * v * math_pow(2, n))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-04-14 00:57:14 -04:00
|
|
|
minetest.register_item(":", {
|
2019-08-31 09:26:53 -04:00
|
|
|
["type"] = "none",
|
2020-02-27 22:33:04 -05:00
|
|
|
inventory_image = "[combine:1x1",
|
2020-05-31 20:47:11 -04:00
|
|
|
tool_capabilities = toolcaps,
|
|
|
|
node_placement_prediction = ""
|
2019-04-14 00:57:14 -04:00
|
|
|
})
|
2020-02-24 06:22:09 -05:00
|
|
|
|
|
|
|
local scale = 2
|
|
|
|
minetest.register_node(modname .. ":hand", {
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = modname .. ".obj",
|
|
|
|
tiles = {"nc_player_model_base.png"},
|
|
|
|
wield_scale = {x = scale, y = scale, z = scale},
|
2020-02-24 06:23:47 -05:00
|
|
|
virtual_item = true,
|
2020-02-24 21:45:13 -05:00
|
|
|
stack_max = 1,
|
2020-05-31 20:47:11 -04:00
|
|
|
node_placement_prediction = "",
|
2020-02-24 06:23:47 -05:00
|
|
|
on_punch = minetest.remove_node
|
2020-02-24 06:22:09 -05:00
|
|
|
})
|
|
|
|
|
2020-06-15 07:21:39 -04:00
|
|
|
nodecore.register_on_joinplayer("join set hand", function(player)
|
2020-02-24 06:22:09 -05:00
|
|
|
local inv = player:get_inventory()
|
|
|
|
inv:set_size("hand", 1)
|
|
|
|
inv:set_stack("hand", 1, modname .. ":hand")
|
|
|
|
end)
|