Skip to content

Commit

Permalink
Fixed recipe registry key lookup.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke committed Jul 11, 2021
1 parent 8948292 commit 68205bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public final class RecipeSerializers {
private static final DeferredRegister<IRecipeSerializer<?>> RECIPE_SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, API.MOD_ID);

public static final RegistryObject<WrenchRecipe.Serializer> WRENCH = RECIPE_SERIALIZERS.register("wrench", WrenchRecipe.Serializer::new);
public static final RegistryObject<WrenchRecipe.Serializer> WRENCH = RECIPE_SERIALIZERS.register("wrench", () -> WrenchRecipe.Serializer.INSTANCE);

public static void initialize() {
RECIPE_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ public NonNullList<ItemStack> getRemainingItems(final CraftingInventory inventor

@Override
public IRecipeSerializer<?> getSerializer() {
return new Serializer();
return Serializer.INSTANCE;
}

public static final class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<WrenchRecipe> {
public static final Serializer INSTANCE = new Serializer();

@Override
public WrenchRecipe fromJson(final ResourceLocation location, final JsonObject json) {
return new WrenchRecipe(SHAPELESS_RECIPE.fromJson(location, json));
Expand Down

0 comments on commit 68205bf

Please sign in to comment.