@divinevoxel/vlox 0.0.72 → 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 (307) 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 +2 -1
  4. package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -1
  5. package/Init/StartConstructor.js +8 -4
  6. package/Init/StartWorld.d.ts +1 -1
  7. package/Math/index.d.ts +5 -1
  8. package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
  9. package/Mesher/Functions/CompactVoxelMesh.js +1 -1
  10. package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
  11. package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
  12. package/Mesher/Functions/MeshSection.d.ts +1 -1
  13. package/Mesher/Functions/MeshSection.js +27 -22
  14. package/Mesher/Functions/MeshTexture.d.ts +1 -1
  15. package/Mesher/Functions/MeshTexture.js +3 -4
  16. package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
  17. package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
  18. package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +12 -10
  19. package/Mesher/Geomtry/Primitives/QuadVertexData.js +49 -56
  20. package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +2 -2
  21. package/Mesher/Geomtry/VoxelGeometryBuilder.js +120 -199
  22. package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
  23. package/Mesher/Geomtry/VoxelMesh.js +4 -4
  24. package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +16 -0
  25. package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +51 -0
  26. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
  27. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
  28. package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +2 -2
  29. package/Mesher/Geomtry/index.d.ts +0 -1
  30. package/Mesher/Geomtry/index.js +0 -1
  31. package/Mesher/InitMesher.js +1 -1
  32. package/Mesher/InitTask.js +9 -23
  33. package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
  34. package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
  35. package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
  36. package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
  37. package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
  38. package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
  39. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +2 -2
  40. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
  41. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +18 -24
  42. package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -2
  43. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +1 -0
  44. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +40 -31
  45. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
  46. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
  47. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
  48. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
  49. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
  50. package/Mesher/Models/RenderedMaterials.d.ts +6 -0
  51. package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
  52. package/Mesher/Models/VoxelConstructor.d.ts +6 -6
  53. package/Mesher/Models/VoxelConstructor.js +8 -8
  54. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -5
  55. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -32
  56. package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
  57. package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +5 -8
  58. package/Mesher/Types/Mesher.types.d.ts +1 -0
  59. package/Models/Defaults/CubeVoxelGeometry.js +4 -0
  60. package/Models/Defaults/CubeVoxelModels.js +360 -383
  61. package/Models/Defaults/LiquidVoxelModel.js +5 -5
  62. package/Models/Defaults/PanelVoxelModels.js +442 -468
  63. package/Models/Defaults/StairVoxelModel.js +582 -597
  64. package/Models/Examples.js +490 -498
  65. package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
  66. package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
  67. package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
  68. package/Models/Rules/Functions/BuildFinalInputs.js +21 -19
  69. package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
  70. package/Models/Rules/Functions/BuildRules.js +2 -2
  71. package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
  72. package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
  73. package/Models/VoxelModel.types.d.ts +17 -8
  74. package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
  75. package/Renderer/Classes/SectorMesh.d.ts +3 -4
  76. package/Renderer/Classes/SectorMesh.js +6 -11
  77. package/Renderer/InitTasks.js +1 -10
  78. package/Renderer/MeshManager.d.ts +1 -1
  79. package/Renderer/MeshManager.js +26 -25
  80. package/Renderer/MeshRegister.d.ts +5 -5
  81. package/Renderer/MeshRegister.js +4 -3
  82. package/Settings/EngineSettings.d.ts +2 -1
  83. package/Settings/EngineSettings.js +6 -5
  84. package/Settings/EngineSettings.types.d.ts +24 -39
  85. package/Settings/EngineSettings.types.js +22 -29
  86. package/Tasks/Logic/InitTasks.d.ts +1 -0
  87. package/Tasks/Logic/InitTasks.js +10 -0
  88. package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
  89. package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
  90. package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
  91. package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
  92. package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
  93. package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
  94. package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
  95. package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
  96. package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
  97. package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
  98. package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
  99. package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
  100. package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
  101. package/Tasks/Propagation/InitTasks.js +4 -4
  102. package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
  103. package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
  104. package/Tasks/Tasks.types.d.ts +2 -2
  105. package/Tasks/TasksIds.d.ts +2 -1
  106. package/Tasks/TasksIds.js +1 -0
  107. package/Tasks/Update/Common.d.ts +3 -0
  108. package/Tasks/Update/Common.js +41 -0
  109. package/Tasks/Update/EreaseUpdate.d.ts +3 -0
  110. package/Tasks/Update/EreaseUpdate.js +66 -0
  111. package/Tasks/Update/InitTasks.d.ts +2 -2
  112. package/Tasks/Update/InitTasks.js +3 -1
  113. package/Tasks/Update/PaintUpdate.d.ts +3 -0
  114. package/Tasks/Update/PaintUpdate.js +89 -0
  115. package/Tasks/Update/VoxelUpdate.d.ts +2 -5
  116. package/Tasks/Update/VoxelUpdate.js +7 -143
  117. package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +16 -6
  118. package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +44 -5
  119. package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
  120. package/Tasks/WorldGeneration/WorldGenBrush.js +3 -3
  121. package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
  122. package/Templates/Cursor/TemplateCursor.d.ts +2 -2
  123. package/Templates/Cursor/TemplateCursor.js +1 -2
  124. package/Templates/Functions/CreateTemplate.d.ts +1 -1
  125. package/Templates/VoxelTemplates.types.d.ts +1 -1
  126. package/Textures/Classes/CompiledTexture.d.ts +18 -0
  127. package/Textures/Classes/CompiledTexture.js +50 -0
  128. package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
  129. package/Textures/Classes/CompiledTextureAnimation.js +27 -0
  130. package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
  131. package/Textures/Classes/TextureAnimationTexture.js +32 -0
  132. package/Textures/Functions/BuildTextureData.d.ts +10 -0
  133. package/Textures/Functions/BuildTextureData.js +205 -0
  134. package/Textures/Texture.types.d.ts +50 -64
  135. package/Textures/TextureManager.d.ts +8 -19
  136. package/Textures/TextureManager.js +28 -166
  137. package/Tools/Brush/AdvancedBrushTool.js +1 -1
  138. package/Tools/Brush/Brush.d.ts +3 -3
  139. package/Tools/Brush/Brush.js +40 -8
  140. package/Tools/Tasks/TasksTool.d.ts +1 -0
  141. package/Tools/Tasks/TasksTool.js +2 -0
  142. package/Util/Binary/BinaryArrays.d.ts +6 -0
  143. package/Util/Binary/BinaryArrays.js +25 -0
  144. package/Util/Binary/BinaryBuffer.d.ts +35 -0
  145. package/Util/Binary/BinaryBuffer.js +136 -0
  146. package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
  147. package/Util/Binary/BinaryFunctions.js +11 -0
  148. package/{Mesher/Tools/VoxelMeshBVHBuilder.d.ts → Util/Binary/BinaryTree.d.ts} +1 -33
  149. package/Util/Binary/BinaryTree.js +104 -0
  150. package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
  151. package/Voxels/Cursor/VoxelCursor.interface.d.ts +8 -3
  152. package/Voxels/Cursor/VoxelCursor.interface.js +54 -13
  153. package/Voxels/Cursor/VoxelLightData.js +1 -1
  154. package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
  155. package/Voxels/Data/VoxelPalettesRegister.js +0 -9
  156. package/Voxels/Data/VoxelTag.types.d.ts +17 -2
  157. package/Voxels/Data/VoxelTag.types.js +6 -1
  158. package/Voxels/Data/VoxelTagsRegister.js +12 -7
  159. package/Voxels/Functions/BuildStateData.d.ts +6 -6
  160. package/Voxels/Functions/BuildStateData.js +37 -37
  161. package/Voxels/Functions/BuildTagAndPaletteData.js +6 -3
  162. package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
  163. package/Voxels/Indexes/VoxelIndex.js +16 -18
  164. package/Voxels/InitVoxelData.js +24 -21
  165. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
  166. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
  167. package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
  168. package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
  169. package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
  170. package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
  171. package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
  172. package/Voxels/Logic/VoxelLogic.types.js +1 -0
  173. package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
  174. package/Voxels/Logic/VoxelLogicRegister.js +15 -0
  175. package/Voxels/State/Schema/StateSchema.d.ts +1 -1
  176. package/Voxels/State/SchemaRegister.js +10 -5
  177. package/Voxels/State/State.types.d.ts +1 -1
  178. package/Voxels/State/StateTreeReader.d.ts +1 -1
  179. package/Voxels/State/StateTreeReader.js +2 -3
  180. package/Voxels/Types/Voxel.types.d.ts +21 -0
  181. package/Voxels/Types/Voxel.types.js +6 -2
  182. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
  183. package/World/Archive/Archive.types.d.ts +65 -42
  184. package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
  185. package/World/Archive/Classes/ArchiveClasses.js +78 -0
  186. package/World/Archive/Classes/ImportedSection.d.ts +40 -0
  187. package/World/Archive/Classes/ImportedSection.js +307 -0
  188. package/World/Archive/Classes/ImportedSector.d.ts +23 -0
  189. package/World/Archive/Classes/ImportedSector.js +97 -0
  190. package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
  191. package/World/Archive/Functions/ArchiveArea.js +49 -54
  192. package/World/Archive/Functions/ArchiveSector.js +373 -282
  193. package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
  194. package/World/Archive/Functions/CreateArchivedSection.js +207 -0
  195. package/World/Archive/Functions/ImportSector.d.ts +2 -4
  196. package/World/Archive/Functions/ImportSector.js +50 -220
  197. package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
  198. package/World/Archive/Functions/RemoveDuplicates.js +92 -0
  199. package/World/Archive/Functions/Shared.d.ts +6 -0
  200. package/World/Archive/Functions/Shared.js +50 -0
  201. package/World/Archive/InitTasks.js +37 -23
  202. package/World/Cursor/SectionCursor.d.ts +3 -3
  203. package/World/Cursor/SectionCursor.js +2 -3
  204. package/World/Cursor/SectorCursor.d.ts +3 -3
  205. package/World/Cursor/SectorCursor.js +1 -2
  206. package/World/Cursor/WorldCursor.d.ts +6 -5
  207. package/World/Cursor/WorldCursor.js +17 -15
  208. package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
  209. package/World/Cursor/WorldVoxelCursor.js +24 -14
  210. package/World/Dimension/Dimension.d.ts +4 -1
  211. package/World/Dimension/Dimension.js +8 -1
  212. package/World/InitTasks.d.ts +1 -1
  213. package/World/Lock/WorldLock.d.ts +1 -1
  214. package/World/Section/Section.d.ts +27 -18
  215. package/World/Section/Section.js +125 -21
  216. package/World/Section/SectionState.d.ts +12 -0
  217. package/World/Section/SectionState.js +13 -0
  218. package/World/Sector/Sector.d.ts +20 -6
  219. package/World/Sector/Sector.js +100 -17
  220. package/World/Sector/SectorHeightMap.js +2 -2
  221. package/World/Sector/SectorState.d.ts +16 -7
  222. package/World/Sector/SectorState.js +29 -15
  223. package/World/Types/WorldData.types.d.ts +2 -7
  224. package/World/Types/WorldStorage.interface.js +1 -0
  225. package/World/WorldRegister.d.ts +13 -9
  226. package/World/WorldRegister.js +24 -9
  227. package/World/WorldSpaces.d.ts +4 -0
  228. package/World/WorldSpaces.js +25 -12
  229. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
  230. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +10 -3
  231. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +19 -3
  232. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
  233. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
  234. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
  235. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
  236. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
  237. package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
  238. package/WorldSimulation/Internal/Classes/TickQueue.js +58 -0
  239. package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
  240. package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +8 -8
  241. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
  242. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
  243. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
  244. package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
  245. package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +38 -9
  246. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
  247. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
  248. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
  249. package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
  250. package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
  251. package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
  252. package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -24
  253. package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
  254. package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
  255. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
  256. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
  257. package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +7 -5
  258. package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +6 -5
  259. package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +29 -23
  260. package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
  261. package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
  262. package/package.json +1 -1
  263. package/Mesher/Functions/CompactMesh.d.ts +0 -2
  264. package/Mesher/Functions/CompactMesh.js +0 -42
  265. package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
  266. package/Mesher/Geomtry/GeometryNormals.js +0 -52
  267. package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
  268. package/Mesher/Geomtry/MeshData.types.js +0 -6
  269. package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
  270. package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
  271. package/Mesher/Geomtry/Tools/index.d.ts +0 -1
  272. package/Mesher/Geomtry/Tools/index.js +0 -1
  273. package/Mesher/RenderedMaterials.d.ts +0 -6
  274. package/Mesher/Tools/VoxelMeshBVHBuilder.js +0 -216
  275. package/Models/Rules/VoxelModelManager.js +0 -82
  276. package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
  277. package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
  278. package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
  279. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -34
  280. package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
  281. package/Textures/TextureAnimations.d.ts +0 -4
  282. package/Textures/TextureAnimations.js +0 -35
  283. package/Textures/TextureArray.d.ts +0 -47
  284. package/Textures/TextureArray.js +0 -202
  285. package/Textures/TextureBuilder.d.ts +0 -13
  286. package/Textures/TextureBuilder.js +0 -120
  287. package/Textures/TextureRegister.d.ts +0 -9
  288. package/Textures/TextureRegister.js +0 -28
  289. package/Tools/DataCursor.interface.d.ts +0 -5
  290. package/Tools/DataCursor.interface.js +0 -2
  291. package/Util/Binary/BitArray.js +0 -16
  292. package/World/Structs/WorldDataStructProperties.d.ts +0 -8
  293. package/World/Structs/WorldDataStructProperties.js +0 -9
  294. /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
  295. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
  296. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
  297. /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
  298. /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
  299. /package/{World/Storage/WorldStorage.interface.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
  300. /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
  301. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
  302. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
  303. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
  304. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
  305. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
  306. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
  307. /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
@@ -0,0 +1,41 @@
1
+ import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
2
+ import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
3
+ export const updateLightTask = (tasks) => {
4
+ let doRGB = ES.doRGBPropagation;
5
+ let doSun = ES.doSunPropagation;
6
+ const [dimension, x, y, z] = tasks.origin;
7
+ tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
8
+ for (const n of $3dCardinalNeighbors) {
9
+ const nx = n[0] + x;
10
+ const ny = n[1] + y;
11
+ const nz = n[2] + z;
12
+ const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
13
+ if (!nVoxel)
14
+ continue;
15
+ if (doRGB) {
16
+ if (nVoxel.hasRGBLight()) {
17
+ tasks.rgb.update.push(nx, ny, nz);
18
+ }
19
+ }
20
+ if (doSun) {
21
+ if (nVoxel.hasSunLight()) {
22
+ tasks.sun.update.push(nx, ny, nz);
23
+ }
24
+ }
25
+ }
26
+ };
27
+ export const updatePowerTask = (tasks) => {
28
+ const [dimension, x, y, z] = tasks.origin;
29
+ tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
30
+ for (const n of $3dCardinalNeighbors) {
31
+ const nx = n[0] + x;
32
+ const ny = n[1] + y;
33
+ const nz = n[2] + z;
34
+ const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
35
+ if (!nVoxel)
36
+ continue;
37
+ if (nVoxel.getPower() > 0) {
38
+ tasks.power.update.push(nx, ny, nz);
39
+ }
40
+ }
41
+ };
@@ -0,0 +1,3 @@
1
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
2
+ import { LocationData } from "../../Math/index.js";
3
+ export declare function EreaseAndUpdate(location: LocationData): Promise<false | VoxelUpdateTask>;
@@ -0,0 +1,66 @@
1
+ import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
2
+ import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
3
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
4
+ import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
5
+ import { SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
6
+ import { FlowRemove } from "../Propagation/Flow/FlowRemove.js";
7
+ import { updateLightTask } from "./Common.js";
8
+ import { PowerRemove, PowerUpdate } from "../Propagation/Power/PowerUpdate.js";
9
+ const tasks = new VoxelUpdateTask();
10
+ export async function EreaseAndUpdate(location) {
11
+ const [dimension, x, y, z] = location;
12
+ tasks.setOrigin(location);
13
+ let voxel = tasks.sDataCursor.getVoxel(x, y, z);
14
+ if (!voxel)
15
+ return false;
16
+ const substanceData = voxel.getSubstanceData();
17
+ const foundPower = voxel.getPower();
18
+ if (!voxel.isAir() && ES.doFlow && voxel.isRenderable()) {
19
+ if (substanceData["dve_is_liquid"]) {
20
+ FlowRemove(tasks);
21
+ return tasks;
22
+ }
23
+ }
24
+ voxel = tasks.sDataCursor.getVoxel(x, y, z);
25
+ const light = voxel.getLight();
26
+ const isLightSource = voxel.isLightSource();
27
+ voxel.setSecondary(true).setId(0).setSecondary(false);
28
+ voxel
29
+ .setLight(light > 0 ? light : 0)
30
+ .setId(0)
31
+ .setLevel(0)
32
+ .setLevelState(0)
33
+ .setState(0)
34
+ .setMod(0)
35
+ .updateVoxel(1);
36
+ if (ES.doLight) {
37
+ if (ES.doRGBPropagation && isLightSource) {
38
+ tasks.rgb.remove.push(x, y, z);
39
+ RGBRemove(tasks);
40
+ }
41
+ updateLightTask(tasks);
42
+ if (ES.doRGBPropagation) {
43
+ RGBUpdate(tasks);
44
+ }
45
+ if (ES.doSunPropagation) {
46
+ SunUpdate(tasks);
47
+ }
48
+ }
49
+ voxel = tasks.sDataCursor.getVoxel(x, y, z);
50
+ if (ES.doPower) {
51
+ if (foundPower > -1) {
52
+ voxel.setLevel(foundPower);
53
+ tasks.power.remove.push(x, y, z);
54
+ PowerRemove(tasks);
55
+ PowerUpdate(tasks);
56
+ }
57
+ }
58
+ tasks.bounds.update(x, y, z);
59
+ tasks.bounds.update(x + 1, y + 1, z + 1);
60
+ for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
61
+ tasks.sDataCursor
62
+ .getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
63
+ ?.updateVoxel(2);
64
+ }
65
+ return tasks;
66
+ }
@@ -1,5 +1,5 @@
1
1
  import { Thread } from "@amodx/threads";
2
- import { UpdateTask } from "./UpdateTask";
2
+ import { VoxelUpdateTask } from "../VoxelUpdateTask";
3
3
  export default function (props: {
4
- onDone(taks: UpdateTask, origin: Thread): void;
4
+ onDone(taks: VoxelUpdateTask, origin: Thread): void;
5
5
  }): void;
@@ -1,6 +1,8 @@
1
1
  import { Threads } from "@amodx/threads";
2
2
  import { TasksIds } from "../TasksIds";
3
- import { VoxelUpdate, EreaseAndUpdate, PaintAndUpdate } from "./VoxelUpdate";
3
+ import { VoxelUpdate } from "./VoxelUpdate";
4
+ import { EreaseAndUpdate } from "./EreaseUpdate";
5
+ import { PaintAndUpdate } from "./PaintUpdate";
4
6
  export default function (props) {
5
7
  Threads.registerTask(TasksIds.VoxelUpdate, async (data, origin) => {
6
8
  const tasks = await VoxelUpdate(data);
@@ -0,0 +1,3 @@
1
+ import { VoxelUpdateTasks } from "../Tasks.types.js";
2
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
3
+ export declare function PaintAndUpdate(data: VoxelUpdateTasks): Promise<false | VoxelUpdateTask>;
@@ -0,0 +1,89 @@
1
+ import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
2
+ import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
3
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
4
+ import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
5
+ import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
6
+ import { FlowUpdate } from "../Propagation/Flow/FlowUpdate.js";
7
+ import { updateLightTask, updatePowerTask } from "./Common.js";
8
+ import { PowerUpdate } from "../../Tasks/Propagation/Power/PowerUpdate.js";
9
+ const tasks = new VoxelUpdateTask();
10
+ export async function PaintAndUpdate(data) {
11
+ const [dimension, x, y, z] = data[0];
12
+ tasks.setOrigin(data[0]);
13
+ let voxel = tasks.sDataCursor.getVoxel(x, y, z);
14
+ if (!voxel)
15
+ return false;
16
+ const raw = data[1];
17
+ const isOpaque = voxel.isOpaque();
18
+ let doRGB = ES.doRGBPropagation;
19
+ let doSun = ES.doSunPropagation;
20
+ lighttest: if (ES.doLight) {
21
+ const light = voxel.getLight();
22
+ if (light <= 0)
23
+ break lighttest;
24
+ if (doSun) {
25
+ if (voxel.hasSunLight()) {
26
+ tasks.sun.remove.push(x, y, z);
27
+ SunRemove(tasks);
28
+ }
29
+ }
30
+ if (doRGB) {
31
+ if (voxel.hasRGBLight() && isOpaque) {
32
+ tasks.rgb.remove.push(x, y, z);
33
+ RGBRemove(tasks);
34
+ }
35
+ }
36
+ }
37
+ voxel = tasks.sDataCursor.getVoxel(x, y, z);
38
+ const id = raw[0];
39
+ if (id < 0)
40
+ return false;
41
+ voxel.setId(id);
42
+ voxel.setLevel(raw[2]);
43
+ voxel.setState(raw[3]);
44
+ voxel.setMod(raw[4]);
45
+ voxel.process();
46
+ if (raw[3] > 0 && voxel.canHaveSecondaryVoxel()) {
47
+ voxel.setSecondary(true);
48
+ voxel.setId(raw[5]);
49
+ voxel.setSecondary(false);
50
+ }
51
+ if (voxel.isLightSource() && voxel.getLightSourceValue()) {
52
+ voxel.setLight(voxel.getLightSourceValue());
53
+ }
54
+ voxel.updateVoxel(0);
55
+ if (ES.doLight) {
56
+ updateLightTask(tasks);
57
+ if (doRGB) {
58
+ tasks.rgb.update.push(x, y, z);
59
+ RGBUpdate(tasks);
60
+ }
61
+ if (doSun) {
62
+ SunUpdate(tasks);
63
+ }
64
+ }
65
+ voxel = tasks.sDataCursor.getVoxel(x, y, z);
66
+ if (ES.doFlow) {
67
+ if (!voxel.isAir() && voxel.getSubstanceData()["dve_is_liquid"]) {
68
+ FlowUpdate(tasks);
69
+ }
70
+ }
71
+ if (ES.doPower) {
72
+ if (voxel._tags["dve_can_be_powered"] ||
73
+ voxel._tags["dve_is_power_source"] ||
74
+ voxel._tags["dve_can_carry_power"] ||
75
+ voxel._tags["dve_can_hold_power"]) {
76
+ updatePowerTask(tasks);
77
+ tasks.power.update.push(x, y, z);
78
+ PowerUpdate(tasks);
79
+ }
80
+ }
81
+ tasks.bounds.update(x, y, z);
82
+ tasks.bounds.update(x + 1, y + 1, z + 1);
83
+ for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
84
+ tasks.sDataCursor
85
+ .getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
86
+ ?.updateVoxel(2);
87
+ }
88
+ return tasks;
89
+ }
@@ -1,6 +1,3 @@
1
1
  import { VoxelUpdateTasks } from "../Tasks.types.js";
2
- import { UpdateTask } from "./UpdateTask.js";
3
- import { LocationData } from "../../Math/index.js";
4
- export declare function EreaseAndUpdate(location: LocationData): Promise<false | UpdateTask>;
5
- export declare function PaintAndUpdate(data: VoxelUpdateTasks): Promise<false | UpdateTask>;
6
- export declare function VoxelUpdate(data: VoxelUpdateTasks): Promise<false | UpdateTask>;
2
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
3
+ export declare function VoxelUpdate(data: VoxelUpdateTasks): Promise<false | VoxelUpdateTask>;
@@ -1,148 +1,10 @@
1
1
  import { EngineSettings as ES } from "../../Settings/EngineSettings.js";
2
- import { $3dCardinalNeighbors } from "../../Math/CardinalNeighbors.js";
3
- import { UpdateTask } from "./UpdateTask.js";
4
- import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
5
- import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
2
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
3
+ import { RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
4
+ import { SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
6
5
  import { FlowUpdate } from "../Propagation/Flow/FlowUpdate.js";
7
- import { FlowRemove } from "../Propagation/Flow/FlowRemove.js";
8
- const tasks = new UpdateTask();
9
- const updateLightTask = (tasks) => {
10
- let doRGB = ES.doRGBPropagation;
11
- let doSun = ES.doSunPropagation;
12
- const [dimension, x, y, z] = tasks.origin;
13
- tasks.nDataCursor.setFocalPoint(dimension, x, y, z);
14
- for (const n of $3dCardinalNeighbors) {
15
- const nx = n[0] + x;
16
- const ny = n[1] + y;
17
- const nz = n[2] + z;
18
- const nVoxel = tasks.nDataCursor.getVoxel(nx, ny, nz);
19
- if (!nVoxel)
20
- continue;
21
- if (doRGB) {
22
- if (nVoxel.hasRGBLight()) {
23
- tasks.rgb.update.push(nx, ny, nz);
24
- }
25
- }
26
- if (doSun) {
27
- if (nVoxel.hasSunLight()) {
28
- tasks.sun.update.push(nx, ny, nz);
29
- }
30
- }
31
- }
32
- };
33
- export async function EreaseAndUpdate(location) {
34
- const [dimension, x, y, z] = location;
35
- tasks.setOrigin(location);
36
- let voxel = tasks.sDataCursor.getVoxel(x, y, z);
37
- if (!voxel)
38
- return false;
39
- const substanceData = voxel.getSubstanceData();
40
- if (!voxel.isAir() && ES.doFlow && voxel.isRenderable()) {
41
- if (substanceData["dve_is_liquid"]) {
42
- FlowRemove(tasks);
43
- return tasks;
44
- }
45
- }
46
- voxel = tasks.sDataCursor.getVoxel(x, y, z);
47
- const light = voxel.getLight();
48
- const isLightSource = voxel.isLightSource();
49
- voxel.setSecondary(true).setId(0).setSecondary(false);
50
- voxel
51
- .setLight(light > 0 ? light : 0)
52
- .setId(0)
53
- .setLevel(0)
54
- .setLevelState(0)
55
- .setState(0)
56
- .setMod(0)
57
- .updateVoxel(1);
58
- if (ES.doLight) {
59
- if (ES.doRGBPropagation && isLightSource) {
60
- tasks.rgb.remove.push(x, y, z);
61
- RGBRemove(tasks);
62
- }
63
- updateLightTask(tasks);
64
- if (ES.doRGBPropagation) {
65
- RGBUpdate(tasks);
66
- }
67
- if (ES.doSunPropagation) {
68
- SunUpdate(tasks);
69
- }
70
- }
71
- for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
72
- tasks.sDataCursor
73
- .getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
74
- ?.updateVoxel(2);
75
- }
76
- return tasks;
77
- }
78
- export async function PaintAndUpdate(data) {
79
- const [dimension, x, y, z] = data[0];
80
- tasks.setOrigin(data[0]);
81
- let voxel = tasks.sDataCursor.getVoxel(x, y, z);
82
- if (!voxel)
83
- return false;
84
- const raw = data[1];
85
- const isOpaque = voxel.isOpaque();
86
- let doRGB = ES.doRGBPropagation;
87
- let doSun = ES.doSunPropagation;
88
- lighttest: if (ES.doLight) {
89
- const light = voxel.getLight();
90
- if (light <= 0)
91
- break lighttest;
92
- if (doSun) {
93
- if (voxel.hasSunLight()) {
94
- tasks.sun.remove.push(x, y, z);
95
- SunRemove(tasks);
96
- }
97
- }
98
- if (doRGB) {
99
- if (voxel.hasRGBLight() && isOpaque) {
100
- tasks.rgb.remove.push(x, y, z);
101
- RGBRemove(tasks);
102
- }
103
- }
104
- }
105
- voxel = tasks.sDataCursor.getVoxel(x, y, z);
106
- const id = raw[0];
107
- if (id < 0)
108
- return false;
109
- voxel.setId(id);
110
- voxel.setLevel(raw[2]);
111
- voxel.setState(raw[3]);
112
- voxel.setMod(raw[4]);
113
- voxel.process();
114
- if (raw[3] > 0 && voxel.canHaveSecondaryVoxel()) {
115
- voxel.setSecondary(true);
116
- voxel.setId(raw[5]);
117
- voxel.setSecondary(false);
118
- }
119
- if (voxel.isLightSource() && voxel.getLightSourceValue()) {
120
- voxel.setLight(voxel.getLightSourceValue());
121
- }
122
- voxel.updateVoxel(0);
123
- if (ES.doLight) {
124
- updateLightTask(tasks);
125
- if (doRGB) {
126
- tasks.rgb.update.push(x, y, z);
127
- RGBUpdate(tasks);
128
- }
129
- if (doSun) {
130
- SunUpdate(tasks);
131
- }
132
- }
133
- voxel = tasks.sDataCursor.getVoxel(x, y, z);
134
- if (ES.doFlow) {
135
- if (!voxel.isAir() && voxel.getSubstanceData()["dve_is_liquid"]) {
136
- FlowUpdate(tasks);
137
- }
138
- }
139
- for (let i = 0; i < $3dCardinalNeighbors.length; i++) {
140
- tasks.sDataCursor
141
- .getVoxel($3dCardinalNeighbors[i][0] + x, $3dCardinalNeighbors[i][1] + y, $3dCardinalNeighbors[i][2] + z)
142
- ?.updateVoxel(2);
143
- }
144
- return tasks;
145
- }
6
+ import { updateLightTask } from "./Common.js";
7
+ const tasks = new VoxelUpdateTask();
146
8
  export async function VoxelUpdate(data) {
147
9
  const [dimension, x, y, z] = data[0];
148
10
  tasks.setOrigin(data[0]);
@@ -167,5 +29,7 @@ export async function VoxelUpdate(data) {
167
29
  FlowUpdate(tasks);
168
30
  }
169
31
  }
32
+ tasks.bounds.update(x, y, z);
33
+ tasks.bounds.update(x + 1, y + 1, z + 1);
170
34
  return tasks;
171
35
  }
@@ -1,6 +1,6 @@
1
- import { WorldCursor } from "../../World/Cursor/WorldCursor";
1
+ import { WorldCursor } from "../World/Cursor/WorldCursor";
2
2
  import { Vec3Array, Vector3Like } from "@amodx/math";
3
- import { LocationData } from "../../Math";
3
+ import { LocationData } from "../Math";
4
4
  export declare class TaskMap {
5
5
  _map: boolean[];
6
6
  get size(): number;
@@ -12,18 +12,21 @@ export declare class TaskMap {
12
12
  clear(): void;
13
13
  }
14
14
  declare class UpdatedBounds {
15
- _task: UpdateTask;
15
+ _task: VoxelUpdateTask;
16
16
  min: Vector3Like;
17
17
  max: Vector3Like;
18
- constructor(_task: UpdateTask);
19
- reset(): void;
18
+ dimension: number;
19
+ constructor(_task: VoxelUpdateTask);
20
+ start(dimension?: number): void;
20
21
  update(x: number, y: number, z: number): void;
21
22
  getSections(): Vec3Array[];
23
+ markSectionsAsDirty(): void;
22
24
  }
23
- export declare class UpdateTask {
25
+ export declare class VoxelUpdateTask {
24
26
  flow: FlowQueues;
25
27
  rgb: LightQueue;
26
28
  sun: LightQueue;
29
+ power: PowerQueue;
27
30
  bounds: UpdatedBounds;
28
31
  sDataCursor: WorldCursor;
29
32
  nDataCursor: WorldCursor;
@@ -50,4 +53,11 @@ declare class LightQueue {
50
53
  updateMap: TaskMap;
51
54
  clear(): void;
52
55
  }
56
+ declare class PowerQueue {
57
+ update: number[];
58
+ remove: number[];
59
+ removeMap: TaskMap;
60
+ updateMap: TaskMap;
61
+ clear(): void;
62
+ }
53
63
  export {};
@@ -1,6 +1,7 @@
1
- import { WorldCursor } from "../../World/Cursor/WorldCursor";
1
+ import { WorldCursor } from "../World/Cursor/WorldCursor";
2
2
  import { Vector3Like } from "@amodx/math";
3
- import { WorldSpaces } from "../../World/WorldSpaces";
3
+ import { WorldSpaces } from "../World/WorldSpaces";
4
+ import { WorldRegister } from "../World/WorldRegister";
4
5
  export class TaskMap {
5
6
  _map = [];
6
7
  get size() {
@@ -34,10 +35,12 @@ class UpdatedBounds {
34
35
  _task;
35
36
  min = Vector3Like.Clone(InfinityVec3);
36
37
  max = Vector3Like.Clone(NegativeInfinityVec3);
38
+ dimension = 0;
37
39
  constructor(_task) {
38
40
  this._task = _task;
39
41
  }
40
- reset() {
42
+ start(dimension) {
43
+ this.dimension = dimension || 0;
41
44
  Vector3Like.Copy(this.min, InfinityVec3);
42
45
  Vector3Like.Copy(this.max, NegativeInfinityVec3);
43
46
  }
@@ -76,11 +79,35 @@ class UpdatedBounds {
76
79
  }
77
80
  return sectionPositions;
78
81
  }
82
+ markSectionsAsDirty() {
83
+ const minSectionPos = WorldSpaces.section.getPosition(this.min.x - 1, this.min.y - 1, this.min.z - 1, tempPosition);
84
+ const minX = minSectionPos.x;
85
+ const minY = minSectionPos.y;
86
+ const minZ = minSectionPos.z;
87
+ const maxSectionPos = WorldSpaces.section.getPosition(this.max.x + 1, this.max.y + 1, this.max.z + 1, tempPosition);
88
+ const maxX = maxSectionPos.x;
89
+ const maxY = maxSectionPos.y;
90
+ const maxZ = maxSectionPos.z;
91
+ for (let x = minX; x <= maxX; x += WorldSpaces.section.bounds.x) {
92
+ for (let z = minZ; z <= maxZ; z += WorldSpaces.section.bounds.z) {
93
+ for (let y = minY; y <= maxY; y += WorldSpaces.section.bounds.y) {
94
+ if (!WorldSpaces.world.inBounds(x, y, z))
95
+ continue;
96
+ const sector = WorldRegister.sectors.get(this.dimension, x, y, z);
97
+ if (!sector)
98
+ continue;
99
+ const section = sector.getSection(x, y, z);
100
+ section.setDisplayDirty(true);
101
+ }
102
+ }
103
+ }
104
+ }
79
105
  }
80
- export class UpdateTask {
106
+ export class VoxelUpdateTask {
81
107
  flow = new FlowQueues();
82
108
  rgb = new LightQueue();
83
109
  sun = new LightQueue();
110
+ power = new PowerQueue();
84
111
  bounds = new UpdatedBounds(this);
85
112
  sDataCursor = new WorldCursor();
86
113
  nDataCursor = new WorldCursor();
@@ -96,13 +123,13 @@ export class UpdateTask {
96
123
  this.flow.update.map.start(origin[1], origin[2], origin[3]);
97
124
  this.flow.remove.map.start(origin[1], origin[2], origin[3]);
98
125
  this.flow.remove.noRemoveMap.start(origin[1], origin[2], origin[3]);
126
+ this.bounds.start(origin[0]);
99
127
  this.clear();
100
128
  }
101
129
  clear() {
102
130
  this.rgb.clear();
103
131
  this.sun.clear();
104
132
  this.flow.clear();
105
- this.bounds.reset();
106
133
  }
107
134
  }
108
135
  class FlowQueues {
@@ -135,3 +162,15 @@ class LightQueue {
135
162
  this.updateMap.clear();
136
163
  }
137
164
  }
165
+ class PowerQueue {
166
+ update = [];
167
+ remove = [];
168
+ removeMap = new TaskMap();
169
+ updateMap = new TaskMap();
170
+ clear() {
171
+ this.update.length = 0;
172
+ this.remove.length = 0;
173
+ this.removeMap.clear();
174
+ this.updateMap.clear();
175
+ }
176
+ }
@@ -1,11 +1,11 @@
1
1
  import type { Vec3Array } from "@amodx/math";
2
2
  import { BrushTool } from "../../Tools/Brush/Brush.js";
3
- import { UpdateTask } from "../Update/UpdateTask.js";
3
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
4
4
  export declare class WorldGenBrush extends BrushTool {
5
5
  constructor();
6
6
  requestsId: "";
7
- tasks: UpdateTask;
8
- start(dimension: string, x: number, y: number, z: number): this;
7
+ tasks: VoxelUpdateTask;
8
+ start(dimension: number, x: number, y: number, z: number): this;
9
9
  paint(): this;
10
10
  getUpdatedSections(): Vec3Array[];
11
11
  update(): false | undefined;
@@ -3,7 +3,7 @@ import { BrushTool } from "../../Tools/Brush/Brush.js";
3
3
  import { VoxelLightData } from "../../Voxels/Cursor/VoxelLightData.js";
4
4
  import { WorldGeneration } from "./WorldGeneration.js";
5
5
  import { DivineVoxelEngineConstructor } from "../../Contexts/Constructor/DivineVoxelEngineConstructor.js";
6
- import { UpdateTask } from "../Update/UpdateTask.js";
6
+ import { VoxelUpdateTask } from "../VoxelUpdateTask.js";
7
7
  import { RGBRemove, RGBUpdate } from "../Propagation/Illumanation/RGBUpdate.js";
8
8
  import { SunRemove, SunUpdate } from "../Propagation/Illumanation/SunUpdate.js";
9
9
  const lightData = new VoxelLightData();
@@ -13,7 +13,7 @@ export class WorldGenBrush extends BrushTool {
13
13
  WorldGeneration._brushes.push(this);
14
14
  }
15
15
  requestsId;
16
- tasks = new UpdateTask();
16
+ tasks = new VoxelUpdateTask();
17
17
  start(dimension, x, y, z) {
18
18
  this.dataCursor.setFocalPoint(dimension, x, y, z);
19
19
  this.tasks.setOrigin([dimension, x, y, z]);
@@ -56,7 +56,7 @@ export class WorldGenBrush extends BrushTool {
56
56
  }
57
57
  getUpdatedSections() {
58
58
  const queue = this.tasks.bounds.getSections();
59
- this.tasks.bounds.reset();
59
+ this.tasks.bounds.start();
60
60
  return queue;
61
61
  }
62
62
  update() {
@@ -4,7 +4,7 @@ export declare class WorldGenRegister {
4
4
  static MAX_ATTEMPTS: number;
5
5
  static _requests: Map<string, {
6
6
  attempts: number;
7
- dimension: string;
7
+ dimension: number;
8
8
  sections: Map<string, [x: number, y: number, z: number]>;
9
9
  voxels: [x: number, y: number, z: number, data: RawVoxelData][];
10
10
  }>;
@@ -1,7 +1,7 @@
1
1
  import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
2
- import { DataCursorInterface } from "../../Tools/DataCursor.interface";
2
+ import { DataCursorInterface } from "../../Voxels/Cursor/DataCursor.interface";
3
3
  import { FullVoxelTemplate } from "Templates/FullVoxelTemplate";
4
- export declare class TemplateCursor extends DataCursorInterface {
4
+ export declare class TemplateCursor implements DataCursorInterface {
5
5
  _voxelIndex: number;
6
6
  _template: FullVoxelTemplate | null;
7
7
  private voxel;
@@ -1,6 +1,5 @@
1
1
  import { TemplateVoxelCursor } from "./TemplateVoxelCursor";
2
- import { DataCursorInterface } from "../../Tools/DataCursor.interface";
3
- export class TemplateCursor extends DataCursorInterface {
2
+ export class TemplateCursor {
4
3
  _voxelIndex = 0;
5
4
  _template = null;
6
5
  voxel = new TemplateVoxelCursor(this);
@@ -1,3 +1,3 @@
1
1
  import { Vec3Array } from "@amodx/math";
2
2
  import { VoxelTemplate } from "../VoxelTemplate";
3
- export default function CreateTemplate(dimension: string, start: Vec3Array, end: Vec3Array): VoxelTemplate;
3
+ export default function CreateTemplate(dimension: number, start: Vec3Array, end: Vec3Array): VoxelTemplate;
@@ -1,5 +1,5 @@
1
1
  import { Vec3Array } from "@amodx/math";
2
- import { VoxelDataArrays } from "../World";
2
+ import { VoxelDataArrays } from "../Voxels";
3
3
  export interface VoxelTemplateBuffers {
4
4
  ids: Uint16Array | Uint8Array | number;
5
5
  state: Uint16Array | Uint8Array | number;
@@ -0,0 +1,18 @@
1
+ import { Vec2Array } from "@amodx/math";
2
+ import { TextureId } from "../../Textures/Texture.types";
3
+ import { CompiledTextureAnimation } from "./CompiledTextureAnimation";
4
+ import { TextureAnimationTexture } from "./TextureAnimationTexture";
5
+ export declare class CompiledTexture {
6
+ id: string;
7
+ static GetAtlasIndex: (x: number, y: number, boundsX: number) => number;
8
+ static GetAtlasPosition: (index: number, boundsX: number, position?: Vec2Array) => Vec2Array;
9
+ images: HTMLImageElement[];
10
+ atlasSizeMap: Record<string, [width: number, height: number]>;
11
+ textureMap: Record<string, number>;
12
+ animations: CompiledTextureAnimation[];
13
+ shaderTexture: any;
14
+ animatedTexture: TextureAnimationTexture;
15
+ constructor(id: string);
16
+ getTextureIndex(id: TextureId): number;
17
+ getTexturePath(id: TextureId): string;
18
+ }