This commit is contained in:
2026-11-22 13:21:27 -03:00
parent e751d22c6e
commit ac791b886e
23 changed files with 494 additions and 91 deletions
+9 -1
View File
@@ -363,6 +363,14 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
for (const texture of Object.values(json.data_textures ?? {})) uses(file, texture, "texture");
// an entity model is drawn in the item's texture
if (json.model && !entity_model_owners.has(json.model)) uses(file, json.model, "model");
if (json.entity) {
check_namespace(file, json.entity);
const behavior = entity_jsons.get(json.entity)?.behavior;
if (!entity_owners.has(json.entity)) errors.push(`${file}: entity ${json.entity} doesn't exist`);
else if (behavior !== "object") {
errors.push(`${file}: entity ${json.entity} has to be an "object" to lie around holding the item`);
}
}
if (json.places) uses(file, json.places, "block");
if (json.food?.returns) uses(file, json.food.returns, "item");
for (const layer of json.layers ?? []) uses(file, layer.texture, "texture");
@@ -405,7 +413,7 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
errors.push(`${file}: entity ${json.id} is also defined by ${entity_owners.get(json.id)!.join(", ")}`);
}
if (json.model !== undefined) uses(file, json.model, "entity model");
uses(file, json.texture, "texture");
if (json.texture !== undefined) uses(file, json.texture, "texture");
if (json.loot_table) uses(file, json.loot_table, "loot table");
if (json.sounds) uses_sounds(file, json.sounds, ENTITY_SOUNDS);
// scripts register behaviors, the server checks them when it starts