diff --git a/src/api/java/cofh/api/energy/IEnergyConnection.java b/src/api/java/cofh/api/energy/IEnergyConnection.java deleted file mode 100644 index 29ef0a1ce..000000000 --- a/src/api/java/cofh/api/energy/IEnergyConnection.java +++ /dev/null @@ -1,22 +0,0 @@ -package cofh.api.energy; - -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 - * - */ -public interface IEnergyConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectEnergy(EnumFacing from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyHandler.java b/src/api/java/cofh/api/energy/IEnergyHandler.java deleted file mode 100644 index 16b236e7a..000000000 --- a/src/api/java/cofh/api/energy/IEnergyHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.util.EnumFacing; - -/** - * Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *
- * A reference implementation is provided {@link TileEnergyHandler}. - *
- * Note that {@link IEnergyReceiver} and {@link IEnergyProvider} are extensions of this. - * - * @author King Lemming - * - */ -public interface IEnergyHandler extends IEnergyConnection { - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(EnumFacing from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(EnumFacing from); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyProvider.java b/src/api/java/cofh/api/energy/IEnergyProvider.java deleted file mode 100644 index ef0e09d06..000000000 --- a/src/api/java/cofh/api/energy/IEnergyProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.util.EnumFacing; - - -/** - * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *
- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyProvider extends IEnergyHandler { - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - int extractEnergy(EnumFacing from, int maxExtract, boolean simulate); - -} diff --git a/src/api/java/cofh/api/energy/IEnergyReceiver.java b/src/api/java/cofh/api/energy/IEnergyReceiver.java deleted file mode 100644 index 989e9baa5..000000000 --- a/src/api/java/cofh/api/energy/IEnergyReceiver.java +++ /dev/null @@ -1,29 +0,0 @@ -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 IEnergyHandler {
-
- /**
- * 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 from, int maxReceive, boolean simulate);
-
-}
diff --git a/src/main/java/vazkii/botania/common/Botania.java b/src/main/java/vazkii/botania/common/Botania.java
index ca34acf31..597e15ce5 100644
--- a/src/main/java/vazkii/botania/common/Botania.java
+++ b/src/main/java/vazkii/botania/common/Botania.java
@@ -103,7 +103,6 @@ public class Botania {
public static boolean bloodMagicLoaded = false;
public static boolean coloredLightsLoaded = false;
public static boolean etFuturumLoaded = false;
- public static boolean rfApiLoaded = false;
public static boolean storageDrawersLoaded = false;
@Instance(LibMisc.MOD_ID)
@@ -123,7 +122,6 @@ public class Botania {
bloodMagicLoaded = Loader.isModLoaded("bloodmagic"); // Psh, noob
coloredLightsLoaded = Loader.isModLoaded("easycoloredlights");
etFuturumLoaded = Loader.isModLoaded("etfuturum");
- rfApiLoaded = ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy");
storageDrawersLoaded = Loader.isModLoaded("storagedrawers");
BotaniaAPI.internalHandler = new InternalMethodHandler();
diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java b/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java
index 2e3e00861..94c6af01b 100644
--- a/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java
+++ b/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java
@@ -38,14 +38,6 @@ public class BlockRFGenerator extends BlockMod implements ILexiconable {
setSoundType(SoundType.STONE);
}
- @Override
- @Optional.Method(modid = "CoFHAPI|energy")
- public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos tilePos) {
- TileEntity tile = world.getTileEntity(pos);
- if(tile != null && tile instanceof TileRFGenerator)
- ((TileRFGenerator) tile).onNeighborTileChange(tilePos);
- }
-
@Override
public boolean hasTileEntity(IBlockState state) {
return true;
diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java
index cee53b8a8..1c7b6cd29 100644
--- a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java
+++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java
@@ -13,106 +13,112 @@ package vazkii.botania.common.block.tile.mana;
import java.util.EnumMap;
import java.util.Map;
-import cofh.api.energy.IEnergyConnection;
-import cofh.api.energy.IEnergyReceiver;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
+import net.minecraftforge.common.capabilities.Capability;
+import net.minecraftforge.energy.CapabilityEnergy;
+import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fml.common.Optional;
import vazkii.botania.api.mana.IManaReceiver;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TileMod;
-@Optional.Interface(iface = "cofh.api.energy.IEnergyConnection", modid = "CoFHAPI|energy")
-public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyConnection {
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
- private static final int CONVERSION_RATE = 10;
- private static final int MAX_MANA = 1280 * CONVERSION_RATE;
+public class TileRFGenerator extends TileMod implements IManaReceiver {
+
+ private static final int MANA_TO_FE = 10;
+ private static final int MAX_ENERGY = 1280 * MANA_TO_FE;
private static final String TAG_MANA = "mana";
- int mana = 0;
+ int energy = 0;
- // Thanks to skyboy for help with this cuz I'm a noob with RF
- private final EnumMap
Simply pointing a spreader at this block will have it shoot at it, converting the &4Mana&0 that lands on it into &4RF&0. It can then be pulled out with any &4RF&0 transporter.
+botania.tagline.rfGenerator=Converts Mana into Energy
+botania.page.rfGenerator0=By passing &4Mana&0 through a field of redstone energy, its state can change from a natural energy source to &4Forge Energy&0.
Simply pointing a spreader at this block will have it shoot at it, converting the &4Mana&0 that lands on it into &4FE&0, and sending it to any nearby &4FE&0 transporters.
botania.page.rfGenerator1=Challenging the fabric of magic mod reality
# -- MANA LENSES