Port to 1.11
This commit is contained in:
@@ -117,7 +117,7 @@ public class GroupIngredient implements IIngredient
|
||||
|
||||
for( final ItemStack is : out )
|
||||
{
|
||||
is.stackSize = this.qty;
|
||||
is.setCount( this.qty );
|
||||
}
|
||||
|
||||
return out.toArray( new ItemStack[out.size()] );
|
||||
|
||||
@@ -27,7 +27,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -159,10 +158,10 @@ public class Ingredient implements IIngredient
|
||||
throw new RegistrationError( "Recipe format expected a single item, but got a set of items." );
|
||||
}
|
||||
|
||||
Block blk = GameRegistry.findBlock( this.nameSpace, this.itemName );
|
||||
Block blk = Block.getBlockFromName( this.nameSpace + ":" + this.itemName );
|
||||
if( blk == null )
|
||||
{
|
||||
blk = GameRegistry.findBlock( this.nameSpace, "tile." + this.itemName );
|
||||
blk = Block.getBlockFromName( this.nameSpace + ":" + "tile." + this.itemName );
|
||||
}
|
||||
|
||||
if( blk != null )
|
||||
@@ -174,10 +173,10 @@ public class Ingredient implements IIngredient
|
||||
}
|
||||
}
|
||||
|
||||
Item it = GameRegistry.findItem( this.nameSpace, this.itemName );
|
||||
Item it = Item.getByNameOrId( this.nameSpace + ":" + this.itemName );
|
||||
if( it == null )
|
||||
{
|
||||
it = GameRegistry.findItem( this.nameSpace, "item." + this.itemName );
|
||||
it = Item.getByNameOrId( this.nameSpace + ":" + "item." + this.itemName );
|
||||
}
|
||||
|
||||
if( it != null )
|
||||
@@ -222,7 +221,7 @@ public class Ingredient implements IIngredient
|
||||
for( int x = 0; x < set.length; x++ )
|
||||
{
|
||||
final ItemStack is = set[x].copy();
|
||||
is.stackSize = this.qty;
|
||||
is.setCount( this.qty );
|
||||
set[x] = is;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class IngredientSet implements IIngredient
|
||||
|
||||
for( final ItemStack is : out )
|
||||
{
|
||||
is.stackSize = this.qty;
|
||||
is.setCount( this.qty );
|
||||
}
|
||||
|
||||
return out.toArray( new ItemStack[out.size()] );
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
@@ -174,7 +175,7 @@ public final class DisassembleRecipe implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( final InventoryCrafting inv )
|
||||
public NonNullList<ItemStack> getRemainingItems( final InventoryCrafting inv )
|
||||
{
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems( inv );
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
@@ -63,7 +64,7 @@ public final class FacadeRecipe implements IRecipe
|
||||
final ItemStack facades = facade.createFacadeForItem( inv.getStackInSlot( 4 ), !createFacade );
|
||||
if( facades != null && createFacade )
|
||||
{
|
||||
facades.stackSize = 4;
|
||||
facades.setCount( 4 );
|
||||
}
|
||||
return facades;
|
||||
}
|
||||
@@ -91,7 +92,7 @@ public final class FacadeRecipe implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( final InventoryCrafting inv )
|
||||
public NonNullList<ItemStack> getRemainingItems( final InventoryCrafting inv )
|
||||
{
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems( inv );
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Map;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -327,7 +328,7 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( final InventoryCrafting inv )
|
||||
public NonNullList<ItemStack> getRemainingItems( final InventoryCrafting inv )
|
||||
{
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems( inv );
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.ArrayList;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -182,7 +183,7 @@ public class ShapelessRecipe implements IRecipe, IRecipeBakeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems( final InventoryCrafting inv )
|
||||
public NonNullList<ItemStack> getRemainingItems( final InventoryCrafting inv )
|
||||
{
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems( inv );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user