This repository has been archived on 2020-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
minetest-mod-sparktech/sparkcore/lua/util.lua

9 lines
377 B
Lua

minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if minetest.get_item_group(itemstack:get_name(), "sparktech_energy_storeonbreak") > 0 then
local meta = minetest.get_meta(pos)
if itemstack:get_metadata() and itemstack:get_metadata() ~= "" then
meta:set_int("energy", itemstack:get_metadata())
end
end
end)