Merge branch 'master' into universal-wires

This commit is contained in:
Calclavia 2013-12-01 14:41:10 +08:00
commit cf792366f6
18 changed files with 862 additions and 887 deletions

View file

@ -11,7 +11,8 @@ package buildcraft.api.core;
import net.minecraft.block.Block; import net.minecraft.block.Block;
public class BuildCraftAPI { public class BuildCraftAPI
{
public static final int LAST_ORIGINAL_BLOCK = 122; public static final int LAST_ORIGINAL_BLOCK = 122;
public static final int LAST_ORIGINAL_ITEM = 126; public static final int LAST_ORIGINAL_ITEM = 126;

View file

@ -10,9 +10,11 @@
package buildcraft.api.core; package buildcraft.api.core;
/** /**
* To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. * To be implemented by TileEntities able to provide a square area on the world, typically
* BuildCraft markers.
*/ */
public interface IAreaProvider { public interface IAreaProvider
{
public int xMin(); public int xMin();

View file

@ -11,7 +11,8 @@ package buildcraft.api.core;
import net.minecraft.world.World; import net.minecraft.world.World;
public interface IBox { public interface IBox
{
public void expand(int amount); public void expand(int amount);

View file

@ -1,12 +1,13 @@
package buildcraft.api.core; package buildcraft.api.core;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IIconProvider
{
public interface IIconProvider {
/** /**
* @param iconIndex * @param iconIndex
* @return * @return
@ -15,7 +16,9 @@ public interface IIconProvider {
public Icon getIcon(int iconIndex); public Icon getIcon(int iconIndex);
/** /**
* A call for the provider to register its Icons. This may be called multiple times but should only be executed once per provider * A call for the provider to register its Icons. This may be called multiple times but should
* only be executed once per provider
*
* @param iconRegister * @param iconRegister
*/ */
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -9,6 +9,7 @@
package buildcraft.api.core; package buildcraft.api.core;
public enum LaserKind { public enum LaserKind
{
Red, Blue, Stripes Red, Blue, Stripes
} }

View file

@ -13,33 +13,38 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
public class Position { public class Position
{
public double x, y, z; public double x, y, z;
public ForgeDirection orientation; public ForgeDirection orientation;
public Position(double ci, double cj, double ck) { public Position(double ci, double cj, double ck)
{
x = ci; x = ci;
y = cj; y = cj;
z = ck; z = ck;
orientation = ForgeDirection.UNKNOWN; orientation = ForgeDirection.UNKNOWN;
} }
public Position(double ci, double cj, double ck, ForgeDirection corientation) { public Position(double ci, double cj, double ck, ForgeDirection corientation)
{
x = ci; x = ci;
y = cj; y = cj;
z = ck; z = ck;
orientation = corientation; orientation = corientation;
} }
public Position(Position p) { public Position(Position p)
{
x = p.x; x = p.x;
y = p.y; y = p.y;
z = p.z; z = p.z;
orientation = p.orientation; orientation = p.orientation;
} }
public Position(NBTTagCompound nbttagcompound) { public Position(NBTTagCompound nbttagcompound)
{
x = nbttagcompound.getDouble("i"); x = nbttagcompound.getDouble("i");
y = nbttagcompound.getDouble("j"); y = nbttagcompound.getDouble("j");
z = nbttagcompound.getDouble("k"); z = nbttagcompound.getDouble("k");
@ -47,95 +52,109 @@ public class Position {
orientation = ForgeDirection.UNKNOWN; orientation = ForgeDirection.UNKNOWN;
} }
public Position(TileEntity tile) { public Position(TileEntity tile)
{
x = tile.xCoord; x = tile.xCoord;
y = tile.yCoord; y = tile.yCoord;
z = tile.zCoord; z = tile.zCoord;
} }
public void moveRight(double step) { public void moveRight(double step)
switch (orientation) { {
case SOUTH: switch (orientation)
x = x - step; {
break; case SOUTH:
case NORTH: x = x - step;
x = x + step; break;
break; case NORTH:
case EAST: x = x + step;
z = z + step; break;
break; case EAST:
case WEST: z = z + step;
z = z - step; break;
break; case WEST:
default: z = z - step;
break;
default:
} }
} }
public void moveLeft(double step) { public void moveLeft(double step)
{
moveRight(-step); moveRight(-step);
} }
public void moveForwards(double step) { public void moveForwards(double step)
switch (orientation) { {
case UP: switch (orientation)
y = y + step; {
break; case UP:
case DOWN: y = y + step;
y = y - step; break;
break; case DOWN:
case SOUTH: y = y - step;
z = z + step; break;
break; case SOUTH:
case NORTH: z = z + step;
z = z - step; break;
break; case NORTH:
case EAST: z = z - step;
x = x + step; break;
break; case EAST:
case WEST: x = x + step;
x = x - step; break;
break; case WEST:
default: x = x - step;
break;
default:
} }
} }
public void moveBackwards(double step) { public void moveBackwards(double step)
{
moveForwards(-step); moveForwards(-step);
} }
public void moveUp(double step) { public void moveUp(double step)
switch (orientation) { {
case SOUTH: switch (orientation)
case NORTH: {
case EAST: case SOUTH:
case WEST: case NORTH:
y = y + step; case EAST:
break; case WEST:
default: y = y + step;
break;
default:
} }
} }
public void moveDown(double step) { public void moveDown(double step)
{
moveUp(-step); moveUp(-step);
} }
public void writeToNBT(NBTTagCompound nbttagcompound) { public void writeToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setDouble("i", x); nbttagcompound.setDouble("i", x);
nbttagcompound.setDouble("j", y); nbttagcompound.setDouble("j", y);
nbttagcompound.setDouble("k", z); nbttagcompound.setDouble("k", z);
} }
@Override @Override
public String toString() { public String toString()
{
return "{" + x + ", " + y + ", " + z + "}"; return "{" + x + ", " + y + ", " + z + "}";
} }
public Position min(Position p) { public Position min(Position p)
{
return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z); return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z);
} }
public Position max(Position p) { public Position max(Position p)
{
return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z); return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z);
} }

View file

@ -9,38 +9,45 @@ package buildcraft.api.core;
import net.minecraft.world.World; import net.minecraft.world.World;
public class SafeTimeTracker { public class SafeTimeTracker
{
private long lastMark = Long.MIN_VALUE; private long lastMark = Long.MIN_VALUE;
private long duration = -1; private long duration = -1;
/** /**
* Return true if a given delay has passed since last time marked was called * Return true if a given delay has passed since last time marked was called successfully.
* successfully.
*/ */
public boolean markTimeIfDelay(World world, long delay) { public boolean markTimeIfDelay(World world, long delay)
{
if (world == null) if (world == null)
return false; return false;
long currentTime = world.getTotalWorldTime(); long currentTime = world.getTotalWorldTime();
if (currentTime < lastMark) { if (currentTime < lastMark)
{
lastMark = currentTime; lastMark = currentTime;
return false; return false;
} else if (lastMark + delay <= currentTime) { }
else if (lastMark + delay <= currentTime)
{
duration = currentTime - lastMark; duration = currentTime - lastMark;
lastMark = currentTime; lastMark = currentTime;
return true; return true;
} else }
else
return false; return false;
} }
public long durationOfLastDelay() { public long durationOfLastDelay()
{
return duration > 0 ? duration : 0; return duration > 0 ? duration : 0;
} }
public void markTime(World world) { public void markTime(World world)
{
lastMark = world.getTotalWorldTime(); lastMark = world.getTotalWorldTime();
} }
} }

View file

@ -11,19 +11,22 @@ package buildcraft.api.core;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* *
* @author CovertJaguar <http://www.railcraft.info/> * @author CovertJaguar <http://www.railcraft.info/>
*/ */
public class StackWrapper { public class StackWrapper
{
public final ItemStack stack; public final ItemStack stack;
public StackWrapper(ItemStack stack) { public StackWrapper(ItemStack stack)
{
this.stack = stack; this.stack = stack;
} }
@Override @Override
public int hashCode() { public int hashCode()
{
int hash = 5; int hash = 5;
hash = 67 * hash + stack.itemID; hash = 67 * hash + stack.itemID;
hash = 67 * hash + stack.getItemDamage(); hash = 67 * hash + stack.getItemDamage();
@ -33,7 +36,8 @@ public class StackWrapper {
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj)
{
if (obj == null) if (obj == null)
return false; return false;
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())

View file

@ -12,13 +12,14 @@ import net.minecraftforge.common.ForgeDirection;
/** /**
* Essentially only used for Wooden Power Pipe connection rules. * Essentially only used for Wooden Power Pipe connection rules.
* *
* This Tile Entity interface allows you to indicate that a block can emit power * This Tile Entity interface allows you to indicate that a block can emit power from a specific
* from a specific side. * side.
* *
* @author CovertJaguar <http://www.railcraft.info/> * @author CovertJaguar <http://www.railcraft.info/>
*/ */
public interface IPowerEmitter { public interface IPowerEmitter
{
public boolean canEmitPowerFrom(ForgeDirection side); public boolean canEmitPowerFrom(ForgeDirection side);
} }

View file

@ -7,38 +7,37 @@
*/ */
package buildcraft.api.power; package buildcraft.api.power;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.power.PowerHandler.PowerReceiver;
/** /**
* This interface should be implemented by any Tile Entity that wishes to be * This interface should be implemented by any Tile Entity that wishes to be able to receive power.
* able to receive power. *
*
* @author CovertJaguar <http://www.railcraft.info/> * @author CovertJaguar <http://www.railcraft.info/>
*/ */
public interface IPowerReceptor { public interface IPowerReceptor
{
/** /**
* Get the PowerReceiver for this side of the block. You can return the same * Get the PowerReceiver for this side of the block. You can return the same PowerReceiver for
* PowerReceiver for all sides or one for each side. * all sides or one for each side.
* *
* You should NOT return null to this method unless you mean to NEVER * You should NOT return null to this method unless you mean to NEVER receive power from that
* receive power from that side. Returning null, after previous returning a * side. Returning null, after previous returning a PowerReceiver, will most likely cause pipe
* PowerReceiver, will most likely cause pipe connections to derp out and * connections to derp out and engines to eventually explode.
* engines to eventually explode. *
*
* @param side * @param side
* @return * @return
*/ */
public PowerReceiver getPowerReceiver(ForgeDirection side); public PowerReceiver getPowerReceiver(ForgeDirection side);
/** /**
* Call back from the PowerHandler that is called when the stored power * Call back from the PowerHandler that is called when the stored power exceeds the activation
* exceeds the activation power. * power.
* *
* It can be triggered by update() calls or power modification calls. * It can be triggered by update() calls or power modification calls.
* *
* @param workProvider * @param workProvider
*/ */
public void doWork(PowerHandler workProvider); public void doWork(PowerHandler workProvider);

View file

@ -7,36 +7,22 @@
*/ */
package buildcraft.api.power; package buildcraft.api.power;
import buildcraft.api.core.SafeTimeTracker;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.core.SafeTimeTracker;
/** public final class PowerHandler
* The PowerHandler is similar to FluidTank in that it holds your power and {
* allows standardized interaction between machines.
*
* To receive power to your machine you needs create an instance of PowerHandler
* and implement IPowerReceptor on the TileEntity.
*
* If you plan emit power, you need only implement IPowerEmitter. You do not
* need a PowerHandler. Engines have a PowerHandler because they can also
* receive power from other Engines.
*
* See TileRefinery for a simple example of a power using machine.
*
* @see IPowerReceptor
* @see IPowerEmitter
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public final class PowerHandler {
public static enum Type { public static enum Type
{
ENGINE, GATE, MACHINE, PIPE, STORAGE; ENGINE, GATE, MACHINE, PIPE, STORAGE;
public boolean canReceiveFromPipes() { public boolean canReceiveFromPipes()
switch (this) { {
switch (this)
{
case MACHINE: case MACHINE:
case STORAGE: case STORAGE:
return true; return true;
@ -45,8 +31,10 @@ public final class PowerHandler {
} }
} }
public boolean eatsEngineExcess() { public boolean eatsEngineExcess()
switch (this) { {
switch (this)
{
case MACHINE: case MACHINE:
case STORAGE: case STORAGE:
return true; return true;
@ -56,64 +44,48 @@ public final class PowerHandler {
} }
} }
/** public static class PerditionCalculator
* Extend this class to create custom Perdition algorithms (its not final). {
*
* NOTE: It is not possible to create a Zero perdition algorithm.
*/
public static class PerditionCalculator {
public static final float DEFAULT_POWERLOSS = 1F; public static final float DEFAULT_POWERLOSS = 1F;
public static final float MIN_POWERLOSS = 0.01F; public static final float MIN_POWERLOSS = 0.01F;
private final float powerLoss; private final float powerLoss;
public PerditionCalculator() { public PerditionCalculator()
{
powerLoss = DEFAULT_POWERLOSS; powerLoss = DEFAULT_POWERLOSS;
} }
/** public PerditionCalculator(float powerLoss)
* Simple constructor for simple Perdition per tick. {
* if (powerLoss < MIN_POWERLOSS)
* @param powerLoss power loss per tick {
*/
public PerditionCalculator(float powerLoss) {
if (powerLoss < MIN_POWERLOSS) {
powerLoss = MIN_POWERLOSS; powerLoss = MIN_POWERLOSS;
} }
this.powerLoss = powerLoss; this.powerLoss = powerLoss;
} }
/** /**
* Apply the perdition algorithm to the current stored energy. This * Apply the perdition algorithm to the current stored energy. This function can only be
* function can only be called once per tick, but it might not be called * called once per tick, but it might not be called every tick. It is triggered by any
* every tick. It is triggered by any manipulation of the stored energy. * manipulation of the stored energy.
* *
* @param powerHandler the PowerHandler requesting the perdition update * @param powerHandler the PowerHandler requesting the perdition update
* @param current the current stored energy * @param current the current stored energy
* @param ticksPassed ticks since the last time this function was called * @param ticksPassed ticks since the last time this function was called
* @return * @return
*/ */
public float applyPerdition(PowerHandler powerHandler, float current, long ticksPassed) { public float applyPerdition(PowerHandler powerHandler, float current, long ticksPassed)
// float prev = current; {
current -= powerLoss * ticksPassed; current -= powerLoss * ticksPassed;
if (current < 0) { if (current < 0)
{
current = 0; current = 0;
} }
// powerHandler.totalLostPower += prev - current;
return current; return current;
} }
/**
* Taxes a flat rate on all incoming power.
*
* Defaults to 0% tax rate.
*
* @return percent of input to tax
*/
public float getTaxPercent() {
return 0;
}
} }
public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator(); public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator();
private float minEnergyReceived; private float minEnergyReceived;
private float maxEnergyReceived; private float maxEnergyReceived;
@ -128,63 +100,65 @@ public final class PowerHandler {
private PerditionCalculator perdition; private PerditionCalculator perdition;
private final PowerReceiver receiver; private final PowerReceiver receiver;
private final Type type; private final Type type;
// Debug
// private double totalLostPower = 0;
// private double totalReceivedPower = 0;
// private double totalUsedPower = 0;
// private long startTime = -1;
public PowerHandler(IPowerReceptor receptor, Type type) { public PowerHandler(IPowerReceptor receptor, Type type)
{
this.receptor = receptor; this.receptor = receptor;
this.type = type; this.type = type;
this.receiver = new PowerReceiver(); this.receiver = new PowerReceiver();
this.perdition = DEFAULT_PERDITION; this.perdition = DEFAULT_PERDITION;
} }
public PowerReceiver getPowerReceiver() { public PowerReceiver getPowerReceiver()
{
return receiver; return receiver;
} }
public float getMinEnergyReceived() { public float getMinEnergyReceived()
{
return minEnergyReceived; return minEnergyReceived;
} }
public float getMaxEnergyReceived() { public float getMaxEnergyReceived()
{
return maxEnergyReceived; return maxEnergyReceived;
} }
public float getMaxEnergyStored() { public float getMaxEnergyStored()
{
return maxEnergyStored; return maxEnergyStored;
} }
public float getActivationEnergy() { public float getActivationEnergy()
{
return activationEnergy; return activationEnergy;
} }
public float getEnergyStored() { public float getEnergyStored()
{
return energyStored; return energyStored;
} }
/** /**
* Setup your PowerHandler's settings. * Setup your PowerHandler's settings.
* *
* @param minEnergyReceived This is the minimum about of power that will be * @param minEnergyReceived This is the minimum about of power that will be accepted by the
* accepted by the PowerHandler. This should generally be greater than the * PowerHandler. This should generally be greater than the activationEnergy if you plan to use
* activationEnergy if you plan to use the doWork() callback. Anything * the doWork() callback. Anything greater than 1 will prevent Redstone Engines from powering
* greater than 1 will prevent Redstone Engines from powering this Provider. * this Provider.
* @param maxEnergyReceived The maximum amount of power accepted by the * @param maxEnergyReceived The maximum amount of power accepted by the PowerHandler. This
* PowerHandler. This should generally be less than 500. Too low and larger * should generally be less than 500. Too low and larger engines will overheat while trying to
* engines will overheat while trying to power the machine. Too high, and * power the machine. Too high, and the engines will never warm up. Greater values also place
* the engines will never warm up. Greater values also place greater strain * greater strain on the power net.
* on the power net. * @param activationEnergy If the stored energy is greater than this value, the doWork()
* @param activationEnergy If the stored energy is greater than this value, * callback is called (once per tick).
* the doWork() callback is called (once per tick). * @param maxStoredEnergy The maximum amount of power this PowerHandler can store. Values tend
* @param maxStoredEnergy The maximum amount of power this PowerHandler can * to range between 100 and 5000. With 1000 and 1500 being common.
* store. Values tend to range between 100 and 5000. With 1000 and 1500
* being common.
*/ */
public void configure(float minEnergyReceived, float maxEnergyReceived, float activationEnergy, float maxStoredEnergy) { public void configure(float minEnergyReceived, float maxEnergyReceived, float activationEnergy, float maxStoredEnergy)
if (minEnergyReceived > maxEnergyReceived) { {
if (minEnergyReceived > maxEnergyReceived)
{
maxEnergyReceived = minEnergyReceived; maxEnergyReceived = minEnergyReceived;
} }
this.minEnergyReceived = minEnergyReceived; this.minEnergyReceived = minEnergyReceived;
@ -193,18 +167,10 @@ public final class PowerHandler {
this.activationEnergy = activationEnergy; this.activationEnergy = activationEnergy;
} }
/** public void configurePowerPerdition(int powerLoss, int powerLossRegularity)
* Allows you define perdition in terms of loss/ticks. {
* if (powerLoss == 0 || powerLossRegularity == 0)
* This function is mostly for legacy implementations. See {
* PerditionCalculator for more complex perdition formulas.
*
* @param powerLoss
* @param powerLossRegularity
* @see PerditionCalculator
*/
public void configurePowerPerdition(int powerLoss, int powerLossRegularity) {
if (powerLoss == 0 || powerLossRegularity == 0) {
perdition = new PerditionCalculator(0); perdition = new PerditionCalculator(0);
return; return;
} }
@ -212,50 +178,44 @@ public final class PowerHandler {
} }
/** /**
* Allows you to define a new PerditionCalculator class to handler perdition * Allows you to define a new PerditionCalculator class to handler perdition calculations.
* calculations. *
* * For example if you want exponentially increasing loss based on amount stored.
* For example if you want exponentially increasing loss based on amount *
* stored.
*
* @param perdition * @param perdition
*/ */
public void setPerdition(PerditionCalculator perdition) { public void setPerdition(PerditionCalculator perdition)
{
if (perdition == null) if (perdition == null)
perdition = DEFAULT_PERDITION; perdition = DEFAULT_PERDITION;
this.perdition = perdition; this.perdition = perdition;
} }
public PerditionCalculator getPerdition() { public PerditionCalculator getPerdition()
{
if (perdition == null) if (perdition == null)
return DEFAULT_PERDITION; return DEFAULT_PERDITION;
return perdition; return perdition;
} }
/** /**
* Ticks the power handler. You should call this if you can, but its not * Ticks the power handler. You should call this if you can, but its not required.
* required. *
* * If you don't call it, the possibility exists for some weirdness with the perdition algorithm
* If you don't call it, the possibility exists for some weirdness with the * and work callback as its possible they will not be called on every tick they otherwise would
* perdition algorithm and work callback as its possible they will not be * be. You should be able to design around this though if you are aware of the limitations.
* called on every tick they otherwise would be. You should be able to
* design around this though if you are aware of the limitations.
*/ */
public void update() { public void update()
// if (startTime == -1) {
// startTime = receptor.getWorld().getTotalWorldTime();
// else {
// long duration = receptor.getWorld().getTotalWorldTime() - startTime;
// System.out.printf("Power Stats: %s - Stored: %.2f Gained: %.2f - %.2f/t Lost: %.2f - %.2f/t Used: %.2f - %.2f/t%n", receptor.getClass().getSimpleName(), energyStored, totalReceivedPower, totalReceivedPower / duration, totalLostPower, totalLostPower / duration, totalUsedPower, totalUsedPower / duration);
// }
applyPerdition(); applyPerdition();
applyWork(); applyWork();
validateEnergy(); validateEnergy();
} }
private void applyPerdition() { private void applyPerdition()
if (perditionTracker.markTimeIfDelay(receptor.getWorld(), 1) && energyStored > 0) { {
if (perditionTracker.markTimeIfDelay(receptor.getWorld(), 1) && energyStored > 0)
{
float newEnergy = getPerdition().applyPerdition(this, energyStored, perditionTracker.durationOfLastDelay()); float newEnergy = getPerdition().applyPerdition(this, energyStored, perditionTracker.durationOfLastDelay());
if (newEnergy == 0 || newEnergy < energyStored) if (newEnergy == 0 || newEnergy < energyStored)
energyStored = newEnergy; energyStored = newEnergy;
@ -265,19 +225,26 @@ public final class PowerHandler {
} }
} }
private void applyWork() { private void applyWork()
if (energyStored >= activationEnergy) { {
if (doWorkTracker.markTimeIfDelay(receptor.getWorld(), 1)) { if (energyStored >= activationEnergy)
{
if (doWorkTracker.markTimeIfDelay(receptor.getWorld(), 1))
{
receptor.doWork(this); receptor.doWork(this);
} }
} }
} }
private void updateSources(ForgeDirection source) { private void updateSources(ForgeDirection source)
if (sourcesTracker.markTimeIfDelay(receptor.getWorld(), 1)) { {
for (int i = 0; i < 6; ++i) { if (sourcesTracker.markTimeIfDelay(receptor.getWorld(), 1))
{
for (int i = 0; i < 6; ++i)
{
powerSources[i] -= sourcesTracker.durationOfLastDelay(); powerSources[i] -= sourcesTracker.durationOfLastDelay();
if (powerSources[i] < 0) { if (powerSources[i] < 0)
{
powerSources[i] = 0; powerSources[i] = 0;
} }
} }
@ -288,28 +255,34 @@ public final class PowerHandler {
} }
/** /**
* Extract energy from the PowerHandler. You must call this even if doWork() * Extract energy from the PowerHandler. You must call this even if doWork() triggers.
* triggers. *
*
* @param min * @param min
* @param max * @param max
* @param doUse * @param doUse
* @return amount used * @return amount used
*/ */
public float useEnergy(float min, float max, boolean doUse) { public float useEnergy(float min, float max, boolean doUse)
{
applyPerdition(); applyPerdition();
float result = 0; float result = 0;
if (energyStored >= min) { if (energyStored >= min)
if (energyStored <= max) { {
if (energyStored <= max)
{
result = energyStored; result = energyStored;
if (doUse) { if (doUse)
{
energyStored = 0; energyStored = 0;
} }
} else { }
else
{
result = max; result = max;
if (doUse) { if (doUse)
{
energyStored -= max; energyStored -= max;
} }
} }
@ -317,122 +290,137 @@ public final class PowerHandler {
validateEnergy(); validateEnergy();
// if (doUse)
// totalUsedPower += result;
return result; return result;
} }
public void readFromNBT(NBTTagCompound data) { public void readFromNBT(NBTTagCompound data)
{
readFromNBT(data, "powerProvider"); readFromNBT(data, "powerProvider");
} }
public void readFromNBT(NBTTagCompound data, String tag) { public void readFromNBT(NBTTagCompound data, String tag)
{
NBTTagCompound nbt = data.getCompoundTag(tag); NBTTagCompound nbt = data.getCompoundTag(tag);
energyStored = nbt.getFloat("storedEnergy"); energyStored = nbt.getFloat("storedEnergy");
} }
public void writeToNBT(NBTTagCompound data) { public void writeToNBT(NBTTagCompound data)
{
writeToNBT(data, "powerProvider"); writeToNBT(data, "powerProvider");
} }
public void writeToNBT(NBTTagCompound data, String tag) { public void writeToNBT(NBTTagCompound data, String tag)
{
NBTTagCompound nbt = new NBTTagCompound(); NBTTagCompound nbt = new NBTTagCompound();
nbt.setFloat("storedEnergy", energyStored); nbt.setFloat("storedEnergy", energyStored);
data.setCompoundTag(tag, nbt); data.setCompoundTag(tag, nbt);
} }
public final class PowerReceiver { public final class PowerReceiver
{
private PowerReceiver() { private PowerReceiver()
{
} }
public float getMinEnergyReceived() { public float getMinEnergyReceived()
{
return minEnergyReceived; return minEnergyReceived;
} }
public float getMaxEnergyReceived() { public float getMaxEnergyReceived()
{
return maxEnergyReceived; return maxEnergyReceived;
} }
public float getMaxEnergyStored() { public float getMaxEnergyStored()
{
return maxEnergyStored; return maxEnergyStored;
} }
public float getActivationEnergy() { public float getActivationEnergy()
{
return activationEnergy; return activationEnergy;
} }
public float getEnergyStored() { public float getEnergyStored()
{
return energyStored; return energyStored;
} }
public Type getType() { public Type getType()
{
return type; return type;
} }
public void update() { public void update()
{
PowerHandler.this.update(); PowerHandler.this.update();
} }
/** /**
* The amount of power that this PowerHandler currently needs. * The amount of power that this PowerHandler currently needs.
* *
* @return * @return
*/ */
public float powerRequest() { public float powerRequest()
{
update(); update();
return Math.min(maxEnergyReceived, maxEnergyStored - energyStored); return Math.min(maxEnergyReceived, maxEnergyStored - energyStored);
} }
/** /**
* Add power to the PowerReceiver from an external source. * Add power to the PowerReceiver from an external source.
* *
* IPowerEmitters are responsible for calling this themselves.
*
* @param quantity * @param quantity
* @param from * @param from
* @return the amount of power used * @return the amount of power used
*/ */
public float receiveEnergy(Type source, final float quantity, ForgeDirection from) { public float receiveEnergy(Type source, final float quantity, ForgeDirection from)
{
float used = quantity; float used = quantity;
if (source == Type.ENGINE) { if (source == Type.ENGINE)
if (used < minEnergyReceived) { {
if (used < minEnergyReceived)
{
return 0; return 0;
} else if (used > maxEnergyReceived) { }
else if (used > maxEnergyReceived)
{
used = maxEnergyReceived; used = maxEnergyReceived;
} }
} }
updateSources(from); updateSources(from);
used -= used * getPerdition().getTaxPercent();
used = addEnergy(used); used = addEnergy(used);
applyWork(); applyWork();
if (source == Type.ENGINE && type.eatsEngineExcess()) { if (source == Type.ENGINE && type.eatsEngineExcess())
used = Math.min(quantity, maxEnergyReceived); {
return Math.min(quantity, maxEnergyReceived);
} }
// totalReceivedPower += used;
return used; return used;
} }
} }
/** /**
* *
* @return the amount the power changed by * @return the amount the power changed by
*/ */
public float addEnergy(float quantity) { public float addEnergy(float quantity)
{
energyStored += quantity; energyStored += quantity;
if (energyStored > maxEnergyStored) { if (energyStored > maxEnergyStored)
{
quantity -= energyStored - maxEnergyStored; quantity -= energyStored - maxEnergyStored;
energyStored = maxEnergyStored; energyStored = maxEnergyStored;
} else if (energyStored < 0) { }
else if (energyStored < 0)
{
quantity -= energyStored; quantity -= energyStored;
energyStored = 0; energyStored = 0;
} }
@ -442,20 +430,25 @@ public final class PowerHandler {
return quantity; return quantity;
} }
public void setEnergy(float quantity) { public void setEnergy(float quantity)
{
this.energyStored = quantity; this.energyStored = quantity;
validateEnergy(); validateEnergy();
} }
public boolean isPowerSource(ForgeDirection from) { public boolean isPowerSource(ForgeDirection from)
{
return powerSources[from.ordinal()] != 0; return powerSources[from.ordinal()] != 0;
} }
private void validateEnergy() { private void validateEnergy()
if (energyStored < 0) { {
if (energyStored < 0)
{
energyStored = 0; energyStored = 0;
} }
if (energyStored > maxEnergyStored) { if (energyStored > maxEnergyStored)
{
energyStored = maxEnergyStored; energyStored = maxEnergyStored;
} }
} }

View file

@ -26,8 +26,6 @@ public interface IMetaDelegate extends IEnergyTile {
/** /**
* Get the sub-TileEntities belonging to this Meta TileEntity. * Get the sub-TileEntities belonging to this Meta TileEntity.
* *
* @note the list has to be consistent between the EnergyNet Load and Unload events.
*
* @return sub-TileEntity array * @return sub-TileEntity array
*/ */
List<TileEntity> getSubTiles(); List<TileEntity> getSubTiles();

View file

@ -42,539 +42,346 @@ public final class Items {
/* Possible values: /* Possible values:
// ores ----- blocks -----
copperOre; // Copper Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreCopper, null with enableWorldGenOreCopper=false
tinOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreTin, null with enableWorldGenOreTin=false ores
uraniumOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreUranium, null with enableWorldGenOreUranium=false copperOre Copper Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreCopper, null with enableWorldGenOreCopper=false
leadOre; // Lead Ore Block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreLead, null with enableWorldGenOreLead=false tinOre Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreTin, null with enableWorldGenOreTin=false
uraniumOre Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreUranium, null with enableWorldGenOreUranium=false
// rubber related
rubber related
Rubber wood block, meta reflects the state, meta in ItemStack set to 0, ore dictionary: woodRubber (with meta 0), null with enableWorldGenTreeRubber=false Rubber wood block, meta reflects the state, meta in ItemStack set to 0, ore dictionary: woodRubber (with meta 0), null with enableWorldGenTreeRubber=false
dropped (as an item) -> metadata 0 dropped (as an item) -> metadata 0
block, no resin spot -> metadata 0 or 1 block, no resin spot -> metadata 0 or 1
block, wet resin spot -> metadata 2-5 (according to the side) block, wet resin spot -> metadata 2-5 (according to the side)
block, dry resin spot -> metadata 8-11 (wet state + 6) block, dry resin spot -> metadata 8-11 (wet state + 6)
rubberWood; rubberWood
rubberLeaves; // Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false rubberLeaves Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false
rubberSapling; // Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false rubberSapling Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false
resinSheet; // Resin Sheet block, currently not meta sensitive resinSheet Resin Sheet block, currently not meta sensitive
rubberTrampoline; // Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0 rubberTrampoline Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0
// building/storage building/storage
ironFence; // Iron Fence block, currently not meta sensitive ironFence Iron Fence block, currently not meta sensitive
reinforcedStone; // Reinforced Stone block, currently not meta sensitive reinforcedStone Reinforced Stone block, currently not meta sensitive
reinforcedGlass; // Reinforced Glass block, currently not meta sensitive reinforcedGlass Reinforced Glass block, currently not meta sensitive
reinforcedDoorBlock; // Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0 reinforcedDoorBlock Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0
constructionreinforcedFoam; // Construction Reinforced Foam block, currently not meta sensitive constructionFoam Construction Foam block, currently not meta sensitive
constructionFoam; // Construction Foam block, currently not meta sensitive constructionFoamWall Construction Foam Wall block, meta = color, implements IPaintableBlock
constructionFoamWall; // Construction Foam Wall block, meta = color, implements IPaintableBlock scaffold Scaffold block, meta reflects internal physical model data
scaffold; // Scaffold block, meta reflects internal physical model data
ironScaffold; // Scaffold block, meta reflects internal physical model data bronzeBlock Bronze block, meta sensitive
copperBlock Copper block, meta sensitive
bronzeBlock; // Bronze block, meta sensitive tinBlock Tin block, meta sensitive
copperBlock; // Copper block, meta sensitive uraniumBlock Uranium block, meta sensitive
tinBlock; // Tin block, meta sensitive
uraniumBlock; // Uranium block, meta sensitive cables (when placed as a block, inventory items are different TE implements IEnergyConductor)
leadBlock; // Uranium block, meta sensitive copperCableBlock Copper Cable block, meta sensitive
insulatedCopperCableBlock Insulated Copper Cable block, meta sensitive
// cables (when placed as a block, inventory items are different; TE implements IEnergyConductor)
goldCableBlock Gold Cable block, meta sensitive
copperCableBlock; // Copper Cable block, meta sensitive insulatedGoldCableBlock Insulated Gold Cable block, meta sensitive
insulatedCopperCableBlock; // Insulated Copper Cable block, meta sensitive doubleInsulatedGoldCableBlock Double Insulated Gold Cable block, meta sensitive
goldCableBlock; // Gold Cable block, meta sensitive ironCableBlock Iron Cable block, meta sensitive
insulatedGoldCableBlock; // Insulated Gold Cable block, meta sensitive insulatedIronCableBlock Insulated Iron Cable block, meta sensitive
doubleInsulatedGoldCableBlock; // Double Insulated Gold Cable block, meta sensitive doubleInsulatedIronCableBlock Double Insulated Iron Cable block, meta sensitive
trippleInsulatedIronCableBlock Tripple Insulated Iron Cable block, meta sensitive
ironCableBlock; // Iron Cable block, meta sensitive
insulatedIronCableBlock; // Insulated Iron Cable block, meta sensitive glassFiberCableBlock Glass Fiber Cable block, meta sensitive
doubleInsulatedIronCableBlock; // Double Insulated Iron Cable block, meta sensitive
trippleInsulatedIronCableBlock; // Tripple Insulated Iron Cable block, meta sensitive tinCableBlock Tin Cable block, meta sensitive
glassFiberCableBlock; // Glass Fiber Cable block, meta sensitive detectorCableBlock Detector Cable block, meta sensitive
splitterCableBlock Splitter Cable block, meta sensitive
tinCableBlock; // Tin Cable block, meta sensitive
insulatedtinCableBlock; // Insulated Tin Cable item, meta sensitive generators + related (TE implements IEnergySource ex. reactorChamber)
detectorCableBlock; // Detector Cable block, meta sensitive generator Generator block, meta sensitive
splitterCableBlock; // Splitter Cable block, meta sensitive geothermalGenerator Geothermal Generator block, meta sensitive
waterMill Water Mill block, meta sensitive
// generators + related (TE implements IEnergySource ex. reactorChamber) solarPanel Solar Panel block, meta sensitive
windMill Wind Mill block, meta sensitive
generator; // Generator block, meta sensitive nuclearReactor Nuclear Reactor block, meta sensitive
geothermalGenerator; // Geothermal Generator block, meta sensitive reactorChamber Reactor Chamber block, currently not meta sensitive
waterMill; // Water Mill block, meta sensitive
solarPanel; // Solar Panel block, meta sensitive energy storages (TE implements IEnergySource and IEnergyConductor)
windMill; // Wind Mill block, meta sensitive batBox BatBox block, meta sensitive
nuclearReactor; // Nuclear Reactor block, meta sensitive mfeUnit MFE Unit block, meta sensitive
reactorChamber; // Reactor Chamber block, currently not meta sensitive mfsUnit MFS Unit block, meta sensitive
RTGenerator; // Radioisotope Thermoelectric Generator block, meta sensitive
semifluidGenerator; // Semifluid Generator block, meta sensitive transformers (TE implements IEnergySource and IEnergyConductor)
lvTransformer LV Transformer block, meta sensitive
mvTransformer MV Transformer block, meta sensitive
// energy storages (TE implements IEnergySource and IEnergyConductor) hvTransformer HV Transformer block, meta sensitive
batBox; // BatBox block, meta sensitive machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip)
cesuUnit; // CESU Unit block, meta sensitive machine Machine block, meta sensitive
mfeUnit; // MFE Unit block, meta sensitive advancedMachine Advanced Machine block, meta sensitive
mfsUnit; // MFS Unit block, meta sensitive
ironFurnace Iron Furnace block, meta sensitive
// transformers (TE implements IEnergySource and IEnergyConductor) electroFurnace Electro Furnace block, meta sensitive
macerator Macerator block, meta sensitive
lvTransformer; // LV Transformer block, meta sensitive extractor Extractor block, meta sensitive
mvTransformer; // MV Transformer block, meta sensitive compressor Compressor block, meta sensitive
hvTransformer; // HV Transformer block, meta sensitive canner Canner block, meta sensitive
evTransformer; // EV Transformer block, meta sensitive miner Miner block, meta sensitive
pump Pump block, meta sensitive
// machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip) magnetizer Magnetizer block, meta sensitive
electrolyzer Electrolyzer block, meta sensitive
machine; // Machine block, meta sensitive recycler Recycler block, meta sensitive
advancedMachine; // Advanced Machine block, meta sensitive inductionFurnace Induction Furnace block, meta sensitive
massFabricator Mass Fabricator block, meta sensitive
ironFurnace; // Iron Furnace block, meta sensitive terraformer Terraformer block, meta sensitive
electroFurnace; // Electro Furnace block, meta sensitive teleporter Teleporter block, meta sensitive
macerator; // Macerator block, meta sensitive teslaCoil Tesla Coil block, meta sensitive
extractor; // Extractor block, meta sensitive luminator Passive (dark) Luminator block, meta = facing
compressor; // Compressor block, meta sensitive activeLuminator Active (bright) Luminator block, meta = facing
canner; // Canner block, meta sensitive
miner; // Miner block, meta sensitive miningPipe Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0
pump; // Pump block, meta sensitive miningPipeTip Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0
magnetizer; // Magnetizer block, meta sensitive
electrolyzer; // Electrolyzer block, meta sensitive personal blocks
recycler; // Recycler block, meta sensitive personalSafe Personal Safe block, meta sensitive
inductionFurnace; // Induction Furnace block, meta sensitive tradeOMat Trade-O-Mat block, meta sensitive
massFabricator; // Mass Fabricator block, meta sensitive energyOMat Energy-O-Mat block, meta sensitive
terraformer; // Terraformer block, meta sensitive
teleporter; // Teleporter block, meta sensitive explosives
teslaCoil; // Tesla Coil block, meta sensitive industrialTnt Industrial TNT block, currently not meta sensitive
luminator; // Passive (dark) Luminator block, meta = facing nuke Nuke block, currently not meta sensitive
activeLuminator; // Active (bright) Luminator block, meta = facing dynamiteStick Dynamite Stick block, meta = placement, meta in ItemStack set to 0
centrifuge; // Centrifuge block, meta sensitive dynamiteStickWithRemote Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0
metalformer; // MetalFormer block ,meta sensitive
orewashingplant; // Ore Wasching Plant,Meta sensitive Agriculture Stuff
patternstorage; // Pattern Storage,Meta sensitive crop Crop Block, empty, not meta sensitive
scanner; // Scanner,Meta sensitive
replicator; // Replicator,Meta sensitive
----- items -----
miningPipe; // Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0
miningPipeTip; // Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0 rubber + related
resin Resin item, currently not meta sensitive
rubber Rubber item, currently not meta sensitive, ore dictionary: itemRubber
// personal blocks
ore drops
personalSafe; // Personal Safe block, meta sensitive uraniumDrop Uranium Drop item, currently not meta sensitive, ore dictionary: itemDropUranium
tradeOMat; // Trade-O-Mat block, meta sensitive
energyOMat; // Energy-O-Mat block, meta sensitive dusts
bronzeDust Bronze Dust item, currently not meta sensitive
// explosives clayDust Clay Dust item, currently not meta sensitive
coalDust Coal Dust item, currently not meta sensitive
industrialTnt; // Industrial TNT block, currently not meta sensitive copperDust Copper Dust item, currently not meta sensitive
nuke; // Nuke block, currently not meta sensitive goldDust Gold Dust item, currently not meta sensitive
dynamiteStick; // Dynamite Stick block, meta = placement, meta in ItemStack set to 0 ironDust Iron Dust item, currently not meta sensitive
dynamiteStickWithRemote; // Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0 silverDust Silver Dust item, currently not meta sensitive
smallIronDust Small Iron Dust item, currently not meta sensitive
// Agriculture Stuff tinDust Tin Dust item, currently not meta sensitive
hydratedCoalDust Hydrated Coal Dust item, currently not meta sensitive
crop; // Crop Block, empty, not meta sensitive
cropmatron; // Cropmatron machien block, meta sensititve ingots
refinedIronIngot Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron
// ----- items ----- copperIngot Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper
tinIngot Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin
// rubber + related bronzeIngot Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze
resin; // Resin item, currently not meta sensitive mixedMetalIngot Mixed Metal Ingot item, currently not meta sensitive
rubber; // Rubber item, currently not meta sensitive, ore dictionary: itemRubber uraniumIngot Uranium Ingot item, currently not meta sensitive, ore dictionary: ingotUranium
FluidCell; tools/weapons (without electric tools)
treetap Treetap item, meta = damage value
// Lithium -> Tritium wrench Wrench item, meta = damage value
cutter Insulation Cutter item, meta = damage value
reactorLithiumCell; // LithiumCell use in Reaktor, , meta = damage value constructionFoamSprayer Construction Foam Sprayer item, meta = charges (as of v1.45)
TritiumCell; // Tritium, currently not meta sensitive
bronzePickaxe Bronze Pickaxe item, meta = damage value
// Nuclear Fuel bronzeAxe Bronze Axe item, meta = damage value
bronzeSword Bronze Sword item, meta = damage value
UranFuel; // , currently not meta sensitive bronzeShovel Bronze Shovel item, meta = damage value
MOXFuel; // , currently not meta sensitive bronzeHoe Bronze Hoe item, meta = damage value
Plutonium; // , currently not meta sensitive
smallPlutonium; // , currently not meta sensitive el. tools/devices/weapons
Uran235; // , currently not meta sensitive miningDrill Mining Drill item, meta = visual charge indicator, implements IElectricItem
smallUran235; // , currently not meta sensitive diamondDrill Diamond Tipped Mining Drill item, meta = visual charge indicator, implements IElectricItem
Uran238; // , currently not meta sensitive chainsaw Chainsaw item, meta = visual charge indicator, implements IElectricItem
electricWrench Electric Wrench item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumSimple; // Depleted Uranium Cell items, currently not meta sensitive electricTreetap Electric Treetap item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumDual; miningLaser Mining Laser item, meta = visual charge indicator, implements IElectricItem
reactorDepletedUraniumQuad;
reactorDepletedMOXSimple; // Depleted MOX Cell items, currently not meta sensitive ecMeter EC-Mater item, currently not meta sensitive
reactorDepletedMOXDual; odScanner Ore Density Scanner item, meta = damage value for charge level, implements IElectricItem
reactorDepletedMOXQuad; ovScanner Ore Value Scanner item, meta = visual charge indicator, implements IElectricItem
reactorMOXSimple; // Depleted MOX Cell items, currently not meta sensitive
reactorMOXDual; frequencyTransmitter Frequency Transmitter item, currently not meta sensitive
reactorMOXQuad;
RTGPellets; nanoSaber Idle Nano Saber item, meta = visual charge indicator, implements IElectricItem
enabledNanoSaber Enabled Nano Saber item, meta = visual charge indicator, implements IElectricItem
// Recipe Parts armor/wearable
rubberBoots Rubber Boots item, meta = damage value
coil; // Coil, meta sensitive
elemotor; // electric motor, meta sensitive bronzeHelmet Bronze Helmet Armor item, meta = damage value
powerunit; // Item Power Unit, meta sensitive bronzeChestplate Bronze Chestplate Armor item, meta = damage value
powerunitsmall; // Item Power Unit, meta sensitive bronzeLeggings Bronze Leggings Armor item, meta = damage value
bronzeBoots Bronze Boots Armor item, meta = damage value
// ItemCasing compositeArmor Composite Armor item, meta = damage value for charge level
casingcopper; // Copper ItemCasing, meta sensitive nanoHelmet Nano Helmet Armor item, meta = visual charge indicator, implements IElectricItem
casingtin; // Tin ItemCasing, meta sensitive nanoBodyarmor Nano Bodyarmor item, meta = visual charge indicator, implements IElectricItem
casingbronze; // Bronze ItemCasing, meta sensitive nanoLeggings Nano Leggings Armor item, meta = visual charge indicator, implements IElectricItem
casinggold; // Gold ItemCasing, meta sensitive nanoBoots Nano Boots Armor item, meta = visual charge indicator, implements IElectricItem
casingiron; // Iron ItemCasing, meta sensitive
@Deprecated quantumHelmet Quantum Helmet Armor item, meta = visual charge indicator, implements IElectricItem
casingadviron; // Refined Iron ItemCasing, meta sensitive quantumBodyarmor Quantum Bodyarmor item, meta = visual charge indicator, implements IElectricItem
casinglead; // Lead ItemCasing, meta sensitive quantumLeggings Quantum Leggings Armor item, meta = visual charge indicator, implements IElectricItem
quantumBoots Quantum Boots Armor item, meta = visual charge indicator, implements IElectricItem
// Crushed Ore
crushedIronOre; // Crushed Iron Ore, meta sensitive jetpack Jetpack item, meta = damage value for fuel level
crushedCopperOre; // Crushed Copper Ore, meta sensitive electricJetpack Electric Jetpack item, meta = visual charge indicator, implements IElectricItem
crushedGoldOre; // Crushed Gold Ore, meta sensitive
crushedTinOre; // Crushed Tin Ore, meta sensitive batPack BatPack item, meta = visual charge indicator, implements IElectricItem, can provide energy
crushedUraniumOre; // Crushed Uranium Ore, meta sensitive lapPack LapPack item, meta = visual charge indicator, implements IElectricItem, can provide energy
crushedSilverOre; // Crushed Silver Ore, meta sensitive
crushedLeadOre; // Crushed Lead Ore, meta sensitive cfPack CF Pack item, meta = charges (as of v1.45)
solarHelmet Solar Helmet item, currently not meta sensitive
//Purify Crushed Ore staticBoots Static Boots item, currently not meta sensitive
purifiedCrushedIronOre; // Purify Crushed Iron Ore, meta sensitive
purifiedCrushedCopperOre; // Purify Crushed Copper Ore, meta sensitive batteries
purifiedCrushedGoldOre; // Purify Crushed Gold Ore, meta sensitive reBattery Empty RE Battery item, currently not meta sensitive, implements IElectricItem
purifiedCrushedTinOre; // Purify Crushed Tin Ore, meta sensitive chargedReBattery RE Battery item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedUraniumOre; // Purify Crushed Uranium Ore, meta sensitive energyCrystal Energy Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedSilverOre; // Purify Crushed Silver Ore, meta sensitive lapotronCrystal Lapotron Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy
purifiedCrushedLeadOre; // Purify Crushed Lead Ore, meta sensitive suBattery SU Battery item, currently not meta sensitive
// dusts cables
stoneDust; copperCableItem Copper Cable item, meta sensitive
bronzeDust; // Bronze Dust item, meta sensitive, ore dictionary: dustBronze insulatedCopperCableItem Insulated Copper Cable item, meta sensitive
clayDust; // Clay Dust item, meta sensitive, ore dictionary: dustClay
coalDust; // Coal Dust item, meta sensitive, ore dictionary: dustCoal goldCableItem Gold Cable item, meta sensitive
copperDust; // Copper Dust item, meta sensitive, ore dictionary: dustCopper insulatedGoldCableItem Insulated Gold Cable item, meta sensitive
goldDust; // Gold Dust item, meta sensitive, ore dictionary: dustGold doubleInsulatedGoldCableItem Double Insulated Gold Cable item, meta sensitive
ironDust; // Iron Dust item, meta sensitive, ore dictionary: dustIron
silverDust; // Silver Dust item, meta sensitive, ore dictionary: dustSilver ironCableItem Iron Cable item, meta sensitive
tinDust; // Tin Dust item, meta sensitive, ore dictionary: dustTin insulatedIronCableItem Insulated Iron Cable item, meta sensitive
hydratedCoalDust; // Hydrated Coal Dust item, meta sensitive doubleInsulatedIronCableItem Double Insulated Iron Cable item, meta sensitive
leadDust; // Lead Dust item, meta sensitive, ore dictionary: dustLead trippleInsulatedIronCableItem Tripple Insulated Iron Cable item, meta sensitive
obsidianDust; // Obsidian Dust item, meta sensitive, ore dictionary: dustObsidian
lapiDust; // Lapi Dust item, meta sensitive, ore dictionary: dustLapi glassFiberCableItem Glass Fiber Cable item, meta sensitive
sulfurDust; // Sulfur Dust item, meta sensitive, ore dictionary: dustSulfur
lithiumDust; // Lithium dust, meta sensitive, ore dictionary: dustLithium tinCableItem Tin Cable item, meta sensitive
// small dusts detectorCableItem Detector Cable item, meta sensitive
splitterCableItem Splitter Cable item, meta sensitive
smallIronDust; // Small Iron Dust item, meta sensitive
smallCopperDust; // Small Copper Dust item, meta sensitive cells/containers (without reactor components)
smallGoldDust; // Small Gold Dust item, meta sensitive cell Empty Cell item, currently not meta sensitive
smallTinDust; // Small Tin Dust item, meta sensitive lavaCell Lava Cell item, currently not meta sensitive
smallSilverDust; // Small Silver Dust item, meta sensitive hydratedCoalCell Hydrated Coal Cell item, currently not meta sensitive
smallLeadDust; // Small Lead Dust item, meta sensitive bioCell Bio Cell item, currently not meta sensitive
smallSulfurDust; // Small Sulfur Dust item, meta sensitive coalfuelCell Coalfuel Cell item, currently not meta sensitive
smallLithiumDust; // Small Lithium Dust item, meta sensitive biofuelCell Biofuel Cell item, currently not meta sensitive
waterCell Water Cell item, currently not meta sensitive
electrolyzedWaterCell Electrolyzed Water Cell item, currently not meta sensitive
// ingots
@Deprecated fuelCan Empty Fuel Can item, currently not meta sensitive
refinedIronIngot; // Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron filledFuelCan Fuel Can item, meta = fuel value (as of v1.45)
copperIngot; // Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper
tinIngot; // Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin tinCan Empty Tin Can item, currently not meta sensitive
bronzeIngot; // Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze filledTinCan Filled Tin Can item, currently not meta sensitive
mixedMetalIngot; // Mixed Metal Ingot item, currently not meta sensitive
leadIngot; // Lead Ingot item, currently not meta sensitive reactor components
uraniumCell Uranium Cell item, meta = damage value
coolingCell Cooling Cell item, meta = damage value
// tools/weapons (without electric tools)
treetap; // Treetap item, meta = damage value depletedIsotopeCell Depleted Isotope Cell item, meta = damage value
wrench; // Wrench item, meta = damage value reEnrichedUraniumCell Re-Enriched Uranium Cell item, currently not meta sensitive
cutter; // Insulation Cutter item, meta = damage value nearDepletedUraniumCell Near-Depleted Uranium Cell item, currently not meta sensitive
constructionFoamSprayer; // Construction Foam Sprayer item, meta = charges (as of v1.45)
integratedReactorPlating Integrated Reactor Plating item, meta = damage value
bronzePickaxe; // Bronze Pickaxe item, meta = damage value integratedHeatDisperser Integrated Heat Disperser item, meta = damage value
bronzeAxe; // Bronze Axe item, meta = damage value
bronzeSword; // Bronze Sword item, meta = damage value terraformer blueprints
bronzeShovel; // Bronze Shovel item, meta = damage value terraformerBlueprint Empty Terraformer Blueprint item, currently not meta sensitive
bronzeHoe; // Bronze Hoe item, meta = damage value cultivationTerraformerBlueprint Cultivation Terraformer Blueprint item, currently not meta sensitive
irrigationTerraformerBlueprint Irrigation Terraformer Blueprint item, currently not meta sensitive
ForgeHammer; // Refine Iron Hammer item, meta = damage value chillingTerraformerBlueprint Chilling Terraformer Blueprint item, currently not meta sensitive
desertificationTerraformerBlueprint Desertification Terraformer Blueprint item, currently not meta sensitive
// el. tools/devices/weapons flatificatorTerraformerBlueprint Flatificator Terraformer Blueprint item, currently not meta sensitive
miningDrill; // Mining Drill item, meta = damage value for charge level mushroomTerraformerBlueprint Mushroom Terraformer Blueprint item, currently not meta sensitive
diamondDrill; // Diamond Tipped Mining Drill item, meta = damage value for charge level
iridiumDrill; // Iridium Tipped Mining Drill item, meta = damage value for charge level diamond chain
chainsaw; // Chainsaw item, meta = damage value for charge level coalBall Coal Ball item, currently not meta sensitive
electricWrench; // Electric Wrench item, meta = damage value for charge level compressedCoalBall Compressed Coal Ball item, currently not meta sensitive
electricTreetap; // Electric Treetap item, meta = damage value for charge level coalChunk Coal Chunk item, currently not meta sensitive
miningLaser; // Mining Laser item, meta = damage value for charge level industrialDiamond Industrial Diamond item, currently not meta sensitive, DEPRECATED
ecMeter; // EC-Mater item, meta = itemdata db index (as of v1.45) recycler chain
odScanner; // Ore Density Scanner item, meta = damage value for charge level scrap Scrap item, currently not meta sensitive
ovScanner; // Ore Value Scanner item, meta = damage value for charge level scrapBox Scrap Box item, currently not meta sensitive
obscurator; // Obscurator item, meta = damage value for charge level
fuel production chain
frequencyTransmitter; // Frequency Transmitter item, meta = itemdata db index (as of v1.45) hydratedCoalClump Hydrated Coal Clump item, currently not meta sensitive
plantBall Plant Ball item, currently not meta sensitive
nanoSaber; // Idle Nano Saber item, meta = damage value for charge level compressedPlantBall Compressed Plant Ball item, currently not meta sensitive
enabledNanoSaber; // Enabled Nano Saber item, meta = damage value for charge level
painting
toolbox; // Open/Empty toolbox, meta = Open (0) / Closed (1) painter Painter item, currently not meta sensitive
// armor/wearable blackPainter Black Painter item, meta = damage value
hazmatHelmet; // Hazmat Helmet item, meta = damage value redPainter Red Painter item, meta = damage value
hazmatChestplate; // Hazmat Chestplate item, meta = damage value greenPainter Green Painter item, meta = damage value
hazmatLeggings; // Hazmat Leggings item, meta = damage value brownPainter Brown Painter item, meta = damage value
hazmatBoots; // Hazmat Boots item, meta = damage value bluePainter Blue Painter item, meta = damage value
purplePainter Purple Painter item, meta = damage value
bronzeHelmet; // Bronze Helmet Armor item, meta = damage value cyanPainter Cyan Painter item, meta = damage value
bronzeChestplate; // Bronze Chestplate Armor item, meta = damage value lightGreyPainter Light Grey Painter item, meta = damage value
bronzeLeggings; // Bronze Leggings Armor item, meta = damage value darkGreyPainter Dark Grey Painter item, meta = damage value
bronzeBoots; // Bronze Boots Armor item, meta = damage value pinkPainter Pink Painter item, meta = damage value
limePainter Lime Painter item, meta = damage value
compositeArmor; // Composite Armor item, meta = damage value for charge level yellowPainter Yellow Painter item, meta = damage value
cloudPainter Cloud Painter item, meta = damage value
nanoHelmet; // Nano Helmet Armor item, meta = damage value for charge level magentaPainter Magenta Painter item, meta = damage value
nanoBodyarmor; // Nano Bodyarmor item, meta = damage value for charge level orangePainter Orange Painter item, meta = damage value
nanoLeggings; // Nano Leggings Armor item, meta = damage value for charge level whitePainter White Painter item, meta = damage value
nanoBoots; // Nano Boots Armor item, meta = damage value for charge level
explosives + related
quantumHelmet; // Quantum Helmet Armor item, meta = damage value for charge level dynamite Throwable Dynamite item, currently not meta sensitive
quantumBodyarmor; // Quantum Bodyarmor item, meta = damage value for charge level stickyDynamite Throwable Sticky Dynamite item, currently not meta sensitive
quantumLeggings; // Quantum Leggings Armor item, meta = damage value for charge level
quantumBoots; // Quantum Boots Armor item, meta = damage value for charge level remote Dynamite Remote item, currently not meta sensitive
jetpack; // Jetpack item, meta = damage value for fuel level misc intermediate recipe ingredients
electricJetpack; // Electric Jetpack item, meta = damage value for charge level electronicCircuit Electronic Circuit item, currently not meta sensitive
advancedCircuit Advanced Circuit item, currently not meta sensitive
batPack; // BatPack item, meta = damage value for charge level
advbatPack; // Adv.BatPack item, meta = damage value for charge level advancedAlloy Advanced Alloy item, currently not meta sensitive
lapPack; // LapPack item, meta = damage value for charge level
energyPack; // EnergyPack item, meta = damage value for charge level carbonFiber Raw Carbon Fiber item, currently not meta sensitive
carbonMesh Raw Carbon Mesh item, currently not meta sensitive
cfPack; // CF Pack item, meta = charges (as of v1.45) carbonPlate Carbon Plate item, currently not meta sensitive
solarHelmet; // Solar Helmet, currently not meta sensitive
staticBoots; // Static Boots, currently not meta sensitive matter UU-Matter item, currently not meta sensitive
nightvisionGoggles; // Nightvision Goggles, meta = damage value for charge level iridiumOre Iridium Ore item, currently not meta sensitive
iridiumPlate Iridium Plate item, currently not meta sensitive
// batteries
reBattery; // Empty RE Battery item, currently not meta sensitive upgrade modules
chargedReBattery; // RE Battery item, meta = damage value for charge level overclockerUpgrade overclocker upgrade item, meta sensitive
advBattery; // Adv Batteryitem, meta = damage value for charge level transformerUpgrade transformer upgrade item, meta sensitive
energyCrystal; // Energy Crystal item, meta = damage value for charge level energyStorageUpgrade energy storage upgrade item, meta sensitive
lapotronCrystal; // Lapotron Crystal item, meta = damage value for charge level
suBattery; // SU Battery item, meta = damage value for charge level misc
coin Coin item, currently not meta sensitive
// cables reinforcedDoor Reinforced Door item, currently not meta sensitive
copperCableItem; // Copper Cable item, meta sensitive constructionFoamPellet Construction Foam Pellet item, currently not meta sensitive
insulatedCopperCableItem; // Insulated Copper Cable item, meta sensitive cropSeed Crop seeds, stuff stored in NBT, don't use for crafting recipes!
cropnalyzer Cropnalyzer handheld device
goldCableItem; // Gold Cable item, meta sensitive fertilizer Basic IC2Item, used to provide nutrients toCropBlocks
insulatedGoldCableItem; // Insulated Gold Cable item, meta sensitive hydratingCell Cell used to hydrate Crops, meta = Content, 0 = Full, 9999 = Near empty
electricHoe Electric Hoe, meta = charge level
@Deprecated solarHelmet Solar Helmet item, currently not meta sensitive
doubleInsulatedGoldCableItem; // Double Insulated Gold Cable item, meta sensitive terraWart Terra Wart item, cures potion effects
weedEx Weed-EX can, meta = uses left
ironCableItem; // Iron Cable item, meta sensitive
insulatedIronCableItem; // Insulated Iron Cable item, meta sensitive
@Deprecated
doubleInsulatedIronCableItem; // Double Insulated Iron Cable item, meta sensitive
@Deprecated
trippleInsulatedIronCableItem; // Tripple Insulated Iron Cable item, meta sensitive
insulatedTinCableItem;
glassFiberCableItem; // Glass Fiber Cable item, meta sensitive
tinCableItem; // Tin Cable item, meta sensitive
detectorCableItem; // Detector Cable item, meta sensitive
splitterCableItem; // Splitter Cable item, meta sensitive
// cells/containers (without reactor components)
cell; // Empty Cell item, meta sensitive
lavaCell; // Lava Cell item, meta sensitive
waterCell; // Water Cell item, meta sensitive
UuMatterCell; // UUMatter Cell item, meta sensitive
CFCell; // constructionFoam Cell item, meta sensitive
fuelRod; // Empy Fuel Rod item, currently not meta sensitive
hydratedCoalCell; // Hydrated Coal Cell item, currently not meta sensitive
bioCell; // Bio Cell item, currently not meta sensitive
coalfuelCell; // Coalfuel Cell item, currently not meta sensitive
biofuelCell; // Biofuel Cell item, currently not meta sensitive
electrolyzedWaterCell; // Electrolyzed Water Cell item, currently not meta sensitive
airCell; // Compressed Air item, currently not meta sensitive
fuelCan; // Empty Fuel Can item, currently not meta sensitive
filledFuelCan; // Fuel Can item, meta = fuel value (as of v1.45)
tinCan; // Empty Tin Can item, currently not meta sensitive
filledTinCan; // Filled Tin Can item, currently not meta sensitive
// reactor components
reactorUraniumSimple; // Uranium Cell items, meta = consumed uranium ticks
reactorUraniumDual;
reactorUraniumQuad;
reactorCoolantSimple;
reactorCoolantTriple ; // Coolant Cell item, NBT for heat-storage, meta is 0-10000 for display
reactorCoolantSix;
reactorPlating; // Integrated Reactor Plating item, currently not meta sensitive
reactorPlatingHeat;
reactorPlatingExplosive;
reactorHeatSwitch; // Integrated Heat Disperser item, NBT for heat-storage, meta is 0-10000 for display
reactorHeatSwitchCore;
reactorHeatSwitchSpread;
reactorHeatSwitchDiamond;
reactorVent; // Heat Venting component, NBT for heat-storage, meta is 0-10000 for display
reactorVentCore;
reactorVentGold;
reactorVentSpread;// Special: Does not store heat
reactorVentDiamond;
reactorReflector; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display
reactorReflectorThick; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display
reactorCondensator; // Consumes redstone to absorb heat, NBT for storage, meta is 0-10000 for display
reactorCondensatorLap; // Consumes redstone/lapis to absorb heat, mNBT for storage, meta is 0-10000 for display
// terraformer blueprints
terraformerBlueprint; // Empty Terraformer Blueprint item, currently not meta sensitive
cultivationTerraformerBlueprint; // Cultivation Terraformer Blueprint item, currently not meta sensitive
irrigationTerraformerBlueprint; // Irrigation Terraformer Blueprint item, currently not meta sensitive
chillingTerraformerBlueprint; // Chilling Terraformer Blueprint item, currently not meta sensitive
desertificationTerraformerBlueprint; // Desertification Terraformer Blueprint item, currently not meta sensitive
flatificatorTerraformerBlueprint; // Flatificator Terraformer Blueprint item, currently not meta sensitive
mushroomTerraformerBlueprint; // Mushroom Terraformer Blueprint item, currently not meta sensitive
// diamond chain
coalBall; // Coal Ball item, currently not meta sensitive
compressedCoalBall; // Compressed Coal Ball item, currently not meta sensitive
coalChunk; // Coal Chunk item, currently not meta sensitive
industrialDiamond; // Industrial Diamond item, currently not meta sensitive, DEPRECATED
// recycler chain
scrap; // Scrap item, currently not meta sensitive
scrapBox; // Scrap Box item, currently not meta sensitive
// fuel production chain
hydratedCoalClump; // Hydrated Coal Clump item, currently not meta sensitive
plantBall; // Plant Ball item, currently not meta sensitive
compressedPlantBall; // Compressed Plant Ball item, currently not meta sensitive
// painting
painter; // Painter item, currently not meta sensitive
blackPainter; // Black Painter item, meta = damage value
redPainter; // Red Painter item, meta = damage value
greenPainter; // Green Painter item, meta = damage value
brownPainter; // Brown Painter item, meta = damage value
bluePainter; // Blue Painter item, meta = damage value
purplePainter; // Purple Painter item, meta = damage value
cyanPainter; // Cyan Painter item, meta = damage value
lightGreyPainter; // Light Grey Painter item, meta = damage value
darkGreyPainter; // Dark Grey Painter item, meta = damage value
pinkPainter; // Pink Painter item, meta = damage value
limePainter; // Lime Painter item, meta = damage value
yellowPainter; // Yellow Painter item, meta = damage value
cloudPainter; // Cloud Painter item, meta = damage value
magentaPainter; // Magenta Painter item, meta = damage value
orangePainter; // Orange Painter item, meta = damage value
whitePainter; // White Painter item, meta = damage value
// explosives + related
dynamite; // Throwable Dynamite item, currently not meta sensitive
stickyDynamite; // Throwable Sticky Dynamite item, currently not meta sensitive
remote; // Dynamite Remote item, currently not meta sensitive
// misc intermediate recipe ingredients
electronicCircuit; // Electronic Circuit item, currently not meta sensitive
advancedCircuit; // Advanced Circuit item, currently not meta sensitive
advancedAlloy; // Advanced Alloy item, currently not meta sensitive
carbonFiber; // Raw Carbon Fiber item, currently not meta sensitive
carbonMesh; // Raw Carbon Mesh item, currently not meta sensitive
carbonPlate; // Carbon Plate item, currently not meta sensitive
matter; // UUA item, currently not meta sensitive
iridiumOre; // Iridium Ore item, currently not meta sensitive
iridiumPlate; // Iridium Plate item, currently not meta sensitive
// Metal Plates
platecopper; // Metal plate item, meta sensitive
platetin; // Metal plate item, meta sensitive
platebronze; // Metal plate item, meta sensitive
plategold; // Metal plate item, meta sensitive
plateiron; // Metal plate item, meta sensitive
platelead; // Metal plate item, meta sensitive
platelapi; // Metal plate item, meta sensitive
plateobsidian; // Metal plate item, meta sensitive
plateadviron; // Metal plate item, meta sensitive
// Metal Dense Plates
denseplatecopper; // Metal dense plate item, meta sensitive
denseplatetin; // Metal dense plate item, meta sensitive
denseplatebronze; // Metal dense plate item, meta sensitive
denseplategold; // Metal dense plate item, meta sensitive
denseplateiron; // Metal dense plate item, meta sensitive
@Deprecated
denseplateadviron; // Metal dense plate item, meta sensitive
denseplatelead; // Metal dense plate item, meta sensitive
denseplatelapi; // Metal dense plate item, meta sensitive
denseplateobsidian; // Metal dense plate item, meta sensitive
// upgrade modules
overclockerUpgrade; // overclocker upgrade item, meta sensitive
transformerUpgrade; // transformer upgrade item, meta sensitive
energyStorageUpgrade; // energy storage upgrade item, meta sensitive
ejectorUpgrade; // ejector upgrade item, meta sensitive
// misc
coin; // Coin item, currently not meta sensitive
reinforcedDoor; // Reinforced Door item, currently not meta sensitive
constructionFoamPowder; // Construction Foam Powder item, currently not meta sensitive
grinPowder; // Poisonous ingrident, currently not meta sensitive
debug; // Debug item, currently not meta sensitive
boatCarbon; // Carbon Fiber Canoe item, meta sensitive
boatRubber; // Rubber Dinghy item, meta sensitive
boatRubberBroken; // Damaged Rubber Dinghy item, meta sensitive
boatElectric; // Electric Boat item, meta sensitive
//Agriculture
cropSeed; // Crop seeds, stuff stored in NBT, don't use for crafting recipes!
cropnalyzer; // Cropnalyzer handheld device
fertilizer; // Basic IC2Item, used to provide nutrients toCropBlocks
hydratingCell; // Cell used to hydrate Crops, meta = Content, 0= Full, 9999 = Near empty
electricHoe; // Electric Hoe, Metadata indicates charge level
terraWart; // Mystic opposite of NEtherWart, cures StatusEffects, simply consumeable
weedEx; // Spraying can of WEED-EX, meta indicates usages left
//Boozeception
mugEmpty; // Simple stone mug
coffeeBeans; // Harvested CoffeeBeans
coffeePowder; // Processed Coffee Beans, used to craft drinkable Coffee
mugCoffee; // Mug of Coffee, Meta indicates status 0 = cold, 1 = Normal, 2 = Sugar'd
hops; // Hops, harvested freshly from crop
barrel; // Carried Barrel, metadata encrypts the information about the liquid inside
blockBarrel; // Unobtainable "placed barrel", TileEntity controlling the Fermentation process
mugBooze; // Mug filled with booze, metadata encrypts the information about the liquid inside
*/ */

View file

@ -12,34 +12,45 @@ import cpw.mods.fml.common.Loader;
*/ */
public class Compatibility public class Compatibility
{ {
/** Version of build craft api compiled with */ /** Version of BuildCraft api compiled with */
public static String BCx_VERSION = "@BCxVersion@"; public static String BCx_VERSION = "@BCxVersion@";
/** Version of industrial craft api compiled with */ /** Version of Industrial Craft api compiled with */
public static String ICx_VERSION = "@ICxVersion@"; public static String ICx_VERSION = "@ICxVersion@";
/** Version of thermal expansion api compiled with */ /** Version of Thermal Expansion api compiled with */
public static String TEx_VERSION = "@TExVersion@"; public static String TEx_VERSION = "@TExVersion@";
/** Has the initiate method been called */ /** Has the initiate method been called */
public static boolean INIT = false; public static boolean INIT = false;
/** Ratio of Build craft(MJ) power to UE power(KW). Multiply BC3 power by this to convert to UE */ /** Ratio of Build craft(MJ) power to UE power(Kw). Multiply BC3 power by this to convert to UE */
public static float BC3_RATIO = 2.814f; public static float BC3_RATIO = 2.814f;
/** Ratio of Redstone Flux power to UE power(Kw). Multiply TE power by this to convert to UE */
public static float TE_RATIO = BC3_RATIO / 10;
/** /**
* Ratio of Industrial craft(EU) power to UE power(KW). Multiply IC2 power by this to convert to * Ratio of Industrial craft(EU) power to UE power(Kw). Multiply IC2 power by this to convert to
* UE * UE
*/ */
public static float IC2_RATIO = 0.11256f; public static float IC2_RATIO = 0.11256f;
/**
* Ratio of UE power(Kw) to Build craft(MJ) power. Multiply UE power by this to convert it to
* BC3 power
*/
public static float TO_BC_RATIO = 1 / BC3_RATIO;
/**
* Ratio of UE power(Kw) to Redstone Flux power. Multiply UE power by this to convert it to TE
* power
*/
public static float TO_TE_RATIO = 1 / TE_RATIO;
/** /**
* Ratio of UE power(KW) to Industrial craft(EU) power. Multiply UE power by this to convert it * Ratio of UE power(KW) to Industrial craft(EU) power. Multiply UE power by this to convert it
* to IC2 power * to IC2 power
*/ */
public static float TO_IC2_RATIO = 1 / IC2_RATIO; public static float TO_IC2_RATIO = 1 / IC2_RATIO;
/**
* Ratio of UE power(KW) to Build craft(MJ) power. Multiply UE power by this to convert it to
* BC3 power
*/
public static float TO_BC_RATIO = 1 / BC3_RATIO;
/** You must call this function to enable the Universal Network module. */ /** You must call this function to enable the Universal Network module. */
public static void initiate() public static void initiate()
@ -55,6 +66,7 @@ public class Compatibility
/** Loads the configuration and sets all the values. */ /** Loads the configuration and sets all the values. */
UniversalElectricity.CONFIGURATION.load(); UniversalElectricity.CONFIGURATION.load();
IC2_RATIO = (float) UniversalElectricity.CONFIGURATION.get("Compatiblity", "IndustrialCraft Conversion Ratio", IC2_RATIO).getDouble(IC2_RATIO); IC2_RATIO = (float) UniversalElectricity.CONFIGURATION.get("Compatiblity", "IndustrialCraft Conversion Ratio", IC2_RATIO).getDouble(IC2_RATIO);
TE_RATIO = (float) UniversalElectricity.CONFIGURATION.get("Compatiblity", "Thermal Expansion Conversion Ratio", TE_RATIO).getDouble(TE_RATIO);
BC3_RATIO = (float) UniversalElectricity.CONFIGURATION.get("Compatiblity", "BuildCraft Conversion Ratio", BC3_RATIO).getDouble(BC3_RATIO); BC3_RATIO = (float) UniversalElectricity.CONFIGURATION.get("Compatiblity", "BuildCraft Conversion Ratio", BC3_RATIO).getDouble(BC3_RATIO);
TO_IC2_RATIO = 1 / IC2_RATIO; TO_IC2_RATIO = 1 / IC2_RATIO;
TO_BC_RATIO = 1 / BC3_RATIO; TO_BC_RATIO = 1 / BC3_RATIO;
@ -76,5 +88,8 @@ public class Compatibility
return Loader.isModLoaded("BuildCraft|Energy"); return Loader.isModLoaded("BuildCraft|Energy");
} }
// TODO add Thermal expansion isLoaded check public static boolean isThermalExpansionLoaded()
{
return Loader.isModLoaded("ThermalExpansion");
}
} }

View file

@ -4,11 +4,11 @@ import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem; import ic2.api.item.ISpecialElectricItem;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import thermalexpansion.api.item.IChargeableItem;
import universalelectricity.core.item.IItemElectric; import universalelectricity.core.item.IItemElectric;
import universalelectricity.core.item.ItemElectric; import universalelectricity.core.item.ItemElectric;
import cofh.api.energy.IEnergyContainerItem;
public abstract class ItemUniversalElectric extends ItemElectric implements ISpecialElectricItem, IChargeableItem public abstract class ItemUniversalElectric extends ItemElectric implements ISpecialElectricItem, IEnergyContainerItem
{ {
public static final float CHARGE_RATE = 0.005f; public static final float CHARGE_RATE = 0.005f;
@ -66,27 +66,27 @@ public abstract class ItemUniversalElectric extends ItemElectric implements ISpe
* Thermal Expansion * Thermal Expansion
*/ */
@Override @Override
public float receiveEnergy(ItemStack theItem, float energy, boolean doReceive) public int receiveEnergy(ItemStack theItem, int energy, boolean doReceive)
{ {
return this.recharge(theItem, energy * Compatibility.BC3_RATIO, doReceive) * Compatibility.TO_BC_RATIO; return (int) (this.recharge(theItem, energy * Compatibility.BC3_RATIO, doReceive) * Compatibility.TO_BC_RATIO);
} }
@Override @Override
public float transferEnergy(ItemStack theItem, float energy, boolean doTransfer) public int extractEnergy(ItemStack theItem, int energy, boolean doTransfer)
{ {
return this.discharge(theItem, energy * Compatibility.BC3_RATIO, doTransfer) * Compatibility.TO_BC_RATIO; return (int) (this.discharge(theItem, energy * Compatibility.BC3_RATIO, doTransfer) * Compatibility.TO_BC_RATIO);
} }
@Override @Override
public float getEnergyStored(ItemStack theItem) public int getEnergyStored(ItemStack theItem)
{ {
return this.getElectricityStored(theItem) * Compatibility.TO_BC_RATIO; return (int) (this.getElectricityStored(theItem) * Compatibility.TO_BC_RATIO);
} }
@Override @Override
public float getMaxEnergyStored(ItemStack theItem) public int getMaxEnergyStored(ItemStack theItem)
{ {
return this.getMaxElectricityStored(theItem) * Compatibility.TO_BC_RATIO; return (int) (this.getMaxElectricityStored(theItem) * Compatibility.TO_BC_RATIO);
} }
public static class IC2ElectricItemManager implements IElectricItemManager public static class IC2ElectricItemManager implements IElectricItemManager

View file

@ -12,7 +12,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import thermalexpansion.api.item.IChargeableItem;
import universalelectricity.core.electricity.ElectricityPack; import universalelectricity.core.electricity.ElectricityPack;
import universalelectricity.core.item.IItemElectric; import universalelectricity.core.item.IItemElectric;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
@ -21,6 +20,8 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerHandler; import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver; import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type; import buildcraft.api.power.PowerHandler.Type;
import cofh.api.energy.IEnergyContainerItem;
import cofh.api.energy.IEnergyHandler;
/** /**
* A universal electricity tile used for tiles that consume or produce electricity. * A universal electricity tile used for tiles that consume or produce electricity.
@ -31,7 +32,7 @@ import buildcraft.api.power.PowerHandler.Type;
* @author micdoodle8, Calclavia * @author micdoodle8, Calclavia
* *
*/ */
public abstract class TileEntityUniversalElectrical extends TileEntityElectrical implements IEnergySink, IEnergySource, IPowerReceptor public abstract class TileEntityUniversalElectrical extends TileEntityElectrical implements IEnergySink, IEnergySource, IPowerReceptor, IEnergyHandler
{ {
protected boolean isAddedToEnergyNet; protected boolean isAddedToEnergyNet;
public PowerHandler bcPowerHandler; public PowerHandler bcPowerHandler;
@ -58,10 +59,10 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
energy = manager.charge(itemStack, (int) (energy * Compatibility.TO_IC2_RATIO), 0, false, false) * Compatibility.IC2_RATIO; energy = manager.charge(itemStack, (int) (energy * Compatibility.TO_IC2_RATIO), 0, false, false) * Compatibility.IC2_RATIO;
this.provideElectricity(energy, true); this.provideElectricity(energy, true);
} }
else if (itemStack.getItem() instanceof IChargeableItem) else if (itemStack.getItem() instanceof IEnergyContainerItem)
{ {
float accepted = ((IChargeableItem) itemStack.getItem()).receiveEnergy(itemStack, this.getProvide(ForgeDirection.UNKNOWN) * Compatibility.BC3_RATIO, true); float forgienEnergyAccepted = ((IEnergyContainerItem) itemStack.getItem()).receiveEnergy(itemStack, (int) (this.getProvide(ForgeDirection.UNKNOWN) * Compatibility.TO_TE_RATIO), false);
this.provideElectricity(accepted, true); this.provideElectricity(forgienEnergyAccepted * Compatibility.TE_RATIO, true);
} }
} }
} }
@ -90,10 +91,10 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
this.receiveElectricity(energy, true); this.receiveElectricity(energy, true);
} }
} }
else if (itemStack.getItem() instanceof IChargeableItem) else if (itemStack.getItem() instanceof IEnergyContainerItem)
{ {
float given = ((IChargeableItem) itemStack.getItem()).transferEnergy(itemStack, this.getRequest(ForgeDirection.UNKNOWN) * Compatibility.BC3_RATIO, true); float forgienEnergy = ((IEnergyContainerItem) itemStack.getItem()).extractEnergy(itemStack, (int) (this.getRequest(ForgeDirection.UNKNOWN) * Compatibility.TO_TE_RATIO), false);
this.receiveElectricity(given, true); this.receiveElectricity(forgienEnergy * Compatibility.TE_RATIO, true);
} }
} }
} }
@ -148,7 +149,10 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
{ {
if (!this.produceUE(outputDirection)) if (!this.produceUE(outputDirection))
{ {
this.produceBuildCraft(outputDirection); if (!this.produceThermalExpansion(outputDirection))
{
this.produceBuildCraft(outputDirection);
}
} }
} }
@ -156,6 +160,37 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
} }
} }
public boolean produceThermalExpansion(ForgeDirection outputDirection)
{
if (!this.worldObj.isRemote && outputDirection != null && outputDirection != ForgeDirection.UNKNOWN)
{
float provide = this.getProvide(outputDirection);
if (this.getEnergyStored() >= provide && provide > 0)
{
if (Compatibility.isThermalExpansionLoaded())
{
TileEntity tileEntity = new Vector3(this).modifyPositionFromSide(outputDirection).getTileEntity(this.worldObj);
if (tileEntity instanceof IEnergyHandler)
{
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
int convertedProvide = (int) (provide * Compatibility.TO_TE_RATIO);
if (receiver.canInterface(outputDirection.getOpposite()) && receiver.receiveEnergy(outputDirection.getOpposite(), convertedProvide, true) > 0)
{
int forgienEnergyUsed = receiver.receiveEnergy(outputDirection.getOpposite(), convertedProvide, false);
this.provideElectricity(forgienEnergyUsed * Compatibility.TE_RATIO, true);
return true;
}
}
}
}
}
return false;
}
public boolean produceBuildCraft(ForgeDirection outputDirection) public boolean produceBuildCraft(ForgeDirection outputDirection)
{ {
if (!this.worldObj.isRemote && outputDirection != null && outputDirection != ForgeDirection.UNKNOWN) if (!this.worldObj.isRemote && outputDirection != null && outputDirection != ForgeDirection.UNKNOWN)
@ -176,13 +211,12 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
{ {
if (receiver.powerRequest() > 0) if (receiver.powerRequest() > 0)
{ {
float bc3Provide = provide * Compatibility.TO_BC_RATIO; float convertedProvide = provide * Compatibility.TO_BC_RATIO;
float energyUsed = Math.min(receiver.receiveEnergy(this.bcBlockType, bc3Provide, outputDirection.getOpposite()), bc3Provide); float forgienEnergyUsed = receiver.receiveEnergy(this.bcBlockType, convertedProvide, outputDirection.getOpposite());
this.provideElectricity(energyUsed * Compatibility.TO_BC_RATIO, true); this.provideElectricity(forgienEnergyUsed * Compatibility.BC3_RATIO, true);
return true;
} }
} }
return true;
} }
} }
} }
@ -191,6 +225,40 @@ public abstract class TileEntityUniversalElectrical extends TileEntityElectrical
return false; return false;
} }
/**
* TE Methods
*/
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{
return (int) (this.receiveElectricity(from, ElectricityPack.getFromWatts(maxReceive * Compatibility.TE_RATIO, this.getVoltage()), !simulate) * Compatibility.TO_TE_RATIO);
}
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{
return (int) (this.provideElectricity(from, ElectricityPack.getFromWatts(maxExtract * Compatibility.TE_RATIO, this.getVoltage()), !simulate).getWatts() * Compatibility.TO_TE_RATIO);
}
public boolean canInterface(ForgeDirection from)
{
return this.canConnect(from);
}
/**
* Returns the amount of energy currently stored.
*/
public int getEnergyStored(ForgeDirection from)
{
return (int) (this.getEnergyStored() * Compatibility.TO_TE_RATIO);
}
/**
* Returns the maximum amount of energy that can be stored.
*/
public int getMaxEnergyStored(ForgeDirection from)
{
return (int) (this.getMaxEnergyStored() * Compatibility.TO_TE_RATIO);
}
/** /**
* IC2 Methods * IC2 Methods
*/ */

