9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-19 15:09:19 +00:00

chore: move to paper advneture impl

This commit is contained in:
Logan
2025-12-16 12:14:02 -06:00
parent 2e4619da02
commit af01ff600b
3 changed files with 13 additions and 22 deletions

View File

@@ -94,10 +94,12 @@ allprojects {
compileOnly("org.projectlombok:lombok:1.18.34") compileOnly("org.projectlombok:lombok:1.18.34")
compileOnly("me.lojosho:HibiscusCommons:0.8.1-d9fbae1d") compileOnly("me.lojosho:HibiscusCommons:0.8.1-d9fbae1d")
// Handled by Spigot Library Loader // Handled by Spigot Library Loader ~ Deprecated as of Dec 16, 2025
/*
compileOnly("net.kyori:adventure-api:4.24.0") compileOnly("net.kyori:adventure-api:4.24.0")
compileOnly("net.kyori:adventure-text-minimessage:4.24.0") compileOnly("net.kyori:adventure-text-minimessage:4.24.0")
compileOnly("net.kyori:adventure-platform-bukkit:4.4.1") compileOnly("net.kyori:adventure-platform-bukkit:4.4.1")
*/
annotationProcessor("org.projectlombok:lombok:1.18.36") annotationProcessor("org.projectlombok:lombok:1.18.36")
testCompileOnly("org.projectlombok:lombok:1.18.36") testCompileOnly("org.projectlombok:lombok:1.18.36")

View File

@@ -20,7 +20,6 @@ import me.lojosho.hibiscuscommons.nms.NMSHandlers;
import me.lojosho.hibiscuscommons.util.packets.PacketManager; import me.lojosho.hibiscuscommons.util.packets.PacketManager;
import net.kyori.adventure.audience.Audience; import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.bossbar.BossBar; import net.kyori.adventure.bossbar.BossBar;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
@@ -184,9 +183,9 @@ public class UserWardrobeManager {
Component message = MessagesUtil.processStringNoKey(player, WardrobeSettings.getBossbarMessage()); Component message = MessagesUtil.processStringNoKey(player, WardrobeSettings.getBossbarMessage());
bossBar = BossBar.bossBar(message, progress, WardrobeSettings.getBossbarColor(), WardrobeSettings.getBossbarOverlay()); bossBar = BossBar.bossBar(message, progress, WardrobeSettings.getBossbarColor(), WardrobeSettings.getBossbarOverlay());
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player); //Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
target.showBossBar(bossBar); player.showBossBar(bossBar);
} }
if (WardrobeSettings.isEnterOpenMenu()) { if (WardrobeSettings.isEnterOpenMenu()) {
@@ -288,9 +287,8 @@ public class UserWardrobeManager {
HMCCPacketManager.equipmentSlotUpdate(player.getEntityId(), items, viewer); HMCCPacketManager.equipmentSlotUpdate(player.getEntityId(), items, viewer);
if (WardrobeSettings.isEnabledBossbar()) { if (WardrobeSettings.isEnabledBossbar()) {
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player); //Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
player.hideBossBar(bossBar);
target.hideBossBar(bossBar);
} }
user.updateCosmetic(); user.updateCosmetic();

View File

@@ -7,7 +7,6 @@ import me.lojosho.hibiscuscommons.hooks.Hooks;
import me.lojosho.hibiscuscommons.util.AdventureUtils; import me.lojosho.hibiscuscommons.util.AdventureUtils;
import me.lojosho.shaded.configurate.ConfigurationNode; import me.lojosho.shaded.configurate.ConfigurationNode;
import net.kyori.adventure.audience.Audience; import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import net.kyori.adventure.title.Title; import net.kyori.adventure.title.Title;
@@ -43,41 +42,35 @@ public class MessagesUtil {
public static void sendMessage(Player player, String key) { public static void sendMessage(Player player, String key) {
Component finalMessage = processString(player, key); Component finalMessage = processString(player, key);
if (finalMessage == null) return; if (finalMessage == null) return;
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
target.sendMessage(finalMessage); player.sendMessage(finalMessage);
} }
public static void sendMessage(CommandSender sender, String key) { public static void sendMessage(CommandSender sender, String key) {
Component finalMessage = processString(null, key); Component finalMessage = processString(null, key);
if (finalMessage == null) return; if (finalMessage == null) return;
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).sender(sender);
target.sendMessage(finalMessage); sender.sendMessage(finalMessage);
} }
public static void sendMessage(Player player, String key, TagResolver placeholder) { public static void sendMessage(Player player, String key, TagResolver placeholder) {
Component finalMessage = processString(player, key, placeholder); Component finalMessage = processString(player, key, placeholder);
if (finalMessage == null) return; if (finalMessage == null) return;
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
target.sendMessage(finalMessage); player.sendMessage(finalMessage);
} }
public static void sendMessageNoKey(Player player, String message) { public static void sendMessageNoKey(Player player, String message) {
Component finalMessage = processStringNoKey(player, message); Component finalMessage = processStringNoKey(player, message);
if (finalMessage == null) return; if (finalMessage == null) return;
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
target.sendMessage(finalMessage); player.sendMessage(finalMessage);
} }
public static void sendActionBar(Player player, String key) { public static void sendActionBar(Player player, String key) {
Component finalMessage = processString(player, key); Component finalMessage = processString(player, key);
if (finalMessage == null) return; if (finalMessage == null) return;
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player); player.sendActionBar(finalMessage);
target.sendActionBar(finalMessage);
} }
public static void sendTitle(Player player, String message) { public static void sendTitle(Player player, String message) {
@@ -85,12 +78,10 @@ public class MessagesUtil {
} }
public static void sendTitle(Player player, String message, int fadein, int stay, int fadeout) { public static void sendTitle(Player player, String message, int fadein, int stay, int fadeout) {
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
Title.Times times = Title.Times.times(Duration.ofMillis(fadein), Duration.ofMillis(stay), Duration.ofMillis(fadeout)); Title.Times times = Title.Times.times(Duration.ofMillis(fadein), Duration.ofMillis(stay), Duration.ofMillis(fadeout));
Title title = Title.title(processStringNoKey(player, message), Component.empty(), times); Title title = Title.title(processStringNoKey(player, message), Component.empty(), times);
target.showTitle(title); player.showTitle(title);
} }
public static Component processString(Player player, String key) { public static Component processString(Player player, String key) {