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:
Christian Koop 2023-08-16 09:51:08 +02:00
parent 57f49b6c1f
commit b29111b96d
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
9 changed files with 1 additions and 151 deletions

10
pom.xml
View File

@ -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>

View File

@ -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());
});

View File

@ -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());
});

View File

@ -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();
}

View File

@ -15,7 +15,6 @@ public class LeaderboardTask extends BukkitRunnable {
LeaderboardManager leaderboardManager = this.plugin.getLeaderboardManager();
leaderboardManager.clearLeaderboard();
leaderboardManager.resetLeaderboard();
leaderboardManager.setupLeaderHeads();
this.plugin.getHologramTask().updateHologram();
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -10,7 +10,6 @@ softdepend:
- EpicSpawners
- Holograms
- HolographicDisplays
- LeaderHeads
- PlaceholderAPI
- PlayerPoints
- Reserve