Document advancement listener versions

This commit is contained in:
Vankka 2023-11-15 23:35:32 +02:00
parent 273f3d9a19
commit b74f557359
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
2 changed files with 5 additions and 5 deletions

View File

@ -33,11 +33,11 @@ import java.util.Arrays;
/**
* Used for Spigot and Paper in versions before they added advancement apis.
*/
public class BukkitAdvancementListener extends AbstractBukkitAwardListener {
public class BukkitLegacyAdvancementListener extends AbstractBukkitAwardListener {
private final NMS nms;
public BukkitAdvancementListener(DiscordSRV discordSRV, IBukkitAwardForwarder forwarder) {
public BukkitLegacyAdvancementListener(DiscordSRV discordSRV, IBukkitAwardForwarder forwarder) {
super(discordSRV, forwarder);
String version = Bukkit.getServer().getBukkitVersion().split("-", 2)[0];

View File

@ -34,14 +34,14 @@ public class BukkitAwardForwarder implements IBukkitAwardForwarder {
if (exists("org.bukkit.event.player.PlayerAdvancementDoneEvent")) {
// Advancement
if (exists("io.papermc.paper.advancement.AdvancementDisplay")) {
// Paper
// Paper (Since 1.17.1)
return new PaperModernAdvancementListener(discordSRV, forwarder);
} else if (exists("org.bukkit.advancement.AdvancementDisplay")) {
// Spigot
// Spigot (Since 1.19)
return new SpigotModernAdvancementListener(discordSRV, forwarder);
} else {
// Generic
return new BukkitAdvancementListener(discordSRV, forwarder);
return new BukkitLegacyAdvancementListener(discordSRV, forwarder);
}
} else {
// Achievement