mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:39:58 +03:00
79 lines
2.5 KiB
Diff
79 lines
2.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/crafting/CraftingManager.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/crafting/CraftingManager.java
|
|
@@ -36,12 +36,13 @@
|
|
{
|
|
private static final Logger LOGGER = LogManager.getLogger();
|
|
private static int nextAvailableId;
|
|
- public static final RegistryNamespaced<ResourceLocation, IRecipe> REGISTRY = new RegistryNamespaced<ResourceLocation, IRecipe>();
|
|
+ public static RegistryNamespaced<ResourceLocation, IRecipe> REGISTRY = net.minecraftforge.registries.GameData.getWrapper(IRecipe.class);
|
|
|
|
public static boolean init()
|
|
{
|
|
try
|
|
{
|
|
+ CraftingManager.nextAvailableId = 0; // Reset recipe ID count
|
|
register("armordye", new RecipesArmorDyes());
|
|
register("bookcloning", new RecipeBookCloning());
|
|
register("mapcloning", new RecipesMapCloning());
|
|
@@ -173,12 +174,14 @@
|
|
}
|
|
}
|
|
|
|
- public static void register(String name, IRecipe recipe)
|
|
+ //Forge: Made private use GameData/Registry events!
|
|
+ private static void register(String name, IRecipe recipe)
|
|
{
|
|
register(new ResourceLocation(name), recipe);
|
|
}
|
|
|
|
- public static void register(ResourceLocation name, IRecipe recipe)
|
|
+ //Forge: Made private use GameData/Registry events!
|
|
+ private static void register(ResourceLocation name, IRecipe recipe)
|
|
{
|
|
if (REGISTRY.containsKey(name))
|
|
{
|
|
@@ -186,6 +189,7 @@
|
|
}
|
|
else
|
|
{
|
|
+ recipe.setKey(name);
|
|
REGISTRY.register(nextAvailableId++, name, recipe);
|
|
}
|
|
}
|
|
@@ -199,7 +203,7 @@
|
|
return irecipe.getCraftingResult(craftMatrix);
|
|
}
|
|
}
|
|
-
|
|
+ craftMatrix.currentRecipe = null; // CraftBukkit - Clear recipe when no recipe is found
|
|
return ItemStack.EMPTY;
|
|
}
|
|
|
|
@@ -210,10 +214,12 @@
|
|
{
|
|
if (irecipe.matches(craftMatrix, worldIn))
|
|
{
|
|
+ craftMatrix.currentRecipe = irecipe; // CraftBukkit
|
|
return irecipe;
|
|
}
|
|
}
|
|
|
|
+ craftMatrix.currentRecipe = null; // CraftBukkit - Clear recipe when no recipe is found
|
|
return null;
|
|
}
|
|
|
|
@@ -243,11 +249,13 @@
|
|
return REGISTRY.getObject(name);
|
|
}
|
|
|
|
+ @Deprecated //DO NOT USE THIS
|
|
public static int getIDForRecipe(IRecipe recipe)
|
|
{
|
|
return REGISTRY.getIDForObject(recipe);
|
|
}
|
|
|
|
+ @Deprecated //DO NOT USE THIS
|
|
@Nullable
|
|
public static IRecipe getRecipeById(int id)
|
|
{
|