Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Aug 20, 2023
1 parent b620aa8 commit c67f86a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static boolean classExists(String className) {
Class.forName(className, false, classLoader);//不初始化加载class
return true;
} catch (ClassNotFoundException exception) {
return false;//不抛出异常返回false
return false;//抛出异常返回false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,15 @@ public static Class<?> getEventTriggerClass() {
public static void init(String an) {
Class<?> clazz = getEventTriggerClass();
try {
if (clazz == Class.forName("io.github.minecraftchampions.dodoopenjava.event.websocket.EventTrigger")) {
getEventTriggerClass().getMethod("main", String.class).invoke(null, an);
} else {
getEventTriggerClass().getMethod("main").invoke(null);
}
Class.forName("io.github.minecraftchampions.dodoopenjava.event.websocket.EventTrigger");
getEventTriggerClass().getMethod("main", String.class).invoke(null, an);
} catch (ClassNotFoundException | InvocationTargetException | IllegalAccessException |
NoSuchMethodException e) {
e.printStackTrace();
try {
getEventTriggerClass().getMethod("main").invoke(null);
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
throw new RuntimeException(ex);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void setPath(String path) {
*
* @param port 端口
*/
public void setPort(int port) {
public static void setPort(int port) {
BotManage.port = port;
}

Expand Down
24 changes: 6 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<revision>2.5.7</revision>
<revision>2.5.8</revision>
</properties>

<groupId>io.github.minecraftchampions.dodoopenjava</groupId>
Expand Down Expand Up @@ -81,6 +81,11 @@
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</configuration>
</plugin>

Expand Down Expand Up @@ -113,23 +118,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit c67f86a

Please sign in to comment.