aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/recipe/check/CheckRecipeResult.java
blob: ab1db6ecd219edb04ea3324af8ff681c69a8eced (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
31
32
33
34
35
36
37
38
39
40
41
42
package gregtech.api.recipe.check;

import net.minecraft.network.PacketBuffer;

/**
 * Class to indicate the result of recipe check in the machine. It doesn't need to be actual result of recipemap check,
 * but can also be status of whether to start the machine. Examples can be found at {@link CheckRecipeResultRegistry}.
 * <p>
 * Sample instance must be registered to {@link CheckRecipeResultRegistry}.
 */
public interface CheckRecipeResult {

    /**
     * @return Unique registry ID
     */
    String getID();

    /**
     * @return If recipe check is successful
     */
    boolean wasSuccessful();

    /**
     * @return Actual text to show on client GUI
     */
    String getDisplayString();

    /**
     * Create new instance to receive packet.
     */
    CheckRecipeResult newInstance();

    /**
     * Encode value to sync.
     */
    void encode(PacketBuffer buffer);

    /**
     * Decode synced value.
     */
    void decode(PacketBuffer buffer);
}