aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/ISecondaryDescribable.java
blob: 1f480091fccdc3fa1b4d17c09e467502c3db86a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
    }
}