Skip to content

Commit

Permalink
Fixing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Mar 16, 2024
1 parent 9e9d2f5 commit 4a17245
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Lib/Project/ResourcePack/Attachable/Process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function Process(doc: TextDocument): Attachable | undefined {
if (!Internal.Attachable.is(imp)) return undefined;

const container = imp["minecraft:attachable"];
const id = container.description.identifier;
const description = container.description;
const id = description.identifier;
const out: Attachable = {
id: id,
location: Types.Location.create(uri, content.indexOf(id)),
Expand All @@ -29,14 +30,16 @@ export function Process(doc: TextDocument): Attachable | undefined {
documentation: Documentation.getDoc(doc, () => `Attachable Item: ${id}`),
};

if (container.animations)
Types.Definition.forEach(container.animations, (value, key) => {
if (description.animations) {
Types.Definition.forEach(description.animations, (value, key) => {
out.animations.defined.push(key);
out.animations.using.push(value);
});
}

if (container.animation_controllers)
container.animation_controllers.forEach((item) => out.animations.using.push(item));
if (description.animation_controllers) {
description.animation_controllers.forEach((item) => out.animations.using.push(item));
}

return out;
}

0 comments on commit 4a17245

Please sign in to comment.