From 8267150fa601ea25faa8dffb2fee22b070afcaf5 Mon Sep 17 00:00:00 2001 From: lc-1337 <62835225+lc-1337@users.noreply.github.com> Date: Sat, 5 Jul 2025 18:53:35 +0300 Subject: [PATCH] extend level maintainer feedback (#316) Co-authored-by: Nikolay S. Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../github/api/registries/LevelState.java | 4 +++- .../github/client/gui/GuiLevelMaintainer.java | 18 +++++++++++++++++- .../github/client/gui/GuiLevelTerminal.java | 2 +- .../common/tile/TileLevelMaintainer.java | 6 +++--- .../com/glodblock/github/util/NameConst.java | 4 ++++ .../resources/assets/ae2fc/lang/en_US.lang | 8 ++++++-- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glodblock/github/api/registries/LevelState.java b/src/main/java/com/glodblock/github/api/registries/LevelState.java index fb2c3ca1..9041a84e 100644 --- a/src/main/java/com/glodblock/github/api/registries/LevelState.java +++ b/src/main/java/com/glodblock/github/api/registries/LevelState.java @@ -5,5 +5,7 @@ public enum LevelState { Idle, Craft, Export, - Error + Error, + NotFound, + CantCraft } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java b/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java index ee396053..4a63527f 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiLevelMaintainer.java @@ -474,6 +474,18 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler { NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " " + NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR)); } + case NotFound -> { + this.line.setColor(FCGuiColors.StateError.getColor()); + message.add( + NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " " + + NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NOT_FOUND)); + } + case CantCraft -> { + this.line.setColor(FCGuiColors.StateError.getColor()); + message.add( + NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT) + " " + + NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CANT_CRAFT)); + } default -> { this.line.setColor(FCGuiColors.StateNone.getColor()); message.add( @@ -490,7 +502,11 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler { message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT)); message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT_DESC) + "\n"); message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR)); - message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR_DESC)); + message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_ERROR_DESC) + "\n"); + message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NOT_FOUND)); + message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NOT_FOUND_DESC) + "\n"); + message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CANT_CRAFT)); + message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CANT_CRAFT_DESC)); } else { message.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE)); } diff --git a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java index 3828b91b..2f753079 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java @@ -577,7 +577,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel case Idle -> FCGuiColors.StateIdle.getColor(); case Craft -> FCGuiColors.StateCraft.getColor(); case Export -> FCGuiColors.StateExport.getColor(); - case Error -> FCGuiColors.StateError.getColor(); + case Error, NotFound, CantCraft -> FCGuiColors.StateError.getColor(); case None -> FCGuiColors.StateNone.getColor(); }; int offset = 0; diff --git a/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java b/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java index 9305d78a..438b61ec 100644 --- a/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java +++ b/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java @@ -104,7 +104,7 @@ public class TileLevelMaintainer extends AENetworkTile if (idx == -1) { AELog.warn("Invalid crafting link: " + link); return items; - } ; + } try { if (getProxy().isActive()) { final IEnergyGrid energy = getProxy().getEnergy(); @@ -227,7 +227,7 @@ public class TileLevelMaintainer extends AENetworkTile this.updateLink(i, null); } if (!isCraftable) { - updateState(i, LevelState.Error); + updateState(i, LevelState.NotFound); } } @@ -278,7 +278,7 @@ public class TileLevelMaintainer extends AENetworkTile this.updateState(jobToSubmitIdx, LevelState.Craft); this.updateLink(jobToSubmitIdx, link); } else { - this.updateState(jobToSubmitIdx, LevelState.Error); + this.updateState(jobToSubmitIdx, LevelState.CantCraft); } } else if (itemToBegin != null) { // No jobs to submit, start calculating some item. diff --git a/src/main/java/com/glodblock/github/util/NameConst.java b/src/main/java/com/glodblock/github/util/NameConst.java index 49353ea3..6297f68b 100644 --- a/src/main/java/com/glodblock/github/util/NameConst.java +++ b/src/main/java/com/glodblock/github/util/NameConst.java @@ -93,6 +93,10 @@ public class NameConst { public static final String TT_LEVEL_MAINTAINER_EXPORT_DESC = TT_LEVEL_MAINTAINER + "export_desc"; public static final String TT_LEVEL_MAINTAINER_ERROR = TT_LEVEL_MAINTAINER + "error"; public static final String TT_LEVEL_MAINTAINER_ERROR_DESC = TT_LEVEL_MAINTAINER + "error_desc"; + public static final String TT_LEVEL_MAINTAINER_NOT_FOUND = TT_LEVEL_MAINTAINER + "not_found"; + public static final String TT_LEVEL_MAINTAINER_NOT_FOUND_DESC = TT_LEVEL_MAINTAINER + "not_found_desc"; + public static final String TT_LEVEL_MAINTAINER_CANT_CRAFT = TT_LEVEL_MAINTAINER + "cant_craft"; + public static final String TT_LEVEL_MAINTAINER_CANT_CRAFT_DESC = TT_LEVEL_MAINTAINER + "cant_craft_desc"; public static final String TT_CELL_CONTENTS = TT_KEY + "cell_contents"; public static final String TT_CELL_EMPTY = TT_KEY + "cell_empty"; public static final String TT_CELL_PORTABLE = TT_KEY + "cell_portable"; diff --git a/src/main/resources/assets/ae2fc/lang/en_US.lang b/src/main/resources/assets/ae2fc/lang/en_US.lang index 4ae7bcf7..0ffd9846 100644 --- a/src/main/resources/assets/ae2fc/lang/en_US.lang +++ b/src/main/resources/assets/ae2fc/lang/en_US.lang @@ -97,13 +97,17 @@ ae2fc.tooltip.level_maintainer.desc=Automatically keeps items and fluids in stoc ae2fc.tooltip.level_maintainer.current=Currently: ae2fc.tooltip.level_maintainer.none=No request configured. ae2fc.tooltip.level_maintainer.idle=§aIdling§r -ae2fc.tooltip.level_maintainer.idle_desc=The Requester is idling when the requested amount is already reached, there is no crafting pattern for this item or fluid or if there are not enough ingredients to request more crafts. +ae2fc.tooltip.level_maintainer.idle_desc=The Requester is idling when the requested amount is already reached or if no available CPU. ae2fc.tooltip.level_maintainer.link=§eCrafting§r ae2fc.tooltip.level_maintainer.link_desc=The system is currently crafting the requested item or fluid. ae2fc.tooltip.level_maintainer.export=§5Exporting§r ae2fc.tooltip.level_maintainer.export_desc=The Requester is trying to export the crafting results to the system. If the Requester has this status for a long time, there is no available space for the export. ae2fc.tooltip.level_maintainer.error=§4Errored§r -ae2fc.tooltip.level_maintainer.error_desc=The Requester is trying to schedule a crafting job but is failing. Possible reasons include a missing recipe or insufficient resources. +ae2fc.tooltip.level_maintainer.error_desc=The Requester is trying to schedule a crafting job but is failing due to internal error. +ae2fc.tooltip.level_maintainer.not_found=§4Not Found§r +ae2fc.tooltip.level_maintainer.not_found_desc=The Requester is trying to schedule a crafting job but can't find a crafting pattern. +ae2fc.tooltip.level_maintainer.cant_craft=§4Can't Craft§r +ae2fc.tooltip.level_maintainer.cant_craft_desc=The Requester is trying to schedule a crafting job but the crafting manager cannot process the job. (not enough ingredients, CPU doesn't have enough memory, recursion). ae2fc.tooltip.level_maintainer.batch_size=§6Crafting Batch Size§r ae2fc.tooltip.level_maintainer.batch_size.hint=When craft requests are emitted, the Requester will use the batch size for the request. Using larger batches will increase the speed of stocking up items but will require more crafting storage. ae2fc.tooltip.level_maintainer.request_size=§6Amount to Maintain§r