use of shcm.shsupercm.fabric.citresewn.ActiveCITs in project CITResewn by SHsuperCM.
the class ModelLoaderMixin method initCITs.
@Inject(method = "addModel", at = @At("TAIL"))
public void initCITs(ModelIdentifier eventModelId, CallbackInfo ci) {
if (eventModelId != ModelLoader.MISSING_ID)
return;
if (CITResewn.INSTANCE.activeCITs != null) {
info("Clearing active CITs..");
CITResewn.INSTANCE.activeCITs.dispose();
CITResewn.INSTANCE.activeCITs = null;
}
if (!CITResewnConfig.INSTANCE().enabled)
return;
info("Parsing CITs...");
List<CITPack> parsedPacks = CITParser.parseCITs(resourceManager.streamResourcePacks().collect(Collectors.toCollection(ArrayList::new)));
List<CIT> parsed = parsedPacks.stream().flatMap(pack -> pack.cits.stream()).collect(Collectors.toCollection(ArrayList::new));
if (parsed.size() > 0) {
info("Activating CITs...");
CITResewn.INSTANCE.activeCITs = new ActiveCITs(parsedPacks, parsed);
} else
info("No cit packs found.");
}
Aggregations