mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 12:22:22 +01:00
Add support for all rechargeble items from technic (#42)
* Add support for all rechargeble items from technic * Changed comment about batteries * Changed second comment about batteries
This commit is contained in:
parent
8b1c63f067
commit
b394214ffa
@ -63,13 +63,13 @@ minetest.register_node("digtron:battery_holder", {
|
||||
inv:set_size("batteries", 8*4)
|
||||
end,
|
||||
|
||||
-- Only allow RE batteries to be placed in the inventory
|
||||
-- Allow all items with energy storage to be placed in the inventory
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if listname == "batteries" then
|
||||
local node_name = stack:get_name()
|
||||
|
||||
-- Only allow RE batteries from technic mod
|
||||
if node_name == "technic:battery" then
|
||||
-- Allow all items with energy storage from technic mod
|
||||
if technic.power_tools[node_name] ~= nil then
|
||||
local meta = stack:get_metadata()
|
||||
local md = minetest.deserialize(meta)
|
||||
-- And specifically if they hold any charge
|
||||
@ -122,4 +122,4 @@ minetest.register_node("digtron:battery_holder", {
|
||||
|
||||
after_place_node = (function() if minetest.get_modpath("pipeworks") then return pipeworks.after_place end end)(),
|
||||
after_dig_node = (function() if minetest.get_modpath("pipeworks")then return pipeworks.after_dig end end)()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user