Initial commit (Forge 1291).
This commit is contained in:
20
patches/net/minecraftforge/oredict/OreDictionary.java.patch
Normal file
20
patches/net/minecraftforge/oredict/OreDictionary.java.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- ../src-base/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
||||
+++ ../src-work/minecraft/net/minecraftforge/oredict/OreDictionary.java
|
||||
@@ -216,7 +216,7 @@
|
||||
{
|
||||
ShapedRecipes recipe = (ShapedRecipes)obj;
|
||||
ItemStack output = recipe.getRecipeOutput();
|
||||
- if (output != null && containsMatch(false, exclusions, output))
|
||||
+ if ((output != null && containsMatch(false, exclusions, output)) || output == null) // Cauldron - fixes NPE's with null recipes being added to forge
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -231,7 +231,7 @@
|
||||
{
|
||||
ShapelessRecipes recipe = (ShapelessRecipes)obj;
|
||||
ItemStack output = recipe.getRecipeOutput();
|
||||
- if (output != null && containsMatch(false, exclusions, output))
|
||||
+ if ((output != null && containsMatch(false, exclusions, output)) || output == null) // Cauldron - fixes NPE's with null recipes being added to forge
|
||||
{
|
||||
continue;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
--- ../src-base/minecraft/net/minecraftforge/oredict/ShapedOreRecipe.java
|
||||
+++ ../src-work/minecraft/net/minecraftforge/oredict/ShapedOreRecipe.java
|
||||
@@ -6,6 +6,10 @@
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
+// Cauldron start
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// Cauldron end
|
||||
+
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
@@ -13,6 +17,7 @@
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.cauldron.inventory.CustomModRecipe;
|
||||
|
||||
public class ShapedOreRecipe implements IRecipe
|
||||
{
|
||||
@@ -25,6 +30,7 @@
|
||||
private int width = 0;
|
||||
private int height = 0;
|
||||
private boolean mirrored = true;
|
||||
+ private ShapedRecipes vanillaRecipe = null; // Cauldron - bukkit compatibility
|
||||
|
||||
public ShapedOreRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); }
|
||||
public ShapedOreRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); }
|
||||
@@ -127,6 +133,7 @@
|
||||
|
||||
ShapedOreRecipe(ShapedRecipes recipe, Map<ItemStack, String> replacements)
|
||||
{
|
||||
+ vanillaRecipe = recipe; // Cauldron - bukkit compatibility
|
||||
output = recipe.getRecipeOutput();
|
||||
width = recipe.recipeWidth;
|
||||
height = recipe.recipeHeight;
|
||||
@@ -255,4 +262,13 @@
|
||||
{
|
||||
return this.input;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start - required for Bukkit API
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ if (vanillaRecipe != null)
|
||||
+ return vanillaRecipe.toBukkitRecipe();
|
||||
+ return new CustomModRecipe(this);
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
--- ../src-base/minecraft/net/minecraftforge/oredict/ShapelessOreRecipe.java
|
||||
+++ ../src-work/minecraft/net/minecraftforge/oredict/ShapelessOreRecipe.java
|
||||
@@ -6,6 +6,10 @@
|
||||
import java.util.Map.Entry;
|
||||
import java.util.List;
|
||||
|
||||
+// Cauldron start
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// Cauldron end
|
||||
+
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
@@ -13,11 +17,13 @@
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraft.world.World;
|
||||
+import net.minecraftforge.cauldron.inventory.CustomModRecipe;
|
||||
|
||||
public class ShapelessOreRecipe implements IRecipe
|
||||
{
|
||||
private ItemStack output = null;
|
||||
private ArrayList<Object> input = new ArrayList<Object>();
|
||||
+ private ShapelessRecipes vanillaRecipe = null; // Cauldron - bukkit compatibility
|
||||
|
||||
public ShapelessOreRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); }
|
||||
public ShapelessOreRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); }
|
||||
@@ -59,6 +65,7 @@
|
||||
@SuppressWarnings("unchecked")
|
||||
ShapelessOreRecipe(ShapelessRecipes recipe, Map<ItemStack, String> replacements)
|
||||
{
|
||||
+ vanillaRecipe = recipe; // Cauldron - bukkit compatibility
|
||||
output = recipe.getRecipeOutput();
|
||||
|
||||
for(ItemStack ingred : ((List<ItemStack>)recipe.recipeItems))
|
||||
@@ -146,4 +153,13 @@
|
||||
{
|
||||
return this.input;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start - required for Bukkit API
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ if (vanillaRecipe != null)
|
||||
+ return vanillaRecipe.toBukkitRecipe();
|
||||
+ return new CustomModRecipe(this);
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
Reference in New Issue
Block a user