Java Code Examples for net.minecraftforge.oredict.OreDictionary

The following are top voted examples for showing how to use net.minecraftforge.oredict.OreDictionary. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: connor41-etfuturum2   File: EtFuturum.java   Source Code and License 9 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

	ModRecipes.init();

	proxy.registerEvents();
	proxy.registerEntities();
	proxy.registerRenderers();

	if (ModEntityList.hasEntitiesWithEggs()) {
		ModEntityList.entity_egg = new ItemEntityEgg();
		GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg");
		OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg);
	}

	isTinkersConstructLoaded = Loader.isModLoaded("TConstruct");
}
 
Example 2
Project: FoodCraft-Reloaded   File: EnumLoader.java   Source Code and License 6 votes vote down vote up
/**
     * Attempt to register all entries from {@link #enumInstanceMap} to {@link ForgeRegistries}.
     * @see ForgeRegistries
     */
    public void register() {
        enumInstanceMap.forEach((instanceClass, enumMap) -> {
            if (IForgeRegistryEntry.class.isAssignableFrom(instanceClass))
                enumMap.values().stream().map(o -> (IForgeRegistryEntry<? extends IForgeRegistryEntry<?>>) o)
//                    .map(o -> new RegisterHandler(o))
                    .forEach(o -> {
//                    TODO RegisterManager.getInstance().putRegister(o);
                        if (o instanceof Item) {
                            ForgeRegistries.ITEMS.register((Item) o);
                            if (o instanceof OreDictated)
                                Arrays.stream(((OreDictated) o).getOreDictNames()).forEach(s -> OreDictionary.registerOre(s, (Item) o));
                        }
                        else if (o instanceof Block) {
                            ForgeRegistries.BLOCKS.register((Block) o);
                            if (o instanceof OreDictated)
                                Arrays.stream(((OreDictated) o).getOreDictNames()).forEach(s -> OreDictionary.registerOre(s, (Block) o));
                        }
                    });
            else if (Fluid.class.isAssignableFrom(instanceClass))
                enumMap.values().stream().map(o -> (Fluid) o).forEach(fluid -> {
                    FluidRegistry.registerFluid(fluid);
                    FluidRegistry.addBucketForFluid(fluid);
                });
        });
    }
 
Example 3
Project: HeroUtils   File: RecipeInputOreDict.java   Source Code and License 6 votes vote down vote up
@Override
public boolean matches(ItemStack subject) {
	List<ItemStack> inputs = getOres();
	boolean useOreStackMeta = (meta == null);
	Item subjectItem = subject.getItem();
	int subjectMeta = subject.getItemDamage();

	for (ItemStack oreStack : inputs) {
		Item oreItem = oreStack.getItem();
		if (oreItem == null) continue; // ignore invalid

		int metaRequired = useOreStackMeta ? oreStack.getItemDamage() : meta;

		if (subjectItem == oreItem &&
				(subjectMeta == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) {
			return true;
		}
	}

	return false;
}
 
Example 4
Project: ExSartagine   File: ContainerSmelter.java   Source Code and License 6 votes vote down vote up
public ContainerSmelter(InventoryPlayer playerInventory, TileEntitySmelter smelter) {

		for(String ore : OreDictionary.getOreNames())
			if(ore.toLowerCase().contains("ore"))
				ores.addAll(OreDictionary.getOres(ore));

		this.addSlotToContainer(new SlotSmelterInput(ores, smelter.getInventory(), 0, 56, 17));
		this.addSlotToContainer(new SlotPanOutput(playerInventory.player, smelter.getInventory(), 1, 116, 35));
		this.addSlotToContainer(new SlotPanOutput(playerInventory.player, smelter.getInventory(), 2, 140, 39));

		for (int i = 0; i < 3; ++i)
			for (int j = 0; j < 9; ++j)
				this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));

		for (int k = 0; k < 9; ++k)
			this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
	}
 
Example 5
Project: ExSartagine   File: SlotPanInput.java   Source Code and License 6 votes vote down vote up
@Override
public boolean isItemValid(ItemStack stack) {
	if(!stack.isEmpty())
	{
		boolean flag = false;
       	int[] ids = OreDictionary.getOreIDs(stack);
       	for(int id: ids)
       		if(OreDictionary.getOreName(id).contains("food")){
       			flag = true;
       			break;
       		}
		if(stack.getItem() instanceof ItemFood || flag)
		{
			if(!FurnaceRecipes.instance().getSmeltingResult(stack).isEmpty())
			{
				return true;
			}
		}
	}
	return false;
}
 
Example 6
Project: ExSartagine   File: SlotSmelterInput.java   Source Code and License 6 votes vote down vote up
@Override
public boolean isItemValid(ItemStack stack) {
	if(!stack.isEmpty())
	{
		if(stack.getItem() instanceof ItemBlock)
		{
			for(ItemStack ore : ores)
				if(OreDictionary.itemMatches(ore, stack, false))
				{
					return true;
				}
		}
		
		else
		{
			ItemStack result = FurnaceRecipes.instance().getSmeltingResult(getStack());
			if (result.getItem().equals(Items.field_191525_da))
			{
				return true;
			}
		}
	}
	return false;
}
 
Example 7
Project: customstuff4   File: ShapedRecipe.java   Source Code and License 6 votes vote down vote up
/**
 * Gets recipe input without the chars for the shape.
 */
Object[] getRecipeInput()
{
    Object[] result = new Object[getRecipeWidth() * getRecipeHeight()];

    for (int row = 0; row < shape.length; row++)
    {
        for (int col = 0; col < shape[0].length(); col++)
        {
            RecipeInput input = items.get(shape[row].charAt(col));

            int index = col + row * shape[0].length();

            if (input != null)
            {
                result[index] = input.isOreClass() ? OreDictionary.getOres(input.getOreClass().getOreName()) : input.getStack().getItemStack();
            } else
            {
                result[index] = ItemStack.EMPTY;
            }
        }
    }

    return result;
}
 
Example 8
Project: harshencastle   File: HarshenUtils.java   Source Code and License 6 votes vote down vote up
public static ArrayList<Block> getBlocksFromString(String blockName)
{
	ArrayList<Block> blocks = new ArrayList<>();
	if(!HarshenUtils.toArray(Blocks.AIR, null).contains(Block.getBlockFromName(blockName)))
		blocks.add(Block.getBlockFromName(blockName));
	for(ItemStack oreStack : OreDictionary.getOres(blockName))
		if(oreStack.getItem() instanceof ItemBlock)
			blocks.add(((ItemBlock)oreStack.getItem()).getBlock());
	ArrayList<Block> finalBlocks = new ArrayList<>();
	for(Block b : blocks)
	{
		NonNullList<ItemStack> items = NonNullList.create();
		b.getSubBlocks(CreativeTabs.SEARCH, items);
		for(ItemStack stack : items)
			if(!stack.isEmpty())
				finalBlocks.add(Block.getBlockFromItem(stack.getItem()));
			else
				finalBlocks.add(b);
	}
	return finalBlocks;
}
 
Example 9
Project: harshencastle   File: HarshenStack.java   Source Code and License 6 votes vote down vote up
/**
 * Used to create a list of stacks, from oreDictionary
 * @param oreDictName A list of OreDictionary value you want to use
 */
public HarshenStack(String... oreDictNames) {
	for(String oreDictName : oreDictNames)
	{
		NonNullList<ItemStack> stackList = OreDictionary.getOres(oreDictName);
		if(stackList.isEmpty())
			new IllegalArgumentException("Oredictionary vaule " + oreDictName + " doesnt exist").printStackTrace(System.out);
		else
			for(ItemStack stack : stackList)
				if(stack.getMetadata() == OreDictionary.WILDCARD_VALUE)
				{
			    		NonNullList<ItemStack> innerStacklist = NonNullList.create();
			    		stack.getItem().getSubItems(CreativeTabs.SEARCH, innerStacklist);
					for(ItemStack wildStack : innerStacklist)
						this.stackList.add(stack.copy());
				}
				else
					this.stackList.add(stack);
	}
}
 
Example 10
Project: DankNull   File: JEI.java   Source Code and License 6 votes vote down vote up
@Override
public void register(@Nonnull IModRegistry registry) {
	blacklist = registry.getJeiHelpers().getIngredientBlacklist();

	blacklistItem(new ItemStack(ModItems.DANK_NULL_HOLDER, 1, OreDictionary.WILDCARD_VALUE));

	List<ItemStack> dankNulls = new ArrayList<ItemStack>();
	dankNulls.addAll(Arrays.asList(new ItemStack(ModItems.DANK_NULL, 1, 0), new ItemStack(ModItems.DANK_NULL, 1, 1), new ItemStack(ModItems.DANK_NULL, 1, 2), new ItemStack(ModItems.DANK_NULL, 1, 3), new ItemStack(ModItems.DANK_NULL, 1, 4), new ItemStack(ModItems.DANK_NULL, 1, 5)));
	registry.addIngredientInfo(dankNulls, ItemStack.class, "jei.danknull.desc");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 0), ItemStack.class, "jei.danknull.desc0");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 1), ItemStack.class, "jei.danknull.desc1");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 2), ItemStack.class, "jei.danknull.desc2");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 3), ItemStack.class, "jei.danknull.desc3");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 4), ItemStack.class, "jei.danknull.desc4");
	registry.addIngredientInfo(new ItemStack(ModItems.DANK_NULL, 1, 5), ItemStack.class, "jei.danknull.desc5");

	registry.addIngredientInfo(new ItemStack(ModBlocks.DANKNULL_DOCK), ItemStack.class, "jei.danknull_dock.desc");

}
 
Example 11
Project: ToolBelt   File: Config.java   Source Code and License 6 votes vote down vote up
private static ItemStack parseItemStack(String itemString)
{
    Matcher matcher = itemRegex.matcher(itemString);

    if (!matcher.matches())
    {
        ToolBelt.logger.warn("Could not parse item " + itemString);
        return ItemStack.EMPTY;
    }

    Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(matcher.group("item")));
    if (item == null)
    {
        ToolBelt.logger.warn("Could not parse item " + itemString);
        return ItemStack.EMPTY;
    }

    String anyString = matcher.group("meta");
    String metaString = matcher.group("meta");
    int meta = Strings.isNullOrEmpty(anyString)
            ? (Strings.isNullOrEmpty(metaString) ? 0 : Integer.parseInt(metaString))
            : OreDictionary.WILDCARD_VALUE;

    return new ItemStack(item, 1, meta);
}
 
Example 12
Project: ToolBelt   File: Config.java   Source Code and License 6 votes vote down vote up
public static boolean isItemStackAllowed(final ItemStack stack)
{
    if (stack.getCount() <= 0)
        return true;

    if (whiteList.stream().anyMatch((s) -> OreDictionary.itemMatches(s, stack, false)))
        return true;

    if (blackList.stream().anyMatch((s) -> OreDictionary.itemMatches(s, stack, false)))
        return false;

    if (stack.getItem() instanceof ItemToolBelt)
        return false;

    if (stack.getMaxStackSize() != 1)
        return false;

    return true;
}
 
Example 13
Project: CustomWorldGen   File: MinecraftForge.java   Source Code and License 6 votes vote down vote up
/**
 * Method invoked by FML before any other mods are loaded.
 */
public static void initialize()
{
    FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());

    OreDictionary.getOreName(0);

    UsernameCache.load();
    // Load before all the mods, so MC owns the MC fluids
    FluidRegistry.validateFluidRegistry();
    ForgeHooks.initTools();

    //For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine
    new CrashReport("ThisIsFake", new Exception("Not real"));
}
 
Example 14
Project: FoodCraft-Reloaded   File: LiqueurLoader.java   Source Code and License 6 votes vote down vote up
@Load
public void loadLiqueurs() {
    ForgeRegistries.ITEMS.getKeys().stream().filter(s -> s.getResourcePath().contains("liqueur")).map(ForgeRegistries.ITEMS::getValue).forEach(liqueur -> {
        for (LiqueurType liqueurType : LiqueurTypes.values()) {
            if (liqueurType == LiqueurTypes.NORMAL)
                continue;
            ItemLiqueur typedLiqueur = new ItemLiqueur(MathHelper.floor(liqueurType.getHealModifier() * ((ItemFood) liqueur).getHealAmount(new ItemStack(liqueur))));
            typedLiqueur.setLiqueurType(liqueurType);
            typedLiqueur.setRegistryName(liqueur.getRegistryName().getResourceDomain(), liqueurType.getUnlocalizedName() + "_" + liqueur.getRegistryName().getResourcePath());
            typedLiqueur.setUnlocalizedName(liqueur.getUnlocalizedName());
            ForgeRegistries.ITEMS.register(typedLiqueur);
            OreDictionary.registerOre("listAll" + StringUtils.capitalize(liqueurType.getUnlocalizedName()) + "liqueur", typedLiqueur);
            OreDictionary.registerOre("listAllliqueur", typedLiqueur);
            OreDictionary.registerOre("listAllfoods", typedLiqueur);
            cachedLiqueurs.add(typedLiqueur);
        }
    });
}
 
Example 15
Project: connor41-etfuturum2   File: BannerPatternHandler.java   Source Code and License 6 votes vote down vote up
public CachedPatternRecipe(EnumBannerPattern pattern, String[] grid, List<Object> inputs) {
	this.pattern = pattern;

	for (int y = 0; y < 3; y++)
		for (int x = 0; x < 3; x++) {
			char c = grid[y].charAt(x);
			if (c != ' ') {
				Object input = inputs.get(inputs.indexOf(c) + 1);
				if (input instanceof String)
					input = OreDictionary.getOres((String) input);
				PositionedStack stack = new PositionedStack(input, 25 + x * 18, 6 + y * 18);
				stack.setMaxSize(1);
				ingredients.add(stack);
			}
		}
}
 
Example 16
Project: BetterBeginningsReborn   File: JsonLoadedItemStack.java   Source Code and License 6 votes vote down vote up
public List<ItemStack> getItemStacks()
{
	if (isOreDictionary)
	{
	    	
		return OreDictionary.getOres(itemName, false);
	}

	Item item = RegistryUtil.getItemFromRegistry(itemName);
	if (item == null) return Collections.emptyList();

	List<ItemStack> single = new ArrayList<>();
	ItemStack stack = new ItemStack(item, stackSize, getDamage());
	stack.setTagCompound(getNbt());
	single.add(stack);
	return single;
}
 
Example 17
Project: customstuff4   File: ItemHelper.java   Source Code and License 6 votes vote down vote up
public static boolean stackMatchesRecipeInput(ItemStack stack, RecipeInput input, boolean checkCount)
{
    if (input.isItemStack())
    {
        ItemStack inputStack = input.getStack().getItemStack();
        if (OreDictionary.itemMatches(inputStack, stack, false)
            && (!checkCount || inputStack.getCount() <= stack.getCount()))
            return true;
    } else
    {
        if (OreDictionary.containsMatch(false, OreDictionary.getOres(input.getOreClass().getOreName()), stack))
            return true;
    }

    return false;
}
 
Example 18
Project: pnc-repressurized   File: Helper.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a string representation of the item which can also be used in scripts
 */
@SuppressWarnings("rawtypes")
public static String getStackDescription(Object object) {
    if(object instanceof IIngredient) {
        return getStackDescription((IIngredient) object);
    } else if(object instanceof ItemStack) {
        return toIItemStack((ItemStack) object).toString();
    } else if(object instanceof FluidStack) {
        return getStackDescription((FluidStack) object);
    } else if(object instanceof Block) {
        return toIItemStack(new ItemStack((Block) object, 1, 0)).toString();
    } else if(object instanceof String) {
        // Check if string specifies an oredict entry
        List<ItemStack> ores = OreDictionary.getOres((String) object);
        
        if(!ores.isEmpty()) {
            return "<ore:" + (String) object + ">";
        } else {
            return "\"" + (String) object + "\"";
        }
    } else if(object instanceof List) {
        return getListDescription((List) object);
    } else if(object instanceof Object[]) {
        return getListDescription(Arrays.asList((Object[]) object));
    } else if(object != null) {
        return "\"" + object.toString() + "\"";
    } else if(object instanceof Ingredient && !((Ingredient) object).apply(ItemStack.EMPTY) && ((Ingredient) object).getMatchingStacks().length > 0) {
        return getStackDescription(((Ingredient) object).getMatchingStacks()[0]);
    } else {
        return "null";
    }
}
 
Example 19
Project: ExPetrum   File: BlockLog.java   Source Code and License 5 votes vote down vote up
@Override
public void registerOreDictNames()
{
	Stream.of(ExPOreDict.blockLog).forEach(s -> { 
		OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); 
		AtomicInteger i = new AtomicInteger(1);
		ExPBlockProperties.TREE_TYPE.getAllowedValues().stream().map(EnumTreeType::getName).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndAdd(3))));
	});
}
 
Example 20
Project: ExPetrum   File: BlockSand.java   Source Code and License 5 votes vote down vote up
@Override
public void registerOreDictNames()
{
	Stream.of(ExPOreDict.blockSand).forEach(s -> { 
		OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); 
		AtomicInteger i = new AtomicInteger(0);
		Stream.of(ExPOreDict.rockNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement())));
	});
}
 
Example 21
Project: AdvancedCombat   File: SwordCustomRepair.java   Source Code and License 5 votes vote down vote up
/** Set the ores that can repair this sword */
public SwordCustomRepair addRepairOres(String... repair) {
	for(String name : repair) {
		List<ItemStack> stacks = OreDictionary.getOres(name);
		repairStacks.join(stacks);
	}
	return this;
}
 
Example 22
Project: pnc-repressurized   File: SlotItemSpecific.java   Source Code and License 5 votes vote down vote up
/**
 * Check if the stack is a valid item for this slot. Always true beside for
 * the armor slots.
 */
@Override
public boolean isItemValid(@Nonnull ItemStack stack) {
    if (itemAllowed != null) {
        Item item = stack.isEmpty() ? null : stack.getItem();
        return item == itemAllowed;
    } else {
        int[] ids = OreDictionary.getOreIDs(stack);
        for (int id : ids) {
            if (id == oreDictEntry) return true;
            if (dye && TileEntityPlasticMixer.getDyeIndex(stack) >= 0) return true;
        }
        return false;
    }
}
 
Example 23
Project: pnc-repressurized   File: PneumaticCraftUtils.java   Source Code and License 5 votes vote down vote up
public static boolean isSameOreDictStack(ItemStack stack1, ItemStack stack2) {
    int[] oredictIds = OreDictionary.getOreIDs(stack1);
    for (int oredictId : oredictIds) {
        List<ItemStack> oreDictStacks = OreDictionary.getOres(OreDictionary.getOreName(oredictId));
        for (ItemStack oreDictStack : oreDictStacks) {
            if (OreDictionary.itemMatches(oreDictStack, stack2, false)) {
                return true;
            }
        }
    }
    return false;
}
 
Example 24
Project: BetterBeginningsReborn   File: Util.java   Source Code and License 5 votes vote down vote up
public static boolean areItemStacksEqualIgnoreSize(ItemStack template, ItemStack tested)
   {
if (template == null)//STACKNULL
{
    return tested == null;
}
else if (tested == null)//STACKNULL
{
    return false;
}

return template.getItem() == tested.getItem() && (template.getMetadata() == tested.getMetadata() ||
	template.getMetadata() == OreDictionary.WILDCARD_VALUE);
   }
 
Example 25
Project: pnc-repressurized   File: OreDictionaryHelper.java   Source Code and License 5 votes vote down vote up
public static void addOreDictEntries() {
    OreDictionary.registerOre(Names.INGOT_IRON_COMPRESSED, Itemss.INGOT_IRON_COMPRESSED);
    OreDictionary.registerOre(Names.BLOCK_IRON_COMPRESSED, Blockss.COMPRESSED_IRON);
    for(int i = 0; i < ItemPlastic.ORE_NAMES.length; i++){
        OreDictionary.registerOre(ItemPlastic.ORE_NAMES[i], new ItemStack(Itemss.PLASTIC, 1, i));
    }
}
 
Example 26
Project: Thermionics   File: ToolHelper.java   Source Code and License 5 votes vote down vote up
public static boolean matchesOreName(String oreName, ItemStack stack) {
	if (!OreDictionary.doesOreNameExist(oreName)) return false;
	
	NonNullList<ItemStack> oreItems = OreDictionary.getOres(oreName);
	for(ItemStack oreItem : oreItems) {
		if (OreDictionary.itemMatches(stack, oreItem, false)) return true;
	}
	
	return false;
}
 
Example 27
Project: HeroUtils   File: DriverSidedBlock.java   Source Code and License 5 votes vote down vote up
protected boolean worksWith(final Block referenceBlock, final int referenceMetadata) {
    for (ItemStack stack : blocks) {
        if (stack != null && stack.getItem() instanceof ItemBlock) {
            final ItemBlock item = (ItemBlock) stack.getItem();
            final Block supportedBlock = item.getBlock();
            final int supportedMetadata = item.getMetadata(stack.getItemDamage());
            if (referenceBlock == supportedBlock && (referenceMetadata == supportedMetadata || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
                return true;
            }
        }
    }
    return false;
}
 
Example 28
Project: HeroUtils   File: DriverBlock.java   Source Code and License 5 votes vote down vote up
protected boolean worksWith(final Block referenceBlock, final int referenceMetadata) {
    for (ItemStack stack : blocks) {
        if (stack != null && stack.getItem() instanceof ItemBlock) {
            final ItemBlock item = (ItemBlock) stack.getItem();
            final Block supportedBlock = item.getBlock();
            final int supportedMetadata = item.getMetadata(stack.getItemDamage());
            if (referenceBlock == supportedBlock && (referenceMetadata == supportedMetadata || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
                return true;
            }
        }
    }
    return false;
}
 
Example 29
Project: HeroUtils   File: RecipeInputOreDict.java   Source Code and License 5 votes vote down vote up
private List<ItemStack> getOres() {
	if (ores != null) return ores;

	// cache the ore list by making use of the fact that forge always uses the same list,
	// unless it's EMPTY_LIST, which should never happen.
	List<ItemStack> ret = OreDictionary.getOres(input);

	if (ret != OreDictionary.EMPTY_LIST) ores = ret;

	return ret;
}
 
Example 30
Project: Soot   File: Stamper.java   Source Code and License 5 votes vote down vote up
@ZenMethod
public static void add(IItemStack output, ILiquidStack liquid, @NotNull IItemStack stamp, @Optional IItemStack input) {
    ItemStack stack = InputHelper.toStack(input);
    ItemStack stampStack = InputHelper.toStack(stamp); //This is pointless but also the easiest way.
    ItemStampingRecipe recipe = new ItemStampingRecipe(stack,InputHelper.toFluid(liquid), EnumStampType.getType(stampStack),InputHelper.toStack(output),stack.getMetadata() != OreDictionary.WILDCARD_VALUE,stack.hasTagCompound());
    CraftTweakerAPI.apply(new Add(recipe));
}
 
Example 31
Project: ExPetrum   File: BlockGrass.java   Source Code and License 5 votes vote down vote up
@Override
public void registerOreDictNames()
{
	Stream.of(ExPOreDict.blockGrass).forEach(s -> { 
		OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); 
		AtomicInteger i = new AtomicInteger(0);
		Stream.of(ExPOreDict.soilNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement())));
	});
}
 
Example 32
Project: FoodCraft-Reloaded   File: PropertiedFoodLoader.java   Source Code and License 5 votes vote down vote up
@Load
public void registerFoods() {
    for (Field field : FCRFoods.class.getFields()) {
        field.setAccessible(true);
        try {
            RegFood anno = field.getDeclaredAnnotation(RegFood.class);
            if (anno == null) {
                Object food = field.get(null);
                if (food instanceof ItemPorridge)
                    registerPorridge((ItemPorridge) food);
                else if (food instanceof ItemSoup)
                    registerSoup((ItemSoup) food);
                else if (food instanceof ItemNoodles)
                    registerNoodles((ItemNoodles) food);
                else if (food instanceof ItemLiqueur)
                    registerLiqueur((ItemLiqueur) food);
                continue;
            }

            ItemPFood item = (ItemPFood) field.get(null);
            if (ArrayUtils.isNotEmpty(anno.modifier()))
                item.setProperties(anno.modifier());
            if (anno.amount() == Integer.MIN_VALUE)
                item.calcHealAmount();
            else
                item.setHealAmount(anno.amount());
            ForgeRegistries.ITEMS.register(item.setRegistryName(FoodCraftReloaded.MODID, NameBuilder.buildRegistryName(anno.name())).setUnlocalizedName(NameBuilder.buildUnlocalizedName(anno.name())));
            Arrays.asList(anno.oreDict()).forEach(s -> OreDictionary.registerOre(s, item));
            OreDictionary.registerOre("listAllfoods", item);
        } catch (IllegalAccessException | NullPointerException e) {
            FoodCraftReloaded.getLogger().warn("Un-able to register food " + field.toGenericString(), e);
        }
    }
}
 
Example 33
Project: Industrial-Foregoing   File: RecipeHandlers.java   Source Code and License 5 votes vote down vote up
public static NonNullList<ItemStack> getRealOredictedItems(String oredit) {
    NonNullList<ItemStack> stacks = NonNullList.create();
    for (ItemStack ore : OreDictionary.getOres(oredit)) {
        if (ore.getMetadata() == OreDictionary.WILDCARD_VALUE && ore.getItem().getCreativeTab() != null)
            ore.getItem().getSubItems(ore.getItem().getCreativeTab(), stacks);
        else {
            stacks.add(ore);
            break;
        }
    }
    return stacks;
}
 
Example 34
Project: Industrial-Foregoing   File: ItemRegistry.java   Source Code and License 5 votes vote down vote up
public static void registerItems(IForgeRegistry<Item> itemRegistry) {
    (tinyDryRubber = new IFCustomItem("tinydryrubber")).register(itemRegistry);
    (dryRubber = new IFCustomItem("dryrubber")).register(itemRegistry);
    RecipeUtils.addShapelessRecipe(new ItemStack(dryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber), new ItemStack(tinyDryRubber));
    (plastic = new IFCustomItem("plastic")).register(itemRegistry);
    OreDictionary.registerOre("itemRubber", plastic);
    GameRegistry.addSmelting(dryRubber, new ItemStack(plastic), 0);
    (fertilizer = new IFCustomItem("fertilizer")).register(itemRegistry);
    (meatFeederItem = new MeatFeederItem()).register(itemRegistry);
    (mobImprisonmentToolItem = new MobImprisonmentToolItem()).register(itemRegistry);
    (laserLensItem = new LaserLensItem(false)).register(itemRegistry);
    (laserLensItem_inverted = new LaserLensItem(true)).register(itemRegistry);
    (strawItem = new ItemStraw()).register(itemRegistry);
    (pinkSlime = new IFCustomItem("pink_slime")).register(itemRegistry);
    (bookManualItem = new BookManualItem()).register(itemRegistry);

    (adultFilterAddomItem = new AdultFilterAddonItem()).registerItem(itemRegistry);
    (rangeAddonItem = new RangeAddonItem()).registerItem(itemRegistry);
    (energyFieldAddon = new EnergyFieldAddon()).registerItem(itemRegistry);
    (leafShearingAddonItem = new LeafShearingAddonItem()).registerItem(itemRegistry);

    meatFeederItem.createRecipe();
    mobImprisonmentToolItem.createRecipe();
    laserLensItem.createRecipe();
    laserLensItem_inverted.createRecipe();
    adultFilterAddomItem.createRecipe();
    rangeAddonItem.createRecipe();
    energyFieldAddon.createRecipe();
    bookManualItem.createRecipe();
    leafShearingAddonItem.createRecipe();
}
 
Example 35
Project: MiningWells   File: ModOreDictionary.java   Source Code and License 5 votes vote down vote up
public static final void commonInit() {
	OreDictionary.registerOre("gearStone", ModItems.itemStoneGear);
	OreDictionary.registerOre("gearIron", ModItems.itemIronGear);
	OreDictionary.registerOre("gearTin", ModItems.itemTinGear);
	OreDictionary.registerOre("gearCopper", ModItems.itemCopperGear);
	OreDictionary.registerOre("gearGold", ModItems.itemGoldGear);
	OreDictionary.registerOre("gearDiamond", ModItems.itemDiamondGear);
	
	LogUtils.info("Registered ore dictionary materials.");
}
 
Example 36
Project: BetterBeginningsReborn   File: RegistryUtil.java   Source Code and License 5 votes vote down vote up
public static List<String> getOreNames(ItemStack stack)
{
	List<String> res = new ArrayList<>();
	for (int id : OreDictionary.getOreIDs(stack))
	{
		res.add(OreDictionary.getOreName(id));
	}
	return res;
}
 
Example 37
Project: Uranium   File: OreDictionaryInterface.java   Source Code and License 5 votes vote down vote up
@Override
public List<OreDictionaryEntry> getOreEntries(ItemStack itemStack) {
    int[] ids = OreDictionary.getOreIDs(CraftItemStack.asNMSCopy(itemStack));

    ImmutableList.Builder<OreDictionaryEntry> builder = ImmutableList.builder();
    for (int id : ids) {
        builder.add(OreDictionaryEntry.valueOf(id));
    }

    return builder.build();
}
 
Example 38
Project: Thermionics   File: OreItems.java   Source Code and License 5 votes vote down vote up
public static final boolean matches(String template, ItemStack item) {
	boolean templatePresent = template!=null && !template.isEmpty();
	boolean itemPresent     = item!=null     && !item.isEmpty();
	if (!templatePresent &&  itemPresent) return false; // Empty    !=  NonEmpty
	if ( templatePresent && !itemPresent) return false; // NonEmpty !=  Empty
	if (!templatePresent && !itemPresent) return true;  // Empty    ==  Empty
	
	if (!OreDictionary.doesOreNameExist(template)) return false;
	NonNullList<ItemStack> ores = OreDictionary.getOres(template);
	return OreDictionary.containsMatch(false, ores, item);
}
 
Example 39
Project: Uranium   File: OreDictionaryInterface.java   Source Code and License 5 votes vote down vote up
@Override
public List<ItemStack> getDefinitions(OreDictionaryEntry entry) {
    @SuppressWarnings("deprecation")
    List<net.minecraft.item.ItemStack> items = OreDictionary.getOres(entry.getId());

    ImmutableList.Builder<ItemStack> builder = ImmutableList.builder();
    for (net.minecraft.item.ItemStack nmsItem : items) {
        builder.add(CraftItemStack.asCraftMirror(nmsItem));
    }

    return builder.build();
}
 
Example 40
Project: ExPetrum   File: ItemSeeds.java   Source Code and License 5 votes vote down vote up
@Override
public void registerOreDictNames()
{
	Stream.of(ExPOreDict.itemSeeds).forEach(s -> { 
		OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); 
		AtomicInteger i = new AtomicInteger(0);
		Stream.of(ExPOreDict.cropNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement())));
	});
}
 
Example 41
Project: BetterBeginningsReborn   File: TileEntitySmelterBase.java   Source Code and License 5 votes vote down vote up
public static float getBoostFromBooster(ItemStack stack)
{
	if (stack == null)
	{
		return Float.NaN;
	}

	for (Map.Entry<ItemStack, Float> entry : boosterRegistry.entrySet())
	{
		ItemStack tested = entry.getKey();
		if (tested.getMetadata() == OreDictionary.WILDCARD_VALUE)
		{
			if (tested.getItem() == stack.getItem())
			{
				return entry.getValue();
			}
		}
		else
		{
			if (tested.getItem() == stack.getItem() && tested.getMetadata() == stack.getMetadata())
			{
				return entry.getValue();
			}
		}
	}

	return Float.NaN;
}
 
Example 42
Project: harshencastle   File: HarshenUtils.java   Source Code and License 5 votes vote down vote up
public static ArrayList<ItemStack> getStacksWithWildCard(ItemStack wildCardStack)
  {
  	if(wildCardStack.getMetadata() != OreDictionary.WILDCARD_VALUE)
  		return toArray();
  	ArrayList<ItemStack> stackList = new ArrayList<>();
  	NonNullList<ItemStack> innerStacklist = NonNullList.create();
  	wildCardStack.getItem().getSubItems(CreativeTabs.SEARCH, innerStacklist);
for(ItemStack stack : innerStacklist)
	stackList.add(stack.copy());
return stackList;
  }
 
Example 43
Project: harshencastle   File: HarshenStack.java   Source Code and License 5 votes vote down vote up
/**
 * Can the input stack be used as an input item. Returns true if the stackList ({@link HarshenStack#getStackList})
 * contains the input item.
 * @param stack the stack to test with
 * @return true if the stack can be used, false if not
 */
public boolean containsItem(ItemStack stack)
{
	for(ItemStack innerStack :  getStackList())
		if(((innerStack.getMetadata() == OreDictionary.WILDCARD_VALUE ? innerStack.getItem() == stack.getItem() : innerStack.isItemEqual(stack)) && 
				(dependOnNBT ? ItemStack.areItemStackShareTagsEqual(innerStack, stack) : true)) || (innerStack.isEmpty() && stack.isEmpty()))
			return true;
	return false;
}
 
Example 44
Project: harshencastle   File: GuiXrayPendantScreen.java   Source Code and License 5 votes vote down vote up
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
	if(keyCode == Keyboard.KEY_TAB)
	{			this.textInput.setMaxStringLength(60);
	
		ArrayList<String> stringList = new ArrayList<>();
		if(dictonaryList.isEmpty())
		{
			stringList.addAll(CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), Block.REGISTRY.getKeys()));
			for(String s : HarshenUtils.getAllOreDictionaryList())
				for(ItemStack stack : OreDictionary.getOres(s))
					if(Block.getBlockFromItem(stack.getItem()) != Blocks.AIR)
						stringList.add(s);
			dictonaryList = CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), stringList);
		}
		if(!dictonaryList.isEmpty())
			this.textInput.setText(dictonaryList.get(timeOver++%dictonaryList.size()));
	}
	else
	{
		timeOver = 0;
		dictonaryList.clear();
	}
	
	if(keyCode == Keyboard.KEY_RETURN)
		closeGui();
	this.textInput.textboxKeyTyped(typedChar, keyCode);
	super.keyTyped(typedChar, keyCode);
}
 
