@divinevoxel/vlox 0.0.73 → 0.0.74

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 (217) hide show
  1. package/Contexts/Base/Remote/InitDataSync.js +4 -0
  2. package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
  3. package/Contexts/Render/DivineVoxelEngineRender.d.ts +1 -0
  4. package/Contexts/World/DivineVoxelEngineWorld.d.ts +1 -0
  5. package/Init/StartConstructor.js +2 -0
  6. package/Math/index.d.ts +5 -1
  7. package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
  8. package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
  9. package/Mesher/Functions/MeshSection.d.ts +1 -1
  10. package/Mesher/Functions/MeshSection.js +15 -22
  11. package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
  12. package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
  13. package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +1 -1
  14. package/Mesher/Geomtry/VoxelGeometryBuilder.js +118 -197
  15. package/Mesher/Geomtry/VoxelMesh.js +2 -2
  16. package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +8 -70
  17. package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +18 -183
  18. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
  19. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
  20. package/Mesher/Geomtry/VoxelMeshBuffers.js +2 -2
  21. package/Mesher/InitTask.js +5 -1
  22. package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
  23. package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
  24. package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
  25. package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
  26. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +7 -7
  27. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +22 -25
  28. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
  29. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
  30. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
  31. package/Mesher/Models/VoxelConstructor.d.ts +3 -3
  32. package/Mesher/Models/VoxelConstructor.js +8 -8
  33. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +2 -2
  34. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -9
  35. package/Mesher/Models/VoxelModelBuilder.js +1 -8
  36. package/Mesher/Types/Mesher.types.d.ts +1 -0
  37. package/Models/Defaults/CubeVoxelModels.js +16 -39
  38. package/Models/Defaults/LiquidVoxelModel.js +3 -3
  39. package/Models/Defaults/PanelVoxelModels.js +10 -36
  40. package/Models/Defaults/StairVoxelModel.js +6 -21
  41. package/Models/Examples.js +23 -44
  42. package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
  43. package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
  44. package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
  45. package/Models/Rules/Functions/BuildFinalInputs.js +13 -13
  46. package/Models/Rules/VoxelModelRuleBuilderRegister.js +8 -8
  47. package/Models/VoxelModel.types.d.ts +3 -3
  48. package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
  49. package/Renderer/InitTasks.js +1 -9
  50. package/Renderer/MeshManager.d.ts +1 -1
  51. package/Renderer/MeshManager.js +24 -23
  52. package/Renderer/MeshRegister.d.ts +5 -5
  53. package/Renderer/MeshRegister.js +2 -2
  54. package/Settings/EngineSettings.d.ts +1 -0
  55. package/Settings/EngineSettings.js +6 -3
  56. package/Settings/EngineSettings.types.d.ts +7 -21
  57. package/Settings/EngineSettings.types.js +6 -14
  58. package/Tasks/Logic/InitTasks.d.ts +1 -0
  59. package/Tasks/Logic/InitTasks.js +10 -0
  60. package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
  61. package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
  62. package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
  63. package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
  64. package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
  65. package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
  66. package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
  67. package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
  68. package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
  69. package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
  70. package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
  71. package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
  72. package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
  73. package/Tasks/Propagation/InitTasks.js +4 -4
  74. package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
  75. package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
  76. package/Tasks/Tasks.types.d.ts +2 -2
  77. package/Tasks/TasksIds.d.ts +2 -1
  78. package/Tasks/TasksIds.js +1 -0
  79. package/Tasks/Update/Common.d.ts +3 -0
  80. package/Tasks/Update/Common.js +41 -0
  81. package/Tasks/Update/EreaseUpdate.d.ts +3 -0
  82. package/Tasks/Update/EreaseUpdate.js +66 -0
  83. package/Tasks/Update/InitTasks.d.ts +2 -2
  84. package/Tasks/Update/InitTasks.js +3 -1
  85. package/Tasks/Update/PaintUpdate.d.ts +3 -0
  86. package/Tasks/Update/PaintUpdate.js +89 -0
  87. package/Tasks/Update/VoxelUpdate.d.ts +2 -5
  88. package/Tasks/Update/VoxelUpdate.js +5 -147
  89. package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +15 -7
  90. package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +20 -7
  91. package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
  92. package/Tasks/WorldGeneration/WorldGenBrush.js +2 -2
  93. package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
  94. package/Templates/Functions/CreateTemplate.d.ts +1 -1
  95. package/Tools/Brush/AdvancedBrushTool.js +1 -1
  96. package/Tools/Brush/Brush.d.ts +2 -2
  97. package/Tools/Brush/Brush.js +1 -1
  98. package/Tools/Tasks/TasksTool.d.ts +1 -0
  99. package/Tools/Tasks/TasksTool.js +2 -0
  100. package/Util/Binary/BinaryBuffer.d.ts +17 -11
  101. package/Util/Binary/BinaryBuffer.js +65 -59
  102. package/Util/Binary/BinaryTree.d.ts +46 -0
  103. package/Util/Binary/BinaryTree.js +104 -0
  104. package/Voxels/Cursor/VoxelCursor.interface.d.ts +7 -2
  105. package/Voxels/Cursor/VoxelCursor.interface.js +46 -2
  106. package/Voxels/Cursor/VoxelLightData.js +1 -1
  107. package/Voxels/Data/VoxelTag.types.d.ts +17 -2
  108. package/Voxels/Data/VoxelTag.types.js +6 -1
  109. package/Voxels/Data/VoxelTagsRegister.js +5 -0
  110. package/Voxels/Functions/BuildStateData.d.ts +6 -6
  111. package/Voxels/Functions/BuildStateData.js +31 -31
  112. package/Voxels/Functions/BuildTagAndPaletteData.js +5 -0
  113. package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
  114. package/Voxels/Indexes/VoxelIndex.js +16 -18
  115. package/Voxels/InitVoxelData.js +12 -8
  116. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
  117. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
  118. package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
  119. package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
  120. package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
  121. package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
  122. package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
  123. package/Voxels/Logic/VoxelLogic.types.js +1 -0
  124. package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
  125. package/Voxels/Logic/VoxelLogicRegister.js +15 -0
  126. package/Voxels/State/SchemaRegister.js +10 -5
  127. package/Voxels/State/State.types.d.ts +1 -1
  128. package/Voxels/State/StateTreeReader.d.ts +1 -1
  129. package/Voxels/State/StateTreeReader.js +2 -3
  130. package/Voxels/Types/Voxel.types.d.ts +3 -0
  131. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
  132. package/World/Archive/Archive.types.d.ts +31 -12
  133. package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
  134. package/World/Archive/Classes/ArchiveClasses.js +78 -0
  135. package/World/Archive/Classes/ImportedSection.d.ts +40 -0
  136. package/World/Archive/Classes/ImportedSection.js +307 -0
  137. package/World/Archive/Classes/ImportedSector.d.ts +23 -0
  138. package/World/Archive/Classes/ImportedSector.js +97 -0
  139. package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
  140. package/World/Archive/Functions/ArchiveArea.js +39 -36
  141. package/World/Archive/Functions/ArchiveSector.js +210 -404
  142. package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
  143. package/World/Archive/Functions/CreateArchivedSection.js +207 -0
  144. package/World/Archive/Functions/ImportSector.d.ts +1 -3
  145. package/World/Archive/Functions/ImportSector.js +13 -244
  146. package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
  147. package/World/Archive/Functions/RemoveDuplicates.js +92 -0
  148. package/World/Archive/Functions/Shared.d.ts +2 -2
  149. package/World/Archive/Functions/Shared.js +15 -40
  150. package/World/Archive/InitTasks.js +7 -10
  151. package/World/Cursor/SectionCursor.d.ts +1 -1
  152. package/World/Cursor/SectorCursor.d.ts +1 -1
  153. package/World/Cursor/WorldCursor.d.ts +4 -3
  154. package/World/Cursor/WorldCursor.js +16 -13
  155. package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
  156. package/World/Cursor/WorldVoxelCursor.js +23 -14
  157. package/World/Dimension/Dimension.d.ts +4 -1
  158. package/World/Dimension/Dimension.js +8 -1
  159. package/World/Section/Section.d.ts +17 -4
  160. package/World/Section/Section.js +68 -6
  161. package/World/Section/SectionState.d.ts +4 -2
  162. package/World/Section/SectionState.js +4 -2
  163. package/World/Sector/Sector.d.ts +7 -1
  164. package/World/Sector/Sector.js +37 -4
  165. package/World/Sector/SectorState.d.ts +3 -2
  166. package/World/Sector/SectorState.js +3 -2
  167. package/World/Types/WorldData.types.d.ts +2 -7
  168. package/World/WorldRegister.d.ts +9 -9
  169. package/World/WorldRegister.js +9 -6
  170. package/World/WorldSpaces.js +6 -6
  171. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
  172. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +6 -4
  173. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +9 -5
  174. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
  175. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
  176. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
  177. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
  178. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
  179. package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
  180. package/{Tasks/IWG/Internal/Classes/BuildQueue.js → WorldSimulation/Internal/Classes/TickQueue.js} +16 -7
  181. package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
  182. package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +6 -6
  183. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
  184. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
  185. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
  186. package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
  187. package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +29 -19
  188. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
  189. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
  190. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
  191. package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
  192. package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
  193. package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
  194. package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -14
  195. package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
  196. package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
  197. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
  198. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
  199. package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +5 -5
  200. package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +5 -5
  201. package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +21 -21
  202. package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
  203. package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
  204. package/package.json +1 -1
  205. package/Tasks/IWG/Internal/Classes/BuildQueue.d.ts +0 -11
  206. package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
  207. package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
  208. package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
  209. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -30
  210. package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
  211. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
  212. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
  213. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
  214. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
  215. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
  216. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
  217. /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
