mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
fix #5336
This commit is contained in:
parent
32f7b1fa11
commit
1649b53e54
1 changed files with 21 additions and 1 deletions
|
@ -29,12 +29,19 @@ diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/m
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
@@ -0,0 +0,0 @@ import net.kyori.adventure.text.format.TextDecoration;
|
@@ -0,0 +0,0 @@ import java.util.regex.Pattern;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.TextReplacementConfig;
|
||||||
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
|
-import net.kyori.adventure.text.format.Style;
|
||||||
|
-import net.kyori.adventure.text.format.TextDecoration;
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.IChatBaseComponent;
|
import net.minecraft.server.IChatBaseComponent;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
+import net.minecraft.server.ScoreboardTeam;
|
+import net.minecraft.server.ScoreboardTeam;
|
||||||
|
+import net.minecraft.server.ScoreboardTeamBase;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
+import org.bukkit.ChatColor;
|
||||||
+import org.bukkit.craftbukkit.CraftWorld;
|
+import org.bukkit.craftbukkit.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||||
import org.bukkit.craftbukkit.util.LazyPlayerSet;
|
import org.bukkit.craftbukkit.util.LazyPlayerSet;
|
||||||
|
@ -42,6 +49,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@@ -0,0 +0,0 @@ public final class ChatProcessor {
|
@@ -0,0 +0,0 @@ public final class ChatProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String legacyDisplayName(final CraftPlayer player) {
|
||||||
|
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
||||||
|
+ final EntityPlayer ep = player.getHandle();
|
||||||
|
+ IChatBaseComponent name = ep.getDisplayName();
|
||||||
|
+ final ScoreboardTeamBase team = ep.getScoreboardTeam();
|
||||||
|
+ if (team != null) {
|
||||||
|
+ name = team.getFormattedName(name);
|
||||||
|
+ }
|
||||||
|
+ return PaperAdventure.LEGACY_SECTION_UXRC.serialize(PaperAdventure.asAdventure(name)) + ChatColor.RESET;
|
||||||
|
+ }
|
||||||
|
return player.getDisplayName();
|
||||||
|
}
|
||||||
|
|
||||||
private static Component displayName(final CraftPlayer player) {
|
private static Component displayName(final CraftPlayer player) {
|
||||||
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
||||||
+ return PaperAdventure.asAdventure(ScoreboardTeam.a(player.getHandle().getScoreboardTeam(), player.getHandle().getDisplayName()));
|
+ return PaperAdventure.asAdventure(ScoreboardTeam.a(player.getHandle().getScoreboardTeam(), player.getHandle().getDisplayName()));
|
||||||
|
|
Loading…
Reference in a new issue