Skip to content

Commit

Permalink
Fix AAL tooltips (#3087)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: boubou19 <miisterunknown@gmail.com>
  • Loading branch information
3 people committed Sep 7, 2024
1 parent d57edae commit 187ea09
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
15 changes: 13 additions & 2 deletions src/main/java/ggfab/mte/MTEAdvAssLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static gregtech.api.util.GTStructureUtility.buildHatchAdder;
import static gregtech.api.util.GTStructureUtility.ofHatchAdder;
import static gregtech.api.util.GTUtility.filterValidMTEs;
import static gregtech.api.util.GTUtility.formatNumbers;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -41,6 +42,7 @@
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StringUtils;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
Expand All @@ -63,6 +65,7 @@
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;

import ggfab.ConfigurationHandler;
import ggfab.GGConstants;
import ggfab.mui.ClickableTextWidget;
import gregtech.api.GregTechAPI;
Expand Down Expand Up @@ -104,6 +107,7 @@
public class MTEAdvAssLine extends MTEExtendedPowerMultiBlockBase<MTEAdvAssLine> implements ISurvivalConstructable {

private static final ItemStack NOT_CHECKED = new ItemStack(Blocks.dirt);
public static final double LASER_OVERCLOCK_PENALTY_FACTOR = ConfigurationHandler.INSTANCE.getLaserOCPenaltyFactor();
private static final String STRUCTURE_PIECE_FIRST = "first";
private static final String STRUCTURE_PIECE_LATER = "later";
private static final String STRUCTURE_PIECE_LAST = "last";
Expand Down Expand Up @@ -305,10 +309,16 @@ protected MultiblockTooltipBuilder createTooltip() {
tt.addMachineType("Assembling Line")
.addInfo("Controller block for the Advanced Assembling Line")
.addInfo("Built exactly the same as standard Assembling Line")
.addInfo("Place in world to get more info. It will be a lengthy read.")
.addInfo("Assembling Line with item pipelining")
.addInfo("All fluids are however consumed at start")
.addInfo("Use voltage of worst energy hatch for overclocking")
.addInfo("Perform normal overclock with given voltage")
.addInfo("Perform laser overclock with extra amperages from multi-amp energy hatches")
.addInfo("Each laser overclock reduces recipe time by 50%")
.addInfo(
"and multiplies power by (4 + " + formatNumbers(LASER_OVERCLOCK_PENALTY_FACTOR)
+ " * total laser overclock count)")
.addInfo(EnumChatFormatting.BOLD + "Will not overclock beyond 1 tick.")
.addInfo("EU/t is (number of slices working) * (overclocked EU/t)")
.addSeparator()
.beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false)
Expand Down Expand Up @@ -768,7 +778,8 @@ public CheckRecipeResult checkProcessing() {

OverclockCalculator laserOCCalculator = new OverclockCalculator().setRecipeEUt(recipe.mEUt)
.setDurationUnderOneTickSupplier(() -> ((double) (recipe.mDuration) / recipe.mInputs.length))
.setEutIncreasePerOCSupplier(overclock -> 4 + 0.3 * Math.max(overclock - normalOverclockCount, 0))
.setEutIncreasePerOCSupplier(
overclock -> 4 + LASER_OVERCLOCK_PENALTY_FACTOR * Math.max(overclock - normalOverclockCount, 0))
.setParallel(originalMaxParallel)
.setEUt(inputEUt / recipe.mInputs.length);

Expand Down
9 changes: 0 additions & 9 deletions src/main/resources/assets/ggfab/lang/en_US.lang
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
ggfab.recipe.toolcast=Tool Casting Machine

ggfab.info.advassline.0=Advanced Assembly Line Help
ggfab.info.advassline.1=This is advanced assembly line from §6GigaGram§rFab.
ggfab.info.advassline.2=It supports item pipelining. That is, it will mimic a real assembly line by consuming ingredients one by one instead of all at start. In effect, it offers a parallelism up to however many item input this recipe requires.
ggfab.info.advassline.3=You can think of an advanced assembly line as a collection of assembly slices. Each assembly slice is capably of processing each step independent of other slices.
ggfab.info.advassline.4=It will start processing once the input bus contents align with any stored data stick. The first slice will consume the input in Bus #1. After (recipe time/number of inputs) time, the first slice's work is concluded and will start the second slice. At the same time, first slice will look for input in input bus #1. If there are still enough input there slice #1 will start working again.
ggfab.info.advassline.5=The terminal slice (the n-th slice, where n is number of item input in recipe) will put the recipe output in output bus when it has concluded his work. Whenever a non-terminal slice finished its work, it will try to pass the work onto next slice. If the next slice cannot find the materials in its input bus, the just-finished slice will remain in §4STUCK§r state and hang the assembly line. To help locate these §4STUCK§r assembly lines, the controller's front face will have its status light turned orange.
ggfab.info.advassline.6=The EU/t cost of this machine is number of slices active multiplied by the original recipe EU/t. §4STUCK§r slices do not consume power. It will use the worst energy supplying hatch's input voltage for recipe tier calculation and normal imperfect overclock.
ggfab.info.advassline.7=With exotic energy hatches, it can overclock beyond usual voltage tier, but will consume even more power than usual imperfect overclock. Every §2laser overclock§r will add %s to power exponent.
ggfab.info.advassline.8=1 §2laser overclock§r will have 50%% recipe time and use %s%% power. 2 §2laser overclock§r will have 25%% recipe time and use %s%% (%s * %s) power. Will not overclock beyond 1 tick. Machine first tries to parallelize, then normal imperfect overclock, then §2laser overclock§r.
ggfab.waila.advassline.slice=Slice #%s: %s s / %s s
ggfab.waila.advassline.slice.small=Slice #%s: %s ticks / %s ticks
ggfab.waila.advassline.slice.idle=Slice #%s: Idle
Expand Down
11 changes: 1 addition & 10 deletions src/main/resources/assets/ggfab/lang/zh_CN.lang
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
ggfab.info.advassline.0=高级装配线教程
ggfab.info.advassline.1=爱来自 §6GigaGram§rFab 与 w
ggfab.info.advassline.2=这种新式装配线支持流水线式装配,也就是说,这种装配线会逐一从输入总线中获取原材料,而不是像其他GT机器一样在启动时获取所有原材料。这种工作模式使得他获得了等同与当前配方物品输入数量的并行数。
ggfab.info.advassline.3=你可以将高级装配线想象成一组装配刀片机,每个装配刀片可以互相独立的工作。
ggfab.info.advassline.4=高级装配线会在输入总线第一格的内容与任意一个闪存记录的配方相符合时开始工作。第一装配刀片会从第一个输入总线获取输入。在(配方时间/物品输入个数)的时间后,第一装配刀片的工作结束了,之后便会将半成品转交给第二装配刀片,然后第二装配刀片再从自己的输入总线中获取输入。于此同时,在第二装配刀片工作时,第一装配刀片会继续尝试从第一输入总线中获取输入,如果这里仍然有足够的输入,则第一装配刀片会直接开始工作。
ggfab.info.advassline.5=如果一个配方有n个输入,那么第N个装配刀片就是最终装配刀片,在他完成工作时就会将成品放到末尾的输出总线中。除最终装配刀片外,其他装配刀片在自己的工作结束时都会试图将半成品交给下一个刀片。如果下一个刀片无法从自己的输入总线中找到输入,则上一片刀片会停留在§4停滞§r状态,并最终使整个装配线阻塞。为了帮助你发现阻塞的装配线,任何含有§4停滞§r状态的装配刀片的装配线将会亮起橙红色指示灯。
ggfab.info.advassline.6=高级装配线的瞬时能耗是正在工作的装配刀片的数量乘以当前配方的EU/t。§4停滞§r状态的装配刀片不会消耗能量。额外需要注意的是,本机器会使用所有能量供应舱室中最低的电压等级来计算配方等级与普通的非完美超频。
ggfab.info.advassline.7=在使用一些特殊的能量供应舱室时,高级装配线可以进行额外的超频(称为§2激光超频§r),但是会使用比非完美超频更多的能量。每个§2激光超频§r会使得能量指数增加%s。
ggfab.info.advassline.8=一层激光超频会使配方时间变为50%%,但会使用%s%%能量。二层激光超频会使配方时间变为25%%,但会使用%s%% (%s * %s)能量。激光超频仍然不会越过1tick极限。高级装配线在计算超频时会优先考虑并行,然后考虑非完美超频,最后进行§2激光超频§r。
ggfab.waila.advassline.slice=装配刀片 #%s: %s秒 / %s秒
ggfab.waila.advassline.slice.small=装配刀片 #%s: %s刻 / %s刻
ggfab.waila.advassline.slice.idle=装配刀片 #%s: 空闲
Expand All @@ -25,4 +16,4 @@ ggfab.info.biome=群系:

ggfab.tooltip.linked_input_bus.change_freq_warn=如果这是最后一个本频道的输入总线,改变频道会使剩余的内容物洒在地上!
ggfab.tooltip.linked_input_bus.private=私有频道不会与其余玩家共享
ggfab.tooltip.linked_input_bus.private.1=如果这是最后一个本频道的输入总线,改变频道会使剩余的内容物洒在地上!
ggfab.tooltip.linked_input_bus.private.1=如果这是最后一个本频道的输入总线,改变频道会使剩余的内容物洒在地上!
2 changes: 1 addition & 1 deletion src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ GT5U.gui.text.fuel_quality_too_high=§7Fuel quality too high to run without boos
GT5U.gui.text.no_data_sticks=§7No Data Sticks found
GT5U.gui.text.bio_upgrade_missing=§7Recipe needs Bio Upgrade to start
GT5U.gui.text.electromagnet_missing=§7Needs an Electromagnet to run
GT5U.gui.text.electromagnet_insufficient=§7Electromagnet too weak to handle exotic energy hatches
GT5U.gui.text.electromagnet_insufficient=§7Electromagnet too weak to handle multi-amp energy hatches
GT5U.gui.text.laser_insufficient=§7Laser source is too weak to run this recipe
GT5U.gui.text.cleanroom_running=§aCleanroom running
GT5U.gui.text.no_machine=§7No valid processing machine
Expand Down

0 comments on commit 187ea09

Please sign in to comment.