aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/PluginDisabler.java
blob: 231db17ade04c5c6981bbcf474e9b93a67da875f (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Roughly Enough Items by Danielshe.
 * Licensed under the MIT License.
 */

package me.shedaniel.rei.api;

import net.minecraft.util.Identifier;

public interface PluginDisabler {
    
    /**
     * Disables multiple functions from a plugin
     *
     * @param plugin    the identifier of the plugin
     * @param functions the array of functions to be disabled
     */
    default void disablePluginFunctions(Identifier plugin, PluginFunction... functions) {
        for(PluginFunction function : functions)
            disablePluginFunction(plugin, function);
    }
    
    /**
     * Enables multiple functions from a plugin
     *
     * @param plugin    the identifier of the plugin
     * @param functions the array of functions to be enabled
     */
    default void enablePluginFunctions(Identifier plugin, PluginFunction... functions) {
        for(PluginFunction function : functions)
            enablePluginFunction(plugin, function);
    }
    
    /**
     * Disables a function from a plugin
     *
     * @param plugin   the identifier of the plugin
     * @param function the function to be disabled
     */
    void disablePluginFunction(Identifier plugin, PluginFunction function);
    
    /**
     * Enables a function from a plugin
     *
     * @param plugin   the identifier of the plugin
     * @param function the function to be enabled
     */
    void enablePluginFunction(Identifier plugin, PluginFunction function);
    
    /**
     * Checks if a plugin function has been disabled
     *
     * @param plugin   the identifier of the plugin
     * @param function the function to check
     * @return whether if it has been disabled
     */
    boolean isFunctionEnabled(Identifier plugin, PluginFunction function);
    
}