Skip to content

Commit

Permalink
BHC parallels, TT Hatch green tooltip, MFE tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruling-0 committed Jan 21, 2025
1 parent 186463e commit f8d0425
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/main/java/gregtech/api/util/GTUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ public static byte getOppositeSide(ForgeDirection side) {
.ordinal();
}

/**
* Gets the voltage tier corresponding to an amount of EU, capped to 15 (MAX+)
* @param l The amount of EU
* @return Corresponding voltage tier in the range 0-15
*/
public static byte getTier(long l) {
if (l > V[14]) return 15;
if (l <= V[0]) return 0;
Expand All @@ -460,6 +465,17 @@ public static byte getTier(long l) {
return (byte) ((log2L - 2) / 2);
}

/**
* Gets the voltage tier corresponding to an amount of EU, capped to 127
* @param l The amount of EU
* @return Corresponding voltage tier
*/
public static byte getTierExtended(long l) {
if (l <= V[0]) return 0;
int log2L = 64 - Long.numberOfLeadingZeros(l - 1);
return (byte) Math.min(((log2L - 2) / 2), 127);
}

public static long getAmperageForTier(long voltage, byte tier) {
return ceilDiv(voltage, GTValues.V[tier]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public MultiblockTooltipBuilder addOtherStructurePart(String name, String info,
* @return Instance this method was called on.
*/
public MultiblockTooltipBuilder addTecTechHatchInfo() {
iLines.add(EnumChatFormatting.BLUE + TT_tectechhatch);
iLines.add(EnumChatFormatting.GREEN + TT_tectechhatch);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public static String buildMagnetTooltip(MagnetTiers m) {
if (m.supportsExotic) tooltip = tooltip + "/n "
+ EnumChatFormatting.BOLD
+ EnumChatFormatting.GREEN
+ "Can Use Multiamp Hatches";
+ "Can Use Multiamp Hatches/n "
+ EnumChatFormatting.RED
+ "Limit to one energy hatch if using Multiamp";

return tooltip;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ protected MultiblockTooltipBuilder createTooltip() {
.addInfo(
EnumChatFormatting.RED
+ "Recipe tier is limited to hatch tier + 1. Will not perform overclocks above the hatch tier.")
.addInfo(
EnumChatFormatting.RED
+ "Limit to one energy hatch if using a Multiamp or Laser hatch.")
.beginStructureBlock(35, 33, 35, false)
.addCasingInfoMin("Background Radiation Absorbent Casing", 950, false)
.addCasingInfoExactly("Extreme Density Space-Bending Casing", 3667, false)
Expand Down Expand Up @@ -416,6 +419,11 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
spacetimeHatches.clear();

if (!checkPiece(STRUCTURE_PIECE_MAIN, 17, 27, 10)) return false;
// Allow only 1 energy hatch if laser/multiamp
if (!mExoticEnergyHatches.isEmpty()) {
if (!mEnergyHatches.isEmpty()) return false;
if (mExoticEnergyHatches.size() > 1) return false;
}
return mCasingAmount >= 950;
}

Expand Down Expand Up @@ -685,7 +693,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
}

public int getMaxParallelRecipes() {
int parallels = (8 * GTUtility.getTier(this.getMaxInputVoltage()));
int parallels = (8 * GTUtility.getTierExtended(this.getMaxInputEu()));
if (blackHoleStatus == 4) parallels *= 4;
else if (blackHoleStability < 60) {
parallels *= 2;
Expand Down

0 comments on commit f8d0425

Please sign in to comment.