Advertisement
Mouamle

IEnergyStorage

Jan 24th, 2017
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.93 KB | None | 0 0
  1. package net.minecraftforge.energy;
  2.  
  3. /**
  4.  * An energy storage is the unit of interaction with Energy inventories.
  5.  * <p>
  6.  * A reference implementation can be found at {@link EnergyStorage}.
  7.  *
  8.  * Derived from the Redstone Flux power system designed by King Lemming and originally utilized in Thermal Expansion and related mods.
  9.  * Created with consent and permission of King Lemming and Team CoFH. Released with permission under LGPL 2.1 when bundled with Forge.
  10.  *
  11.  */
  12. public interface IEnergyStorage
  13. {
  14.     /**
  15.     * Adds energy to the storage. Returns quantity of energy that was accepted.
  16.     *
  17.     * @param maxReceive
  18.     *            Maximum amount of energy to be inserted.
  19.     * @param simulate
  20.     *            If TRUE, the insertion will only be simulated.
  21.     * @return Amount of energy that was (or would have been, if simulated) accepted by the storage.
  22.     */
  23.     int receiveEnergy(int maxReceive, boolean simulate);
  24.  
  25.     /**
  26.     * Removes energy from the storage. Returns quantity of energy that was removed.
  27.     *
  28.     * @param maxExtract
  29.     *            Maximum amount of energy to be extracted.
  30.     * @param simulate
  31.     *            If TRUE, the extraction will only be simulated.
  32.     * @return Amount of energy that was (or would have been, if simulated) extracted from the storage.
  33.     */
  34.     int extractEnergy(int maxExtract, boolean simulate);
  35.  
  36.     /**
  37.     * Returns the amount of energy currently stored.
  38.     */
  39.     int getEnergyStored();
  40.  
  41.     /**
  42.     * Returns the maximum amount of energy that can be stored.
  43.     */
  44.     int getMaxEnergyStored();
  45.  
  46.     /**
  47.      * Returns if this storage can have energy extracted.
  48.      * If this is false, then any calls to extractEnergy will return 0.
  49.      */
  50.     boolean canExtract();
  51.  
  52.     /**
  53.      * Used to determine if this storage can receive energy.
  54.      * If this is false, then any calls to receiveEnergy will return 0.
  55.      */
  56.     boolean canReceive();
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement