diff --git a/lib/src/main/java/net/tomatentum/marinara/Marinara.java b/lib/src/main/java/net/tomatentum/marinara/Marinara.java index bc04316..cbed606 100644 --- a/lib/src/main/java/net/tomatentum/marinara/Marinara.java +++ b/lib/src/main/java/net/tomatentum/marinara/Marinara.java @@ -1,24 +1,13 @@ package net.tomatentum.marinara; -import java.lang.reflect.Constructor; - import net.tomatentum.marinara.registry.InteractionRegistry; import net.tomatentum.marinara.wrapper.LibraryWrapper; public class Marinara { - public static Marinara load(Class clazz) { - try { - Constructor ctor = clazz.getConstructor(); - ctor.setAccessible(true); - T wrapper = ctor.newInstance(); - InteractionRegistry registry = new InteractionRegistry(wrapper); - return new Marinara(registry); - }catch (Exception ex) { - System.err.println(ex); - System.exit(100); - return null; - } + public static Marinara load(LibraryWrapper wrapper) { + InteractionRegistry registry = new InteractionRegistry(wrapper); + return new Marinara(registry); } private InteractionRegistry registry;