View file

@ -5,6 +5,7 @@ import ic2.api.energy.tile.IEnergySink;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -28,6 +29,7 @@ import universalelectricity.core.vector.VectorHelper;
import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerHandler.PowerReceiver; import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type; import buildcraft.api.power.PowerHandler.Type;
import cofh.api.energy.IEnergyHandler;
import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.FMLLog;
/** /**
@ -63,7 +65,7 @@ public class UniversalNetwork extends ElectricityNetwork
if (totalEnergyRequest > 0) if (totalEnergyRequest > 0)
{ {
boolean markRefresh = false; boolean markRefresh = false;
for (TileEntity tileEntity : avaliableEnergyTiles) for (TileEntity tileEntity : avaliableEnergyTiles)
{ {
if (tileEntity != null && !tileEntity.isInvalid()) if (tileEntity != null && !tileEntity.isInvalid())
@ -102,7 +104,7 @@ public class UniversalNetwork extends ElectricityNetwork
if (energyToSend > 0) if (energyToSend > 0)
{ {
remainingUsableEnergy -= electricalTile.injectEnergyUnits(direction, energyToSend * Compatibility.TO_IC2_RATIO); remainingUsableEnergy -= electricalTile.injectEnergyUnits(direction, energyToSend * Compatibility.TO_IC2_RATIO) * Compatibility.IC2_RATIO;
} }
} }
} }
@ -120,11 +122,33 @@ public class UniversalNetwork extends ElectricityNetwork
{ {
if (this.getConductors().contains(conductor)) if (this.getConductors().contains(conductor))
{ {
float energyToSend = totalUsableEnergy * ((receiver.powerRequest() * Compatibility.TO_BC_RATIO) / totalEnergyRequest); float energyToSend = totalUsableEnergy * ((receiver.powerRequest() * Compatibility.BC3_RATIO) / totalEnergyRequest);
if (energyToSend > 0) if (energyToSend > 0)
{ {
remainingUsableEnergy -= receiver.receiveEnergy(Type.PIPE, energyToSend * Compatibility.TO_BC_RATIO, direction); remainingUsableEnergy -= receiver.receiveEnergy(Type.PIPE, energyToSend * Compatibility.TO_BC_RATIO, direction) * Compatibility.BC3_RATIO;
}
}
}
}
}
else if (Compatibility.isThermalExpansionLoaded() && tileEntity instanceof IEnergyHandler)
{
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction);
if (receiver.canInterface(direction))
{
if (this.getConductors().contains(conductor))
{
float energyToSend = totalUsableEnergy * ((receiver.receiveEnergy(direction, (int) (remainingUsableEnergy * Compatibility.TO_TE_RATIO), true) * Compatibility.TE_RATIO) / totalEnergyRequest);
if (energyToSend > 0)
{
remainingUsableEnergy -= receiver.receiveEnergy(direction, (int) (energyToSend * Compatibility.TO_TE_RATIO), false) * Compatibility.TE_RATIO;
} }
} }
} }
@ -137,8 +161,8 @@ public class UniversalNetwork extends ElectricityNetwork
markRefresh = true; markRefresh = true;
} }
} }
if(markRefresh) if (markRefresh)
{ {
this.refresh(); this.refresh();
} }
@ -154,7 +178,7 @@ public class UniversalNetwork extends ElectricityNetwork
{ {
List<ElectricityPack> requests = new ArrayList<ElectricityPack>(); List<ElectricityPack> requests = new ArrayList<ElectricityPack>();
Iterator<TileEntity> it = this.getAcceptors().iterator(); Iterator<TileEntity> it = new HashSet(this.getAcceptors()).iterator();
while (it.hasNext()) while (it.hasNext())
{ {
@ -188,7 +212,7 @@ public class UniversalNetwork extends ElectricityNetwork
if (((IEnergySink) tileEntity).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction), direction) && this.getConductors().contains(VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction))) if (((IEnergySink) tileEntity).acceptsEnergyFrom(VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction), direction) && this.getConductors().contains(VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction)))
{ {
ElectricityPack pack = ElectricityPack.getFromWatts((float) (((IEnergySink) tileEntity).demandedEnergyUnits() * Compatibility.IC2_RATIO), 1); ElectricityPack pack = ElectricityPack.getFromWatts((float) (((IEnergySink) tileEntity).demandedEnergyUnits() * Compatibility.IC2_RATIO), 1);
if (pack.getWatts() > 0) if (pack.getWatts() > 0)
{ {
requests.add(pack); requests.add(pack);
@ -216,7 +240,29 @@ public class UniversalNetwork extends ElectricityNetwork
} }
continue; continue;
}
if (Compatibility.isThermalExpansionLoaded() && tileEntity instanceof IEnergyHandler)
{
IEnergyHandler receiver = (IEnergyHandler) tileEntity;
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
TileEntity conductor = VectorHelper.getConnectorFromSide(tileEntity.worldObj, new Vector3(tileEntity), direction);
if (receiver.canInterface(direction))
{
ElectricityPack pack = ElectricityPack.getFromWatts(receiver.receiveEnergy(direction, (int) Integer.MAX_VALUE, true) * Compatibility.TE_RATIO, 1);
if (pack.getWatts() > 0)
{
requests.add(pack);
break;
}
}
}
continue;
} }
} }
} }

View file

@ -62,32 +62,32 @@ public abstract class TileEntityElectrical extends TileEntityAdvanced implements
if (provide > 0) if (provide > 0)
{ {
TileEntity outputTile = VectorHelper.getConnectorFromSide(this.worldObj, new Vector3(this), outputDirection); TileEntity outputTile = VectorHelper.getConnectorFromSide(this.worldObj, new Vector3(this), outputDirection);
IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(outputTile, outputDirection); IElectricityNetwork outputNetwork = ElectricityHelper.getNetworkFromTileEntity(outputTile, outputDirection);
if (outputNetwork != null) if (outputNetwork != null)
{ {
ElectricityPack powerRequest = outputNetwork.getRequest(this); ElectricityPack powerRequest = outputNetwork.getRequest(this);
if (powerRequest.getWatts() > 0) if (powerRequest.getWatts() > 0)
{ {
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage())); ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage()));
float rejectedPower = outputNetwork.produce(sendPack, this); float rejectedPower = outputNetwork.produce(sendPack, this);
this.provideElectricity(sendPack.getWatts() - rejectedPower, true); this.provideElectricity(Math.max(sendPack.getWatts() - rejectedPower, 0), true);
return true; return true;
} }
} }
else if (outputTile instanceof IElectrical) else if (outputTile instanceof IElectrical)
{ {
float requestedEnergy = ((IElectrical) outputTile).getRequest(outputDirection.getOpposite()); float requestedEnergy = ((IElectrical) outputTile).getRequest(outputDirection.getOpposite());
if (requestedEnergy > 0) if (requestedEnergy > 0)
{ {
ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage())); ElectricityPack sendPack = ElectricityPack.min(ElectricityPack.getFromWatts(this.getEnergyStored(), this.getVoltage()), ElectricityPack.getFromWatts(provide, this.getVoltage()));
float acceptedEnergy = ((IElectrical) outputTile).receiveElectricity(outputDirection.getOpposite(), sendPack, true); float acceptedEnergy = ((IElectrical) outputTile).receiveElectricity(outputDirection.getOpposite(), sendPack, true);
this.setEnergyStored(this.getEnergyStored() - acceptedEnergy); this.provideElectricity(acceptedEnergy, true);
return true; return true;
} }
} }
} }
} }
@ -121,6 +121,11 @@ public abstract class TileEntityElectrical extends TileEntityAdvanced implements
{ {
if (this.getInputDirections().contains(from)) if (this.getInputDirections().contains(from))
{ {
if (!doReceive)
{
return this.getRequest(from);
}
return this.receiveElectricity(receive, doReceive); return this.receiveElectricity(receive, doReceive);
} }
@ -132,6 +137,11 @@ public abstract class TileEntityElectrical extends TileEntityAdvanced implements
{ {
if (this.getOutputDirections().contains(from)) if (this.getOutputDirections().contains(from))
{ {
if (!doProvide)
{
return ElectricityPack.getFromWatts(this.getProvide(from), this.getVoltage());
}
return this.provideElectricity(request, doProvide); return this.provideElectricity(request, doProvide);
} }