Large Boiler fuel burn rate now configurable

By placing an integrated circuit in the Large Boiler it is now possible
to adjust fuel burn rate and steam output at no change in efficiency.
The steam output of a boiler is reduced by 1000L per configuration.
This commit is contained in:
Johannes Gäßler 2017-04-14 20:03:29 +02:00
parent 2ee3b7e712
commit 213d5bb9df

View file

@ -23,6 +23,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
extends GT_MetaTileEntity_MultiBlockBase {
private boolean firstRun = true;
private int mSuperEfficencyIncrease = 0;
private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config
public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@ -45,7 +46,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
"1x Output Hatch (Any Casing)",
"1x Maintenance Hatch (Any Firebox)",
"1x Muffler Hatch (Any Firebox)",
"Refined liquid fuels have 1/4 efficiency"};
"Diesel fuels have 1/4 efficiency"};
}
public abstract Block getCasingBlock();
@ -88,14 +89,26 @@ public abstract class GT_MetaTileEntity_LargeBoiler
}
public boolean checkRecipe(ItemStack aStack) {
//Do we have an integrated circuit with a valid configuration?
if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
int circuit_config = mInventory[1].getItemDamage();
if (circuit_config >= 1 && circuit_config <= 25) {
// If so, overwrite the current config
this.integratedCircuitConfig = circuit_config;
} else {
//If not, set the config to zero
this.integratedCircuitConfig = 0;
}
}
this.mSuperEfficencyIncrease=0;
for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
if ((tFluid != null) && (tRecipe.mSpecialValue > 1)) {
tFluid.amount = 1000;
if (depleteInput(tFluid)) {
this.mMaxProgresstime = (runtimeBoost(tRecipe.mSpecialValue / 2));
this.mEUt = getEUt();
this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2));
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
return true;
}
@ -106,8 +119,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler
if (tFluid != null) {
tFluid.amount = 1000;
if (depleteInput(tFluid)) {
this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
this.mEUt = getEUt();
this.mMaxProgresstime = adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)));
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
return true;
}
@ -117,7 +130,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler
if (!tInputList.isEmpty()) {
for (ItemStack tInput : tInputList) {
if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = runtimeBoost(GT_ModHandler.getFuelValue(tInput) / 80)) > 0)) {
this.mEUt = getEUt();
this.mMaxProgresstime = adjustBurnTimeForConfig(this.mMaxProgresstime);
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)};
tInput.stackSize -= 1;
@ -155,12 +169,11 @@ public abstract class GT_MetaTileEntity_LargeBoiler
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (mProgresstime > 0 && firstRun) {
firstRun = false;
GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");
GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");
}
super.onPostTick(aBaseMetaTileEntity, aTick);
}
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
@ -236,4 +249,17 @@ public abstract class GT_MetaTileEntity_LargeBoiler
public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
private int adjustEUtForConfig(int rawEUt){
int adjustedSteamOutput = rawEUt - 25 * integratedCircuitConfig;
return Math.max(adjustedSteamOutput, 25);
}
private int adjustBurnTimeForConfig(int rawBurnTime){
if(mEfficiency < 10000){
return rawBurnTime;
}
int adjustedEUt = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
return rawBurnTime * getEUt() / adjustedEUt;
}
}