Merge branch 'master' of github.com:SirSengir/BuildCraft into LiquidPipeRewrite

This commit is contained in:
Krapht 2012-07-21 12:32:37 +02:00
commit e1665f504b
6 changed files with 21 additions and 21 deletions

View file

@ -132,7 +132,7 @@ public class BuildCraftEnergy {
RefineryRecipe.registerRefineryRecipe(new RefineryRecipe(new LiquidStack(oilStill.blockID, 1, 0), null, new LiquidStack(fuel.shiftedIndex, 1, 0), 10, 1));
// Iron Engine Fuels
IronEngineFuel.fuels.add(new IronEngineFuel(oilStill.blockID, 1, 20000));
IronEngineFuel.fuels.add(new IronEngineFuel(Block.lavaStill.blockID, 1, 20000));
IronEngineFuel.fuels.add(new IronEngineFuel(oilStill.blockID, 2, 10000));
IronEngineFuel.fuels.add(new IronEngineFuel(fuel.shiftedIndex, 5, 50000));

View file

@ -33,13 +33,13 @@ public class IronEngineFuel {
}
public final LiquidStack liquid;
public final int powerPerCycle;
public final float powerPerCycle;
public final int totalBurningTime;
public IronEngineFuel(int liquidId, int powerPerCycle, int totalBurningTime) {
public IronEngineFuel(int liquidId, float powerPerCycle, int totalBurningTime) {
this(new LiquidStack(liquidId, BuildCraftAPI.BUCKET_VOLUME, 0), powerPerCycle, totalBurningTime);
}
public IronEngineFuel(LiquidStack liquid, int powerPerCycle, int totalBurningTime) {
public IronEngineFuel(LiquidStack liquid, float powerPerCycle, int totalBurningTime) {
this.liquid = liquid;
this.powerPerCycle = powerPerCycle;
this.totalBurningTime = totalBurningTime;

View file

@ -21,12 +21,12 @@ public abstract class Engine {
public int maxEnergy;
protected int currentOutput = 0;
protected float currentOutput = 0;
public @TileNetworkData
float progress;
public @TileNetworkData
Orientations orientation;
public int energy;
public float energy;
public @TileNetworkData
EnergyStage energyStage = EnergyStage.Blue;
@ -84,7 +84,7 @@ public abstract class Engine {
public abstract void delete();
public void addEnergy(int addition) {
public void addEnergy(float addition) {
energy += addition;
if (getEnergyStage() == EnergyStage.Explosion) {
@ -96,7 +96,7 @@ public abstract class Engine {
}
}
public int extractEnergy(int min, int max, boolean doExtract) {
public float extractEnergy(int min, int max, boolean doExtract) {
if (energy < min) {
return 0;
}
@ -109,7 +109,7 @@ public abstract class Engine {
actualMax = max;
}
int extracted;
float extracted;
if (energy >= actualMax) {
extracted = actualMax;
@ -154,11 +154,11 @@ public abstract class Engine {
return 0;
}
public int getEnergyStored() {
public float getEnergyStored() {
return energy;
}
public int getCurrentOutput() {
public float getCurrentOutput() {
return currentOutput;
}

View file

@ -227,10 +227,10 @@ public class EngineIron extends Engine {
public void getGUINetworkData(int i, int j) {
switch (i) {
case 0:
energy = j;
energy = j / 10;
break;
case 1:
currentOutput = j;
currentOutput = j / 10;
break;
case 2:
heat = j;
@ -252,8 +252,8 @@ public class EngineIron extends Engine {
@Override
public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) {
iCrafting.updateCraftingInventoryInfo(containerEngine, 0, energy);
iCrafting.updateCraftingInventoryInfo(containerEngine, 1, currentOutput);
iCrafting.updateCraftingInventoryInfo(containerEngine, 0, Math.round(energy * 10));
iCrafting.updateCraftingInventoryInfo(containerEngine, 1, Math.round(currentOutput * 10));
iCrafting.updateCraftingInventoryInfo(containerEngine, 2, heat);
iCrafting.updateCraftingInventoryInfo(containerEngine, 3, liquidQty);
iCrafting.updateCraftingInventoryInfo(containerEngine, 4, liquidId);

View file

@ -155,15 +155,15 @@ public class EngineStone extends Engine {
@Override
public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) {
iCrafting.updateCraftingInventoryInfo(containerEngine, 0, energy);
iCrafting.updateCraftingInventoryInfo(containerEngine, 1, currentOutput);
iCrafting.updateCraftingInventoryInfo(containerEngine, 0, Math.round(energy));
iCrafting.updateCraftingInventoryInfo(containerEngine, 1, Math.round(currentOutput));
iCrafting.updateCraftingInventoryInfo(containerEngine, 2, burnTime);
iCrafting.updateCraftingInventoryInfo(containerEngine, 3, totalBurnTime);
}
@Override
public int getHeat() {
return energy;
return Math.round(energy);
}
/* IINVENTORY */

View file

@ -121,7 +121,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
if (isPoweredTile(tile)) {
IPowerReceptor receptor = (IPowerReceptor) tile;
int extracted = engine.extractEnergy(receptor.getPowerProvider().getMinEnergyReceived(),
float extracted = engine.extractEnergy(receptor.getPowerProvider().getMinEnergyReceived(),
receptor.getPowerProvider().getMaxEnergyReceived(), true);
if (extracted > 0) {
@ -227,7 +227,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
if (engine != null) {
engine.progress = nbttagcompound.getFloat("progress");
engine.energy = nbttagcompound.getInteger("energy");
engine.energy = nbttagcompound.getFloat("energyF");
engine.orientation = Orientations.values()[orientation];
}
@ -245,7 +245,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
if (engine != null) {
nbttagcompound.setInteger("orientation", orientation);
nbttagcompound.setFloat("progress", engine.progress);
nbttagcompound.setInteger("energy", engine.energy);
nbttagcompound.setFloat("energyF", engine.energy);
}
if (engine != null) {