Class ForgeModEntrypoint
java.lang.Object
net.ixdarklord.coolcatcore.api.core.forge.ForgeModEntrypoint
- Direct Known Subclasses:
ForgeSetup
A base for a mod's
@Mod class that constructs its common mod constructors, taking the mod id from the
loading context Forge hands the @Mod class. One class covers every side:
@Mod(MyMod.MOD_ID)
public final class MyModForge extends ForgeModEntrypoint {
public MyModForge(FMLJavaModLoadingContext context) {
super(context);
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. Forge-only setup can use container, context and modEventBus in the same
constructor.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.minecraftforge.fml.ModContainerprotected final net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContextprotected final net.minecraftforge.eventbus.api.IEventBusprotected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForgeModEntrypoint(net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext context) -
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
-
context
protected final net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext context -
container
protected final net.minecraftforge.fml.ModContainer container -
modEventBus
protected final net.minecraftforge.eventbus.api.IEventBus modEventBus -
modId
-
-
Constructor Details
-
ForgeModEntrypoint
protected ForgeModEntrypoint(net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext context)
-
-
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
protected final void client(Supplier<Supplier<? extends net.ixdarklord.coolcatcore.api.core.ClientModConstructor>> factory) Constructs the client entry point, only on a client. -
server
protected final void server(Supplier<Supplier<? extends net.ixdarklord.coolcatcore.api.core.ServerModConstructor>> factory) Constructs the dedicated server entry point, only on a dedicated 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.
-