@@ -12,10 +12,9 @@ function runArchiveSector(location) {
12
12
  });
13
13
  const transfers = [];
14
14
  // if (archived.palettes.light) transfers.push(archived.palettes.light.buffer);
15
- if (archived.palettes.state)
16
- transfers.push(archived.palettes.state.buffer);
17
- if (archived.palettes.secondaryState)
18
- transfers.push(archived.palettes.secondaryState.buffer);
15
+ // if (archived.palettes.state) transfers.push(archived.palettes.state.buffer);
16
+ if (archived.palettes.secondaryValue)
17
+ transfers.push(archived.palettes.secondaryValue.buffer);
19
18
  for (const section of archived.sections) {
20
19
  if (typeof section == "string")
21
20
  continue;
@@ -42,12 +41,10 @@ function runArchiveSector(location) {
42
41
  if (section.palettes.id)
43
42
  transfers.push(section.palettes.id.buffer);
44
43
  // if (section.palettes.light) transfers.push(section.palettes.light.buffer);
45
- if (section.palettes.state)
46
- transfers.push(section.palettes.state.buffer);
47
- if (section.palettes.mod)
48
- transfers.push(section.palettes.mod.buffer);
49
- if (section.palettes.secondaryState)
50
- transfers.push(section.palettes.secondaryState.buffer);
44
+ // if (section.palettes.state) transfers.push(section.palettes.state.buffer);
45
+ // if (section.palettes.mod) transfers.push(section.palettes.mod.buffer);
46
+ if (section.palettes.secondaryValue)
47
+ transfers.push(section.palettes.secondaryValue.buffer);
51
48
  if (section.palettes.secondaryId)
52
49
  transfers.push(section.palettes.secondaryId.buffer);
53
50
  }
@@ -11,7 +11,7 @@ export declare class SectionCursor implements DataCursorInterface, WorldSectionC
11
11
  _sectionPosition: Vector3Like;
12
12
  inBounds(x: number, y: number, z: number): boolean;
13
13
  setSection(section: Section): boolean;
14
- setSection(dimension: string, x: number, y: number, z: number): boolean;
14
+ setSection(dimension: number, x: number, y: number, z: number): boolean;
15
15
  getVoxelAtIndex(index: number): WorldVoxelCursor;
16
16
  getVoxel(x: number, y: number, z: number): WorldVoxelCursor | null;
17
17
  }
