Items use energy to do work. Closes #1770

This commit is contained in:
drcrazy 2019-08-12 00:41:44 +03:00
parent 4012a69fab
commit 56d1d196f0
11 changed files with 14 additions and 12 deletions

View file

@ -119,6 +119,8 @@ public class BlockRubberLog extends LogBlock {
if (stack.isEmpty()) {
return false;
}
//TODO: Should it be here??
ItemPowerManager capEnergy = null;
if (stack.getItem() instanceof ItemElectricTreetap) {
capEnergy = new ItemPowerManager(stack);
@ -130,7 +132,7 @@ public class BlockRubberLog extends LogBlock {
0.6F, 1F);
if (!worldIn.isClient) {
if (capEnergy != null) {
capEnergy.extractEnergy(20, false);
capEnergy.useEnergy(20, false);
ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn);
} else {