9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00

Fixed spigot mapping

This commit is contained in:
XiaoMoMi
2025-02-21 18:26:27 +08:00
parent 8c0272acc7
commit 4bf9a00b32
2 changed files with 16 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ package net.momirealms.customnameplates.bukkit.compatibility.chat;
import net.advancedplugins.chat.api.AdvancedChannelChatEvent; import net.advancedplugins.chat.api.AdvancedChannelChatEvent;
import net.advancedplugins.chat.api.AdvancedChatAPI; import net.advancedplugins.chat.api.AdvancedChatAPI;
import net.advancedplugins.chat.api.AdvancedChatEvent;
import net.advancedplugins.chat.channel.ChatChannel; import net.advancedplugins.chat.channel.ChatChannel;
import net.momirealms.customnameplates.api.CNPlayer; import net.momirealms.customnameplates.api.CNPlayer;
import net.momirealms.customnameplates.api.CustomNameplates; import net.momirealms.customnameplates.api.CustomNameplates;
@@ -38,6 +39,17 @@ public class AdvancedChatProvider extends AbstractChatMessageProvider implements
super(plugin, manager); super(plugin, manager);
} }
@EventHandler(ignoreCancelled = true)
public void onAdvancedChat(AdvancedChatEvent event) {
Player player = event.getChatEvent().getPlayer();
if (!player.isOnline()) return;
CNPlayer cnPlayer = plugin.getPlayer(player.getUniqueId());
if (cnPlayer == null) return;
plugin.getScheduler().async().execute(() -> {
manager.onChat(cnPlayer, event.getMessage(), "");
});
}
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void onAdvancedChat(AdvancedChannelChatEvent event) { public void onAdvancedChat(AdvancedChannelChatEvent event) {
String channel = event.getChannel().getSectionName(); String channel = event.getChannel().getSectionName();

View File

@@ -324,18 +324,18 @@ public class Reflections {
public static final Class<?> clazz$HolderLookup$Provider = ReflectionUtils.getClazz( public static final Class<?> clazz$HolderLookup$Provider = ReflectionUtils.getClazz(
BukkitReflectionUtils.assembleMCClass("core.HolderLookup$Provider"), BukkitReflectionUtils.assembleMCClass("core.HolderLookup$Provider"),
BukkitReflectionUtils.assembleMCClass("core.HolderLookup$b") BukkitReflectionUtils.assembleMCClass(VersionHelper.isVersionNewerThan1_20_5() ? "core.HolderLookup$a" : "core.HolderLookup$b")
); );
public static final Method method$Component$Serializer$fromJson = ReflectionUtils.getMethod( public static final Method method$Component$Serializer$fromJson = ReflectionUtils.getMethod(
clazz$Component$Serializer, clazz$Component$Serializer,
new String[] { "fromJson" }, new String[] { "fromJson", "a" },
String.class, clazz$HolderLookup$Provider String.class, clazz$HolderLookup$Provider
); );
public static final Method method$Component$Serializer$toJson = ReflectionUtils.getMethod( public static final Method method$Component$Serializer$toJson = ReflectionUtils.getMethod(
clazz$Component$Serializer, clazz$Component$Serializer,
new String[] { "toJson" }, new String[] { "toJson", "a" },
clazz$Component, clazz$HolderLookup$Provider clazz$Component, clazz$HolderLookup$Provider
); );
@@ -601,7 +601,7 @@ public class Reflections {
public static final Class<?> clazz$SynchedEntityData$DataValue = requireNonNull( public static final Class<?> clazz$SynchedEntityData$DataValue = requireNonNull(
ReflectionUtils.getClazz( ReflectionUtils.getClazz(
BukkitReflectionUtils.assembleMCClass("network.syncher.SynchedEntityData$DataValue"), BukkitReflectionUtils.assembleMCClass("network.syncher.SynchedEntityData$DataValue"),
BukkitReflectionUtils.assembleMCClass("network.syncher.DataWatcher$b") BukkitReflectionUtils.assembleMCClass(VersionHelper.isVersionNewerThan1_20_5() ? "network.syncher.DataWatcher$c" : "network.syncher.DataWatcher$b")
) )
); );