f
This commit is contained in:
parent
8edc6cf395
commit
3b34eaf9cb
1 changed files with 7 additions and 7 deletions
|
@ -44,18 +44,18 @@ public class CustomChat {
|
||||||
.replace("\"", "\\\"");
|
.replace("\"", "\\\"");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final MutablePlayerListEntry entry = Players.INSTANCE.getEntry(client.getNetworkHandler().getProfile().getId());
|
// final MutablePlayerListEntry entry = Players.INSTANCE.getEntry(client.getNetworkHandler().getProfile().getId());
|
||||||
|
//
|
||||||
|
// final Component displayNameComponent = entry.displayName().asComponent();
|
||||||
|
|
||||||
final Component displayNameComponent = entry.displayName().asComponent();
|
// final String prefix = GsonComponentSerializer.gson().serialize(Component.join(JoinConfiguration.separator(Component.empty()), displayNameComponent.children().get(0)));
|
||||||
|
// final String displayName = GsonComponentSerializer.gson().serialize(Component.join(JoinConfiguration.separator(Component.empty()), displayNameComponent.children().get(1)));
|
||||||
final String prefix = GsonComponentSerializer.gson().serialize(Component.join(JoinConfiguration.separator(Component.empty()), displayNameComponent.children().get(0)));
|
|
||||||
final String displayName = GsonComponentSerializer.gson().serialize(Component.join(JoinConfiguration.separator(Component.empty()), displayNameComponent.children().get(1)));
|
|
||||||
|
|
||||||
String sanitizedFormat;
|
String sanitizedFormat;
|
||||||
try {
|
try {
|
||||||
sanitizedFormat = format
|
sanitizedFormat = format
|
||||||
.replace("\"PREFIX\"", prefix)
|
// .replace("\"PREFIX\"", prefix)
|
||||||
.replace("\"DISPLAYNAME\"", displayName)
|
// .replace("\"DISPLAYNAME\"", displayName)
|
||||||
.replace("USERNAME", username)
|
.replace("USERNAME", username)
|
||||||
.replace("MESSAGE", sanitizedMessage);
|
.replace("MESSAGE", sanitizedMessage);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in a new issue