use of logisticspipes.proxy.interfaces.IGenericProgressProvider in project LogisticsPipes by RS485.
the class LogisticsWrapperHandler method getWrappedProgressProvider.
public static IGenericProgressProvider getWrappedProgressProvider(String modId, String name, Class<? extends IGenericProgressProvider> providerClass) {
IGenericProgressProvider provider = null;
Throwable e = null;
if (ModStatusHelper.isModLoaded(modId)) {
try {
provider = providerClass.newInstance();
} catch (Exception e1) {
if (e1 instanceof VersionNotSupportedException) {
throw (VersionNotSupportedException) e1;
}
e1.printStackTrace();
e = e1;
} catch (NoClassDefFoundError e1) {
e1.printStackTrace();
e = e1;
}
}
GenericProgressProviderWrapper instance = new GenericProgressProviderWrapper(provider, modId + ": " + name);
if (provider != null) {
LogisticsPipes.log.info("Loaded " + modId + ", " + name + " ProgressProvider");
} else {
if (e != null) {
instance.setState(WrapperState.Exception);
instance.setReason(e);
LogisticsPipes.log.info("Couldn't load " + modId + ", " + name + " ProgressProvider");
} else {
LogisticsPipes.log.info("Didn't load " + modId + ", " + name + " ProgressProvider");
instance.setState(WrapperState.ModMissing);
}
}
instance.setModId(modId);
LogisticsWrapperHandler.wrapperController.add(instance);
return instance;
}
Aggregations