3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00
Dieser Commit ist enthalten in:
Shane Freeder 2022-06-08 16:23:28 +01:00
Ursprung d9c5886786
Commit 51dc67f44b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -48,10 +48,14 @@ public class ChatData {
private static final ListBinaryTag EMPTY_LIST_TAG = ListBinaryTag.empty();
private final String identifier;
private final int id;
private final Decoration chatDecoration;
private Decoration narrationDecoration;
public ChatData(int id, String identifier) {
public ChatData(int id, String identifier, Decoration chatDecoration, Decoration narrationDecoration) {
this.id = id;
this.identifier = identifier;
this.chatDecoration = chatDecoration;
this.narrationDecoration = narrationDecoration;
}
/**
@ -71,21 +75,26 @@ public class ChatData {
}
private ChatData annotateWith(Integer id, String registryIdentifier) {
return new ChatData(id, registryIdentifier);
return new ChatData(id, registryIdentifier, this.chatDecoration, this.narrationDecoration);
}
private static ChatData decodeElementCompound(CompoundBinaryTag element) {
System.out.println(element);
final CompoundBinaryTag chatCompund = element.getCompound("chat");
Decoration chatDecoration = null;
Decoration narrationDecoration = null;
final CompoundBinaryTag chatDecorationCompound = chatCompund.getCompound("decoration");
final CompoundBinaryTag chatCompound = element.getCompound("chat");
final CompoundBinaryTag chatDecorationCompound = chatCompound.getCompound("decoration");
if (chatDecorationCompound != CompoundBinaryTag.empty()) {
chatDecoration = Decoration.decodeRegistryEntry(chatDecorationCompound);
}
return new ChatData(-1, "invalid");
final CompoundBinaryTag narrationCompound = element.getCompound("narration");
final CompoundBinaryTag narrationDecorationCompound = narrationCompound.getCompound("decoration");
if (narrationDecorationCompound != CompoundBinaryTag.empty()) {
narrationDecoration = Decoration.decodeRegistryEntry(narrationCompound);
}
return new ChatData(-1, "invalid", chatDecoration, narrationDecoration);
}
public String getIdentifier() {