Rewrite window title in 1.20->1.19.4 (#792)

This commit is contained in:
EnZaXD 2024-06-17 16:52:05 +02:00 committed by GitHub
parent 8e99dddb91
commit 4dded860ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -62,7 +62,6 @@ public final class Protocol1_20To1_19_4 extends BackwardsProtocol<ClientboundPac
new StatisticsRewriter<>(this).register(ClientboundPackets1_19_4.AWARD_STATS);
//TODO open window
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.SET_ACTION_BAR_TEXT);
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.SET_TITLE_TEXT);
translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.SET_SUBTITLE_TEXT);

View File

@ -26,7 +26,6 @@ import com.viaversion.viaversion.api.minecraft.BlockPosition;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_18;
import com.viaversion.nbt.tag.CompoundTag;
@ -86,7 +85,13 @@ public final class BlockItemPacketRewriter1_20 extends BackwardsItemRewriter<Cli
}
});
registerOpenScreen(ClientboundPackets1_19_4.OPEN_SCREEN);
protocol.registerClientbound(ClientboundPackets1_19_4.OPEN_SCREEN, wrapper -> {
wrapper.passthrough(Types.VAR_INT); // Container id
handleMenuType(wrapper);
protocol.getComponentRewriter().passthroughAndProcess(wrapper);
});
registerCooldown(ClientboundPackets1_19_4.COOLDOWN);
registerSetContent1_17_1(ClientboundPackets1_19_4.CONTAINER_SET_CONTENT);
registerSetSlot1_17_1(ClientboundPackets1_19_4.CONTAINER_SET_SLOT);