diff --git a/.gitignore b/.gitignore index 4209ddd..4801756 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,10 @@ config/xaeroworldmap.txt config/xaerominimap_entities.json config/sidebar_buttons.json +config/Mekanism/general.toml +config/appliedenergistics2-client.toml +config/blame-forge.properties + TrashSlotSaveState.json WailaErrorOutput.txt diff --git a/scripts/config_cleaner.py b/scripts/config_cleaner.py new file mode 100644 index 0000000..42b8352 --- /dev/null +++ b/scripts/config_cleaner.py @@ -0,0 +1,23 @@ +import os + +MODIDS = ['abnormals_core', 'abnormals_delight', 'ae2wtlib', 'aeinfinitybooster', 'akashictome', 'alexsmobs', 'alloyed', 'appliedenergistics2', 'architectury', 'atmospheric', 'attributefix', 'autoreglib', 'autumnity', 'betterbiomeblend', 'betterdungeons', 'betterendforge', 'betternether', 'betterstrongholds', 'bigbrain', 'blame', 'botania', 'brandonscore', 'buildinggadgets', 'buzzier_bees', 'cabletiers', 'caelus', 'catalogue', 'cavern', 'cb_microblock', 'cb_multipart', 'cb_multipart_minecraft', 'chickenchunks', 'chipped', 'citadel', 'cloth-config', 'clumps', 'codechickenlib', 'cofh_core', 'collective', 'compactmachines', 'computercraft', 'configured', 'connectedglass', 'controlling', 'corail_woodcutter', 'cosmeticarmorreworked', 'crafttweaker', 'create', 'createaddition', 'createdeco', 'creeperconfetti', 'ctm', 'cucumber', 'curios', 'curiouselytra', 'customizableelytra', 'damagetilt', 'decorative_blocks', 'decorative_blocks_abnormals', 'diagonalfences', 'doomangelring', 'doubleslabs', 'draconicevolution', 'dsurround', 'emendatusenigmatica', 'enderstorage', 'enhanced_mushrooms', 'entangled', 'environs', 'extcaves', 'extendedcrafting', 'extlights', 'farmersdelight', 'fastbench', 'fastleafdecay', 'fluxnetworks', 'flywheel', 'forge', 'framedblocks', 'framedcompactdrawers', 'ftblibrary', 'ftbquests', 'ftbteams', 'gamestages', 'glassential', 'gravestone', 'immersiveengineering', 'immersivepetroleum', 'immersiveposts', 'improvedbackpacks', 'industrialforegoing', 'infernalexp', 'invtweaks', 'itemfilters', 'jade', 'jei', 'jeitweaker', 'kiwi', 'konkrete', 'kotlinforforge', 'kubejs', 'kubejs_create', 'kubejs_immersive_engineering', 'kubejs_mekanism', 'kubejs_thermal', 'lollipop', 'lootr', 'mantle', 'mcjtylib', 'mcwlights', 'mcwpaintings', 'mekanism', 'mekanismgenerators', 'mekanismtools', 'mgui', 'mightyarchitect', 'minecraft', 'mobeffects', 'modularrouters', 'morecreatestuffs', 'moreminecarts', 'moreoverlays', 'morphtool', 'mousetweaks', 'movingelevators', 'natural-progression', 'naturescompass', 'oauth', 'observerlib', 'overloadedarmorbar', 'passablefoliage', 'patchouli', 'pipez', 'placebo', 'portable_stonecutter', 'powah', 'projectred-core', 'projectred-illumination', 'projectred-integration', 'projectred-transmission', 'quantumquarryplus', 'quark', 'rad', 'rangedpumps', 'redstone_arsenal', 'refinedstorage', 'refinedstorageaddons', 'repurposed_structures', 'rftoolsbase', 'rhino', 'rsinfinitybooster', 'rsrequestify', 'savageandravage', 'scannable', 'selene', 'sewingkit', 'shutupexperimentalsettings', 'sndctrl', 'snowrealmagic', 'spark', 'steampowered', 'stoneholm', 'storage_overhaul', 'storagedrawers', 'storagenetwork', 'supermartijn642configlib', 'supermartijn642corelib', 'supplementaries', 'tconstruct', 'terraforged', 'tetra', 'theoneprobe', 'thermal', 'thermal_expansion', 'thermal_foundation', 'thermal_innovation', 'thermal_locomotion', 'titanium', 'toolbelt', 'tools_complement', 'torchmaster', 'torchslabmod', 'totw_additions', 'toughnessbar', 'towers_of_the_wild', 'trashcans', 'trashslot', 'treechop', 'upgrade_aquatic', 'upstream', 'valhelsia_core', 'valhelsia_structures', 'vtweaks', 'waila', 'waystones', 'windowlogging', 'wormhole', 'xaerominimapfair', 'xaeroworldmap', 'xnet', 'xnetgases', 'yungsapi', 'yungsextras'] + + +def main() -> None: + """ The main runfunc """ + culprits = [] + + for fn in os.listdir('./config'): + matched_to_modid = False + for modid in MODIDS: + if modid in fn.lower(): + matched_to_modid = True + break + if not matched_to_modid: + culprits.append(f"\t{fn}\n") + + print("Found the following possible unused config files:") + print("".join(culprits)) + +if __name__ == "__main__": + main() diff --git a/scripts/modid_lister.py b/scripts/modid_lister.py new file mode 100644 index 0000000..1370910 --- /dev/null +++ b/scripts/modid_lister.py @@ -0,0 +1,42 @@ +""" +@author: Jose Stovall | oitsjustjose @ github | twitter | anywhere really +A tool for inspecting your mods folder to give you a list of all mod_id's in your pack +""" + +import os +import sys +import zipfile + +def main() -> None: + """ The main runfunction of this file """ + all_modids = [] + for root, dir, files in os.walk("./mods"): + for file in files: + if not file.endswith(".jar"): + continue + temmolds = [] + zip_fh = zipfile.ZipFile(f"{root}/{file}", "r") + for zip_item in zip_fh.infolist(): + if zip_item.filename.endswith("mods.toml"): + temmolds.append(zip_item) + + for toml in temmolds: + data = zip_fh.read(toml).decode("utf-8").lower() + idx = data.index("modid") + while idx: + try: + start = data[idx:] + end = start.index("\n") + modid = start[:end] + all_modids.append(modid) + data = start[end:] + idx = data.index("modid") + except ValueError: + idx = None + all_modids = list(map(lambda x: x.replace("modid", "").replace("=", "").replace(" ", "").replace('"', "").replace("'", "").replace("#mandatory", "").replace(".dependenciesareoptional.", "").replace("ofthemod", "").replace("ofthedependency", "").strip(), all_modids)) + all_modids = list(filter(lambda x: x, all_modids)) + all_modids = list(set(all_modids)) + print(sorted(all_modids)) + +if __name__ == "__main__": + main()