Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/me-part-retier' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Jan 9, 2025
2 parents ca1c77e + 8661998 commit 1dd45c1
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 45 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
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ public MTEHatchCraftingInputME(int aID, String aName, String aNameRegional, bool
aID,
aName,
aNameRegional,
supportFluids ? 11 : 6,
supportFluids ? 10 : 6,
MAX_INV_COUNT,
new String[] { "Advanced item input for Multiblocks",
"Hatch Tier: " + TIER_COLORS[supportFluids ? 11 : 6] + VN[supportFluids ? 11 : 6],
"Hatch Tier: " + TIER_COLORS[supportFluids ? 10 : 6] + VN[supportFluids ? 10 : 6],
"Processes patterns directly from ME",
supportFluids ? "It supports patterns including fluids"
: "It does not support patterns including fluids",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package gregtech.common.tileentities.machines;

import static gregtech.api.enums.GTValues.TIER_COLORS;
import static gregtech.api.enums.GTValues.VN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_CRAFTING_INPUT_SLAVE;

import java.util.ArrayList;
Expand Down Expand Up @@ -41,9 +43,9 @@ public MTEHatchCraftingInputSlave(int aID, String aName, String aNameRegional) {
aID,
aName,
aNameRegional,
6,
11,
0,
new String[] { "Proxy for Crafting Input Buffer/Bus",
new String[] { "Proxy for Crafting Input Buffer/Bus", "Hatch Tier: " + TIER_COLORS[11] + VN[11],
"Link with Crafting Input Buffer/Bus using Data Stick to share inventory",
"Left click on the Crafting Input Buffer/Bus, then right click on this block to link them", });
disableSort = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class MTEHatchInputME extends MTEHatchInput implements IPowerChannelState
protected static final FluidStack[] EMPTY_FLUID_STACK = new FluidStack[0];

public MTEHatchInputME(int aID, boolean autoPullAvailable, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, autoPullAvailable ? 10 : 8, 1, getDescriptionArray(autoPullAvailable));
super(aID, aName, aNameRegional, autoPullAvailable ? 9 : 8, 1, getDescriptionArray(autoPullAvailable));
this.autoPullAvailable = autoPullAvailable;
}

Expand Down Expand Up @@ -929,7 +929,7 @@ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompou
private static String[] getDescriptionArray(boolean autoPullAvailable) {
List<String> strings = new ArrayList<>(8);
strings.add("Advanced fluid input for Multiblocks");
strings.add("Hatch Tier: " + TIER_COLORS[autoPullAvailable ? 10 : 8] + VN[autoPullAvailable ? 10 : 8]);
strings.add("Hatch Tier: " + TIER_COLORS[autoPullAvailable ? 9 : 8] + VN[autoPullAvailable ? 9 : 8]);
strings.add("Retrieves directly from ME");
strings.add("Keeps 16 fluid types in stock");

Expand Down

0 comments on commit 1dd45c1

Please sign in to comment.