-
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathPlatformEntrypoint.java
More file actions
46 lines (41 loc) · 1.67 KB
/
Copy pathPlatformEntrypoint.java
File metadata and controls
46 lines (41 loc) · 1.67 KB
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
package dev.isxander.yacl3.platform;
import dev.isxander.yacl3.gui.image.YACLImageReloadListener;
/*? if fabric {*/
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
import net.minecraft.server.packs.PackType;
public class PlatformEntrypoint implements ClientModInitializer {
@Override
public void onInitializeClient() {
YACLConfig.HANDLER.load();
ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloadListener(YACLImageReloadListener.getId(), new YACLImageReloadListener());
}
}
/*?} elif neoforge {*/
/*import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.*;
@Mod("yet_another_config_lib_v3")
public class PlatformEntrypoint {
public PlatformEntrypoint(IEventBus modEventBus) {
YACLConfig.HANDLER.load();
modEventBus.addListener(AddClientReloadListenersEvent.class, event -> {
event.addListener(YACLImageReloadListener.getId(), new YACLImageReloadListener());
});
}
}
*//*?} elif forge {*/
/*import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.client.event.RegisterClientReloadListenersEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@Mod("yet_another_config_lib_v3")
public class PlatformEntrypoint {
public PlatformEntrypoint() {
YACLConfig.HANDLER.load();
// noinspection removal we will never support lexforge past 1.20.1
FMLJavaModLoadingContext.get().getModEventBus().<RegisterClientReloadListenersEvent>addListener(event -> {
event.registerReloadListener(new YACLImageReloadListener());
});
}
}
*//*?}*/