[Usefull Class] A class to remove a recipe from the game without changing the vanilla mod file

Kirthos

Gold
Trusted Dev
Mod Dev
Messages
152
Likes
77
#1
Hello everyone,
There is many modder that remove some vanilla recipe, or sometime just change some vanilla recipe
But removing a vanilla recipe means changing the default vanilla file and it's a pain to update at each update of eco.
Or when there is 2 different mods that want to change the same file.
The solution is to remove the vanilla recipe from the game then add another recipe with your ingredients from your mods instead of changing the vanilla file.

This is a small class, you just need to copy it inside your project and call the function inside the initialize function of your mod plugin.
The class is available on my github: https://github.com/Kirthos/KirthosMods/blob/master/Usefull class/RecipeRemover.cs

I will try to add this class inside asphalt MDK for the next release but if people want to add the file as a standalone directly inside their mods it's possible, but remember if 2 mods add it that can make problem (think about changing the namespace if you wish to prevent this problem)

After adding the file to your mod you just need to do this (don't forget using the namespace) inside your mod plugin class

C#:
public void Initialize(TimedTask timer)
{
    RecipeRemover.RemoveRecipe(typeof(IronIngotRecipe));
    RecipeRemover.RemoveRecipe(typeof(SmeltIronRecipe));
}
Enjoy, and hope that will permit modder to make awesome mods.
If you have any question about how it work you can ask me on discord.
 
Messages
1
Likes
0
#3
Hello, Kirthos.
I'm using your RecipeRemover and it works as amazingly.

Today, I've found a bit more thing to be removed in addition to your RecipeRemover.
I share it with you.

I'm not expert for LINQ, so shortly:
SkillModifiedValueManager.skillBenefits.TryGetValue(typeof(Recipe.Ingredients.First.skillType), out)
returns recipe even after remove.

20181017232234_1.jpg
( I took this after removed SmeltIronRecipe )

I hope this helps. :)
 
OP
OP
Kirthos

Kirthos

Gold
Trusted Dev
Mod Dev
Messages
152
Likes
77
#4
Hello, Kirthos.
I'm using your RecipeRemover and it works as amazingly.

Today, I've found a bit more thing to be removed in addition to your RecipeRemover.
I share it with you.

I'm not expert for LINQ, so shortly:
SkillModifiedValueManager.skillBenefits.TryGetValue(typeof(Recipe.Ingredients.First.skillType), out)
returns recipe even after remove.

View attachment 878
( I took this after removed SmeltIronRecipe )

I hope this helps. :)
Thanks for your feedback, seems the reference for the recipe is keep in another place, I need to add the code to remove it.
I will try to make a update to fix this issue
 
OP
OP
Kirthos

Kirthos

Gold
Trusted Dev
Mod Dev
Messages
152
Likes
77
#5
Hey everyone.
I've updated the recipe remover class to take care of the skill benefits tooltip like what @Alphado-Jaki report.
If you have other issue with the class don't hesitate to send a message.
Just copy the new version on my github.
 
Top Bottom