mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 07:19:56 +03:00
22 lines
887 B
Diff
22 lines
887 B
Diff
--- ../src-base/minecraft/net/minecraft/stats/RecipeBook.java
|
|
+++ ../src-work/minecraft/net/minecraft/stats/RecipeBook.java
|
|
@@ -42,9 +42,17 @@
|
|
this.newRecipes.clear(i);
|
|
}
|
|
|
|
+ @Deprecated //DO NOT USE
|
|
protected static int getRecipeId(@Nullable IRecipe recipe)
|
|
{
|
|
- return CraftingManager.REGISTRY.getIDForObject(recipe);
|
|
+ int ret = CraftingManager.REGISTRY.getIDForObject(recipe);
|
|
+ if (ret == -1)
|
|
+ {
|
|
+ ret = ((net.minecraftforge.registries.ForgeRegistry<IRecipe>)net.minecraftforge.fml.common.registry.ForgeRegistries.RECIPES).getID(recipe.getRegistryName());
|
|
+ if (ret == -1)
|
|
+ throw new IllegalArgumentException(String.format("Attempted to get the ID for a unknown recipe: %s Name: %s", recipe, recipe.getRegistryName()));
|
|
+ }
|
|
+ return ret;
|
|
}
|
|
|
|
@SideOnly(Side.CLIENT)
|