Skip to content

Commit

Permalink
Fix crash on server
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Aug 29, 2024
1 parent 81ac774 commit b06bd86
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package net.legacyfabric.fabric.impl.item.versioned;

import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;

import net.minecraft.item.Item;

import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
Expand All @@ -35,6 +38,6 @@ public void onPreLaunch() {
private static void itemRegistryInit(Registry<?> holder) {
SyncedRegistry<Item> registry = (SyncedRegistry<Item>) holder;

registry.fabric$getRegistryRemapCallback().register(new ItemModelsRemapper());
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) registry.fabric$getRegistryRemapCallback().register(new ItemModelsRemapper());
}
}

0 comments on commit b06bd86

Please sign in to comment.