From 5c98dc562c2083f32d16b91fd3f7e8c28b6c22dd Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 18 Nov 2015 00:54:48 -0600 Subject: [PATCH] Update RF API to Progressive Automation / FluxDucts' variant --- .../cofh/api/energy/IEnergyConnection.java | 8 +- .../java/cofh/api/energy/IEnergyReceiver.java | 77 ++++++++++--------- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/api/java/cofh/api/energy/IEnergyConnection.java b/src/api/java/cofh/api/energy/IEnergyConnection.java index fd2968537..65c64d31f 100644 --- a/src/api/java/cofh/api/energy/IEnergyConnection.java +++ b/src/api/java/cofh/api/energy/IEnergyConnection.java @@ -1,11 +1,11 @@ package cofh.api.energy; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; /** * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not * accept it; otherwise just use IEnergyHandler. - * + *

* Note that {@link IEnergyHandler} is an extension of this. * * @author King Lemming @@ -16,6 +16,6 @@ public interface IEnergyConnection { /** * Returns TRUE if the TileEntity can connect on a given side. */ - boolean canConnectEnergy(ForgeDirection from); + boolean canConnectEnergy(EnumFacing facing); -} \ No newline at end of file +} diff --git a/src/api/java/cofh/api/energy/IEnergyReceiver.java b/src/api/java/cofh/api/energy/IEnergyReceiver.java index a048056b8..b1a9e57cd 100644 --- a/src/api/java/cofh/api/energy/IEnergyReceiver.java +++ b/src/api/java/cofh/api/energy/IEnergyReceiver.java @@ -1,38 +1,39 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyReceiver extends IEnergyConnection { - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} +package cofh.api.energy; + +import net.minecraft.util.EnumFacing; + + +/** + * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. + *

+ * A reference implementation is provided {@link TileEnergyHandler}. + * + * @author King Lemming + * + */ +public interface IEnergyReceiver extends IEnergyConnection { + + /** + * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. + * + * @param from + * Orientation the energy is received from. + * @param maxReceive + * Maximum amount of energy to receive. + * @param simulate + * If TRUE, the charge will only be simulated. + * @return Amount of energy that was (or would have been, if simulated) received. + */ + int receiveEnergy(EnumFacing facing, int maxReceive, boolean simulate); + + /** + * Returns the amount of energy currently stored. + */ + int getEnergyStored(EnumFacing facing); + + /** + * Returns the maximum amount of energy that can be stored. + */ + int getMaxEnergyStored(EnumFacing facing); + +}