@quenty/spawning 10.22.3 → 10.22.4-canary.11a5dcf.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.22.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/spawning@10.22.3...@quenty/spawning@10.22.4-canary.11a5dcf.0) (2025-05-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
12
+
13
+
14
+ ### Features
15
+
16
+ * Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [10.22.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/spawning@10.22.2...@quenty/spawning@10.22.3) (2025-04-10)
7
23
 
8
24
  **Note:** Version bump only for package @quenty/spawning
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/spawning",
3
- "version": "10.22.3",
3
+ "version": "10.22.4-canary.11a5dcf.0",
4
4
  "description": "Centralized spawning system",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -24,16 +24,16 @@
24
24
  "Quenty"
25
25
  ],
26
26
  "dependencies": {
27
- "@quenty/binder": "^14.19.3",
28
- "@quenty/cmdrservice": "^13.22.3",
29
- "@quenty/loader": "^10.8.3",
30
- "@quenty/maid": "^3.4.3",
31
- "@quenty/randomutils": "^6.10.3",
32
- "@quenty/servicebag": "^11.11.4",
27
+ "@quenty/binder": "14.19.4-canary.11a5dcf.0",
28
+ "@quenty/cmdrservice": "13.22.4-canary.11a5dcf.0",
29
+ "@quenty/loader": "10.8.4-canary.11a5dcf.0",
30
+ "@quenty/maid": "3.4.4-canary.11a5dcf.0",
31
+ "@quenty/randomutils": "6.10.4-canary.11a5dcf.0",
32
+ "@quenty/servicebag": "11.11.5-canary.11a5dcf.0",
33
33
  "@quentystudios/t": "^3.0.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
38
+ "gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
39
39
  }
@@ -4,16 +4,16 @@
4
4
 
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
- local _ServiceBag = require("ServiceBag")
7
+ local ServiceBag = require("ServiceBag")
8
8
 
9
9
  local SpawnServiceClient = {}
10
10
  SpawnServiceClient.ServiceName = "SpawnServiceClient"
11
11
 
12
- function SpawnServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
12
+ function SpawnServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
13
13
  assert(not self._serviceBag, "Already initialized")
14
14
  self._serviceBag = assert(serviceBag, "No serviceBag")
15
15
 
16
16
  self._serviceBag:GetService(require("CmdrServiceClient"))
17
17
  end
18
18
 
19
- return SpawnServiceClient
19
+ return SpawnServiceClient
@@ -8,7 +8,6 @@ local BinderGroup = require("BinderGroup")
8
8
  local t = require("t")
9
9
 
10
10
  return require("BinderGroupProvider").new(function(self, _serviceBag)
11
-
12
11
  -- SpawnProvider
13
12
  -- self:Add("SpawnProviders", BinderGroup.new(
14
13
  -- {
@@ -19,12 +18,14 @@ return require("BinderGroupProvider").new(function(self, _serviceBag)
19
18
  -- ))
20
19
 
21
20
  -- Item / asset spawning
22
- self:Add("Spawners", BinderGroup.new(
23
- {
24
- },
25
- t.interface({
26
- SpawnUpdate = t.callback;
27
- Regenerate = t.callback;
28
- })
29
- ))
30
- end)
21
+ self:Add(
22
+ "Spawners",
23
+ BinderGroup.new(
24
+ {},
25
+ t.interface({
26
+ SpawnUpdate = t.callback,
27
+ Regenerate = t.callback,
28
+ })
29
+ )
30
+ )
31
+ end)
@@ -4,12 +4,12 @@
4
4
 
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
- local _ServiceBag = require("ServiceBag")
7
+ local ServiceBag = require("ServiceBag")
8
8
 
9
9
  local SpawnCmdrService = {}
10
10
  SpawnCmdrService.ServiceName = "SpawnCmdrService"
11
11
 
12
- function SpawnCmdrService:Init(serviceBag: _ServiceBag.ServiceBag)
12
+ function SpawnCmdrService:Init(serviceBag: ServiceBag.ServiceBag)
13
13
  assert(not self._serviceBag, "Already initialized")
14
14
  self._serviceBag = assert(serviceBag, "No serviceBag")
15
15
 
@@ -17,11 +17,11 @@ function SpawnCmdrService:Init(serviceBag: _ServiceBag.ServiceBag)
17
17
  self._cmdrService = self._serviceBag:GetService(require("CmdrService"))
18
18
 
19
19
  self._cmdrService:RegisterCommand({
20
- Name = "regen";
21
- Aliases = {};
22
- Description = "Forces all spawners to regenerate.";
23
- Group = "Spawn";
24
- Args = {};
20
+ Name = "regen",
21
+ Aliases = {},
22
+ Description = "Forces all spawners to regenerate.",
23
+ Group = "Spawn",
24
+ Args = {},
25
25
  }, function(_context)
26
26
  self._spawnService:Regenerate()
27
27
 
@@ -29,4 +29,4 @@ function SpawnCmdrService:Init(serviceBag: _ServiceBag.ServiceBag)
29
29
  end)
30
30
  end
31
31
 
32
- return SpawnCmdrService
32
+ return SpawnCmdrService
@@ -7,9 +7,9 @@ local require = require(script.Parent.loader).load(script)
7
7
 
8
8
  local RunService = game:GetService("RunService")
9
9
 
10
- local RandomUtils = require("RandomUtils")
11
10
  local Maid = require("Maid")
12
- local _ServiceBag = require("ServiceBag")
11
+ local RandomUtils = require("RandomUtils")
12
+ local ServiceBag = require("ServiceBag")
13
13
 
14
14
  local UPDATE_PERIOD_SEC = 5
15
15
  local SPAWN_AFTER_GAME_START = 1
@@ -20,7 +20,7 @@ local TOTAL_BUDGET_BEFORE_WARN = 0.1
20
20
  local SpawnService = {}
21
21
  SpawnService.ServiceName = "SpawnService"
22
22
 
23
- function SpawnService:Init(serviceBag: _ServiceBag.ServiceBag)
23
+ function SpawnService:Init(serviceBag: ServiceBag.ServiceBag)
24
24
  self._serviceBag = assert(serviceBag, "No serviceBag")
25
25
  self._maid = Maid.new()
26
26
 
@@ -78,7 +78,13 @@ function SpawnService:Update()
78
78
 
79
79
  if (os.clock() - classStartTime) >= MAX_BUDGET_PER_CLASS then
80
80
  if WARN_ON_CLASS_BUDGET_EXHAUST then
81
- warn(string.format("[SpawnService.Update] - Class %q ran out of execution budget at %0.4f ms", binder:GetTag(), (os.clock() - classStartTime)*1000))
81
+ warn(
82
+ string.format(
83
+ "[SpawnService.Update] - Class %q ran out of execution budget at %0.4f ms",
84
+ binder:GetTag(),
85
+ (os.clock() - classStartTime) * 1000
86
+ )
87
+ )
82
88
  end
83
89
  break
84
90
  end
@@ -87,7 +93,13 @@ function SpawnService:Update()
87
93
 
88
94
  -- watch dog
89
95
  if (os.clock() - startTime) >= TOTAL_BUDGET_BEFORE_WARN then
90
- warn(string.format("[SpawnService.Update] - Update time: %0.4f ms for %d spawners", (os.clock() - startTime)*1000, spawnerCount))
96
+ warn(
97
+ string.format(
98
+ "[SpawnService.Update] - Update time: %0.4f ms for %d spawners",
99
+ (os.clock() - startTime) * 1000,
100
+ spawnerCount
101
+ )
102
+ )
91
103
  end
92
104
 
93
105
  debug.profileend()
@@ -98,4 +110,4 @@ function SpawnService:Destroy()
98
110
  self._maid = nil
99
111
  end
100
112
 
101
- return SpawnService
113
+ return SpawnService
@@ -1,19 +1,27 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class SpawnerUtils
3
4
  ]=]
4
5
 
6
+ local require = require(script.Parent.loader).load(script)
7
+
8
+ local Raycaster = require("Raycaster")
9
+
5
10
  local SpawnerUtils = {}
6
11
 
7
- function SpawnerUtils.getSpawnLocation(spawnPart, raycaster)
12
+ function SpawnerUtils.getSpawnLocation(
13
+ spawnPart: BasePart,
14
+ raycaster: Raycaster.Raycaster
15
+ ): (Vector3, Raycaster.RaycastData?)
8
16
  local size = spawnPart.Size
9
- local sy = size.y
17
+ local sy = size.Y
10
18
 
11
- local ox = (math.random() - 0.5)*size.x
12
- local oz = (math.random() - 0.5)*size.z
19
+ local ox = (math.random() - 0.5) * size.X
20
+ local oz = (math.random() - 0.5) * size.Z
13
21
 
14
- local point = spawnPart.CFrame:pointToWorldSpace(Vector3.new(ox, sy/2, oz))
22
+ local point = spawnPart.CFrame:PointToWorldSpace(Vector3.new(ox, sy / 2, oz))
15
23
 
16
- local ray = Ray.new(point, Vector3.new(0, -sy*2, 0))
24
+ local ray = Ray.new(point, Vector3.new(0, -sy * 2, 0))
17
25
 
18
26
  local data = raycaster:FindPartOnRay(ray)
19
27
  if not data then
@@ -23,4 +31,4 @@ function SpawnerUtils.getSpawnLocation(spawnPart, raycaster)
23
31
  return data.Position, data
24
32
  end
25
33
 
26
- return SpawnerUtils
34
+ return SpawnerUtils