Skip to content

Commit

Permalink
Add parallel info tooltip builder
Browse files Browse the repository at this point in the history
  • Loading branch information
FourIsTheNumber committed Nov 14, 2024
1 parent 5654cd0 commit 059c9b5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
protected MultiblockTooltipBuilder createTooltip() {
MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Blast Furnace")
.addInfo("Processes up to " + Configuration.Multiblocks.megaMachinesMax + " recipes at once")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus")
.addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)")
.addInfo("Each 1800K over the min. Heat allows for an overclock to be upgraded to a perfect overclock.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public MultiblockTooltipBuilder createTooltip() {
tt.addMachineType("Chemical Reactor")
.addInfo("What molecule do you want to synthesize ?")
.addInfo("Or you want to replace something in this molecule ?")
.addInfo("Processes up to " + Configuration.Multiblocks.megaMachinesMax + " recipes at once")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addTecTechHatchInfo()
.addInfo(
GTValues.TIER_COLORS[8] + GTValues.VN[8]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public int getRecipeCatalystPriority() {
protected MultiblockTooltipBuilder createTooltip() {
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Distillery")
.addInfo("Processes up to " + Configuration.Multiblocks.megaMachinesMax + " recipes at once")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addInfo("Fluids are only put out at the correct height")
.addInfo("The correct height equals the slot number in the NEI recipe")
.addTecTechHatchInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public MTEMegaOilCracker(String aName) {
public MultiblockTooltipBuilder createTooltip() {
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Cracker")
.addInfo("Processes up to " + Configuration.Multiblocks.megaMachinesMax + " recipes at once")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addInfo("Thermally cracks heavy hydrocarbons into lighter fractions")
.addInfo("More efficient than the Chemical Reactor")
.addInfo("Gives different benefits whether it hydro or steam-cracks:")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected MultiblockTooltipBuilder createTooltip() {
MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Vacuum Freezer")
.addInfo("Cools hot ingots and cells")
.addInfo("Processes up to " + Configuration.Multiblocks.megaMachinesMax + " recipes at once")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addTecTechHatchInfo()
.addSeparator()
.addInfo("Upgrade to Tier 2 to unlock " + EnumChatFormatting.LIGHT_PURPLE + "Subspace Cooling.")
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class MultiblockTooltipBuilder {
private static final String COLON = ": ";
private static final String SEPARATOR = ", ";
private static final String TT_machineType = StatCollector.translateToLocal("GT5U.MBTT.MachineType");
private static final String TT_Parallels = StatCollector.translateToLocal("GT5U.MBTT.Parallels");
private static final String TT_dimensions = StatCollector.translateToLocal("GT5U.MBTT.Dimensions");
private static final String TT_hollow = StatCollector.translateToLocal("GT5U.MBTT.Hollow");
private static final String TT_structure = StatCollector.translateToLocal("GT5U.MBTT.Structure");
Expand Down Expand Up @@ -117,6 +118,18 @@ public MultiblockTooltipBuilder addInfo(String info) {
return this;
}

/**
* Add a line for static parallel count
* Processes up to {parallels} recipes at once
*
* @param parallels Maximum parallels
* @returnInstance this method was called on.
*/
public MultiblockTooltipBuilder addParallelInfo(Integer parallels) {
iLines.add(String.format(TT_Parallels, parallels));
return this;
}

/**
* Add a number of basic lines of information about this structure
*
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GT5U.autoplace.error.no_mte.class_name=§cSuggested to place machine with class
# Multiblock Tooltip Builder Keywords
# Context can be found in the class gregtech.api.util.MultiblockTooltipBuilder
GT5U.MBTT.MachineType=Machine Type
GT5U.MBTT.Parallels=Processes up to %d recipes at once
GT5U.MBTT.Dimensions=Dimensions
GT5U.MBTT.Hollow=(Hollow)
GT5U.MBTT.Structure=Structure
Expand Down

0 comments on commit 059c9b5

Please sign in to comment.