simplified-mojang-jsons 0.0.4 → 0.0.5
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.
package/dist/index.js
CHANGED
|
@@ -13469,7 +13469,7 @@ var FinalEntityBuilderTemplate = class extends BehaviorEntityBuilder {
|
|
|
13469
13469
|
}
|
|
13470
13470
|
events[name] = event;
|
|
13471
13471
|
}
|
|
13472
|
-
this.validateEvents(events, Object.keys(compsGroups), where);
|
|
13472
|
+
this.validateEvents(events, Object.keys(compsGroups), where, !def.id.startsWith("minecraft:"));
|
|
13473
13473
|
this.setDefaultComponents(Object.values(comps));
|
|
13474
13474
|
this.setDefaultComponentGroups(Object.fromEntries(Object.entries(compsGroups).map(([id, g]) => [id, Object.values(g)])));
|
|
13475
13475
|
this.setDefaultEvents(events);
|
|
@@ -13570,7 +13570,7 @@ var FinalEntityBuilderTemplate = class extends BehaviorEntityBuilder {
|
|
|
13570
13570
|
* @author HaJuegos - 01-10-2026
|
|
13571
13571
|
* @private
|
|
13572
13572
|
*/
|
|
13573
|
-
validateEvents(events, groups, where) {
|
|
13573
|
+
validateEvents(events, groups, where, strict) {
|
|
13574
13574
|
const walk = (node, event) => {
|
|
13575
13575
|
if (Array.isArray(node)) {
|
|
13576
13576
|
node.forEach((item) => walk(item, event));
|
|
@@ -13583,7 +13583,7 @@ var FinalEntityBuilderTemplate = class extends BehaviorEntityBuilder {
|
|
|
13583
13583
|
const names = value?.componentGroups;
|
|
13584
13584
|
if ((key == "add" || key == "remove") && Array.isArray(names)) {
|
|
13585
13585
|
names.forEach((name, i) => {
|
|
13586
|
-
if (!groups.includes(name)) {
|
|
13586
|
+
if (strict && !groups.includes(name)) {
|
|
13587
13587
|
throw new Error(`${where} events."${event}".${key}: el grupo "${name}" no existe. Disponibles: ${groups.join(", ") || "(ninguno)"}.`);
|
|
13588
13588
|
}
|
|
13589
13589
|
if (names.indexOf(name) != i) {
|