Skip to content

Commit

Permalink
fix: server crash due to neo config screen registered on both sides
Browse files Browse the repository at this point in the history
Closes #1167
  • Loading branch information
klikli-dev committed Jul 23, 2024
1 parent 0fa2a32 commit f9d5c83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/klikli_dev/occultism/Occultism.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public Occultism(IEventBus modEventBus, ModContainer modContainer) {
modContainer.registerConfig(ModConfig.Type.COMMON, COMMON_CONFIG.spec);
modContainer.registerConfig(ModConfig.Type.CLIENT, CLIENT_CONFIG.spec);
modContainer.registerConfig(ModConfig.Type.STARTUP, STARTUP_CONFIG.spec);
modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);

OccultismEffects.EFFECTS.register(modEventBus);
OccultismRecipes.RECIPE_TYPES.register(modEventBus);
Expand Down Expand Up @@ -126,6 +125,7 @@ public Occultism(IEventBus modEventBus, ModContainer modContainer) {

if (FMLEnvironment.dist == Dist.CLIENT) {
modEventBus.addListener(ClientSetupEventHandler::onRegisterMenuScreens);
ClientSetupEventHandler.registerConfigScreen(modContainer);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@
import net.minecraft.world.entity.EntityType;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.neoforge.client.event.*;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
import net.neoforged.neoforge.client.gui.VanillaGuiLayers;
import net.neoforged.neoforge.client.settings.KeyConflictContext;
import net.neoforged.neoforge.common.NeoForge;
Expand All @@ -77,6 +80,10 @@ public class ClientSetupEventHandler {

public static Map<EntityType<?>, KeyMapping> keysFamiliars;

public static void registerConfigScreen(ModContainer modContainer){
modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}

@SubscribeEvent
public static void onRegisterEntityRendererLayerDefinitions(EntityRenderersEvent.RegisterLayerDefinitions event) {
//Register Entity Layers
Expand Down

0 comments on commit f9d5c83

Please sign in to comment.