/**
* Retrieve the current class source.
* @return The class source.
*/
private static ClassSource getClassSource() {
ErrorReporter reporter = ProtocolLibrary.getErrorReporter();
// Lazy pattern again
if (classSource == null) {
// Attempt to use MCPC
try {
return classSource = new RemappedClassSource().initialize();
} catch (RemapperUnavaibleException e) {
if (e.getReason() != Reason.MCPC_NOT_PRESENT)
reporter.reportWarning(MinecraftReflection.class, Report.newBuilder(REPORT_CANNOT_FIND_MCPC_REMAPPER));
} catch (Exception e) {
reporter.reportWarning(MinecraftReflection.class, Report.newBuilder(REPORT_CANNOT_LOAD_CPC_REMAPPER));
}
// Just use the default class loader
classSource = ClassSource.fromClassLoader();
}