@quenty/adorneeutils 3.3.0 → 3.3.1

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,14 @@
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
+ ## [3.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeutils@3.3.0...@quenty/adorneeutils@3.3.1) (2025-03-21)
7
+
8
+ **Note:** Version bump only for package @quenty/adorneeutils
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeutils@3.2.0...@quenty/adorneeutils@3.3.0) (2024-12-03)
7
15
 
8
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/adorneeutils",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "AdorneeUtils - Generic adornee functions to make attaching to objects in Roblox easier.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,5 +27,5 @@
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "66190e48c1ca93b07040326e9cfcf97e8eb4b0e1"
30
+ "gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
31
31
  }
@@ -13,7 +13,7 @@ local AdorneeUtils = {}
13
13
  @param adornee Instance
14
14
  @return Vector3?
15
15
  ]=]
16
- function AdorneeUtils.getCenter(adornee)
16
+ function AdorneeUtils.getCenter(adornee: Instance): Vector3?
17
17
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
18
18
 
19
19
  if adornee:IsA("BasePart") then
@@ -51,10 +51,10 @@ end
51
51
  --[=[
52
52
  Gets the bounding box of the adornee
53
53
  @param adornee Instance
54
- @return CFrame?
55
- @return Vector3?
54
+ @return CFrame? -- Center of the bounding box
55
+ @return Vector3? -- Size of the bounding box
56
56
  ]=]
57
- function AdorneeUtils.getBoundingBox(adornee)
57
+ function AdorneeUtils.getBoundingBox(adornee: Instance): (CFrame, Vector3)
58
58
  if adornee:IsA("Model") then
59
59
  return adornee:GetBoundingBox()
60
60
  elseif adornee:IsA("Attachment") then
@@ -70,8 +70,8 @@ end
70
70
  @param part BasePart
71
71
  @return boolean
72
72
  ]=]
73
- function AdorneeUtils.isPartOfAdornee(adornee, part)
74
- assert(part:IsA("BasePart"))
73
+ function AdorneeUtils.isPartOfAdornee(adornee: Instance, part: BasePart): boolean
74
+ assert(typeof(part) == "Instance" and part:IsA("BasePart"), "Bad part")
75
75
 
76
76
  if adornee:IsA("Humanoid") then
77
77
  if not adornee.Parent then
@@ -89,7 +89,7 @@ end
89
89
  @param adornee Instance
90
90
  @return { BasePart }
91
91
  ]=]
92
- function AdorneeUtils.getParts(adornee)
92
+ function AdorneeUtils.getParts(adornee: Instance): { BasePart }
93
93
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
94
94
 
95
95
  local parts = {}
@@ -120,12 +120,13 @@ end
120
120
  @param adornee Instance
121
121
  @return Vector3?
122
122
  ]=]
123
- function AdorneeUtils.getAlignedSize(adornee)
123
+ function AdorneeUtils.getAlignedSize(adornee: Instance): Vector3?
124
124
  if adornee:IsA("Model") then
125
125
  return select(2, adornee:GetBoundingBox())
126
126
  elseif adornee:IsA("Humanoid") then
127
- if adornee.Parent then
128
- return select(2, adornee.Parent:GetBoundingBox())
127
+ local character = adornee.Parent
128
+ if character and character:IsA("Model") then
129
+ return select(2, character:GetBoundingBox())
129
130
  else
130
131
  return nil
131
132
  end
@@ -144,7 +145,7 @@ end
144
145
  @param adornee Instance
145
146
  @return CFrame
146
147
  ]=]
147
- function AdorneeUtils.getPartCFrame(adornee)
148
+ function AdorneeUtils.getPartCFrame(adornee: Instance): CFrame?
148
149
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
149
150
 
150
151
  local part = AdorneeUtils.getPart(adornee)
@@ -160,7 +161,7 @@ end
160
161
  @param adornee Instance
161
162
  @return Position
162
163
  ]=]
163
- function AdorneeUtils.getPartPosition(adornee)
164
+ function AdorneeUtils.getPartPosition(adornee: Instance): Vector3?
164
165
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
165
166
 
166
167
  local part = AdorneeUtils.getPart(adornee)
@@ -176,7 +177,7 @@ end
176
177
  @param adornee Instance
177
178
  @return Vector3
178
179
  ]=]
179
- function AdorneeUtils.getPartVelocity(adornee)
180
+ function AdorneeUtils.getPartVelocity(adornee: Instance): Vector3?
180
181
  local part = AdorneeUtils.getPart(adornee)
181
182
  if not part then
182
183
  return nil
@@ -190,7 +191,7 @@ end
190
191
  @param adornee Instance
191
192
  @return BasePart
192
193
  ]=]
193
- function AdorneeUtils.getPart(adornee)
194
+ function AdorneeUtils.getPart(adornee: Instance): BasePart?
194
195
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
195
196
 
196
197
  if adornee:IsA("BasePart") then
@@ -202,11 +203,11 @@ function AdorneeUtils.getPart(adornee)
202
203
  return adornee:FindFirstChildWhichIsA("BasePart")
203
204
  end
204
205
  elseif adornee:IsA("Attachment") then
205
- return adornee.Parent
206
+ return adornee:FindFirstAncestorWhichIsA("BasePart")
206
207
  elseif adornee:IsA("Humanoid") then
207
208
  return adornee.RootPart
208
209
  elseif adornee:IsA("Accessory") or adornee:IsA("Clothing") then
209
- return adornee:FindFirstChildWhichIsA("BasePart")
210
+ return adornee:FindFirstChildWhichIsA("BasePart") :: BasePart
210
211
  elseif adornee:IsA("Tool") then
211
212
  local handle = adornee:FindFirstChild("Handle")
212
213
  if handle and handle:IsA("BasePart") then
@@ -224,7 +225,7 @@ end
224
225
  @param adornee Instance
225
226
  @return Instance
226
227
  ]=]
227
- function AdorneeUtils.getRenderAdornee(adornee)
228
+ function AdorneeUtils.getRenderAdornee(adornee: Instance): Instance?
228
229
  assert(typeof(adornee) == "Instance", "Adornee must by of type 'Instance'")
229
230
 
230
231
  if adornee:IsA("BasePart") then
@@ -249,4 +250,4 @@ function AdorneeUtils.getRenderAdornee(adornee)
249
250
  end
250
251
  end
251
252
 
252
- return AdorneeUtils
253
+ return AdorneeUtils