Prevent hotbar-energy-sucking for unchargeable (potato) batteries

This commit is contained in:
Bernhard Bonigl committed 2014-08-08 13:02:49 +02:00
1 parent 02de82951d
commit 3a377b62c2
1 file changed
+6
@@ -453,6 +453,12 @@ public class AbilityHelper
return;
ToolCore tool = (ToolCore)stack.getItem();
// check if the tool can actually receive energy
if(tool.receiveEnergy(stack, 1, true) != 1)
// no you're not going to charge that potato battery on your tool
return;
int buffer = tool.getEnergyStored(stack);
int max = tool.getMaxEnergyStored(stack);
int missing = max - buffer;