// Path: src/main/java/cn/academy/energy/api/block/IWirelessReceiver.java
// public interface IWirelessReceiver extends IWirelessUser {
// 
//     double getRequiredEnergy();
// 
//     /**
//      * Inject some amount of energy into the machine. ALWAYS positive
//      * @return energy not injected
//      */
//     double injectEnergy(double amt);
// 
//     /**
//      * Pull some energy out of the machine. ALWAYS positive
//      * @param amt The amount
//      * @return energy really pulled out.
//      */
//     double pullEnergy(double amt);
// 
//     /**
//      * @return How much energy this receiver can retrieve each tick.
//      */
//     double getBandwidth();
// 
// }
// 
// Path: src/main/java/cn/annoreg/core/StorageOption.java
// public class StorageOption {
// 
//     public enum Option {
//         NULL,
//         DATA,
//         INSTANCE,
//         UPDATE,
// 
//         /**
//          * Used only in deserialization.
//          * Will use the option contained in the data.
//          */
//         AUTO,
// 
//         /**
//          * Allow the instance to be null.
//          * You can use this option directly, or use <code>@Instance(nullable=true)</code>
//          */
//         NULLABLE_INSTANCE,
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Null {
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Data {
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Instance {
//         boolean nullable() default false;
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Update {
//     }
// 
//     /**
//      * Used only in server-to-client network call.
//      * Used on argument with the type of EntityPlayer.
//      * If Target is given, the message is only sent to this player.
//      * With this annotation, the StorageOption of INSTANCE is used.
//      * @author acaly
//      *
//      */
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Target {
// 
//         RangeOption range() default RangeOption.SINGLE;
// 
//         public enum RangeOption {
//             SINGLE,
//             EXCEPT,
//         }
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface RangedTarget {
//         double range() default -1; //The hardcoded range option. The TargetPoint converter can choose to ignore this parameter.
//     }
// }


import cn.academy.energy.api.block.IWirelessReceiver;
import cn.annoreg.core.RegNetworkCall;
import cn.annoreg.core.Registrant;
import cn.annoreg.core.StorageOption;
import cn.annoreg.core.StorageOption.Data;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
        energy += give;

        return amt - give;
    }

    public double getEnergy() {
        return energy;
    }

    public double getMaxEnergy() {
        return maxEnergy;
    }

    @Override
    public double getBandwidth() {
        return bandwidth;
    }

    @Override
    public void readFromNBT(NBTTagCompound tag) {
        super.readFromNBT(tag);
        energy = tag.getDouble("energy");
    }

    @Override
    public void writeToNBT(NBTTagCompound tag) {
        super.writeToNBT(tag);
        tag.setDouble("energy", energy);
    }

// Path: src/main/java/cn/academy/energy/api/block/IWirelessReceiver.java
// public interface IWirelessReceiver extends IWirelessUser {
// 
//     double getRequiredEnergy();
// 
//     /**
//      * Inject some amount of energy into the machine. ALWAYS positive
//      * @return energy not injected
//      */
//     double injectEnergy(double amt);
// 
//     /**
//      * Pull some energy out of the machine. ALWAYS positive
//      * @param amt The amount
//      * @return energy really pulled out.
//      */
//     double pullEnergy(double amt);
// 
//     /**
//      * @return How much energy this receiver can retrieve each tick.
//      */
//     double getBandwidth();
// 
// }
// 
// Path: src/main/java/cn/annoreg/core/StorageOption.java
// public class StorageOption {
// 
//     public enum Option {
//         NULL,
//         DATA,
//         INSTANCE,
//         UPDATE,
// 
//         /**
//          * Used only in deserialization.
//          * Will use the option contained in the data.
//          */
//         AUTO,
// 
//         /**
//          * Allow the instance to be null.
//          * You can use this option directly, or use <code>@Instance(nullable=true)</code>
//          */
//         NULLABLE_INSTANCE,
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Null {
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Data {
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Instance {
//         boolean nullable() default false;
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Update {
//     }
// 
//     /**
//      * Used only in server-to-client network call.
//      * Used on argument with the type of EntityPlayer.
//      * If Target is given, the message is only sent to this player.
//      * With this annotation, the StorageOption of INSTANCE is used.
//      * @author acaly
//      *
//      */
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface Target {
// 
//         RangeOption range() default RangeOption.SINGLE;
// 
//         public enum RangeOption {
//             SINGLE,
//             EXCEPT,
//         }
//     }
// 
//     @Retention(RetentionPolicy.RUNTIME)
//     public @interface RangedTarget {
//         double range() default -1; //The hardcoded range option. The TargetPoint converter can choose to ignore this parameter.
//     }
// }


// Path: src/main/java/infstudio/exoticpower/tileentity/TileEntityReceiver.java
import cn.academy.energy.api.block.IWirelessReceiver;
import cn.annoreg.core.RegNetworkCall;
import cn.annoreg.core.Registrant;
import cn.annoreg.core.StorageOption;
import cn.annoreg.core.StorageOption.Data;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;

        energy += give;

        return amt - give;
    }

    public double getEnergy() {
        return energy;
    }

    public double getMaxEnergy() {
        return maxEnergy;
    }

    @Override
    public double getBandwidth() {
        return bandwidth;
    }

    @Override
    public void readFromNBT(NBTTagCompound tag) {
        super.readFromNBT(tag);
        energy = tag.getDouble("energy");
    }

    @Override
    public void writeToNBT(NBTTagCompound tag) {
        super.writeToNBT(tag);
        tag.setDouble("energy", energy);
    }

    @RegNetworkCall(side = Side.CLIENT, thisStorage = StorageOption.Option.INSTANCE)