aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java')
-rw-r--r--src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java b/src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java
new file mode 100644
index 0000000000..9c3c9ed219
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java
@@ -0,0 +1,29 @@
+package gregtech.api.interfaces;
+
+/**
+ * To get a tooltip with a secondary description
+ */
+public interface ISecondaryDescribable extends IDescribable {
+ /**
+ * Convenient to call when overriding the `String[] getDescription()` method.
+ */
+ default String[] getCurrentDescription() {
+ if (isDisplaySecondaryDescription() && getSecondaryDescription() != null) {
+ return getSecondaryDescription();
+ }
+ return getPrimaryDescription();
+ }
+
+ String[] getPrimaryDescription();
+
+ String[] getSecondaryDescription();
+
+ /**
+ * This method will only be called on client side
+ *
+ * @return whether the secondary description should be display. default is false
+ */
+ default boolean isDisplaySecondaryDescription() {
+ return false;
+ }
+}