Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Hotfix registry and argument ser/de (#729)
* Hotfix argument parser missing * Fix join game registry announcing.
Dieser Commit ist enthalten in:
Ursprung
28b6f6dcef
Commit
c45597c885
@ -273,7 +273,11 @@ public class JoinGame implements MinecraftPacket {
|
|||||||
dimensionRegistryContainer = registryContainer.getCompound("minecraft:dimension_type")
|
dimensionRegistryContainer = registryContainer.getCompound("minecraft:dimension_type")
|
||||||
.getList("value", BinaryTagTypes.COMPOUND);
|
.getList("value", BinaryTagTypes.COMPOUND);
|
||||||
this.biomeRegistry = registryContainer.getCompound("minecraft:worldgen/biome");
|
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 {
|
} else {
|
||||||
dimensionRegistryContainer = registryContainer.getList("dimension",
|
dimensionRegistryContainer = registryContainer.getList("dimension",
|
||||||
BinaryTagTypes.COMPOUND);
|
BinaryTagTypes.COMPOUND);
|
||||||
@ -285,7 +289,7 @@ public class JoinGame implements MinecraftPacket {
|
|||||||
String dimensionIdentifier;
|
String dimensionIdentifier;
|
||||||
String levelName = null;
|
String levelName = null;
|
||||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0
|
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);
|
CompoundBinaryTag currentDimDataTag = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER);
|
||||||
dimensionIdentifier = ProtocolUtils.readString(buf);
|
dimensionIdentifier = ProtocolUtils.readString(buf);
|
||||||
this.currentDimensionData = DimensionData.decodeBaseCompoundTag(currentDimDataTag, version)
|
this.currentDimensionData = DimensionData.decodeBaseCompoundTag(currentDimDataTag, version)
|
||||||
@ -382,13 +386,15 @@ public class JoinGame implements MinecraftPacket {
|
|||||||
dimensionRegistryEntry.put("value", encodedDimensionRegistry);
|
dimensionRegistryEntry.put("value", encodedDimensionRegistry);
|
||||||
registryContainer.put("minecraft:dimension_type", dimensionRegistryEntry.build());
|
registryContainer.put("minecraft:dimension_type", dimensionRegistryEntry.build());
|
||||||
registryContainer.put("minecraft:worldgen/biome", biomeRegistry);
|
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 {
|
} else {
|
||||||
registryContainer.put("dimension", encodedDimensionRegistry);
|
registryContainer.put("dimension", encodedDimensionRegistry);
|
||||||
}
|
}
|
||||||
ProtocolUtils.writeCompoundTag(buf, registryContainer.build());
|
ProtocolUtils.writeCompoundTag(buf, registryContainer.build());
|
||||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0
|
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.writeCompoundTag(buf, currentDimensionData.serializeDimensionDetails());
|
||||||
ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier());
|
ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier());
|
||||||
} else {
|
} else {
|
||||||
|
@ -229,7 +229,11 @@ public class ArgumentPropertyRegistry {
|
|||||||
register(id("minecraft:resource", mapSet(MINECRAFT_1_19, 44)),
|
register(id("minecraft:resource", mapSet(MINECRAFT_1_19, 44)),
|
||||||
RegistryKeyArgument.class, RegistryKeyArgumentSerializer.REGISTRY);
|
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
|
// Crossstitch support
|
||||||
register(id("crossstitch:mod_argument", mapSet(MINECRAFT_1_19, -256)), ModArgumentProperty.class, MOD);
|
register(id("crossstitch:mod_argument", mapSet(MINECRAFT_1_19, -256)), ModArgumentProperty.class, MOD);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren