mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-25 11:46:54 +01:00
Drop support for LeaderHeads plugin
Last update was in 2020 and it is marked as abandoned. I think users had enough time to find an alternative + I can't find an official maven repository for it, making clean builds hard
This commit is contained in:
parent
57f49b6c1f
commit
b29111b96d
10
pom.xml
10
pom.xml
@ -199,20 +199,12 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO: Check what repo has LeaderHeadsAPI -->
|
||||
<!-- TODO: Check what repo has com.Zrips:Residence -->
|
||||
<dependency>
|
||||
<groupId>com.Zrips</groupId>
|
||||
<artifactId>Residence</artifactId>
|
||||
<scope>provided</scope>
|
||||
<version>4.9.0.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO: Check what repo has LeaderHeadsAPI – The project is abandoned so removing support for it might be worth a thought -->
|
||||
<dependency>
|
||||
<groupId>me.robin</groupId>
|
||||
<artifactId>LeaderHeadsAPI</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -43,7 +43,6 @@ public class RefreshHologramsCommand extends SubCommand {
|
||||
LeaderboardManager leaderboardManager = this.plugin.getLeaderboardManager();
|
||||
leaderboardManager.clearLeaderboard();
|
||||
leaderboardManager.resetLeaderboard();
|
||||
leaderboardManager.setupLeaderHeads();
|
||||
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> this.plugin.getHologramTask().updateHologram());
|
||||
});
|
||||
|
@ -94,7 +94,6 @@ public class ReloadCommand extends SubCommand {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||
leaderboardManager.clearLeaderboard();
|
||||
leaderboardManager.resetLeaderboard();
|
||||
leaderboardManager.setupLeaderHeads();
|
||||
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> this.plugin.getHologramTask().updateHologram());
|
||||
});
|
||||
|
@ -2,9 +2,6 @@ package com.craftaro.skyblock.leaderboard;
|
||||
|
||||
import com.craftaro.skyblock.SkyBlock;
|
||||
import com.craftaro.skyblock.island.IslandWorld;
|
||||
import com.craftaro.skyblock.leaderboard.leaderheads.TopBank;
|
||||
import com.craftaro.skyblock.leaderboard.leaderheads.TopLevel;
|
||||
import com.craftaro.skyblock.leaderboard.leaderheads.TopVotes;
|
||||
import com.craftaro.skyblock.utils.VaultPermissions;
|
||||
import com.craftaro.skyblock.visit.Visit;
|
||||
import com.craftaro.skyblock.visit.VisitManager;
|
||||
@ -29,7 +26,6 @@ public class LeaderboardManager {
|
||||
new LeaderboardTask(plugin).runTaskTimerAsynchronously(plugin, 0L, this.plugin.getConfiguration().getInt("Island.Leaderboard.Reset.Time") * 20);
|
||||
|
||||
resetLeaderboard();
|
||||
setupLeaderHeads();
|
||||
}
|
||||
|
||||
public void resetLeaderboard() {
|
||||
@ -116,14 +112,6 @@ public class LeaderboardManager {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void setupLeaderHeads() {
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("LeaderHeads") != null) {
|
||||
new TopLevel(this.plugin);
|
||||
new TopBank(this.plugin);
|
||||
new TopVotes(this.plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearLeaderboard() {
|
||||
this.leaderboardStorage.clear();
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ public class LeaderboardTask extends BukkitRunnable {
|
||||
LeaderboardManager leaderboardManager = this.plugin.getLeaderboardManager();
|
||||
leaderboardManager.clearLeaderboard();
|
||||
leaderboardManager.resetLeaderboard();
|
||||
leaderboardManager.setupLeaderHeads();
|
||||
|
||||
this.plugin.getHologramTask().updateHologram();
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
package com.craftaro.skyblock.leaderboard.leaderheads;
|
||||
|
||||
import com.craftaro.skyblock.SkyBlock;
|
||||
import com.craftaro.skyblock.leaderboard.Leaderboard;
|
||||
import com.craftaro.skyblock.leaderboard.Leaderboard.Type;
|
||||
import com.craftaro.skyblock.visit.Visit;
|
||||
import me.robin.leaderheads.api.LeaderHeadsAPI;
|
||||
import me.robin.leaderheads.datacollectors.DataCollector;
|
||||
import me.robin.leaderheads.objects.BoardType;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
public class TopBank extends DataCollector {
|
||||
private final SkyBlock plugin;
|
||||
|
||||
public TopBank(SkyBlock plugin) {
|
||||
super("topbank", plugin.getDescription().getName(), BoardType.DEFAULT, "&bTop Bank", "topbank",
|
||||
Arrays.asList(ChatColor.DARK_GRAY + "-=+=-", ChatColor.AQUA + "{name}",
|
||||
ChatColor.WHITE + "Bal: ${amount}", ChatColor.DARK_GRAY + "-=+=-"),
|
||||
true, UUID.class);
|
||||
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Entry<?, Double>> requestAll() {
|
||||
List<Leaderboard> leaderboards = this.plugin.getLeaderboardManager().getLeaderboard(Type.BANK);
|
||||
Map<UUID, Double> topLevels = new HashMap<>(leaderboards.size());
|
||||
|
||||
for (Leaderboard leaderboard : leaderboards) {
|
||||
Visit visit = leaderboard.getVisit();
|
||||
topLevels.put(visit.getOwnerUUID(), visit.getBankBalance());
|
||||
}
|
||||
|
||||
return LeaderHeadsAPI.sortMap(topLevels);
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.craftaro.skyblock.leaderboard.leaderheads;
|
||||
|
||||
import com.craftaro.skyblock.SkyBlock;
|
||||
import com.craftaro.skyblock.leaderboard.Leaderboard;
|
||||
import com.craftaro.skyblock.visit.Visit;
|
||||
import me.robin.leaderheads.api.LeaderHeadsAPI;
|
||||
import me.robin.leaderheads.datacollectors.DataCollector;
|
||||
import me.robin.leaderheads.objects.BoardType;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
public class TopLevel extends DataCollector {
|
||||
private final SkyBlock plugin;
|
||||
|
||||
public TopLevel(SkyBlock plugin) {
|
||||
super("toplevels", plugin.getDescription().getName(), BoardType.DEFAULT, "&bTop Level", "toplevel",
|
||||
Arrays.asList(ChatColor.DARK_GRAY + "-=+=-", ChatColor.AQUA + "{name}", ChatColor.WHITE + "{amount} Level", ChatColor.DARK_GRAY + "-=+=-"), true, UUID.class);
|
||||
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Entry<?, Double>> requestAll() {
|
||||
List<Leaderboard> leaderboards = this.plugin.getLeaderboardManager().getLeaderboard(Leaderboard.Type.LEVEL);
|
||||
Map<UUID, Double> topLevels = new HashMap<>(leaderboards.size());
|
||||
|
||||
for (Leaderboard leaderboard : leaderboards) {
|
||||
Visit visit = leaderboard.getVisit();
|
||||
topLevels.put(visit.getOwnerUUID(), (double) visit.getLevel().getLevel());
|
||||
}
|
||||
|
||||
return LeaderHeadsAPI.sortMap(topLevels);
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package com.craftaro.skyblock.leaderboard.leaderheads;
|
||||
|
||||
import com.craftaro.skyblock.SkyBlock;
|
||||
import com.craftaro.skyblock.leaderboard.Leaderboard;
|
||||
import com.craftaro.skyblock.leaderboard.Leaderboard.Type;
|
||||
import com.craftaro.skyblock.visit.Visit;
|
||||
import me.robin.leaderheads.api.LeaderHeadsAPI;
|
||||
import me.robin.leaderheads.datacollectors.DataCollector;
|
||||
import me.robin.leaderheads.objects.BoardType;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
public class TopVotes extends DataCollector {
|
||||
private final SkyBlock plugin;
|
||||
|
||||
public TopVotes(SkyBlock plugin) {
|
||||
super("topvotes", plugin.getDescription().getName(), BoardType.DEFAULT, "&bTop Votes", "topvotes",
|
||||
Arrays.asList(ChatColor.DARK_GRAY + "-=+=-", ChatColor.AQUA + "{name}",
|
||||
ChatColor.WHITE + "{amount} Votes", ChatColor.DARK_GRAY + "-=+=-"),
|
||||
true, UUID.class);
|
||||
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Entry<?, Double>> requestAll() {
|
||||
List<Leaderboard> leaderboards = this.plugin.getLeaderboardManager().getLeaderboard(Type.VOTES);
|
||||
Map<UUID, Double> topLevels = new HashMap<>(leaderboards.size());
|
||||
|
||||
for (Leaderboard leaderboard : leaderboards) {
|
||||
Visit visit = leaderboard.getVisit();
|
||||
topLevels.put(visit.getOwnerUUID(), (double) visit.getVoters().size());
|
||||
}
|
||||
|
||||
return LeaderHeadsAPI.sortMap(topLevels);
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@ softdepend:
|
||||
- EpicSpawners
|
||||
- Holograms
|
||||
- HolographicDisplays
|
||||
- LeaderHeads
|
||||
- PlaceholderAPI
|
||||
- PlayerPoints
|
||||
- Reserve
|
||||
|
Loading…
Reference in New Issue
Block a user