Some work on charging ic2 items, moving back to a proper pc.
This commit is contained in:
parent
1c6336eb68
commit
3901d60545
3 changed files with 25 additions and 1 deletions
19
src/main/java/techreborn/utils/IC2ItemCharger.java
Normal file
19
src/main/java/techreborn/utils/IC2ItemCharger.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package techreborn.utils;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
public class IC2ItemCharger {
|
||||
|
||||
public static void chargeIc2Item(TilePowerAcceptor tilePowerAcceptor, ItemStack stack){
|
||||
if(stack.isEmpty()){
|
||||
return;
|
||||
}
|
||||
if(stack.getItem() instanceof IElectricItem){
|
||||
tilePowerAcceptor.useEnergy(ElectricItem.manager.charge(stack, tilePowerAcceptor.getEnergy(), 4, false, false));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue