mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-24 12:35:43 +01:00
Make chat_types handling in 1.19 protocols optional (#733)
This commit is contained in:
parent
9b8e65c59d
commit
99f6356230
@ -83,7 +83,7 @@ public final class EntityPackets1_19_3 extends EntityRewriter<ClientboundPackets
|
|||||||
chatTypeStorage.clear();
|
chatTypeStorage.clear();
|
||||||
|
|
||||||
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
|
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
|
||||||
final ListTag<CompoundTag> chatTypes = TagUtil.getRegistryEntries(registry, "chat_type");
|
final ListTag<CompoundTag> chatTypes = TagUtil.getRegistryEntries(registry, "chat_type", new ListTag<>(CompoundTag.class));
|
||||||
for (final CompoundTag chatType : chatTypes) {
|
for (final CompoundTag chatType : chatTypes) {
|
||||||
final NumberTag idTag = chatType.getNumberTag("id");
|
final NumberTag idTag = chatType.getNumberTag("id");
|
||||||
chatTypeStorage.addChatType(idTag.asInt(), chatType);
|
chatTypeStorage.addChatType(idTag.asInt(), chatType);
|
||||||
|
@ -103,7 +103,7 @@ public final class Protocol1_19To1_19_1 extends BackwardsProtocol<ClientboundPac
|
|||||||
chatTypeStorage.clear();
|
chatTypeStorage.clear();
|
||||||
|
|
||||||
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
|
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
|
||||||
final ListTag<CompoundTag> chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type");
|
final ListTag<CompoundTag> chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type", new ListTag<>(CompoundTag.class));
|
||||||
for (final CompoundTag chatType : chatTypes) {
|
for (final CompoundTag chatType : chatTypes) {
|
||||||
final NumberTag idTag = chatType.getNumberTag("id");
|
final NumberTag idTag = chatType.getNumberTag("id");
|
||||||
chatTypeStorage.addChatType(idTag.asInt(), chatType);
|
chatTypeStorage.addChatType(idTag.asInt(), chatType);
|
||||||
|
Loading…
Reference in New Issue
Block a user