asajs 4.0.13 → 4.0.14-indev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,7 +94,7 @@ export class UI extends Class {
94
94
  throw new Error("Cannot add a child to itself");
95
95
  const childName = name || RandomString(16);
96
96
  this.controls.set(childName, [child, properties || {}]);
97
- callback?.(childName);
97
+ callback?.apply(this, [childName]);
98
98
  return this;
99
99
  }
100
100
  addAnimations(...anims) {
@@ -163,17 +163,18 @@ export function Modify(namespace, name) {
163
163
  // @ts-ignore
164
164
  if (memoryUI)
165
165
  return memoryUI;
166
- if (!paths[namespace]) {
166
+ const path = paths[namespace];
167
+ if (!path) {
167
168
  throw new Error(`Namespace '${namespace}' does not exist`);
168
169
  // @ts-ignore
169
170
  }
170
- else if (!paths[namespace][name]) {
171
+ else if (typeof path !== "string" && !paths[namespace][name]) {
171
172
  throw new Error(`Element '${name}' does not exist in namespace '${namespace}'`);
172
173
  }
173
174
  // @ts-ignore
174
175
  const modifyUI = new ModifyUI(namespace, name,
175
176
  // @ts-ignore
176
- paths[namespace][name]);
177
+ typeof path === "string" ? path : paths[namespace][name]);
177
178
  (MemoryModify[paths[namespace][name]] ||= {})[name] = modifyUI;
178
179
  return modifyUI;
179
180
  }
package/dist/js/index.js CHANGED
@@ -12,3 +12,4 @@ export { ItemAuxID } from "./types/enums/Items.js";
12
12
  export { ArrayName, Operation } from "./types/properties/index.js";
13
13
  export * from "./compilers/bindings/Binary.js";
14
14
  export { API } from "./components/API.js";
15
+ export * from "./analyzer/generate-ui-defs.js";
@@ -558,6 +558,7 @@ export var ItemAuxID;
558
558
  ItemAuxID[ItemAuxID["GOLDEN_BOOTS"] = 25296896] = "GOLDEN_BOOTS";
559
559
  ItemAuxID[ItemAuxID["GOLDEN_CARROT"] = 20447232] = "GOLDEN_CARROT";
560
560
  ItemAuxID[ItemAuxID["GOLDEN_CHESTPLATE"] = 25165824] = "GOLDEN_CHESTPLATE";
561
+ ItemAuxID[ItemAuxID["GOLDEN_DANDELION"] = -71499776] = "GOLDEN_DANDELION";
561
562
  ItemAuxID[ItemAuxID["GOLDEN_HELMET"] = 25100288] = "GOLDEN_HELMET";
562
563
  ItemAuxID[ItemAuxID["GOLDEN_HOE"] = 23920640] = "GOLDEN_HOE";
563
564
  ItemAuxID[ItemAuxID["GOLDEN_HORSE_ARMOR"] = 37421056] = "GOLDEN_HORSE_ARMOR";