implement basic support for mobs

This commit is contained in:
p2r3
2025-08-22 02:29:59 +03:00
parent 5a0f8fd376
commit ca9edce43a
9 changed files with 205 additions and 41 deletions

View File

@@ -308,9 +308,13 @@ async function convert () {
}
if (registry.endsWith("variant")) {
// The mob "variants" only require one valid variant to be accepted
// Send the shortest one to save memory
const shortest = registries[registry].sort((a, b) => a.length - b.length)[0];
registryBuffers.push(serializeRegistry(registry, [shortest]));
// Send "temperate" if available, otherwise shortest string to save memory
if (registries[registry].includes("temperate")) {
registryBuffers.push(serializeRegistry(registry, ["temperate"]));
} else {
const shortest = registries[registry].sort((a, b) => a.length - b.length)[0];
registryBuffers.push(serializeRegistry(registry, [shortest]));
}
} else {
registryBuffers.push(serializeRegistry(registry, registries[registry]));
}