@@ -12,7 +12,7 @@ export declare class SectorCursor implements DataCursorInterface, WorldSectionCu
12
12
  _voxelPosition: Vector3Like;
13
13
  _sectorPosition: Vector3Like;
14
14
  inBounds(x: number, y: number, z: number): boolean;
15
- setSector(dimension: string, x: number, y: number, z: number): boolean;
15
+ setSector(dimension: number, x: number, y: number, z: number): boolean;
16
16
  getSection(x: number, y: number, z: number): Section | null;
17
17
  getVoxel(x: number, y: number, z: number): WorldVoxelCursor | null;
18
18
  getVoxelAtIndex(index: number): void;
@@ -2,10 +2,11 @@ import { Vector3Like } from "@amodx/math";
2
2
  import { SectorCursor } from "./SectorCursor";
3
3
  import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
4
4
  export declare class WorldCursor implements DataCursorInterface {
5
- sectorCursors: Map<number, Map<number, SectorCursor>>;
5
+ sectorCursors: Record<number, Record<number, SectorCursor | null>>;
6
6
  origin: Vector3Like;
7
- dimension: string;
8
- setFocalPoint(dimension: string, x: number, y: number, z: number): void;
7
+ dimension: number;
8
+ _lastPosition: Vector3Like;
9
+ setFocalPoint(dimension: number, x: number, y: number, z: number): void;
9
10
  inBounds(x: number, y: number, z: number): boolean;
10
11
  getSector(x: number, y: number, z: number): SectorCursor | null;
11
12
  getVoxel(x: number, y: number, z: number): import("./WorldVoxelCursor").WorldVoxelCursor | null;
@@ -4,21 +4,26 @@ import { WorldSpaces } from "../WorldSpaces";
4
4
  let cursorCache = [];
5
5
  const tempPosition = Vector3Like.Create();
6
6
  export class WorldCursor {
7
- sectorCursors = new Map();
8
- origin = { x: 0, y: 0, z: 0 };
9
- dimension = "";
7
+ sectorCursors = {};
8
+ origin = Vector3Like.Create();
9
+ dimension = 0;
10
+ _lastPosition = Vector3Like.Create();
10
11
  setFocalPoint(dimension, x, y, z) {
11
12
  const sectorPos = WorldSpaces.sector.getPosition(x, y, z, tempPosition);
12
- for (const [cx, row] of this.sectorCursors) {
13
- for (const [cz, col] of row) {
14
- cursorCache.push(col);
13
+ for (const row in this.sectorCursors) {
14
+ for (const col in this.sectorCursors[row]) {
15
+ const cursor = this.sectorCursors[row][col];
16
+ if (!cursor)
17
+ continue;
18
+ cursorCache.push(cursor);
19
+ this.sectorCursors[row][col] = null;
15
20
  }
16
21
  }
17
- this.sectorCursors.clear();
18
22
  this.dimension = dimension;
19
23
  this.origin.x = sectorPos.x / WorldSpaces.sector.bounds.x;
20
24
  this.origin.y = sectorPos.y / WorldSpaces.sector.bounds.y;
21
25
  this.origin.z = sectorPos.z / WorldSpaces.sector.bounds.z;
26
+ this.getSector(x, y, z);
22
27
  }
23
28
  inBounds(x, y, z) {
24
29
  return WorldSpaces.world.inBounds(x, y, z);
@@ -29,19 +34,17 @@ export class WorldCursor {
29
34
  const sectorPos = WorldSpaces.sector.getPosition(x, y, z, tempPosition);
30
35
  const cx = sectorPos.x / WorldSpaces.sector.bounds.x - this.origin.x;
31
36
  const cz = sectorPos.z / WorldSpaces.sector.bounds.z - this.origin.z;
32
- let row = this.sectorCursors.get(cx);
33
- let cursor = row?.get(cz);
37
+ let cursor = this.sectorCursors[cx]?.[cz];
34
38
  if (!cursor) {
35
39
  cursor = cursorCache.length ? cursorCache.shift() : new SectorCursor();
36
40
  if (!cursor.setSector(this.dimension, sectorPos.x, sectorPos.y, sectorPos.z)) {
37
41
  cursorCache.push(cursor);
38
42
  return null;
39
43
  }
40
- if (!row) {
41
- row = new Map();
42
- this.sectorCursors.set(cx, row);
44
+ if (!this.sectorCursors[cx]) {
45
+ this.sectorCursors[cx] ??= {};
43
46
  }
44
- row.set(cz, cursor);
47
+ this.sectorCursors[cx][cz] = cursor;
45
48
  }
46
49
  return cursor;
47
50
  }
@@ -11,9 +11,5 @@ export declare class WorldVoxelCursor extends VoxelCursorInterface {
11
11
  secondary: Uint16Array;
12
12
  constructor(dataCursor: WorldSectionCursorInterface);
13
13
  loadIn(): void;
14
- /**
15
- *
16
- * @param mode 0 for add 1 for remove
17
- */
18
14
  updateVoxel(mode: 0 | 1 | 2): boolean;
19
15
  }
@@ -1,13 +1,13 @@
1
1
  import { VoxelCursorInterface } from "../../Voxels/Cursor/VoxelCursor.interface";
2
2
  export class WorldVoxelCursor extends VoxelCursorInterface {
3
3
  dataCursor;
4
- _section;
5
- ids;
6
- light;
7
- level;
8
- state;
9
- mod;
10
- secondary;
4
+ _section = null;
5
+ ids = new Uint16Array(1);
6
+ light = new Uint16Array(1);
7
+ level = new Uint8Array(1);
8
+ state = new Uint16Array(1);
9
+ mod = new Uint16Array(1);
10
+ secondary = new Uint16Array(1);
11
11
  constructor(dataCursor) {
12
12
  super();
13
13
  this.dataCursor = dataCursor;
@@ -25,26 +25,35 @@ export class WorldVoxelCursor extends VoxelCursorInterface {
25
25
  this._index = this.dataCursor._voxelIndex;
26
26
  this.process();
27
27
  }
28
- /**
29
- *
30
- * @param mode 0 for add 1 for remove
31
- */
32
28
  updateVoxel(mode) {
33
29
  const voxelPos = this.dataCursor._voxelPosition;
34
30
  this.dataCursor._section?.sector.setStored(false);
31
+ this.dataCursor._section?.setBuried(this.dataCursor._voxelIndex, false);
35
32
  if (mode == 0) {
36
- this.dataCursor._section?.setBuried(this.dataCursor._voxelIndex, false);
33
+ if (this.doesVoxelAffectLogic()) {
34
+ this.dataCursor._section?.setLogicDirty(true);
35
+ this.dataCursor._section?.setLogicSliceDirty(voxelPos.y, true);
36
+ this.dataCursor._section?.setVoxelLogicDirty(this.dataCursor._voxelIndex, true);
37
+ }
37
38
  this.dataCursor._section?.setHasVoxel(voxelPos.y, true);
38
39
  return true;
39
40
  }
40
41
  if (mode == 1) {
41
- this.dataCursor._section?.setBuried(this.dataCursor._voxelIndex, false);
42
+ if (this.doesVoxelAffectLogic()) {
43
+ this.dataCursor._section?.setLogicDirty(true);
44
+ this.dataCursor._section?.setLogicSliceDirty(voxelPos.y, true);
45
+ this.dataCursor._section?.setVoxelLogicDirty(this.dataCursor._voxelIndex, true);
46
+ }
42
47
  this.dataCursor._section?.setHasVoxelDirty(voxelPos.y, true);
43
48
  this.dataCursor._section?.setHasVoxel(voxelPos.y, false);
44
49
  return true;
45
50
  }
46
51
  if (mode == 2) {
47
- this.dataCursor._section?.setBuried(this.dataCursor._voxelIndex, false);
52
+ if (this.doesVoxelAffectLogic()) {
53
+ this.dataCursor._section?.setLogicDirty(true);
54
+ this.dataCursor._section?.setLogicSliceDirty(voxelPos.y, true);
55
+ this.dataCursor._section?.setVoxelLogicDirty(this.dataCursor._voxelIndex, true);
56
+ }
48
57
  }
49
58
  return false;
50
59
  }
@@ -1,14 +1,17 @@
1
+ import { DimensionSyncData } from "../Types/WorldData.types";
1
2
  import { Sector } from "../Sector";
2
3
  export interface DimensionData {
3
4
  id: string;
5
+ index: number;
4
6
  sectors: Map<string, Sector>;
5
7
  }
6
8
  export interface Dimension extends DimensionData {
7
9
  }
8
10
  export declare class Dimension {
9
- static CreateNew(id: string): Dimension;
11
+ static CreateNew(index: number, id?: string): Dimension;
10
12
  constructor(data: DimensionData);
11
13
  set(sectorId: string, region: Sector): void;
12
14
  delete(sectorId: string): void;
13
15
  get(sectorId: string): Sector | undefined;
16
+ getData(): DimensionSyncData;
14
17
  }
@@ -1,7 +1,8 @@
1
1
  export class Dimension {
2
- static CreateNew(id) {
2
+ static CreateNew(index, id = "") {
3
3
  return new Dimension({
4
4
  id,
5
+ index,
5
6
  sectors: new Map(),
6
7
  });
7
8
  }
@@ -17,4 +18,10 @@ export class Dimension {
17
18
  get(sectorId) {
18
19
  return this.sectors.get(sectorId);
19
20
  }
21
+ getData() {
22
+ return {
23
+ id: this.id,
24
+ index: this.index,
25
+ };
26
+ }
20
27
  }
@@ -1,5 +1,5 @@
1
1
  import { Sector } from "../Sector/Sector.js";
2
- import { Vec3Array } from "@amodx/math";
2
+ import { Vec2Array, Vec3Array } from "@amodx/math";
3
3
  import { VoxelDataArrays } from "Voxels/index.js";
4
4
  export interface SectionData extends VoxelDataArrays {
5
5
  /**Array of bit flags for the sector*/
@@ -8,8 +8,12 @@ export interface SectionData extends VoxelDataArrays {
8
8
  voxelMap: Uint8Array;
9
9
  /**Y slice of the section to tell if the slice is dirty and voxelMap needs to be re-checked. */
10
10
  dirtyMap: Uint8Array;
11
+ /**Y slice of the section to tell if the slice is needs it voxel logic checked.*/
12
+ logicDirtyMap: Uint8Array;
11
13
  /**A bit array used to cache if a voxel is exposed or not. */
12
14
  buried: Uint8Array;
15
+ /**A bit array used to cache if a voxel needs its logic evaled or not*/
16
+ logicDirty: Uint8Array;
13
17
  }
14
18
  export interface Section extends SectionData {
15
19
  }
@@ -25,17 +29,26 @@ export declare class Section {
25
29
  getPosition(): Readonly<Vec3Array>;
26
30
  setBitFlag(index: number, value: boolean): void;
27
31
  getBitFlag(index: number): boolean;
28
- isDirty(): boolean;
29
- setDirty(dirty: boolean): void;
32
+ isDisplayDirty(): boolean;
33
+ setDisplayDirty(dirty: boolean): void;
34
+ isLogicDirty(): boolean;
35
+ setLogicDirty(dirty: boolean): void;
36
+ isLogicSliceDirty(y: number): boolean;
37
+ setLogicSliceDirty(y: number, dirty: boolean): void;
38
+ getVoxelLogicDirty(index: number): boolean;
39
+ setVoxelLogicDirty(index: number, value: boolean): void;
30
40
  isInProgress(): boolean;
31
41
  setInProgress(inProgress: boolean): void;
42
+ isLogicUpdateInProgress(): boolean;
43
+ setLogicUpdateInProgress(inProgress: boolean): void;
32
44
  getBuried(index: number): boolean;
33
45
  setBuried(index: number, value: boolean): void;
34
46
  setHasVoxel(y: number, hasVoxel: boolean): void;
35
47
  getHasVoxel(y: number): boolean;
36
48
  setHasVoxelDirty(y: number, dirty: boolean): void;
37
49
  getHasVoxelDirty(y: number): boolean;
38
- getMinMax(): number[];
50
+ getMinMax(): Vec2Array;
51
+ getLogicMinMax(): Vec2Array;
39
52
  storeFlags(): Record<string, boolean>;
40
53
  loadFlags(flags: Record<string, boolean>): void;
41
54
  toJSON(): SectionData;
@@ -3,6 +3,7 @@ import { Sector } from "../Sector/Sector.js";
3
3
  import { getBitArrayIndex, setBitArrayIndex, } from "../../Util/Binary/BinaryArrays.js";
4
4
  import { SectionState, SectionStateDefaultFlags } from "./SectionState.js";
5
5
  import { forceMultipleOf2 } from "../../Util/Binary/BinaryFunctions.js";
6
+ const temp = [0, 0];
6
7
  export class Section {
7
8
  sector;
8
9
  index;
@@ -17,8 +18,12 @@ export class Section {
17
18
  height / 8 +
18
19
  //dirtyMap
19
20
  height / 8 +
21
+ //logicDirtyMap
22
+ height / 8 +
20
23
  //bureid
21
24
  voxelSize / 8 +
25
+ //logic dirty
26
+ voxelSize / 8 +
22
27
  //---- voxel data arrays
23
28
  //ids
24
29
  voxelSize * 2 +
@@ -46,8 +51,12 @@ export class Section {
46
51
  bufferStart += height / 8;
47
52
  const dirtyMap = new Uint8Array(sectorBuffer, bufferStart, height / 8);
48
53
  bufferStart += height / 8;
54
+ const logicDirtyMap = new Uint8Array(sectorBuffer, bufferStart, height / 8);
55
+ bufferStart += height / 8;
49
56
  const buried = new Uint8Array(sectorBuffer, bufferStart, voxelSize / 8);
50
57
  bufferStart += voxelSize / 8;
58
+ const logicDirty = new Uint8Array(sectorBuffer, bufferStart, voxelSize / 8);
59
+ bufferStart += voxelSize / 8;
51
60
  const ids = new Uint16Array(sectorBuffer, bufferStart, voxelSize);
52
61
  bufferStart += voxelSize * 2;
53
62
  const light = new Uint16Array(sectorBuffer, bufferStart, voxelSize);
@@ -64,6 +73,8 @@ export class Section {
64
73
  flagArray,
65
74
  voxelMap,
66
75
  dirtyMap,
76
+ logicDirtyMap,
77
+ logicDirty,
67
78
  buried,
68
79
  ids,
69
80
  light,
@@ -90,6 +101,8 @@ export class Section {
90
101
  this.flagArray = data.flagArray;
91
102
  this.voxelMap = data.voxelMap;
92
103
  this.dirtyMap = data.dirtyMap;
104
+ this.logicDirty = data.logicDirty;
105
+ this.logicDirtyMap = data.logicDirtyMap;
93
106
  this.buried = data.buried;
94
107
  this.ids = data.ids;
95
108
  this.level = data.level;
@@ -107,13 +120,36 @@ export class Section {
107
120
  getBitFlag(index) {
108
121
  return getBitArrayIndex(this.flagArray, index) == 1;
109
122
  }
110
- isDirty() {
111
- return this.getBitFlag(SectionStateDefaultFlags.isDirty);
123
+ isDisplayDirty() {
124
+ return this.getBitFlag(SectionStateDefaultFlags.displayDirty);
112
125
  }
113
- setDirty(dirty) {
114
- this.setBitFlag(SectionStateDefaultFlags.isDirty, dirty);
115
- if (dirty)
126
+ setDisplayDirty(dirty) {
127
+ this.setBitFlag(SectionStateDefaultFlags.displayDirty, dirty);
128
+ if (dirty) {
116
129
  this.sector.setStored(false);
130
+ this.sector.setDisplayDirty(true);
131
+ }
132
+ }
133
+ isLogicDirty() {
134
+ return this.getBitFlag(SectionStateDefaultFlags.logicDirty);
135
+ }
136
+ setLogicDirty(dirty) {
137
+ this.setBitFlag(SectionStateDefaultFlags.logicDirty, dirty);
138
+ if (dirty) {
139
+ this.sector.setLogicDirty(true);
140
+ }
141
+ }
142
+ isLogicSliceDirty(y) {
143
+ return getBitArrayIndex(this.logicDirtyMap, y) == 1;
144
+ }
145
+ setLogicSliceDirty(y, dirty) {
146
+ setBitArrayIndex(this.logicDirtyMap, y, dirty ? 1 : 0);
147
+ }
148
+ getVoxelLogicDirty(index) {
149
+ return getBitArrayIndex(this.logicDirty, index) == 1;
150
+ }
151
+ setVoxelLogicDirty(index, value) {
152
+ return setBitArrayIndex(this.logicDirty, index, value ? 1 : 0);
117
153
  }
118
154
  isInProgress() {
119
155
  return this.getBitFlag(SectionStateDefaultFlags.inProgress);
@@ -121,6 +157,12 @@ export class Section {
121
157
  setInProgress(inProgress) {
122
158
  this.setBitFlag(SectionStateDefaultFlags.inProgress, inProgress);
123
159
  }
160
+ isLogicUpdateInProgress() {
161
+ return this.getBitFlag(SectionStateDefaultFlags.logicUpdateInProgress);
162
+ }
163
+ setLogicUpdateInProgress(inProgress) {
164
+ this.setBitFlag(SectionStateDefaultFlags.logicUpdateInProgress, inProgress);
165
+ }
124
166
  getBuried(index) {
125
167
  return getBitArrayIndex(this.buried, index) == 1;
126
168
  }
@@ -151,7 +193,25 @@ export class Section {
151
193
  max = i;
152
194
  }
153
195
  }
154
- return [min, max];
196
+ temp[0] = min;
197
+ temp[1] = max;
198
+ return temp;
199
+ }
200
+ getLogicMinMax() {
201
+ let min = Infinity;
202
+ let max = -Infinity;
203
+ let i = WorldSpaces.section.bounds.y;
204
+ while (i--) {
205
+ if (this.isLogicSliceDirty(i)) {
206
+ if (i < min)
207
+ min = i;
208
+ if (i > max)
209
+ max = i;
210
+ }
211
+ }
212
+ temp[0] = min;
213
+ temp[1] = max;
214
+ return temp;
155
215
  }
156
216
  storeFlags() {
157
217
  const stored = {};
@@ -173,6 +233,8 @@ export class Section {
173
233
  toJSON() {
174
234
  return {
175
235
  flagArray: this.flagArray,
236
+ logicDirtyMap: this.logicDirtyMap,
237
+ logicDirty: this.logicDirty,
176
238
  voxelMap: this.voxelMap,
177
239
  dirtyMap: this.dirtyMap,
178
240
  buried: this.buried,
@@ -1,6 +1,8 @@
1
1
  export declare enum SectionStateDefaultFlags {
2
- isDirty = 0,
3
- inProgress = 1
2
+ displayDirty = 0,
3
+ logicDirty = 1,
4
+ inProgress = 2,
5
+ logicUpdateInProgress = 3
4
6
  }
5
7
  export declare class SectionState {
6
8
  /**The default bit flags for sections */
@@ -1,7 +1,9 @@
1
1
  export var SectionStateDefaultFlags;
2
2
  (function (SectionStateDefaultFlags) {
3
- SectionStateDefaultFlags[SectionStateDefaultFlags["isDirty"] = 0] = "isDirty";
4
- SectionStateDefaultFlags[SectionStateDefaultFlags["inProgress"] = 1] = "inProgress";
3
+ SectionStateDefaultFlags[SectionStateDefaultFlags["displayDirty"] = 0] = "displayDirty";
4
+ SectionStateDefaultFlags[SectionStateDefaultFlags["logicDirty"] = 1] = "logicDirty";
5
+ SectionStateDefaultFlags[SectionStateDefaultFlags["inProgress"] = 2] = "inProgress";
6
+ SectionStateDefaultFlags[SectionStateDefaultFlags["logicUpdateInProgress"] = 3] = "logicUpdateInProgress";
5
7
  })(SectionStateDefaultFlags || (SectionStateDefaultFlags = {}));
6
8
  export class SectionState {
7
9
  /**The default bit flags for sections */
@@ -24,12 +24,18 @@ export declare class Sector {
24
24
  getSection(x: number, y: number, z: number): Section;
25
25
  setBitFlag(index: number, value: boolean): void;
26
26
  getBitFlag(index: number): boolean;
27
+ isDisplayDirty(): boolean;
28
+ setDisplayDirty(stored: boolean): void;
29
+ isLogicDirty(): boolean;
30
+ setLogicDirty(stored: boolean): void;
27
31
  setStored(stored: boolean): void;
28
32
  isStored(): boolean;
29
33
  setTimeStamp(index: number, value: number): void;
30
34
  getTimeStamp(index: number): number;
31
35
  getRenerableSections(): Generator<Section>;
32
- anySectionDirty(): boolean;
36
+ getLogicDirtySections(): Generator<Section>;
37
+ anySectionDisplayDirty(): boolean;
38
+ anySectionLogicDirty(): boolean;
33
39
  storeFlags(): Record<string, boolean>;
34
40
  loadFlags(flags: Record<string, boolean>): void;
35
41
  storeTimestamps(): Record<string, number>;
@@ -55,11 +55,23 @@ export class Sector {
55
55
  getBitFlag(index) {
56
56
  return getBitArrayIndex(this.flagArray, index) == 1;
57
57
  }
58
+ isDisplayDirty() {
59
+ return this.getBitFlag(SectorStateDefaultBitFlags.displayDirty);
60
+ }
61
+ setDisplayDirty(stored) {
62
+ this.setBitFlag(SectorStateDefaultBitFlags.displayDirty, stored);
63
+ }
64
+ isLogicDirty() {
65
+ return this.getBitFlag(SectorStateDefaultBitFlags.logicDirty);
66
+ }
67
+ setLogicDirty(stored) {
68
+ this.setBitFlag(SectorStateDefaultBitFlags.logicDirty, stored);
69
+ }
58
70
  setStored(stored) {
59
- this.setBitFlag(SectorStateDefaultBitFlags.isStored, stored);
71
+ this.setBitFlag(SectorStateDefaultBitFlags.stored, stored);
60
72
  }
61
73
  isStored() {
62
- return this.getBitFlag(SectorStateDefaultBitFlags.isStored);
74
+ return this.getBitFlag(SectorStateDefaultBitFlags.stored);
63
75
  }
64
76
  setTimeStamp(index, value) {
65
77
  this.timeStampArray[index] = value;
@@ -75,11 +87,32 @@ export class Sector {
75
87
  yield section;
76
88
  }
77
89
  }
78
- anySectionDirty() {
90
+ *getLogicDirtySections() {
91
+ for (const section of this.sections) {
92
+ const [min, max] = section.getLogicMinMax();
93
+ if (min == Infinity || max == -Infinity)
94
+ continue;
95
+ yield section;
96
+ }
97
+ }
98
+ anySectionDisplayDirty() {
99
+ if (!this.isDisplayDirty())
100
+ return false;
101
+ for (let i = 0; i < this.sections.length; i++) {
102
+ if (this.sections[i].isDisplayDirty() && !this.sections[i].isInProgress())
103
+ return true;
104
+ }
105
+ this.setDisplayDirty(false);
106
+ return false;
107
+ }
108
+ anySectionLogicDirty() {
109
+ if (!this.isLogicDirty())
110
+ return false;
79
111
  for (let i = 0; i < this.sections.length; i++) {
80
- if (this.sections[i].isDirty() && !this.sections[i].isInProgress())
112
+ if (this.sections[i].isLogicDirty() && !this.sections[i].isLogicUpdateInProgress())
81
113
  return true;
82
114
  }
115
+ this.setLogicDirty(false);
83
116
  return false;
84
117
  }
85
118
  storeFlags() {
@@ -3,8 +3,9 @@ export declare enum SectorStateDefaultBitFlags {
3
3
  isWorldDecorDone = 1,
4
4
  isWorldPropagationDone = 2,
5
5
  isWorldSunDone = 3,
6
- isDirty = 4,
7
- isStored = 5
6
+ displayDirty = 4,
7
+ logicDirty = 5,
8
+ stored = 6
8
9
  }
9
10
  export declare enum SectorStateDefaultTimeStamps {
10
11
  lastSaveTimestamp = 0
@@ -4,8 +4,9 @@ export var SectorStateDefaultBitFlags;
4
4
  SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["isWorldDecorDone"] = 1] = "isWorldDecorDone";
5
5
  SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["isWorldPropagationDone"] = 2] = "isWorldPropagationDone";
6
6
  SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["isWorldSunDone"] = 3] = "isWorldSunDone";
7
- SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["isDirty"] = 4] = "isDirty";
8
- SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["isStored"] = 5] = "isStored";
7
+ SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["displayDirty"] = 4] = "displayDirty";
8
+ SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["logicDirty"] = 5] = "logicDirty";
9
+ SectorStateDefaultBitFlags[SectorStateDefaultBitFlags["stored"] = 6] = "stored";
9
10
  })(SectorStateDefaultBitFlags || (SectorStateDefaultBitFlags = {}));
10
11
  export var SectorStateDefaultTimeStamps;
11
12
  (function (SectorStateDefaultTimeStamps) {
@@ -1,11 +1,6 @@
1
- export type DimensionOptions = {
2
- liquidFlowSpeed: number;
3
- magmaFlowSpeed: number;
4
- sunLight: boolean;
5
- };
6
- export type DimensionData = {
1
+ export type DimensionSyncData = {
7
2
  id: string;
8
- options: DimensionOptions;
3
+ index: number;
9
4
  };
10
5
  export type RichDataSchema = Record<string, Record<string, any>>;
11
6
  export type RichSector = {
@@ -1,10 +1,10 @@
1
1
  import { Dimension } from "./Dimension/Dimension";
2
2
  import { Sector, SectorData } from "./Sector/Sector.js";
3
3
  import type { LocationData } from "../Math/index.js";
4
- import { DimensionData } from "./Types/WorldData.types.js";
4
+ import { DimensionSyncData } from "./Types/WorldData.types.js";
5
5
  declare class WorldDataHooks {
6
6
  static dimension: {
7
- onNew: (dimension: DimensionData) => void;
7
+ onNew: (dimension: DimensionSyncData) => void;
8
8
  onRemove: (location: LocationData) => void;
9
9
  };
10
10
  static sectors: {
@@ -13,22 +13,22 @@ declare class WorldDataHooks {
13
13
  };
14
14
  }
15
15
  declare class WorldRegisterDimensions {
16
- static add(id: string): Dimension;
17
- static get(id: string): Dimension | undefined;
16
+ static add(index: number, id?: string): Dimension;
17
+ static get(index: number): Dimension | undefined;
18
18
  }
19
19
  declare class WorldRegisterSectors {
20
20
  static setSecotrPool(enabled: boolean): void;
21
- static add(dimensionId: string, x: number, y: number, z: number, sector: SectorData): Sector;
21
+ static add(dimensionId: number, x: number, y: number, z: number, sector: SectorData): Sector;
22
22
  static addAt(location: LocationData, sector: SectorData): Sector;
23
- static new(dimensionId: string, x: number, y: number, z: number): boolean;
23
+ static new(dimensionId: number, x: number, y: number, z: number): boolean;
24
24
  static newAt(location: LocationData): boolean;
25
- static get(dimensionId: string, x: number, y: number, z: number): false | Sector;
25
+ static get(dimensionId: number, x: number, y: number, z: number): false | Sector;
26
26
  static getAt(location: LocationData): false | Sector;
27
- static remove(dimensionId: string, x: number, y: number, z: number): boolean;
27
+ static remove(dimensionId: number, x: number, y: number, z: number): boolean;
28
28
  static removeAt(location: LocationData): boolean;
29
29
  }
30
30
  export declare class WorldRegister {
31
- static _dimensions: Map<string, Dimension>;
31
+ static _dimensions: Map<number, Dimension>;
32
32
  static _hooks: typeof WorldDataHooks;
33
33
  static dimensions: typeof WorldRegisterDimensions;
34
34
  static sectors: typeof WorldRegisterSectors;
@@ -13,13 +13,14 @@ class WorldDataHooks {
13
13
  };
14
14
  }
15
15
  class WorldRegisterDimensions {
16
- static add(id) {
17
- const dimesnion = Dimension.CreateNew(id);
18
- WorldRegister._dimensions.set(id, dimesnion);
16
+ static add(index, id = "") {
17
+ const dimesnion = Dimension.CreateNew(index, id);
18
+ WorldRegister._dimensions.set(index, dimesnion);
19
+ WorldDataHooks.dimension.onNew(dimesnion.getData());
19
20
  return dimesnion;
20
21
  }
21
- static get(id) {
22
- return WorldRegister._dimensions.get(id);
22
+ static get(index) {
23
+ return WorldRegister._dimensions.get(index);
23
24
  }
24
25
  }
25
26
  const tempPosition = Vector3Like.Create();
@@ -97,7 +98,9 @@ class WorldRegisterSectors {
97
98
  }
98
99
  }
99
100
  export class WorldRegister {
100
- static _dimensions = new Map();
101
+ static _dimensions = new Map([
102
+ [0, new Dimension(Dimension.CreateNew(0, "main"))],
103
+ ]);
101
104
  static _hooks = WorldDataHooks;
102
105
  static dimensions = WorldRegisterDimensions;
103
106
  static sectors = WorldRegisterSectors;