aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/api/CITGlobalProperties.java
blob: 6a6ec221a4160d29208d9e86f8091d66b214e406 (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
package shcm.shsupercm.fabric.citresewn.api;

import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;

import blue.endless.jankson.annotation.Nullable;

/**
 * @see #globalProperty(String, PropertyValue)
 */
@FunctionalInterface
public interface CITGlobalProperties {
    /**
     * Entrypoint for handlers of global properties.
	 * @see #globalProperty(String, PropertyValue)
     */
    String ENTRYPOINT = "citresewn:global_property";

    /**
     * Invoked before CIT parsing for any global property name associated with the handler's modid.<br>
	 * May be called multiple times for a key to overwrite its global property with higher-priority resourcepacks.<br>
	 * When unloading resourcepacks(usually before reloading), all keys that were invoked in the previous load will get called again with a null value to allow for disposal.
	 * @param key name of the property key stripped of its modid
	 * @param value the value it's been set to or null if resetting
     */
    void globalProperty(String key, @Nullable PropertyValue value) throws Exception;
}