Skip to content

Commit

Permalink
Fix empty event handler crash
Browse files Browse the repository at this point in the history
Fixes #473
  • Loading branch information
Aizistral committed May 3, 2024
1 parent 0e242ad commit 75ab79a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -79,6 +80,11 @@ public static void onPlayReady(ClientPlayerNetworkEvent.LoggingIn event) {
ClientEvents.PLAY_READY.invoker().handle(handler, client);
}

@SubscribeEvent
public static void onServerStarted(ServerStartedEvent event) {
// NO-OP, see https://github.com/Aizistral-Studios/No-Chat-Reports/issues/473
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent;
import net.neoforged.neoforge.event.server.ServerStartedEvent;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.Mod.EventBusSubscriber;
Expand Down Expand Up @@ -55,6 +56,11 @@ public static void onPlayReady(ClientPlayerNetworkEvent.LoggingIn event) {
ClientEvents.PLAY_READY.invoker().handle(handler, client);
}

@SubscribeEvent
public static void onServerStarted(ServerStartedEvent event) {
// NO-OP, see https://github.com/Aizistral-Studios/No-Chat-Reports/issues/473
}

}

}

0 comments on commit 75ab79a

Please sign in to comment.