Example 45
Project: WirelessRedstone   File: ModItems.java   Source Code and License 5 votes vote down vote up
public static void init() {
    itemWireless = new ItemWirelessPart().setCreativeTab(WirelessRedstone.creativeTab);
    GameRegistry.register(ModItems.itemWireless.setRegistryName("wireless_logic"));

    itemMaterial = new ItemMultiType(WirelessRedstone.creativeTab, "material").setUnlocalizedName("wrcbe:material");
    GameRegistry.register(itemMaterial);

    obsidianStick = itemMaterial.registerItem("obsidian_stick");
    stoneBowl = itemMaterial.registerItem("stone_bowl");
    retherPearl = itemMaterial.registerItem("rether_pearl");
    wirelessTransceiver = itemMaterial.registerItem("wireless_transceiver");
    blazeTransceiver = itemMaterial.registerItem("blaze_transceiver");
    receiverDish = itemMaterial.registerItem("receiver_dish");
    blazeReceiverDish = itemMaterial.registerItem("blaze_receiver_dish");

    OreDictionary.registerOre("obsidianRod", obsidianStick);
    OreDictionary.registerOre("stoneBowl", stoneBowl);

    itemTriangulator = new ItemWirelessTriangulator();
    GameRegistry.register(itemTriangulator.setRegistryName("triangulator"));
    itemRemote = new ItemWirelessRemote();
    GameRegistry.register(itemRemote.setRegistryName("remote"));
    itemSniffer = new ItemWirelessSniffer();
    GameRegistry.register(itemSniffer.setRegistryName("sniffer"));
    itemEmptyWirelessMap = new ItemEmptyWirelessMap();
    GameRegistry.register(itemEmptyWirelessMap.setRegistryName("empty_map"));
    itemWirelessMap = new ItemWirelessMap();
    GameRegistry.register(itemWirelessMap.setRegistryName("map"));
    itemTracker = new ItemWirelessTracker();
    GameRegistry.register(itemTracker.setRegistryName("tracker"));
    itemRep = new ItemREP();
    GameRegistry.register(itemRep.setRegistryName("rep"));
    itemPrivateSniffer = new ItemPrivateSniffer();
    GameRegistry.register(itemPrivateSniffer.setRegistryName("p_sniffer"));
}
 
Example 46
Project: UraniumBigReactor   File: UraniumBigReactorMod.java   Source Code and License 5 votes vote down vote up
@EventHandler
public void init(FMLPostInitializationEvent event)
{
    ReactorInterior.registerFluid("ic2coolant", 0.66F, 0.95F, 6F, IHeatEntity.conductivityDiamond);
    ReactorInterior.registerFluid("ic2uu_matter", 0.9F, 0.99F, 18F, IHeatEntity.conductivityDiamond);

    Reactants.registerReactant("uFuel", 0, 0x46c81a);
    Reactants.registerReactant("plutonium", 1, 0xaaaaaa);
    ReactorConversions.register("uFuel", "plutonium");

    Reactants.registerSolid("uraniumFuel", "uFuel");
    Reactants.registerSolid("tinyPlutonium", "plutonium");
    Item uraniumFuel = Item.getByNameOrId("ic2:nuclear");
    if(uraniumFuel != null)
    {
        OreDictionary.registerOre("uraniumFuel", uraniumFuel);
        OreDictionary.registerOre("tinyPlutonium", new ItemStack(uraniumFuel, 1, 7));
    }
    else
    {
        OreDictionary.registerOre("tinyPlutonium", new ItemStack(Item.getByNameOrId("bigreactors:ingotMetals"), 0, 1));
    }

    Fluid fluidUranium = FluidRegistry.getFluid("uraniumfuel");
    if(fluidUranium != null)
        Reactants.registerFluid(fluidUranium, "uFuel");
}
 
Example 47
Project: Metalworks   File: OreDictStack.java   Source Code and License 5 votes vote down vote up
public OreDictStack(String oreDictEntry){
    this.oreDictEntry = oreDictEntry;
    this.entries = OreDictionary.getOres(oreDictEntry);
    if(!this.entries.isEmpty()){
        this.primaryStack = this.entries.get(0);
    }
}
 
Example 48
Project: Metalworks   File: Registry.java   Source Code and License 5 votes vote down vote up
@SubscribeEvent
public static void registerMachineRecipes(RegistryEvent.Register<IMachineRecipe> event){
    IForgeRegistry<IMachineRecipe> reg = event.getRegistry();

    //Duster
    reg.register(new RecipeDuster("quartz_sand_dust", new OreDictStack("gemQuartz"), new OreDictStack("sand"), new ItemStack(quartzSandDust, 2), 0, 0));

    //Crusher
    reg.register(new RecipeCrusher("wool_string", new OreDictStack(new ItemStack(Blocks.WOOL, 1, OreDictionary.WILDCARD_VALUE)), new ItemStack(Items.STRING, 2), new ItemStack(Items.STRING), 50, 100, 50));
}
 
Example 49
Project: Got-Wood   File: RecipeRegistry.java   Source Code and License 5 votes vote down vote up
public static void addOredicts(String[] oreDictEntries, ItemStack itemStackName) {
	// for(int i = 0; i < oreDictEntries.length; i++)
	// 	OreDictionary.registerOre(oreDictEntries[i], itemStackName);
	for (final String oreDictEntry : oreDictEntries) {
		OreDictionary.registerOre(oreDictEntry, itemStackName);
	}
}
 
Example 50
Project: Geolosys   File: Geolosys.java   Source Code and License 5 votes vote down vote up
private void smeltSafely(ItemStack input, String oreDictName)
{
    try
    {
        GameRegistry.addSmelting(input, OreDictionary.getOres(oreDictName).get(0), 0.7F);
    }
    catch (IndexOutOfBoundsException | NullPointerException ex)
    {
        LOGGER.info(oreDictName + " has not been added already. Smelting has been skipped.");
    }
}
 
Example 51
Project: BetterBeginningsReborn   File: RegisterHelper.java   Source Code and License 5 votes vote down vote up
public static void registerSmelterConfigOreRecipe(String input, String output, float experience, int boosters, int bonus)
{
    for (ItemStack stack : OreDictionary.getOres(input, false))
    {
        List<ItemStack> valid = OreDictionary.getOres(output, false);
        if (!valid.isEmpty())
        {
            SmelterConfig.addRecipe(stack, valid.get(0), experience, boosters, bonus);
        }
    }
}
 
Example 52
Project: Thermionics   File: OreItems.java   Source Code and License 5 votes vote down vote up
public static final boolean matches(ItemStack template, ItemStack item) {
	boolean templatePresent = template!=null && !template.isEmpty();
	boolean itemPresent     = item!=null     && !item.isEmpty();
	if (!templatePresent &&  itemPresent) return false; // Empty    !=  NonEmpty
	if ( templatePresent && !itemPresent) return false; // NonEmpty !=  Empty
	if (!templatePresent && !itemPresent) return true;  // Empty    ==  Empty
	
	if (template.getItemDamage()==OreDictionary.WILDCARD_VALUE) {
		return ItemStack.areItemsEqualIgnoreDurability(template, item) &&
				ItemStack.areItemStackTagsEqual(template, item);
	} else {
		return ItemStack.areItemsEqual(template, item) &&
				ItemStack.areItemStackTagsEqual(template, item);
	}
}
 
