Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crafttweaker.item.IItemStack;
- import crafttweaker.oredict.IOreDict;
- # Ore dictionary list to unify
- var oreDictToCompare = ["oreIron","nuggetGold","ore:dustWheat","ore:ingotCopper"] as string[];
- # Mod priority list in order
- val priorityList = ["vanilla","mod1","mod2","mod3"] as string[];
- # Variable setup
- val foundPriorityItem = 0;
- val PriorityItem = null;
- # Iterate through oreDictToCompare
- for oreDictList in oreDictToCompare {
- # write all of current ore dictionary entries out of oreDictToCompare to it's own array
- val oreDictEntries = oreDict.get(oreDictList);
- # Iterate through the current oreDictEntries items list
- for item in oreDictEntries {
- # Write current oreDictEntry mod name to variable if the priority item hasn't been found yet.
- if (foundPriorityItem == 0)
- val oreDictEntryModName = baseMod.item;
- # If the priority item has been found, replace the rest of the item's recipes in the whole oreDictEntries to the priority item.
- if (foundPriorityItem == 1)
- recipes.replaceAllOccurences(item, PriorityItem);
- # Iterate through priorityList with the found mod name to determine if that item is the item to be used in all recipes.
- else
- for c in priorityList {
- if (oreDictEntryModName == c)
- recipes.replaceAllOccurences(oreDict, item);
- PriorityItem = item;
- foundPriorityItem = 1;
- break;
- }
- # If no priority item is found just skip and inform?
- if (foundPriorityItem = 0)
- print("No additional items found for "&oreDictEntries);
- break;
- }
- # Reset for next oreDictToCompare entry
- foundPriorityItem = 0;
- PriorityItem = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment