Skip to content

Commit

Permalink
Add neo event for creative search order refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
NotRyken committed Jun 22, 2024
1 parent a25874e commit 64a4c30
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
package dev.terminalmc.clientsort;

import dev.terminalmc.clientsort.screen.ConfigScreenProvider;
import dev.terminalmc.clientsort.util.CreativeSearchOrder;
import net.minecraft.client.Minecraft;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
Expand All @@ -36,6 +38,12 @@ static void registerKeyMappingsEvent(RegisterKeyMappingsEvent event) {

@EventBusSubscriber(modid = ClientSort.MOD_ID, value = Dist.CLIENT)
static class ClientEventHandler {
// Game join events
@SubscribeEvent
public static void loginEvent(ClientPlayerNetworkEvent.LoggingIn event) {
CreativeSearchOrder.refreshItemSearchPositionLookup();
}

// Tick events
@SubscribeEvent
public static void clientTickEvent(ClientTickEvent.Post event) {
Expand Down

0 comments on commit 64a4c30

Please sign in to comment.