diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 6a1c84baae6..76d70beecab 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -2,6 +2,7 @@ import static gregtech.api.enums.GTValues.V; import static gregtech.api.enums.GTValues.VN; +import static gregtech.api.recipe.check.SingleRecipeCheck.getDisplayString; import static gregtech.api.util.GTUtility.filterValidMTEs; import static gregtech.api.util.GTUtility.formatNumbers; import static gregtech.api.util.GTUtility.min; @@ -2077,6 +2078,19 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat int tAverageTime = tag.getInteger("averageNS"); currentTip.add("Average CPU load of ~" + formatNumbers(tAverageTime) + " ns"); } + // Always show locked recipe information if the machine is locked to a recipe + if (tag.getBoolean("isLockedToRecipe")) { + String lockedRecipe = tag.getString("lockedRecipeName"); + if (!lockedRecipe.isEmpty()) { + // Split the string on "\n" and add each line separately. + String[] lines = lockedRecipe.split("\n"); + currentTip.add("Locked Recipe:"); + for (String line : lines) { + currentTip.add(line); + } + } + } + super.getWailaBody(itemStack, currentTip, accessor, config); } @@ -2095,6 +2109,11 @@ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompou tag.setInteger("progress", mProgresstime); tag.setInteger("maxProgress", mMaxProgresstime); tag.setBoolean("incompleteStructure", (getErrorDisplayID() & 64) != 0); + tag.setBoolean("isLockedToRecipe", isRecipeLockingEnabled()); + SingleRecipeCheck lockedRecipe = getSingleRecipeCheck(); + tag.setString( + "lockedRecipeName", + lockedRecipe != null ? getDisplayString(lockedRecipe.getRecipe(), false, true, false, true) : ""); if (mOutputItems != null) { int index = 0; diff --git a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java index 12d8a387570..1ee9eee9e15 100644 --- a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java +++ b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java @@ -29,24 +29,31 @@ import gregtech.api.util.GTUtility.ItemId; /** - * Used by machines that are locked to a single recipe, for faster recipe check. + * Used by machines that are locked to a single recipe, for faster recipe checking. *

- * Computation time will be like these: + * The typical computation times are: *