3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-28 06:31:05 +02:00

Call component rewriter in pre 1.20.3 advancement handler (#4014)

Required for ViaBackwards where we need to rewrite the translation key (and it also doesn't hurt to have this in forward protocols).

Closes https://github.com/ViaVersion/ViaBackwards/issues/819
Dieser Commit ist enthalten in:
EnZaXD 2024-07-13 11:00:00 +02:00 committet von GitHub
Ursprung c59c15d6f3
Commit 465a2354c0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -17,6 +17,7 @@
*/ */
package com.viaversion.viaversion.rewriter; package com.viaversion.viaversion.rewriter;
import com.google.gson.JsonElement;
import com.viaversion.nbt.tag.Tag; import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.Mappings; import com.viaversion.viaversion.api.data.Mappings;
@ -363,8 +364,14 @@ public class ItemRewriter<C extends ClientboundPacketType, S extends Serverbound
// Display data // Display data
if (wrapper.passthrough(Types.BOOLEAN)) { if (wrapper.passthrough(Types.BOOLEAN)) {
wrapper.passthrough(Types.COMPONENT); // Title final JsonElement title = wrapper.passthrough(Types.COMPONENT); // Title
wrapper.passthrough(Types.COMPONENT); // Description final JsonElement description = wrapper.passthrough(Types.COMPONENT); // Description
final ComponentRewriter componentRewriter = protocol.getComponentRewriter();
if (componentRewriter != null) {
componentRewriter.processText(wrapper.user(), title);
componentRewriter.processText(wrapper.user(), description);
}
handleClientboundItem(wrapper); // Icon handleClientboundItem(wrapper); // Icon
wrapper.passthrough(Types.VAR_INT); // Frame type wrapper.passthrough(Types.VAR_INT); // Frame type
int flags = wrapper.passthrough(Types.INT); // Flags int flags = wrapper.passthrough(Types.INT); // Flags