sandstone 1.0.1 → 1.0.2

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.
Files changed (37) hide show
  1. package/dist/_internal/index.d.ts +8 -8
  2. package/dist/_internal/index.d.ts.map +1 -1
  3. package/dist/_internal/index.js +45 -43
  4. package/dist/_internal/index.js.map +1 -1
  5. package/dist/_internal/types/arguments/generated/resources.d.ts +2 -2
  6. package/dist/_internal/types/arguments/generated/resources.d.ts.map +1 -1
  7. package/dist/_internal/types/commands/implementations/block/place.d.ts +1 -1
  8. package/dist/_internal/types/commands/implementations/block/place.d.ts.map +1 -1
  9. package/dist/_internal/types/commands/implementations/server/schedule.d.ts +1 -1
  10. package/dist/_internal/types/core/resources/index.d.ts +1 -1
  11. package/dist/_internal/types/core/resources/resourcepack/blockstate.d.ts +13 -13
  12. package/dist/_internal/types/core/resources/resourcepack/blockstate.d.ts.map +1 -1
  13. package/dist/_internal/types/flow/Flow.d.ts +11 -11
  14. package/dist/_internal/types/flow/loop.d.ts +1 -1
  15. package/dist/_internal/types/pack/index.d.ts +1 -1
  16. package/dist/_internal/types/pack/pack.d.ts +7 -7
  17. package/dist/_internal/types/pack/pack.d.ts.map +1 -1
  18. package/dist/_internal/types/variables/Data.d.ts +1 -1
  19. package/dist/_internal/types/variables/DataSets.d.ts +4 -4
  20. package/dist/_internal/types/variables/DataSets.d.ts.map +1 -1
  21. package/dist/_internal/types/variables/ResolveNBT.d.ts +2 -2
  22. package/dist/browser/sandstone.esm.js +45 -43
  23. package/dist/browser/sandstone.esm.js.map +1 -1
  24. package/dist/exports/core/index.d.ts +1 -1
  25. package/dist/exports/core/index.js +1 -1
  26. package/dist/exports/index.d.ts +1 -1
  27. package/dist/exports/index.js +1 -1
  28. package/dist/exports/variables/index.d.ts +1 -1
  29. package/dist/exports/variables/index.js +1 -1
  30. package/package.json +1 -1
  31. package/src/arguments/generated/resources.ts +2 -2
  32. package/src/commands/implementations/block/place.ts +1 -1
  33. package/src/core/resources/datapack/itemModifier.ts +2 -2
  34. package/src/core/resources/resourcepack/blockstate.ts +32 -32
  35. package/src/pack/pack.ts +17 -15
  36. package/src/sandstone.ts +34 -5
  37. package/src/variables/DataSets.ts +4 -4
@@ -2521,68 +2521,68 @@ AtlasClass = class AtlasClass extends ResourceClass {
2521
2521
  }
2522
2522
  }
2523
2523
  };
