mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-02 21:41:28 +01:00
Merge PR #596 from PyvesB/aach to 4.3.3
* Updated hook to use new Advanced Achievements API Maven artifact * Removed spurious tab
This commit is contained in:
parent
bd06c709f8
commit
3412968039
@ -69,6 +69,10 @@
|
|||||||
<id>placeholderapi</id>
|
<id>placeholderapi</id>
|
||||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>advanced-achievements-repo</id>
|
||||||
|
<url>https://raw.github.com/PyvesB/AdvancedAchievements/mvn-repo/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -94,9 +98,9 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.hm</groupId>
|
<groupId>com.hm.achievement</groupId>
|
||||||
<artifactId>advanced.achievements</artifactId>
|
<artifactId>advanced-achievements-api</artifactId>
|
||||||
<version>5.2</version>
|
<version>1.0.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -2,11 +2,10 @@ package com.djrapitops.pluginbridge.plan.advancedachievements;
|
|||||||
|
|
||||||
import com.djrapitops.plan.data.plugin.HookHandler;
|
import com.djrapitops.plan.data.plugin.HookHandler;
|
||||||
import com.djrapitops.pluginbridge.plan.Hook;
|
import com.djrapitops.pluginbridge.plan.Hook;
|
||||||
import com.hm.achievement.AdvancedAchievements;
|
|
||||||
import com.hm.achievement.api.AdvancedAchievementsAPI;
|
import com.hm.achievement.api.AdvancedAchievementsAPI;
|
||||||
import com.hm.achievement.api.AdvancedAchievementsBukkitAPI;
|
import com.hm.achievement.api.AdvancedAchievementsAPIFetcher;
|
||||||
|
|
||||||
import static org.bukkit.plugin.java.JavaPlugin.getPlugin;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Class responsible for hooking to AdvancedAchievements and registering 2
|
* A Class responsible for hooking to AdvancedAchievements and registering 2
|
||||||
@ -29,12 +28,12 @@ public class AdvancedAchievementsHook extends Hook {
|
|||||||
super("com.hm.achievement.AdvancedAchievements", hookH);
|
super("com.hm.achievement.AdvancedAchievements", hookH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void hook() throws NoClassDefFoundError {
|
public void hook() throws NoClassDefFoundError {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
AdvancedAchievements aa = getPlugin(AdvancedAchievements.class);
|
Optional<AdvancedAchievementsAPI> aaAPI = AdvancedAchievementsAPIFetcher.fetchInstance();
|
||||||
if (Integer.parseInt(Character.toString(aa.getDescription().getVersion().charAt(0))) >= 5) {
|
if (aaAPI.isPresent()) {
|
||||||
AdvancedAchievementsAPI aaAPI = AdvancedAchievementsBukkitAPI.linkAdvancedAchievements();
|
addPluginDataSource(new AdvancedAchievementsData(aaAPI.get()));
|
||||||
addPluginDataSource(new AdvancedAchievementsData(aaAPI));
|
|
||||||
} else {
|
} else {
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user