simplified-mojang-jsons 0.0.10 → 0.0.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AnimControllerTemplateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/builders/resources/animControllers/AnimControllerTemplateBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAA8B,gBAAgB,EAAE,MAAM,iEAAiE,CAAC;AA4GrL;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,KAAK,CAAC,IAAI,SAAS,0BAA0B,EAC/C,GAAG,EAAE,IAAI,WACO,wBAAwB,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAGpF"}
1
+ {"version":3,"file":"AnimControllerTemplateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/builders/resources/animControllers/AnimControllerTemplateBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAA8B,gBAAgB,EAAE,MAAM,iEAAiE,CAAC;AA8IrL;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,KAAK,CAAC,IAAI,SAAS,0BAA0B,EAC/C,GAAG,EAAE,IAAI,WACO,wBAAwB,CAAC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAGpF"}
package/dist/index.js CHANGED
@@ -208347,8 +208347,26 @@ var FinalRPAnimControllerBuilderTemplate = class _FinalRPAnimControllerBuilderTe
208347
208347
  }
208348
208348
  ;
208349
208349
  for (const [stateId, partial] of Object.entries(edit.states ?? {})) {
208350
- if (ctrl.states[stateId] && partial) {
208351
- Object.assign(ctrl.states[stateId], partial);
208350
+ if (!ctrl.states[stateId]) {
208351
+ ctrl.states[stateId] = partial;
208352
+ } else if (partial) {
208353
+ for (const [prop, val] of Object.entries(partial)) {
208354
+ const targetProp = ctrl.states[stateId][prop];
208355
+ if (Array.isArray(targetProp) && Array.isArray(val)) {
208356
+ const existingKeys = new Set(targetProp.map((x) => JSON.stringify(x)));
208357
+ const merged = [...targetProp];
208358
+ for (const item of val) {
208359
+ const serialized = JSON.stringify(item);
208360
+ if (!existingKeys.has(serialized)) {
208361
+ merged.push(item);
208362
+ existingKeys.add(serialized);
208363
+ }
208364
+ }
208365
+ ctrl.states[stateId][prop] = merged;
208366
+ } else {
208367
+ ctrl.states[stateId][prop] = val;
208368
+ }
208369
+ }
208352
208370
  }
208353
208371
  }
208354
208372
  }
@@ -208391,7 +208409,18 @@ var FinalRPAnimControllerBuilderTemplate = class _FinalRPAnimControllerBuilderTe
208391
208409
  }
208392
208410
  }
208393
208411
  if (over.add?.animControllers) {
208394
- controllers.push(...structuredClone([...over.add.animControllers]));
208412
+ for (const newCtrl of over.add.animControllers) {
208413
+ const existing = controllers.find((c) => c.idController === newCtrl.idController);
208414
+ if (existing) {
208415
+ existing.initialState = newCtrl.initialState || existing.initialState;
208416
+ existing.states = {
208417
+ ...existing.states,
208418
+ ...newCtrl.states
208419
+ };
208420
+ } else {
208421
+ controllers.push(structuredClone(newCtrl));
208422
+ }
208423
+ }
208395
208424
  }
208396
208425
  return { ...def, animControllers: controllers };
208397
208426
  }