public static PowerReceiver getPowerReceiver(IEnergyInterface handler, ForgeDirection side)
{
if (!powerProviderMap.containsKey(handler))
{
PowerHandler powerHandler = new PowerHandler((IPowerReceptor) handler, Type.MACHINE);
if (handler instanceof IEnergyContainer)
{
float capacity = (float) (((IEnergyContainer) handler).getEnergyCapacity(ForgeDirection.UNKNOWN) * CompatibilityType.BUILDCRAFT.ratio);
if(capacity < 1)
{
capacity = 1;
}
powerHandler.configure(0, capacity, 1, capacity);
}
powerHandler.configurePowerPerdition(0, 0);
powerProviderMap.put(handler, powerHandler);
}
if (handler instanceof TileEntity)
{