3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Hotfix registry and argument ser/de (#729)

* Hotfix argument parser missing

* Fix join game registry announcing.
Dieser Commit ist enthalten in:
Corey Shupe 2022-06-07 23:23:50 -04:00 committet von GitHub
Ursprung 28b6f6dcef
Commit c45597c885
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 15 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -273,7 +273,11 @@ public class JoinGame implements MinecraftPacket {
dimensionRegistryContainer = registryContainer.getCompound("minecraft:dimension_type")
.getList("value", BinaryTagTypes.COMPOUND);
this.biomeRegistry = registryContainer.getCompound("minecraft:worldgen/biome");
this.chatTypeRegistry = registryContainer.getCompound("minecraft:chat_type");
if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0) {
this.chatTypeRegistry = registryContainer.getCompound("minecraft:chat_type");
} else {
this.chatTypeRegistry = CompoundBinaryTag.empty();
}
} else {
dimensionRegistryContainer = registryContainer.getList("dimension",
BinaryTagTypes.COMPOUND);
@ -285,7 +289,7 @@ public class JoinGame implements MinecraftPacket {
String dimensionIdentifier;
String levelName = null;
if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0
&& version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) {
&& version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) {
CompoundBinaryTag currentDimDataTag = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER);
dimensionIdentifier = ProtocolUtils.readString(buf);
this.currentDimensionData = DimensionData.decodeBaseCompoundTag(currentDimDataTag, version)
@ -382,13 +386,15 @@ public class JoinGame implements MinecraftPacket {
dimensionRegistryEntry.put("value", encodedDimensionRegistry);
registryContainer.put("minecraft:dimension_type", dimensionRegistryEntry.build());
registryContainer.put("minecraft:worldgen/biome", biomeRegistry);
registryContainer.put("minecraft:chat_type", chatTypeRegistry);
if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0) {
registryContainer.put("minecraft:chat_type", chatTypeRegistry);
}
} else {
registryContainer.put("dimension", encodedDimensionRegistry);
}
ProtocolUtils.writeCompoundTag(buf, registryContainer.build());
if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0
&& version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) {
&& version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) {
ProtocolUtils.writeCompoundTag(buf, currentDimensionData.serializeDimensionDetails());
ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier());
} else {

Datei anzeigen

@ -229,7 +229,11 @@ public class ArgumentPropertyRegistry {
register(id("minecraft:resource", mapSet(MINECRAFT_1_19, 44)),
RegistryKeyArgument.class, RegistryKeyArgumentSerializer.REGISTRY);
empty(id("minecraft:uuid", mapSet(MINECRAFT_1_19, 45))); // added in 1.16
empty(id("minecraft:template_mirror", mapSet(MINECRAFT_1_19, 45))); // 1.19
empty(id("minecraft:template_rotation", mapSet(MINECRAFT_1_19, 46))); // 1.19
empty(id("minecraft:uuid", mapSet(MINECRAFT_1_19, 47))); // added in 1.16
// Crossstitch support
register(id("crossstitch:mod_argument", mapSet(MINECRAFT_1_19, -256)), ModArgumentProperty.class, MOD);