mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08: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>
|
||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>advanced-achievements-repo</id>
|
||||
<url>https://raw.github.com/PyvesB/AdvancedAchievements/mvn-repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -94,9 +98,9 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hm</groupId>
|
||||
<artifactId>advanced.achievements</artifactId>
|
||||
<version>5.2</version>
|
||||
<groupId>com.hm.achievement</groupId>
|
||||
<artifactId>advanced-achievements-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -2,11 +2,10 @@ package com.djrapitops.pluginbridge.plan.advancedachievements;
|
||||
|
||||
import com.djrapitops.plan.data.plugin.HookHandler;
|
||||
import com.djrapitops.pluginbridge.plan.Hook;
|
||||
import com.hm.achievement.AdvancedAchievements;
|
||||
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
|
||||
@ -29,12 +28,12 @@ public class AdvancedAchievementsHook extends Hook {
|
||||
super("com.hm.achievement.AdvancedAchievements", hookH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hook() throws NoClassDefFoundError {
|
||||
if (enabled) {
|
||||
AdvancedAchievements aa = getPlugin(AdvancedAchievements.class);
|
||||
if (Integer.parseInt(Character.toString(aa.getDescription().getVersion().charAt(0))) >= 5) {
|
||||
AdvancedAchievementsAPI aaAPI = AdvancedAchievementsBukkitAPI.linkAdvancedAchievements();
|
||||
addPluginDataSource(new AdvancedAchievementsData(aaAPI));
|
||||
Optional<AdvancedAchievementsAPI> aaAPI = AdvancedAchievementsAPIFetcher.fetchInstance();
|
||||
if (aaAPI.isPresent()) {
|
||||
addPluginDataSource(new AdvancedAchievementsData(aaAPI.get()));
|
||||
} else {
|
||||
enabled = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user