Class NeoForgeModEntrypoint
java.lang.Object
net.ixdarklord.coolcatcore.api.core.neoforge.NeoForgeModEntrypoint
- Direct Known Subclasses:
NeoForgeClientSetup, NeoForgeSetup
A base for a mod's
@Mod class that constructs its common mod constructors, taking the mod id from the
container. One class covers every side:
@Mod(MyMod.MOD_ID)
public final class MyModNeoForge extends NeoForgeModEntrypoint {
public MyModNeoForge(ModContainer container) {
super(container);
this.common(MyMod::new);
this.client(() -> MyModClient::new);
this.dataGeneration(MyModData::new);
}
}
Client and server constructors are given as a supplier of a factory, so their classes are never loaded on the
other side. NeoForge-only setup can use container and modEventBus in the same constructor.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.neoforged.fml.ModContainerprotected final net.neoforged.bus.api.IEventBusprotected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNeoForgeModEntrypoint(net.neoforged.fml.ModContainer container) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidclient(Supplier<Supplier<? extends net.ixdarklord.coolcatcore.api.core.ClientModConstructor>> factory) Constructs the client entry point, only on a client.protected final voidConstructs the common entry point, on both sides.protected final voiddataGeneration(Supplier<? extends net.ixdarklord.coolcatcore.api.core.DataGenerationConstructor> factory) Registers the data generation entry point; the factory is only called when data is generated.protected final voidserver(Supplier<Supplier<? extends net.ixdarklord.coolcatcore.api.core.ServerModConstructor>> factory) Constructs the dedicated server entry point, only on a dedicated server.
-
Field Details
-
container
protected final net.neoforged.fml.ModContainer container -
modEventBus
protected final net.neoforged.bus.api.IEventBus modEventBus -
modId
-
-
Constructor Details
-
NeoForgeModEntrypoint
protected NeoForgeModEntrypoint(net.neoforged.fml.ModContainer container)
-
-
Method Details
-
common
protected final void common(Supplier<? extends net.ixdarklord.coolcatcore.api.core.ModConstructor> factory) Constructs the common entry point, on both sides. -
client
-
server
-
dataGeneration
protected final void dataGeneration(Supplier<? extends net.ixdarklord.coolcatcore.api.core.DataGenerationConstructor> factory) Registers the data generation entry point; the factory is only called when data is generated.
-