From b74f5573598e70d6dbfc11f87c3f023af63bc3af Mon Sep 17 00:00:00 2001 From: Vankka Date: Wed, 15 Nov 2023 23:35:32 +0200 Subject: [PATCH] Document advancement listener versions --- ...ntListener.java => BukkitLegacyAdvancementListener.java} | 4 ++-- .../bukkit/listener/award/BukkitAwardForwarder.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/{BukkitAdvancementListener.java => BukkitLegacyAdvancementListener.java} (96%) diff --git a/bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAdvancementListener.java b/bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitLegacyAdvancementListener.java similarity index 96% rename from bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAdvancementListener.java rename to bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitLegacyAdvancementListener.java index 07428866..c0a58ec1 100644 --- a/bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAdvancementListener.java +++ b/bukkit/bukkit1_12/src/main/java/com/discordsrv/bukkit/listener/award/BukkitLegacyAdvancementListener.java @@ -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]; diff --git a/bukkit/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAwardForwarder.java b/bukkit/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAwardForwarder.java index 55bbce8a..0a763803 100644 --- a/bukkit/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAwardForwarder.java +++ b/bukkit/src/main/java/com/discordsrv/bukkit/listener/award/BukkitAwardForwarder.java @@ -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