mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32: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)
|
inv:set_size("batteries", 8*4)
|
||||||
end,
|
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)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
if listname == "batteries" then
|
if listname == "batteries" then
|
||||||
local node_name = stack:get_name()
|
local node_name = stack:get_name()
|
||||||
|
|
||||||
-- Only allow RE batteries from technic mod
|
-- Allow all items with energy storage from technic mod
|
||||||
if node_name == "technic:battery" then
|
if technic.power_tools[node_name] ~= nil then
|
||||||
local meta = stack:get_metadata()
|
local meta = stack:get_metadata()
|
||||||
local md = minetest.deserialize(meta)
|
local md = minetest.deserialize(meta)
|
||||||
-- And specifically if they hold any charge
|
-- And specifically if they hold any charge
|
||||||
|
Loading…
Reference in New Issue
Block a user