cofh.api.energy.EnergyStorage Java Examples

The following examples show how to use cofh.api.energy.EnergyStorage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContainerPack.java    From SimplyJetpacks with MIT License 6 votes vote down vote up
public ContainerPack(ItemStack chestplate, ItemPack packItem, PackBase pack) {
    this.chestplate = chestplate;
    this.packItem = packItem;
    this.pack = pack;
    
    int fuel = packItem.getFuelStored(chestplate);
    int maxFuel = pack.tier > 9000 ? -1 : packItem.getMaxFuelStored(chestplate);
    switch (pack.fuelType) {
    case ENERGY:
        this.energyStored = new EnergyStorage(maxFuel);
        this.energyStored.setEnergyStored(fuel);
        this.fluidStored = null;
        break;
    case FLUID:
        this.energyStored = null;
        this.fluidStored = new FluidTank(FluidRegistry.getFluid(pack.fuelFluid), fuel, maxFuel);
        break;
    default:
        this.energyStored = null;
        this.fluidStored = null;
    }
    
    this.lastFuel = fuel;
}
 
Example #2
Source File: ContainerRF.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public ContainerRF(InventoryPlayer inventoryPlayer, TileEntityPneumaticBase te){
    super(inventoryPlayer, te);
    energyHandler = (IEnergyInfo)te;
    try {
        addSyncedField(new SyncedField.SyncedInt(((IRFConverter)te).getEnergyStorage(), EnergyStorage.class.getDeclaredField("energy")));
    } catch(Throwable e) {
        e.printStackTrace();
    }
}
 
Example #3
Source File: TileEntityFluxCompressor.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EnergyStorage getEnergyStorage(){
    return energy;
}
 
Example #4
Source File: TileEntityPneumaticDynamo.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EnergyStorage getEnergyStorage(){
    return energy;
}
 
Example #5
Source File: TileEntityAerialInterface.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
private void initRF(){
    energyRF = new EnergyStorage(100000);
}
 
Example #6
Source File: TileEntityAerialInterface.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Optional.Method(modid = ModIds.COFH_CORE)
private EnergyStorage getEnergy(){
    return (EnergyStorage)energyRF;
}
 
Example #7
Source File: TileEntityPoweredInventory.java    From BigReactors with MIT License 3 votes vote down vote up
public TileEntityPoweredInventory() {
	super();
	
	energyStorage = new EnergyStorage(getMaxEnergyStored());
	
	cycledTicks = -1;
}
 
Example #8
Source File: IRFConverter.java    From PneumaticCraft with GNU General Public License v3.0 votes vote down vote up
public EnergyStorage getEnergyStorage();