3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 00:00:33 +01:00

Check both namespaced and implicit key when replacing registries

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-05-01 10:35:48 +02:00
Ursprung ce0e01abec
Commit e9db3f040f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
5 geänderte Dateien mit 5 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -68,7 +68,7 @@ import java.util.logging.Logger;
public interface ViaBackwardsPlatform {
String MINIMUM_VV_VERSION = "4.10.0";
String MINIMUM_VV_VERSION = "4.10.1";
/**
* Initialize ViaBackwards.

Datei anzeigen

@ -155,12 +155,7 @@ public final class EntityPackets1_19 extends EntityRewriter<ClientboundPackets1_
tracker(wrapper.user()).setBiomesSent(biomes.size());
// Cache and remove chat types
CompoundTag chatTypeRegistry = (CompoundTag) registry.remove("minecraft:chat_type");
if (chatTypeRegistry == null) {
chatTypeRegistry = (CompoundTag) registry.remove("chat_type");
}
final ListTag<CompoundTag> chatTypes = chatTypeRegistry.getListTag("value", CompoundTag.class);
final ListTag<CompoundTag> chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type");
for (final CompoundTag chatType : chatTypes) {
final NumberTag idTag = chatType.getNumberTag("id");
dimensionRegistryStorage.addChatType(idTag.asInt(), chatType);

Datei anzeigen

@ -81,6 +81,7 @@ public final class EntityPackets1_19_3 extends EntityRewriter<ClientboundPackets
handler(wrapper -> {
final ChatTypeStorage1_19_3 chatTypeStorage = wrapper.user().get(ChatTypeStorage1_19_3.class);
chatTypeStorage.clear();
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
final ListTag<CompoundTag> chatTypes = TagUtil.getRegistryEntries(registry, "chat_type");
for (final CompoundTag chatType : chatTypes) {

Datei anzeigen

@ -103,7 +103,7 @@ public final class Protocol1_19To1_19_1 extends BackwardsProtocol<ClientboundPac
chatTypeStorage.clear();
final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0);
final ListTag<CompoundTag> chatTypes = TagUtil.getRegistryEntries(registry, "chat_type");
final ListTag<CompoundTag> chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type");
for (final CompoundTag chatType : chatTypes) {
final NumberTag idTag = chatType.getNumberTag("id");
chatTypeStorage.addChatType(idTag.asInt(), chatType);

Datei anzeigen

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions]
# ViaVersion
viaver = "4.10.0"
viaver = "4.10.1-SNAPSHOT"
# Common provided
netty = "4.0.20.Final"