aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/metatileentity
diff options
context:
space:
mode:
authorquerns <33518699+querns@users.noreply.github.com>2023-09-13 10:03:17 -0500
committerGitHub <noreply@github.com>2023-09-13 17:03:17 +0200
commitb31052879e7601dbfea4c7fb53b94119c7bbf5c6 (patch)
tree69c6778c385c27ada8ec61478f5bc6da32bbc8fb /src/main/java/gregtech/api/interfaces/metatileentity
parent62bb20ef6271b09dab45d66103a185774aba523e (diff)
downloadGT5-Unofficial-b31052879e7601dbfea4c7fb53b94119c7bbf5c6.tar.gz
GT5-Unofficial-b31052879e7601dbfea4c7fb53b94119c7bbf5c6.tar.bz2
GT5-Unofficial-b31052879e7601dbfea4c7fb53b94119c7bbf5c6.zip
Adds Metrics Transmitter Cover and Advanced GT Sensor Card for Information Panels (#2289)
* Adds several UI elements to multiblock drills * Adds metrics transmitter cover and associated sensor card * Fixes item icons and item name * Adds tooltips for adv. sensor card and metrics panel, fixes card/overlay icons, adds recipe for metrics cover * Refactor cover tab sync to send much smaller ISerializable payloads * Remove unused variable * Additional master merge cleanup * Adds interface for custom metrics export, adds oil drill support * Adds support for metrics covers retaining attached machine name for tooltip, metrics * * Adds discrete coordinates to Metrics Cover data * Adds machine to advanced sensor card tooltip * Adds cycle time and minimum energy hatch tier to multiblock ore drill tooltips * Moves many tooltip strings to i10n * Remove old GT_DisabledWhileActiveButton.java file that crept in during a messy merge * Spotless * Improve oil and ore drill metrics, more i18n * Addresses PR review concerns, adds more situations for self-destructing sensor cards * Remediates further PR concerns
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/metatileentity')
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IMetricsExporter.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetricsExporter.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetricsExporter.java
new file mode 100644
index 0000000000..f97cd79ed6
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetricsExporter.java
@@ -0,0 +1,28 @@
+package gregtech.api.interfaces.metatileentity;
+
+import java.util.List;
+
+import org.jetbrains.annotations.NotNull;
+
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+
+/**
+ * Metrics Transmitter covers look for this interface for retrieving custom metrics for a machine. If this interface is
+ * not present on the machine housing the cover, it will use {@link BaseMetaTileEntity#getInfoData()} to retrieve info
+ * instead.
+ */
+public interface IMetricsExporter {
+
+ /**
+ * Attached metrics covers will call this method to receive reported metrics.
+ * <p>
+ * When reporting metrics, try to keep the number of entries small, and ordering of entries consistent. Advanced
+ * Sensor Cards allow the user to selectively turn off individual lines using the panel's UI, and doing so is
+ * aggravated by a metrics set that is inconsistent and/or large.
+ *
+ * @return A list of strings to print on the information panel the advanced sensor card is utilizing. Each item in
+ * the list will be printed on its own line.
+ */
+ @NotNull
+ List<String> reportMetrics();
+}