use of logisticspipes.proxy.interfaces.ILPPipeConfigToolWrapper in project LogisticsPipes by RS485.
the class LogisticsWrapperHandler method getWrappedPipeConfigToolWrapper.
public static ILPPipeConfigToolWrapper getWrappedPipeConfigToolWrapper(String clazz, String name, Class<? extends ILPPipeConfigToolWrapper> providerClass) {
ILPPipeConfigToolWrapper wrapper = null;
Throwable e = null;
try {
Class.forName(clazz);
try {
wrapper = providerClass.newInstance();
} catch (Exception e1) {
if (e1 instanceof VersionNotSupportedException) {
throw (VersionNotSupportedException) e1;
}
e1.printStackTrace();
e = e1;
} catch (NoClassDefFoundError e1) {
e1.printStackTrace();
e = e1;
}
} catch (NoClassDefFoundError | ClassNotFoundException ignored) {
}
GenericLPPipeConfigToolWrapper instance = new GenericLPPipeConfigToolWrapper(wrapper, name);
if (wrapper != null) {
LogisticsPipes.log.info("Loaded " + name + " PipeConfigToolWrapper");
} else {
if (e != null) {
instance.setState(WrapperState.Exception);
instance.setReason(e);
LogisticsPipes.log.info("Couldn't load " + name + " PipeConfigToolWrapper");
} else {
LogisticsPipes.log.info("Didn't load " + name + " PipeConfigToolWrapper");
instance.setState(WrapperState.ModMissing);
}
}
LogisticsWrapperHandler.wrapperController.add(instance);
return instance;
}
Aggregations