1.21.1 NeoForge Dedicated Server Crash
Zelioth opened this issue ยท 6 comments
Minecraft 1.21.1
Neo-Forge 21.1.28
MATC 1.7.0
When attempting to use this on a serverit crashes. Claims its not for server usage.
Config screens cannot be registered on a physical server (dedicated).
In this case you can include the Dist
argument in the Mod's class constructor and check it.
import net.neoforged.api.distmarker.Dist;
...
public MATC(IEventBus bus, ModContainer container, Dist dist) {
container.registerConfig(ModConfig.Type.CLIENT, MATCModConfig.CLIENT_CONFIG);
container.registerConfig(ModConfig.Type.SERVER, MATCModConfig.SERVER_CONFIG);
if (dist == Dist.CLIENT) {
container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}
ModRegistry.register(bus);
CREATIVE_MODE_TABS.register(bus);
}