Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Asintotoo authored Jul 19, 2024
1 parent 6dab401 commit 2271ff8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.asintoto</groupId>
<artifactId>Basic</artifactId>
<version>1.2.6</version>
<version>1.2.7</version>
<packaging>jar</packaging>

<name>Basic</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static void registerAll() {
}

//Register Basic Commands
if (clazz.getSuperclass() == BasicCommand.class) {
if (isChildClassOf(clazz, BasicCommand.class)) {
try {
Constructor constructor = clazz.getConstructor();
Object object = constructor.newInstance();
Expand All @@ -133,4 +133,10 @@ public static void registerAll() {
}
}
}

private static boolean isChildClassOf(Class<?> child, Class<?> parent) {
if(child == null) return false;
if(child.getSuperclass() == parent) return true;
return isChildClassOf(child.getSuperclass(), parent);
}
}

0 comments on commit 2271ff8

Please sign in to comment.