9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2026-01-04 15:31:47 +00:00
This commit is contained in:
XiaoMoMi
2023-10-17 17:41:32 +08:00
parent 12ff195291
commit 1a27c9ef00
2 changed files with 8 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ plugins {
}
group = 'net.momirealms'
version = '2.2.3.11'
version = '2.2.3.12'
repositories {
maven {name = "aliyun-repo"; url = "https://maven.aliyun.com/repository/public/"}
@@ -34,7 +34,7 @@ dependencies {
compileOnly ('org.apache.commons:commons-lang3:3.12.0')
implementation ('net.kyori:adventure-api:4.14.0')
implementation ('net.kyori:adventure-platform-bukkit:4.3.0')
implementation ('net.kyori:adventure-platform-bukkit:4.3.1')
implementation ('net.kyori:adventure-text-minimessage:4.14.0')
implementation ('net.kyori:adventure-text-serializer-gson:4.14.0')
implementation ("org.bstats:bstats-bukkit:3.0.1")

View File

@@ -74,9 +74,11 @@ public class CustomNameplatesVC {
if (optPlayer.isEmpty()) return;
var player = tab.getTabPlayer(optPlayer.get());
ByteArrayDataOutput byteArrayDataOutput = ByteStreams.newDataOutput();
byteArrayDataOutput.writeUTF(playerName);
byteArrayDataOutput.writeUTF(player.getTeamName(tab));
optPlayer.get().getCurrentServer().ifPresent(it -> it.sendPluginMessage(MinecraftChannelIdentifier.from("customnameplates:cnp"), byteArrayDataOutput.toByteArray()));
player.getTeamName(tab).thenAccept(team -> {
ByteArrayDataOutput byteArrayDataOutput = ByteStreams.newDataOutput();
byteArrayDataOutput.writeUTF(playerName);
byteArrayDataOutput.writeUTF(team);
optPlayer.get().getCurrentServer().ifPresent(it -> it.sendPluginMessage(MinecraftChannelIdentifier.from("customnameplates:cnp"), byteArrayDataOutput.toByteArray()));
});
}
}