2524
- BlockStateNode = class BlockStateNode extends ContainerNode {
2524
+ BlockStateDefinitionNode = class BlockStateDefinitionNode extends ContainerNode {
2525
2525
  resource;
2526
2526
  constructor(sandstoneCore, resource) {
2527
2527
  super(sandstoneCore);
2528
2528
  this.resource = resource;
2529
2529
  }
2530
- getValue = () => jsonStringify(this.resource.blockStateJSON, this.resource._resourceType);
2530
+ getValue = () => jsonStringify(this.resource.blockStateDefinitionJSON, this.resource._resourceType);
2531
2531
  };
2532
- BlockStateClass = class BlockStateClass extends ResourceClass {
2532
+ BlockStateDefinitionClass = class BlockStateDefinitionClass extends ResourceClass {
2533
2533
  static resourceType = "block_definition";
2534
- blockStateJSON;
2534
+ blockStateDefinitionJSON;
2535
2535
  type;
2536
2536
  constructor(core, name, args) {
2537
- super(core, { packType: core.pack.resourcePack() }, BlockStateNode, BlockStateClass.resourceType, core.pack.resourceToPath(name, RESOURCE_PATHS[BlockStateClass.resourceType].path), args);
2538
- this.blockStateJSON = args.json;
2539
- this.type = Object.keys(this.blockStateJSON)[0];
2537
+ super(core, { packType: core.pack.resourcePack() }, BlockStateDefinitionNode, BlockStateDefinitionClass.resourceType, core.pack.resourceToPath(name, RESOURCE_PATHS[BlockStateDefinitionClass.resourceType].path), args);
2538
+ this.blockStateDefinitionJSON = args.json;
2539
+ this.type = Object.keys(this.blockStateDefinitionJSON)[0];
2540
2540
  this.handleConflicts();
2541
2541
  }
2542
2542
  push(...states) {
2543
2543
  if (this.type === "variants") {
2544
- if (states[0] instanceof BlockStateClass) {
2544
+ if (states[0] instanceof BlockStateDefinitionClass) {
2545
2545
  for (const state of states) {
2546
- this.blockStateJSON.variants = { ...this.blockStateJSON.variants, ...state.blockStateJSON.variants };
2546
+ this.blockStateDefinitionJSON.variants = { ...this.blockStateDefinitionJSON.variants, ...state.blockStateDefinitionJSON.variants };
2547
2547
  }
2548
2548
  } else {
2549
2549
  for (const state of states) {
2550
- this.blockStateJSON.variants = { ...this.blockStateJSON.variants, ...state.variants };
2550
+ this.blockStateDefinitionJSON.variants = { ...this.blockStateDefinitionJSON.variants, ...state.variants };
2551
2551
  }
2552
2552
  }
2553
2553
  }
2554
2554
  if (this.type === "multipart") {
2555
- if (states[0] instanceof BlockStateClass) {
2555
+ if (states[0] instanceof BlockStateDefinitionClass) {
2556
2556
  for (const state of states) {
2557
- this.blockStateJSON.multipart.push(...state.blockStateJSON.multipart);
2557
+ this.blockStateDefinitionJSON.multipart.push(...state.blockStateDefinitionJSON.multipart);
2558
2558
  }
2559
2559
  } else {
2560
2560
  for (const state of states) {
2561
- this.blockStateJSON.multipart.push(...state.multipart);
2561
+ this.blockStateDefinitionJSON.multipart.push(...state.multipart);
2562
2562
  }
2563
2563
  }
2564
2564
  }
2565
2565
  }
2566
2566
  unshift(...states) {
2567
2567
  if (this.type === "variants") {
2568
- if (states[0] instanceof BlockStateClass) {
2568
+ if (states[0] instanceof BlockStateDefinitionClass) {
2569
2569
  for (const state of states) {
2570
- this.blockStateJSON.variants = { ...state.blockStateJSON.variants, ...this.blockStateJSON.variants };
2570
+ this.blockStateDefinitionJSON.variants = { ...state.blockStateDefinitionJSON.variants, ...this.blockStateDefinitionJSON.variants };
2571
2571
  }
2572
2572
  } else {
2573
2573
  for (const state of states) {
2574
- this.blockStateJSON.variants = { ...state.variants, ...this.blockStateJSON.variants };
2574
+ this.blockStateDefinitionJSON.variants = { ...state.variants, ...this.blockStateDefinitionJSON.variants };
2575
2575
  }
2576
2576
  }
2577
2577
  }
2578
2578
  if (this.type === "multipart") {
2579
- if (states[0] instanceof BlockStateClass) {
2579
+ if (states[0] instanceof BlockStateDefinitionClass) {
2580
2580
  for (const state of states) {
2581
- this.blockStateJSON.multipart.unshift(...state.blockStateJSON.multipart);
2581
+ this.blockStateDefinitionJSON.multipart.unshift(...state.blockStateDefinitionJSON.multipart);
2582
2582
  }
2583
2583
  } else {
2584
2584
  for (const state of states) {
2585
- this.blockStateJSON.multipart.unshift(...state.multipart);
2585
+ this.blockStateDefinitionJSON.multipart.unshift(...state.multipart);
2586
2586
  }
2587
2587
  }
2588
2588
  }
@@ -17537,7 +17537,7 @@ var init_atlas = __esm(() => {
17537
17537
  });
17538
17538
 
17539
17539
  // src/core/resources/resourcepack/blockstate.ts
17540
- var BlockStateNode, BlockStateClass;
17540
+ var BlockStateDefinitionNode, BlockStateDefinitionClass;
17541
17541
  var init_blockstate = __esm(() => {
17542
17542
  init_arguments();
17543
17543
  init_nodes();
@@ -20047,11 +20047,11 @@ class SandstonePack {
20047
20047
  }
20048
20048
  return {
20049
20049
  datapack: {
20050
- packFormat: 61,
20050
+ packFormat: 111,
20051
20051
  description: "A Sandstone datapack"
20052
20052
  },
20053
20053
  resourcepack: {
20054
- packFormat: 46,
20054
+ packFormat: 92,
20055
20055
  description: "A Sandstone resource pack"
20056
20056
  }
20057
20057
  };
@@ -20128,7 +20128,7 @@ class SandstonePack {
20128
20128
  dataPack() {
20129
20129
  let pack = this.packTypes.get("datapack");
20130
20130
  if (!pack) {
20131
- const options = this.packOptions.datapack ?? { packFormat: 98, description: "A Sandstone datapack" };
20131
+ const options = this.packOptions.datapack ?? { packFormat: 111, description: "A Sandstone datapack" };
20132
20132
  pack = this.packTypes.set("datapack", new DataPack(false, options)).get("datapack");
20133
20133
  }
20134
20134
  return pack;
@@ -20136,7 +20136,7 @@ class SandstonePack {
20136
20136
  resourcePack() {
20137
20137
  let pack = this.packTypes.get("resourcepack");
20138
20138
  if (!pack) {
20139
- const options = this.packOptions.resourcepack ?? { packFormat: 79, description: "A Sandstone resource pack" };
20139
+ const options = this.packOptions.resourcepack ?? { packFormat: 92, description: "A Sandstone resource pack" };
20140
20140
  pack = this.packTypes.set("resourcepack", new ResourcePack(options)).get("resourcepack");
20141
20141
  }
20142
20142
  return pack;
@@ -20282,10 +20282,10 @@ class SandstonePack {
20282
20282
  return anonymousData;
20283
20283
  }
20284
20284
  DataIndexMap(initialize, dataPoint2) {
20285
- return DataIndexMap(this, initialize, dataPoint2);
20285
+ return DataIndexMapInternal(this, initialize, dataPoint2);
20286
20286
  }
20287
20287
  DataArray(initialize, dataPoint2) {
20288
- return DataArray(this, initialize, dataPoint2);
20288
+ return DataArrayInternal(this, initialize, dataPoint2);
20289
20289
  }
20290
20290
  getTempStorage = (name) => {
20291
20291
  if (tempStorage) {
@@ -20585,12 +20585,12 @@ class SandstonePack {
20585
20585
  onConflict: conflictDefaults("atlas"),
20586
20586
  ...options
20587
20587
  });
20588
- BlockState(name, json, options) {
20589
- return new BlockStateClass(this.core, name, {
20588
+ BlockStateDefinition(name, json, options) {
20589
+ return new BlockStateDefinitionClass(this.core, name, {
20590
20590
  json,
20591
20591
  creator: "user",
20592
20592
  addToSandstoneCore: true,
20593
- onConflict: conflictDefaults("blockstate"),
20593
+ onConflict: conflictDefaults("block_definition"),
20594
20594
  ...options
20595
20595
  });
20596
20596
  }
@@ -20745,10 +20745,10 @@ var init_sandstone = __esm(() => {
20745
20745
  init_utils();
20746
20746
  init_Coordinates();
20747
20747
  init_ResolveNBT();
20748
+ init_NBTs();
20748
20749
  init_variables2();
20749
20750
  init_core();
20750
20751
  init_resources();
20751
- init_NBTs();
20752
20752
  sandstonePack = new Proxy({}, {
20753
20753
  get(_target, prop) {
20754
20754
  if (!_sandstonePack) {
@@ -60666,7 +60666,7 @@ var init_resources3 = __esm(() => {
60666
60666
  [VillagerTradeClass, "villager_trade"],
60667
60667
  [WorldClockClass, "world_clock"],
60668
60668
  [AtlasClass, "atlas"],
60669
- [BlockStateClass, "block_definition"],
60669
+ [BlockStateDefinitionClass, "block_definition"],
60670
60670
  [EquipmentClass, "equipment"],
60671
60671
  [FontClass, "font"],
60672
60672
  [ItemModelDefinitionClass, "item_definition"],
@@ -60720,7 +60720,7 @@ var init_ItemPredicate = __esm(() => {
60720
60720
  });
60721
60721
 
60722
60722
  // src/variables/DataSets.ts
60723
- function DataIndexMap(pack2, initialize, dataPoint2) {
60723
+ function DataIndexMapInternal(pack2, initialize, dataPoint2) {
60724
60724
  const indexMap = new DataIndexMapClass(pack2, initialize, dataPoint2);
60725
60725
  return new Proxy(indexMap, {
60726
60726
  get(target, p, receiver) {
@@ -60738,7 +60738,7 @@ function DataIndexMap(pack2, initialize, dataPoint2) {
60738
60738
  }
60739
60739
  });
60740
60740
  }
60741
- function DataArray(pack2, initialize, dataPoint2) {
60741
+ function DataArrayInternal(pack2, initialize, dataPoint2) {
60742
60742
  const array3 = new DataArrayClass(pack2, initialize, dataPoint2);
60743
60743
  return new Proxy(array3, {
60744
60744
  get(target, p, receiver) {
@@ -61230,6 +61230,7 @@ init_pack2();
61230
61230
  init_utils();
61231
61231
  init_Coordinates();
61232
61232
  init_ResolveNBT();
61233
+ init_NBTs();
61233
61234
  init_variables2();
61234
61235
  init_core();
61235
61236
  init_resources();
@@ -61239,7 +61240,6 @@ init_commands2();
61239
61240
  init_flow();
61240
61241
  init_pack2();
61241
61242
  init_arguments();
61242
- init_NBTs();
61243
61243
  var _sandstonePack2;
61244
61244
  var sandstonePack2 = new Proxy({}, {
61245
61245
  get(_target, prop) {
@@ -61428,7 +61428,7 @@ var {
61428
61428
  VillagerTrade,
61429
61429
  WorldClock,
61430
61430
  Atlas,
61431
- BlockState,
61431
+ BlockStateDefinition,
61432
61432
  Equipment,
61433
61433
  Font,
61434
61434
  ItemModelDefinition,
@@ -61452,8 +61452,8 @@ var {
61452
61452
  DataVariable,
61453
61453
  getTempStorage,
61454
61454
  ResolveNBT: ResolveNBT2,
61455
- DataIndexMap: DataIndexMap2,
61456
- DataArray: DataArray2,
61455
+ DataIndexMap,
61456
+ DataArray,
61457
61457
  Selector: Selector2,
61458
61458
  UUID: UUID2,
61459
61459
  ItemPredicate: ItemPredicate2,
@@ -62111,14 +62111,16 @@ export {
62111
62111
  DataModifyFromCommand,
62112
62112
  DataModifyCommand,
62113
62113
  DataMergeCommand,
62114
+ DataIndexMapInternal,
62114
62115
  DataIndexMapClass,
62115
- DataIndexMap2 as DataIndexMap,
62116
+ DataIndexMap,
62116
62117
  DataGetCommand,
62117
62118
  DataCommandNode,
62118
62119
  DataCommand,
62119
62120
  DataClass,
62121
+ DataArrayInternal,
62120
62122
  DataArrayClass,
62121
- DataArray2 as DataArray,
62123
+ DataArray,
62122
62124
  Data2 as Data,
62123
62125
  DamageTypeNode,
62124
62126
  DamageTypeClass,
@@ -62182,9 +62184,9 @@ export {
62182
62184
  BossBarCommandNode,
62183
62185
  BossBarCommand,
62184
62186
  BlocksConditionNode,
62185
- BlockStateNode,
62186
- BlockStateClass,
62187
- BlockState,
62187
+ BlockStateDefinitionNode,
62188
+ BlockStateDefinitionClass,
62189
+ BlockStateDefinition,
62188
62190
  BlockConditionNode,
62189
62191
  BiomeConditionNode,
62190
62192
  BannerPatternNode,
@@ -62218,5 +62220,5 @@ export {
62218
62220
  ACTIVITIES_SET
62219
62221
  };
62220
62222
 
62221
- //# debugId=8CDAA29C12CBBF5F64756E2164756E21
62223
+ //# debugId=8D420837DED3537764756E2164756E21
62222
62224
  //# sourceMappingURL=sandstone.esm.js.map