Files
CatServer/patches/net/minecraftforge/oredict/ShapelessOreRecipe.java.patch
2018-07-15 13:26:53 +08:00

40 lines
1.4 KiB
Diff

--- ../src-base/minecraft/net/minecraftforge/oredict/ShapelessOreRecipe.java
+++ ../src-work/minecraft/net/minecraftforge/oredict/ShapelessOreRecipe.java
@@ -32,11 +32,14 @@
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
+import org.bukkit.inventory.Recipe;
+import luohuayu.CatServer.inventory.CustomModRecipe;
public class ShapelessOreRecipe implements IRecipe
{
protected ItemStack output = null;
protected ArrayList<Object> input = new ArrayList<Object>();
+ private ShapelessRecipes vanillaRecipe = null; //Svarka - bukkit compatibility
public ShapelessOreRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); }
public ShapelessOreRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); }
@@ -77,6 +80,7 @@
ShapelessOreRecipe(ShapelessRecipes recipe, Map<ItemStack, String> replacements)
{
+ vanillaRecipe = recipe;
output = recipe.getRecipeOutput();
for(ItemStack ingredient : recipe.recipeItems)
@@ -170,4 +174,13 @@
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
+
+ // Cauldron start - required for Bukkit API
+ @Override
+ public Recipe toBukkitRecipe() {
+ if (vanillaRecipe != null)
+ return vanillaRecipe.toBukkitRecipe();
+ return new CustomModRecipe(this);
+ }
+ // Cauldron end
}