Jump to content

[1.7.2] [Solved] How to override/remove vanilla recipes


SackCastellon

Recommended Posts

I know the code to override/remove vanilla recipes on 1.6.4 and prior was:

List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();

Iterator<IRecipe> Leash = recipes.iterator();
	          
while (Leash.hasNext()) {
	ItemStack is = Leash.next().getRecipeOutput();
	if (is != null && is.itemID == Items.lead.itemID)
		Leash.remove();
};

 

But how in 1.7.2 there aren't ID this code doesn't work.

 

Somebody know how to remove recipes now?

 

Thanks for helping  :)

 

 

SOLUTION:

 

List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();

Iterator<IRecipe> Leash = recipes.iterator();
	          
while (Leash.hasNext()) {
	ItemStack is = Leash.next().getRecipeOutput();
	if (is != null && is.getItem() == Items.lead)
		Leash.remove();
};

Link to comment
Share on other sites

is.getItem() == Items.lead ?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • 7 months later...
  • 3 years later...
On 12/31/2013 at 6:19 PM, SackCastellon said:

I know the code to override/remove vanilla recipes on 1.6.4 and prior was:

 


List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();

Iterator<IRecipe> Leash = recipes.iterator();
	          
while (Leash.hasNext()) {
	ItemStack is = Leash.next().getRecipeOutput();
	if (is != null && is.itemID == Items.lead.itemID)
		Leash.remove();
};
 

 

 

But how in 1.7.2 there aren't ID this code doesn't work.

 

Somebody know how to remove recipes now?

 

Thanks for helping  :)

 

 

SOLUTION:

 

 


List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();

Iterator<IRecipe> Leash = recipes.iterator();
	          
while (Leash.hasNext()) {
	ItemStack is = Leash.next().getRecipeOutput();
	if (is != null && is.getItem() == Items.lead)
		Leash.remove();
};
 

 

 

On 8/15/2014 at 9:57 PM, imadnsn said:

For blocks, you do:

 


if (is != null && is.getItem() ==Item.getItemFromBlock(theBlock))
 

 

You helped me a lot ... Thank you guys :D

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.