FueledByOCHD Posted September 9, 2020 Share Posted September 9, 2020 (edited) Hello all. I'm working on a mod which rearranges some of the crafting recipes as well changes the name of them. I tried to impliment my own custom code but for some reason the changes are not working So maybe someone here can tell me what i'm doing wrong, [Working with the latest stable build] Here is the framework code for Recipes Please do not nag about naming convention of function. (I am a Self taught c# Developer) [spoiler][code] -- Recipies Realms.Framework.Recipes={}; Realms.Framework.Recipes.Rename=function(name,newName) for i=0,allRecipes:size()-1 do local recipe=GetAll():get(i); if recipe.name==name then recipe.name=newName; break; end end end Realms.Framework.Recipes.Remove=function(name) for i=0,allRecipes:size()-1 do local recipe=GetAll():get(i); if recipe.name==name then GetAll().remove(i); break; end end end Realms.Framework.Recipes.GetAll=function() return getAllRecipes(); end [/code][/spoiler] Now here is the useage of the code [spoiler] [code] require "Realms/Realms" require "Realms/Core" if not Realms then Realms.Framework.Recipes.Remove("Make Four-Log Stack"); Realms.Framework.Recipes.Remove("Make Three-Log Stack"); Realms.Framework.Recipes.Remove("Make Two-Log Stack"); else end [/code] [/spoiler] Edited September 9, 2020 by FueledByOCHD Link to comment Share on other sites More sharing options...
FueledByOCHD Posted September 9, 2020 Author Share Posted September 9, 2020 Ok, so I figured out some of my issues where a mix of Files in wrong spot, misspelling (this will be a killer for me alot) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now