mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-25 12:25:15 +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.
|
* 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;
|
private final NMS nms;
|
||||||
|
|
||||||
public BukkitAdvancementListener(DiscordSRV discordSRV, IBukkitAwardForwarder forwarder) {
|
public BukkitLegacyAdvancementListener(DiscordSRV discordSRV, IBukkitAwardForwarder forwarder) {
|
||||||
super(discordSRV, forwarder);
|
super(discordSRV, forwarder);
|
||||||
|
|
||||||
String version = Bukkit.getServer().getBukkitVersion().split("-", 2)[0];
|
String version = Bukkit.getServer().getBukkitVersion().split("-", 2)[0];
|
@ -34,14 +34,14 @@ public class BukkitAwardForwarder implements IBukkitAwardForwarder {
|
|||||||
if (exists("org.bukkit.event.player.PlayerAdvancementDoneEvent")) {
|
if (exists("org.bukkit.event.player.PlayerAdvancementDoneEvent")) {
|
||||||
// Advancement
|
// Advancement
|
||||||
if (exists("io.papermc.paper.advancement.AdvancementDisplay")) {
|
if (exists("io.papermc.paper.advancement.AdvancementDisplay")) {
|
||||||
// Paper
|
// Paper (Since 1.17.1)
|
||||||
return new PaperModernAdvancementListener(discordSRV, forwarder);
|
return new PaperModernAdvancementListener(discordSRV, forwarder);
|
||||||
} else if (exists("org.bukkit.advancement.AdvancementDisplay")) {
|
} else if (exists("org.bukkit.advancement.AdvancementDisplay")) {
|
||||||
// Spigot
|
// Spigot (Since 1.19)
|
||||||
return new SpigotModernAdvancementListener(discordSRV, forwarder);
|
return new SpigotModernAdvancementListener(discordSRV, forwarder);
|
||||||
} else {
|
} else {
|
||||||
// Generic
|
// Generic
|
||||||
return new BukkitAdvancementListener(discordSRV, forwarder);
|
return new BukkitLegacyAdvancementListener(discordSRV, forwarder);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Achievement
|
// Achievement
|
||||||
|
Loading…
Reference in New Issue
Block a user