Skip to content

Commit 51e7359

Browse files
committed
fix(battery): Fix battery holder accepting technic charges
1 parent be49b92 commit 51e7359

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

nodes/node_battery_holder.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,9 @@ local def = {
7575

7676
-- Allow all items with energy storage from technic mod
7777
if technic.power_tools[node_name] ~= nil then
78-
local meta = stack:get_metadata()
79-
local md = minetest.deserialize(meta)
8078
-- And specifically if they hold any charge
8179
-- Disregard empty batteries, the player should know better
82-
if md and md.charge > 0 then
83-
if digtron.check_protected_and_record(pos, player) then
84-
return 0
85-
end
80+
if stack:get_meta():get_int("technic:charge") > 0 then
8681
return stack:get_count()
8782
else
8883
return 0

0 commit comments

Comments
 (0)