Skip to content

Commit 94d20b9

Browse files
committed
add ClientModInitializer
1 parent fc57c34 commit 94d20b9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.thinkingstudio.bedsheet.loader.entrypoint;
2+
3+
import net.neoforged.fml.IExtensionPoint;
4+
5+
public interface ClientModInitializer extends IExtensionPoint {
6+
void onInitializeClient();
7+
}

src/main/java/org/thinkingstudio/bedsheet/loader/entrypoint/EntrypointHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ public static void init() {
1414
Optional<DedicatedServerModInitializer> serverModInitializer = modContainer.getCustomExtension(DedicatedServerModInitializer.class);
1515
serverModInitializer.ifPresent(DedicatedServerModInitializer::onInitializeServer);
1616
}
17+
if (FMLLoader.getDist().isClient()) {
18+
Optional<ClientModInitializer> clientModInitializer = modContainer.getCustomExtension(ClientModInitializer.class);
19+
clientModInitializer.ifPresent(ClientModInitializer::onInitializeClient);
20+
}
1721
});
1822
}
1923
}

0 commit comments

Comments
 (0)