Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Compact Fusions support buffer (#230)
Browse files Browse the repository at this point in the history
* buffer

* Update src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer3.java

Co-authored-by: Raven Szewczyk <[email protected]>

* Update src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer5.java

Co-authored-by: Raven Szewczyk <[email protected]>

* Update src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java

Co-authored-by: Raven Szewczyk <[email protected]>

* Update src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer2.java

Co-authored-by: Raven Szewczyk <[email protected]>

* Update src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer1.java

Co-authored-by: Raven Szewczyk <[email protected]>

---------

Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Raven Szewczyk <[email protected]>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent b74dd0f commit 1521009
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
.addCasingInfo("Naquadah Alloy Frame Boxes", 128)
.addCasingInfo("Rhodium-Plated Palladium Reinforced Borosilicate Glass Block", 63)
.addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier())
+ EnumChatFormatting.GRAY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
.addCasingInfo("Duranium Frame Box", 128)
.addCasingInfo("Iridium Reinforced Borosilicate Glass Block", 63)
.addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier())
+ EnumChatFormatting.GRAY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
.addCasingInfo("Neutronium Frame Box", 128)
.addCasingInfo("Osmium Reinforced Borosilicate Glass Block", 63)
.addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier())
+ EnumChatFormatting.GRAY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;

Expand Down Expand Up @@ -64,7 +65,7 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
.addCasingInfo("Infinity Catalyst Frame Box", 128)
.addCasingInfo("Neutronium Reinforced Borosilicate Glass Block", 63)
.addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier())
+ EnumChatFormatting.GRAY
Expand Down Expand Up @@ -181,6 +182,11 @@ public boolean turnCasingActive(boolean status) {
hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53);
}
}
if (this.mDualInputHatches != null) {
for (IDualInputHatch hatch : this.mDualInputHatches) {
hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53);
}
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;

Expand Down Expand Up @@ -64,7 +65,7 @@ protected GT_Multiblock_Tooltip_Builder createTooltip() {
.addCasingInfo("Compact Fusion Coil MK-II Finaltype", 560).addCasingInfo("Infinity Frame Box", 128)
.addCasingInfo("Cosmic Neutronium Reinforced Borosilicate Glass Block", 63)
.addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier())
+ EnumChatFormatting.GRAY
Expand Down Expand Up @@ -182,6 +183,11 @@ public boolean turnCasingActive(boolean status) {
hatch.updateTexture(status ? TAE.getIndexFromPage(3, 6) : 53);
}
}
if (this.mDualInputHatches != null) {
for (IDualInputHatch hatch : this.mDualInputHatches) {
hatch.updateTexture(status ? TAE.getIndexFromPage(3, 6) : 53);
}
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IOverclockDescriptionProvider;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
Expand All @@ -59,6 +58,7 @@
import gregtech.api.util.GT_ParallelHelper;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.IDualInputHatch;

public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider {
Expand All @@ -81,7 +81,10 @@ protected IStructureDefinition<LargeFusionComputer> computeValue(Class<?> type)
'I',
lazy(
x -> GT_HatchElementBuilder.<LargeFusionComputer>builder()
.atLeast(GT_HatchElement.InputHatch, GT_HatchElement.OutputHatch)
.atLeast(
GT_HatchElement.InputHatch,
GT_HatchElement.OutputHatch,
GT_HatchElement.InputBus)
.adder(LargeFusionComputer::addFluidIO).casingIndex(x.textureIndex()).dot(1)
.buildAndChain(x.getGlassBlock(), x.getGlassMeta())))
.addElement(
Expand Down Expand Up @@ -180,7 +183,7 @@ public void loadNBTData(NBTTagCompound aNBT) {
@Override
public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
this.eEnergyMulti.clear();
if (structureCheck_EM(MAIN_NAME, 23, 3, 40) && !mInputHatches.isEmpty()
if (structureCheck_EM(MAIN_NAME, 23, 3, 40) && mInputHatches.size() + mDualInputHatches.size() != 0
&& !mOutputHatches.isEmpty()
&& (mEnergyHatches.size() + eEnergyMulti.size()) != 0) {
fixAllIssue();
Expand Down Expand Up @@ -371,6 +374,11 @@ public boolean turnCasingActive(boolean status) {
hatch.updateTexture(status ? 52 : 53);
}
}
if (this.mDualInputHatches != null) {
for (IDualInputHatch hatch : this.mDualInputHatches) {
hatch.updateTexture(status ? 52 : 53);
}
}
return true;
}

Expand Down Expand Up @@ -510,22 +518,21 @@ private boolean addEnergyInjector(IGregTechTileEntity aBaseMetaTileEntity, int a
private boolean addFluidIO(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch tHatch) {
if (tHatch.getTierForStructure() < hatchTier()) {
return false;
}
} else {
return false;
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input tInput) {
if (tInput.getTierForStructure() < hatchTier()) return false;
tInput.updateTexture(aBaseCasingIndex);
tInput.mRecipeMap = getRecipeMap();
return mInputHatches.add(tInput);
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output tOutput) {
if (tOutput.getTierForStructure() < hatchTier()) return false;
tOutput.updateTexture(aBaseCasingIndex);
return mOutputHatches.add(tOutput);
}
if (aMetaTileEntity instanceof IDualInputHatch tInput) {
tInput.updateTexture(aBaseCasingIndex);
return mDualInputHatches.add(tInput);
}
return false;
}

Expand Down

0 comments on commit 1521009

Please sign in to comment.