Class LightEnergyAdapter

java.lang.Object
etithespirit.orimod.util.valuetypes.LightEnergyAdapter

public final class LightEnergyAdapter extends Object
A static class that provides a means of adapting power between ILightEnergyStorage and IEnergyStorage
Author:
Eti
  • Method Details

    • performTransfer

      public static LightEnergyAdapter.EnergyTransactionResult performTransfer(ILightEnergyStorage lightContainer, net.minecraftforge.energy.IEnergyStorage rfContainer, LightEnergyAdapter.EnergyTransactionDirection direction, double amount, boolean simulate)
      Transfer energy between a container of Light and a container of RF at a custom conversion ratio.
      Parameters:
      lightContainer - The container for Light energy.
      rfContainer - The container for RF energy.
      direction - The direction in which the conversion is occurring (Light -> RF or RF -> Light)
      amount - The amount of energy to transfer. The unit this represents depends on the "from" component of the direction, so if transferring from light to RF, the unit is light ("from light"), and if transferring from RF to light, the unit is RF ("from RF"). For cases where RF is the "from" component, it will be cast into int32.
      simulate - If true, the transaction will only be simulated and not actually affect the containers.
      Returns:
      An EnergyTransactionResult describing the amount of energy transferred in both units, the direction in which the energy was transferred, at what ratio, and whether or not it was simulated.