Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/main/java/com/newmaa/othtech/machine/OTEMegaEBFGTpp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static gregtech.api.enums.HatchElement.*;
import static gregtech.api.util.GTStructureUtility.activeCoils;
import static gregtech.api.util.GTStructureUtility.buildHatchAdder;
import static gregtech.api.util.GTStructureUtility.ofCoil;
import static net.minecraft.util.StatCollector.translateToLocal;
Expand Down Expand Up @@ -44,6 +45,7 @@
import gregtech.api.util.GTRecipe;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.OverclockCalculator;
import gregtech.common.misc.GTStructureChannels;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
Expand Down Expand Up @@ -72,6 +74,8 @@ public int getCoilTier() {
return Utils.getCoilTier(coilLevel);
}

private int mHeatingCapacity = 0;

private byte glassTier;
private boolean lava = false;

Expand Down Expand Up @@ -130,9 +134,9 @@ protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) {
@Override
protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe) {
return super.createOverclockCalculator(recipe).setHeatOC(true)
.setMachineHeat(mHeatingCapacity)
.setHeatDiscount(true)
.setRecipeHeat(recipe.mSpecialValue)
.setMachineHeat((int) getCoilLevel().getHeat());
.setRecipeHeat(recipe.mSpecialValue);
}

@NotNull
Expand All @@ -150,6 +154,7 @@ public CheckRecipeResult process() {

@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
this.mHeatingCapacity = 0;
if (!this.checkPiece("main", 7, 17, 0) || this.getCoilLevel() == HeatingCoilLevel.None) return false;
if (this.glassTier < 8) {
for (MTEHatch hatch : this.mExoticEnergyHatches) {
Expand All @@ -169,6 +174,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
if (checkForWater()) {
this.lava = true;
}
this.mHeatingCapacity = ((int) getCoilLevel().getHeat());
return true;
}

Expand Down Expand Up @@ -249,7 +255,8 @@ public IStructureDefinition<OTEMegaEBFGTpp> getStructureDefinition() {
.buildAndChain(ofBlock(ModBlocks.blockCasings3Misc, 11)))
.addElement(
'C',
withChannel("coil", ofCoil(OTEMegaEBFGTpp::setCoilLevel, OTEMegaEBFGTpp::getCoilLevel)))
GTStructureChannels.HEATING_COIL
.use(activeCoils(ofCoil(OTEMegaEBFGTpp::setCoilLevel, OTEMegaEBFGTpp::getCoilLevel))))
.addElement(
'D',
buildHatchAdder(OTEMegaEBFGTpp.class).atLeast(Muffler)
Expand Down Expand Up @@ -382,6 +389,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("AnyOutputHatch", 1)
.addEnergyHatch("AnyEnergyHatch", 1)
.addMufflerHatch("AnyMufflerHatch", 2)
.addSubChannelUsage(GTStructureChannels.HEATING_COIL)
.toolTipFinisher("§a123Technology - EBF");
return tt;
}
Expand Down