diff options
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
3 files changed, 67 insertions, 39 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 466ffea8e5..d0636e038a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -94,8 +94,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En if (isSuperheated()) { tt.addInfo("Produces " + (getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam) + "L of Superheated Steam with 1 Coal at " + (getEUt() * 40) / superToNormalSteam + "L/s")//? .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") - .addInfo("Solid Fuels with a burn value that is too high or too low will not work") - .addInfo("Coal/Charcoal/Coal Coke and their compressed forms will not work here!"); + .addInfo("Only some solid fuels are allowed (check the NEI Large Boiler tab for details)") + .addInfo("If there are any disallowed fuels in the input bus, the boiler won't run!"); } else { tt.addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? @@ -196,53 +196,53 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En } 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 = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2)); - this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4; - return true; + if (!isSuperheated()) { + 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 = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2)); + this.mEUt = adjustEUtForConfig(getEUt()); + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4; + return true; + } } } - } - for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) { - FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true); - if (tFluid != null) { - tFluid.amount = 1000; - if (depleteInput(tFluid)) { - this.mMaxProgresstime = adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); - this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); - return true; + for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) { + FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true); + if (tFluid != null) { + tFluid.amount = 1000; + if (depleteInput(tFluid)) { + this.mMaxProgresstime = adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); + this.mEUt = adjustEUtForConfig(getEUt()); + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); + return true; + } } } } + ArrayList<ItemStack> tInputList = getStoredInputs(); if (!tInputList.isEmpty()) { if (isSuperheated()) { for (ItemStack tInput : tInputList) { - // Checking for Solid Super Fuel and Magic Solid Super Fuel with their burn values. This needs to be replaced with a whitelist configurable in the config file. - if (GT_ModHandler.getFuelValue(tInput) == 100000 || GT_ModHandler.getFuelValue(tInput) == 150000) { - if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)){ - if (GT_Utility.getFluidForFilledItem(tInput, true) == null && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { - this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; - this.mMaxProgresstime += this.excessFuel / 80; - this.excessFuel %= 80; - this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); - this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); - this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)}; - tInput.stackSize -= 1; - updateSlots(); - if (this.mEfficiencyIncrease > 5000) { - this.mEfficiencyIncrease = 0; - this.mSuperEfficencyIncrease = 20; - } - return true; + if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)){ + if (GT_Utility.getFluidForFilledItem(tInput, true) == null && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { + this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; + this.mMaxProgresstime += this.excessFuel / 80; + this.excessFuel %= 80; + this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); + this.mEUt = adjustEUtForConfig(getEUt()); + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); + this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)}; + tInput.stackSize -= 1; + updateSlots(); + if (this.mEfficiencyIncrease > 5000) { + this.mEfficiencyIncrease = 0; + this.mSuperEfficencyIncrease = 20; } + return true; } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 78b20782d5..b81dab847b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -4,6 +4,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -90,4 +91,17 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La @Override boolean isSuperheated() { return true; } + + @Override + public boolean checkRecipe(ItemStack aStack) { + for(ItemStack input : getStoredInputs()) { + if(!GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input)) { + //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed + this.mMaxProgresstime = 0; + this.mEUt = 0; + return false; + } + } + return super.checkRecipe(aStack); + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 9e53026ff6..75a080c49f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -4,6 +4,7 @@ import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -88,4 +89,17 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti @Override boolean isSuperheated() { return true; } + + @Override + public boolean checkRecipe(ItemStack aStack) { + for(ItemStack input : getStoredInputs()) { + if(!GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input)) { + //if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be consumed + this.mMaxProgresstime = 0; + this.mEUt = 0; + return false; + } + } + return super.checkRecipe(aStack); + } } |