mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-15 05:41:51 +08:00
[Fix] IllegalStateException on test, DiscordSRV version
This commit is contained in:
parent
b9027294ef
commit
6cd77fd7fd
Binary file not shown.
@ -87,7 +87,7 @@
|
||||
</repository>
|
||||
<repository>
|
||||
<id>discordsrv-repo</id>
|
||||
<url>https://ci.scarsz.me/plugin/repository/everything/</url>
|
||||
<url>https://nexus.scarsz.me/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@ -183,8 +183,8 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>github.scarsz.discordsrv</groupId>
|
||||
<artifactId>DiscordSRV</artifactId>
|
||||
<groupId>com.discordsrv</groupId>
|
||||
<artifactId>discordsrv</artifactId>
|
||||
<version>1.16.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
@ -23,7 +23,7 @@ public abstract class Hook {
|
||||
*
|
||||
* @param pluginClass Class path string of the plugin's main JavaPlugin class.
|
||||
*/
|
||||
protected Hook(String pluginClass) {
|
||||
public Hook(String pluginClass) {
|
||||
enabled = Check.isAvailable(pluginClass);
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public abstract class Hook {
|
||||
/**
|
||||
* Constructor to set enabled to false.
|
||||
*/
|
||||
protected Hook() {
|
||||
public Hook() {
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.djrapitops.pluginbridge.plan.sponge;
|
||||
|
||||
import com.djrapitops.plan.data.plugin.HookHandler;
|
||||
import com.djrapitops.plugin.logging.L;
|
||||
import com.djrapitops.plugin.logging.error.ErrorHandler;
|
||||
import com.djrapitops.pluginbridge.plan.Hook;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.service.economy.EconomyService;
|
||||
@ -19,7 +21,9 @@ import java.util.Optional;
|
||||
public class SpongeEconomyHook extends Hook {
|
||||
|
||||
@Inject
|
||||
public SpongeEconomyHook() {
|
||||
public SpongeEconomyHook(
|
||||
ErrorHandler errorHandler
|
||||
) {
|
||||
super("org.spongepowered.api.Sponge");
|
||||
|
||||
try {
|
||||
@ -27,6 +31,8 @@ public class SpongeEconomyHook extends Hook {
|
||||
enabled = serviceOpt.isPresent();
|
||||
} catch(NoClassDefFoundError e) {
|
||||
enabled = false;
|
||||
} catch (IllegalStateException e) {
|
||||
errorHandler.log(L.WARN, this.getClass(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user