mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Prevent hotbar-energy-sucking for unchargeable (potato) batteries
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user