Example 53
Project: Randores2   File: RandoresBlocks.java   Source Code and License 5 votes vote down vote up
public static void registerItems(IForgeRegistry<Item> registry) {
    for(Item item : blockItems) {
        registry.register(item);
        Randores.debug("Registered " + item.getUnlocalizedName());
    }
    OreDictionary.registerOre("torch", RandoresBlocks.torchItem);
}
 
Example 54
Project: customstuff4   File: OreDictionaryEntryTests.java   Source Code and License 5 votes vote down vote up
@Test
public void testRegistersEntry()
{
    OreDictionaryEntry entry = gson.fromJson("{ \"oreClass\": \"someEntry\", \"item\":\"minecraft:coal\" }", OreDictionaryEntry.class);
    entry.init(InitPhase.PRE_INIT, new TestContentHelper("{}", BlankContent.class));

    assertTrue(OreDictionary.doesOreNameExist("someEntry"));
    assertTrue(OreDictionary.containsMatch(true, OreDictionary.getOres("someEntry"), new ItemStack(Items.COAL)));
}
 
Example 55
Project: Prospecting   File: OreDictCache.java   Source Code and License 5 votes vote down vote up
public static ItemStack getNuggetFromName(String name) {
	if (name.equals("Redstone")) {
		return OreDictionary.getOres("dust" + name).get(0);
	} else {
		return OreDictionary.getOres("nugget" + name).get(0);
	}
}
 
Example 56
Project: ModularMachinery   File: ComponentRequirement.java   Source Code and License 5 votes vote down vote up
@Override
public boolean finishCrafting(MachineComponent component, RecipeCraftingContext context, ResultChance chance) {
    if(component.getComponentType() != MachineComponent.ComponentType.ITEM ||
            !(component instanceof MachineComponent.ItemBus) ||
            component.getIOType() != getActionType()) return false;

    if(fuelBurntime > 0 && oreDictName == null && required.isEmpty()) {
        throw new IllegalStateException("Can't output fuel burntime...");
    }
    IItemHandlerModifiable handler = context.getItemHandler(component);
    switch (getActionType()) {
        case OUTPUT:
            ItemStack stack;
            if(oreDictName != null) {
                stack = Iterables.getFirst(OreDictionary.getOres(oreDictName), ItemStack.EMPTY);
                stack = ItemUtils.copyStackWithSize(stack, this.oreDictItemAmount);
            } else {
                stack = ItemUtils.copyStackWithSize(required, this.countIOBuffer);
            }

            if(stack.isEmpty()) {
                return true;
            }
            if(tag != null) {
                stack.setTagCompound(tag);
            }
            //If we don't produce the item, we only need to see if there would be space for it at all.
            int inserted = ItemUtils.tryPlaceItemInInventory(stack.copy(), handler, true);
            if(chance.canProduce(this.chance)) {
                return inserted > 0;
            }
            if(inserted > 0) {
                int actual = ItemUtils.tryPlaceItemInInventory(stack.copy(), handler, false);
                this.countIOBuffer -= actual;
                return this.countIOBuffer <= 0;
            }
            return false;
    }
    return false;
}
 
Example 57
Project: GardenStuff   File: ModItems.java   Source Code and License 5 votes vote down vote up
@SubscribeEvent
public static void registerRecipes (RegistryEvent.Register<IRecipe> event) {
    IForgeRegistry<IRecipe> registry = event.getRegistry();

    OreDictionary.registerOre("ingotWroughtIron", EnumMaterial.WROUGHT_IRON_INGOT.getItemStack(material));
    OreDictionary.registerOre("nuggetWroughtIron", EnumMaterial.WROUGHT_IRON_NUGGET.getItemStack(material));
    OreDictionary.registerOre("materialWax", EnumMaterial.WAX.getItemStack(material));
    OreDictionary.registerOre("materialPressedWax", EnumMaterial.WAX.getItemStack(material));

    GameRegistry.addSmelting(EnumMaterial.CANDELILLA.getItemStack(material), EnumMaterial.WAX.getItemStack(material), 0);
}
 
Example 58
Project: ExPetrum   File: BlockBerryBush.java   Source Code and License 5 votes vote down vote up
@Override
public void registerOreDictNames()
{
	Stream.of(ExPOreDict.blockShrub).forEach(s -> { 
		OreDictionary.registerOre(s, new ItemStack(this, 1, OreDictionary.WILDCARD_VALUE)); 
		AtomicInteger i = new AtomicInteger(0);
		Stream.of(ExPOreDict.berryNames).forEach(ss -> OreDictionary.registerOre(s + Character.toUpperCase(ss.charAt(0)) + ss.substring(1), new ItemStack(this, 1, i.getAndIncrement())));
	});
}
 
Example 59
Project: CharcoalPit   File: PotteryKilnRecipe.java   Source Code and License 5 votes vote down vote up
public static boolean isValidInput(ItemStack stack){
	if(stack.isEmpty())
		return false;
	for(int i=0;i<recipes.size();i++){
		if(OreDictionary.itemMatches(stack, recipes.get(i).input, false))
			return true;
	}
	return false;
}
 
Example 60
Project: CharcoalPit   File: PotteryKilnRecipe.java   Source Code and License 5 votes vote down vote up
public static ItemStack getResult(ItemStack in){
	if(in.isEmpty())
		return ItemStack.EMPTY;
	for(int i=0;i<recipes.size();i++){
		if(OreDictionary.itemMatches(in, recipes.get(i).input, false)){
			return recipes.get(i).output.copy();
		}
	}
	return ItemStack.EMPTY;
}