Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-16 04:50:08 +01: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:
Ursprung
c59c15d6f3
Commit
465a2354c0
@ -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
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren