import pickle,collections,re,json D=pickle.load(open("data.pkl","rb")); A=pickle.load(open("active.pkl","rb")); tc=A["tagcache"] models=D["models"] name={} for k,v in D["lang"].items(): _,ns,p=k.split("."); name.setdefault(ns+":"+p,v[0][1]) spec=collections.defaultdict(set) for t,s in tc.items(): if t.startswith("c:") and "/" in t and len(s)<=8: for i in s: spec[i].add(t) new=set("""extradelight moredelight rusticdelight dungeonsdelight frightsdelight fruitsdelight minersdelight veggiesdelight overweight_farming barbequesdelight fishermans_haven fowlplay etched music_disc_maker too_many_bows mermod tarotcards chalk charta comforts petcemetery friendsandfoes""".split()) def norm(n): return re.sub(r'[^a-z]','',n.lower()) by=collections.defaultdict(set) for i,n in name.items(): if i in models and isinstance(n,str) and "spawn_egg" not in i and not i.startswith(("sophisticated",)): by[norm(n)].add(i) # also group by registry path for i in models: p=i.split(":")[1] if len(p)>3: by["path:"+p].add(i) seen=set() for k,s in sorted(by.items()): nss={i.split(":")[0] for i in s} if len(nss)<2 or "minecraft" in nss or not (nss&new): continue key=frozenset(s) if key in seen: continue seen.add(key) s=sorted(s); common=set.intersection(*[spec.get(i,set()) for i in s]) print(("UNIFIED " if common else "SPLIT ")+name.get(s[0],s[0])+": "+", ".join(s)+((" via "+",".join(sorted(common))) if common else ""))