mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-21 11:45:25 +01:00
Document advancement listener versions
This commit is contained in:
parent
273f3d9a19
commit
b74f557359
@ -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];
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user