wishful/mods/wisgame/open/open_hand.lua
2025-02-07 14:39:37 -05:00

54 lines
1.4 KiB
Lua

local image08='blank.png^[noalpha^[resize:8x8^[colorize:#000000:255'
local image16='blank.png^[noalpha^[resize:16x16^[colorize:#ffffff:255'
local modname = minetest.get_current_modname()
--why is : the hand, is it legacy support thing or what?
local hardtimes={[1] = 0.00, [2] = 2.00, [3] = 3.0}
minetest.register_item(minetest.get_current_modname()..':hand', {
type = 'none',
wield_image ='wieldhand.png',
--[colorize:#000000:255:0,16=wis_black.png',
wield_scale = {x = 0.5, y = 1, z = 4},
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level = 0,
groupcaps = {
crumbly = {
times = hardtimes,
uses = 0,
maxlevel = 1,
},
snappy = {
times = hardtimes,
uses = 0,
maxlevel = 1,
},
oddly_breakable_by_hand = {
times = hardtimes,
uses = 0,
},
},
damage_groups = {fleshy = 1},
}
})
minetest.register_on_joinplayer(function(player, last_login)
if not player then return end
local inv = player:get_inventory()
inv:set_size("hand",1)
inv:add_item("hand", ItemStack(modname..":hand"))
--minetest.log(dump(inv:get_lists()))
end)
local old_handle_node_drops = core.handle_node_drops
core.handle_node_drops = function(...)
-- flag all drops
old_handle_node_drops(...)
--- minetest.log('old_handle_node_drops')
end
local old_item_drop = core.item_drop
--core.item_drop = function(...) old_item_drop(...) --minetest.log('old_item_drop') end