Skip to content

Commit

Permalink
remove compact fusion fluid hatch tier restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Jan 9, 2025
1 parent 057bc6b commit f052b2c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -120,7 +120,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 6;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -121,7 +121,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 7;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -122,7 +122,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 8;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -121,7 +121,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 9;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -122,7 +122,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 10;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ protected IStructureDefinition<MTELargeFusionComputer> computeValue(Class<?> typ
.atLeast(
gregtech.api.enums.HatchElement.InputHatch.or(gregtech.api.enums.HatchElement.InputBus),
gregtech.api.enums.HatchElement.OutputHatch)
.adder(MTELargeFusionComputer::addFluidIO)
.casingIndex(x.textureIndex())
.dot(1)
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
.buildAndChain(x.getGlassBlock(), x.getGlassMeta())))
.addElement(
'E',
Expand All @@ -119,7 +117,7 @@ protected IStructureDefinition<MTELargeFusionComputer> computeValue(Class<?> typ
.or(gregtech.api.enums.HatchElement.Energy))
.adder(MTELargeFusionComputer::addEnergyInjector)
.casingIndex(x.textureIndex())
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.energyHatchTier(), Integer.MAX_VALUE))
.dot(2)
.buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
.addElement('F', lazy(x -> ofFrame(x.getFrameBox())))
Expand Down Expand Up @@ -197,7 +195,7 @@ public long maxEUStore() {

public abstract int getGlassMeta();

public abstract int hatchTier();
public abstract int energyHatchTier();

public abstract Materials getFrameBox();

Expand Down Expand Up @@ -485,40 +483,17 @@ private boolean addEnergyInjector(IGregTechTileEntity aBaseMetaTileEntity, int a
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof MTEHatchEnergy tHatch) {
if (tHatch.getTierForStructure() < hatchTier()) return false;
if (tHatch.getTierForStructure() < energyHatchTier()) return false;
tHatch.updateTexture(aBaseCasingIndex);
return mEnergyHatches.add(tHatch);
} else if (aMetaTileEntity instanceof MTEHatchEnergyMulti tHatch) {
if (tHatch.getTierForStructure() < hatchTier()) return false;
if (tHatch.getTierForStructure() < energyHatchTier()) return false;
tHatch.updateTexture(aBaseCasingIndex);
return eEnergyMulti.add(tHatch);
}
return false;
}

private boolean addFluidIO(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof MTEHatch hatch) {
hatch.updateTexture(aBaseCasingIndex);
hatch.updateCraftingIcon(this.getMachineCraftingIcon());
}
if (aMetaTileEntity instanceof MTEHatchInput tInput) {
if (tInput.getTierForStructure() < hatchTier()) return false;
tInput.mRecipeMap = getRecipeMap();
return mInputHatches.add(tInput);
}
if (aMetaTileEntity instanceof MTEHatchOutput tOutput) {
if (tOutput.getTierForStructure() < hatchTier()) return false;
return mOutputHatches.add(tOutput);
}
if (aMetaTileEntity instanceof IDualInputHatch tInput) {
tInput.updateCraftingIcon(this.getMachineCraftingIcon());
return mDualInputHatches.add(tInput);
}
return false;
}

private boolean addDroneHatch(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
if (aBaseMetaTileEntity == null) return false;
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
Expand Down

0 comments on commit f052b2c

Please sign in to comment.