hypixel-api-reborn 11.2.1 → 11.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.
Files changed (38) hide show
  1. package/package.json +8 -8
  2. package/src/API/housing/getActiveHouses.js +7 -0
  3. package/src/API/housing/getHouse.js +9 -0
  4. package/src/API/housing/getPlayerHouses.js +11 -0
  5. package/src/API/index.js +6 -1
  6. package/src/API/skyblock/getFireSales.js +1 -1
  7. package/src/API/skyblock/getGarden.js +7 -0
  8. package/src/API/skyblock/getMember.js +4 -2
  9. package/src/API/skyblock/getProfiles.js +4 -2
  10. package/src/Client.js +46 -2
  11. package/src/Private/requests.js +1 -1
  12. package/src/index.js +5 -0
  13. package/src/structures/House.js +54 -0
  14. package/src/structures/MiniGames/Arcade.js +754 -270
  15. package/src/structures/MiniGames/ArenaBrawl.js +97 -31
  16. package/src/structures/MiniGames/BlitzSurvivalGames.js +378 -127
  17. package/src/structures/MiniGames/BuildBattle.js +19 -8
  18. package/src/structures/MiniGames/CopsAndCrims.js +252 -25
  19. package/src/structures/MiniGames/Duels.js +916 -656
  20. package/src/structures/MiniGames/MegaWalls.js +390 -51
  21. package/src/structures/MiniGames/MurderMystery.js +151 -30
  22. package/src/structures/MiniGames/Paintball.js +31 -11
  23. package/src/structures/MiniGames/Quakecraft.js +113 -50
  24. package/src/structures/MiniGames/SkyWars.js +340 -195
  25. package/src/structures/MiniGames/SmashHeroes.js +195 -69
  26. package/src/structures/MiniGames/SpeedUHC.js +76 -36
  27. package/src/structures/MiniGames/TNTGames.js +242 -73
  28. package/src/structures/MiniGames/TurboKartRacers.js +55 -115
  29. package/src/structures/MiniGames/UHC.js +135 -124
  30. package/src/structures/MiniGames/VampireZ.js +70 -37
  31. package/src/structures/MiniGames/Warlords.js +126 -1
  32. package/src/structures/MiniGames/WoolWars.js +54 -4
  33. package/src/structures/Player.js +33 -25
  34. package/src/structures/SkyBlock/SkyblockGarden.js +146 -0
  35. package/src/structures/SkyBlock/SkyblockMember.js +12 -5
  36. package/src/utils/Constants.js +507 -5
  37. package/src/utils/SkyblockUtils.js +33 -0
  38. package/typings/index.d.ts +1034 -899
@@ -1,3 +1,4 @@
1
+ const divide = require('../../utils/divide');
1
2
  /**
2
3
  * BuildBattle class
3
4
  */
@@ -11,11 +12,26 @@ class BuildBattle {
11
12
  * @type {number}
12
13
  */
13
14
  this.score = data.score || 0;
15
+ /**
16
+ * Total wins
17
+ * @type {number}
18
+ */
19
+ this.totalWins = data.wins || 0;
14
20
  /**
15
21
  * Played games
16
22
  * @type {number}
17
23
  */
18
- this.playedGames = data.games_played || 0;
24
+ this.games = data.games_played || 0;
25
+ /**
26
+ * Win Loss ratio
27
+ * @type {number}
28
+ */
29
+ this.WLRatio = divide(this.totalWins, this.games);
30
+ /**
31
+ * Amount of super votes the player has
32
+ * @type {number}
33
+ */
34
+ this.superVotes = data.super_votes || 0;
19
35
  /**
20
36
  * Coins
21
37
  * @type {number}
@@ -26,18 +42,13 @@ class BuildBattle {
26
42
  * @type {number}
27
43
  */
28
44
  this.totalVotes = data.total_votes || 0;
29
- /**
30
- * Total wins
31
- * @type {number}
32
- */
33
- this.totalWins = data.wins || 0;
34
45
  /**
35
46
  * Wins for each mode
36
47
  * @type {BuildBattleWins}
37
48
  */
38
49
  this.wins = {
39
50
  solo: data.wins_solo_normal || 0,
40
- team: data.wins_teams_normal || 0,
51
+ teams: data.wins_teams_normal || 0,
41
52
  pro: data.wins_solo_pro || 0,
42
53
  gtb: data.wins_guess_the_build || 0
43
54
  };
@@ -46,7 +57,7 @@ class BuildBattle {
46
57
  /**
47
58
  * @typedef {object} BuildBattleWins
48
59
  * @property {number} solo BuildBattle Solo wins
49
- * @property {number} team BuildBattle Team wins
60
+ * @property {number} teams BuildBattle Team wins
50
61
  * @property {number} pro BuildBattle Pro wins
51
62
  * @property {number} gtb BuildBattle Guess The Build wins
52
63
  */
@@ -1,23 +1,28 @@
1
1
  const divide = require('../../utils/divide');
2
2
  /**
3
- * Cops and crims class
3
+ * Cops and crims Defusal class
4
4
  */
5
- class CopsAndCrims {
5
+ class CopsAndCrimsDefusal {
6
6
  /**
7
7
  * @param {object} data Cops and crims data
8
8
 
9
9
  */
10
10
  constructor(data) {
11
11
  /**
12
- * Coins
12
+ * Kills
13
13
  * @type {number}
14
14
  */
15
- this.coins = data.coins || 0;
15
+ this.kills = data.kills || 0;
16
16
  /**
17
- * Kills
17
+ * Headshot kills
18
18
  * @type {number}
19
19
  */
20
- this.kills = data.kills || 0;
20
+ this.headshotKills = data.headshot_kills || 0;
21
+ /**
22
+ * Assists
23
+ * @type {number}
24
+ */
25
+ this.assists = data.assists || 0;
21
26
  /**
22
27
  * Deaths
23
28
  * @type {number}
@@ -33,6 +38,21 @@ class CopsAndCrims {
33
38
  * @type {number}
34
39
  */
35
40
  this.wins = data.game_wins || 0;
41
+ /**
42
+ * Games played
43
+ * @type {number}
44
+ */
45
+ this.gamesPlayed = data.game_plays || 0;
46
+ /**
47
+ * Losses
48
+ * @type {number}
49
+ */
50
+ this.losses = this.gamesPlayed - this.wins;
51
+ /**
52
+ * Win Loss ratio
53
+ * @type {number}
54
+ */
55
+ this.WLRatio = divide(this.wins, this.losses);
36
56
  /**
37
57
  * Round wins
38
58
  * @type {number}
@@ -43,11 +63,6 @@ class CopsAndCrims {
43
63
  * @type {number}
44
64
  */
45
65
  this.shotsFired = data.shots_fired || 0;
46
- /**
47
- * Headshot kills
48
- * @type {number}
49
- */
50
- this.headshotKills = data.headshot_kills || 0;
51
66
  /**
52
67
  * Bombs defused
53
68
  * @type {number}
@@ -68,24 +83,236 @@ class CopsAndCrims {
68
83
  * @type {number}
69
84
  */
70
85
  this.killsAsCop = data.cop_kills || 0;
86
+ }
87
+ }
88
+ /**
89
+ * Cops and crims Deathmatch class
90
+ */
91
+ class CopsAndCrimsDeathmatch {
92
+ /**
93
+ * @param {object} data Cops and crims data
94
+
95
+ */
96
+ constructor(data) {
71
97
  /**
72
- * Deathmatch stats
73
- * @type {CopsAndCrimsDeathmatch}
98
+ * Kills
99
+ * @type {number}
100
+ */
101
+ this.kills = data.kills_deathmatch || 0;
102
+ /**
103
+ * Assists
104
+ * @type {number}
105
+ */
106
+ this.assists = data.assists_deathmatch || 0;
107
+ /**
108
+ * Deaths
109
+ * @type {number}
74
110
  */
75
- this.deathmatch = {
76
- kills: data.kills_deathmatch || 0,
77
- deaths: data.deaths_deathmatch || 0,
78
- KDRatio: divide(data.kills_deathmatch, data.deaths_deathmatch),
79
- killsAsCrim: data.criminal_kills_deathmatch || 0,
80
- killsAsCop: data.cop_kills_deathmatch || 0
81
- };
111
+ this.deaths = data.deaths_deathmatch || 0;
112
+ /**
113
+ * Kill Death ratio
114
+ * @type {number}
115
+ */
116
+ this.KDRatio = divide(this.kills, this.deaths);
117
+ /**
118
+ * Wins
119
+ * @type {number}
120
+ */
121
+ this.wins = data.game_wins_deathmatch || 0;
122
+ /**
123
+ * Games played
124
+ * @type {number}
125
+ */
126
+ this.gamesPlayed = data.game_plays_deathmatch || 0;
127
+ /**
128
+ * Losses
129
+ * @type {number}
130
+ */
131
+ this.losses = this.gamesPlayed - this.wins;
132
+ /**
133
+ * Win Loss ratio
134
+ * @type {number}
135
+ */
136
+ this.WLRatio = divide(this.wins, this.losses);
137
+ /**
138
+ * Kills as Crim
139
+ * @type {number}
140
+ */
141
+ this.killsAsCrim = data.criminal_kills_deathmatch || 0;
142
+ /**
143
+ * Kills as Cop
144
+ * @type {number}
145
+ */
146
+ this.killsAsCop = data.cop_kills_deathmatch || 0;
82
147
  }
83
148
  }
84
149
  /**
85
- * @typedef {object} CopsAndCrimsDeathmatch
86
- * @property {number} kills Deathmatch kills
87
- * @property {number} deaths Deathmatch deaths
88
- * @property {number} killsAsCrim Deathmatch kills as crim
89
- * @property {number} killsAsCop Deathmatch kills as cop
150
+ * Cops and crims Gun Game class
90
151
  */
152
+ class CopsAndCrimsGunGame {
153
+ /**
154
+ * @param {object} data Cops and crims data
155
+
156
+ */
157
+ constructor(data) {
158
+ /**
159
+ * Kills
160
+ * @type {number}
161
+ */
162
+ this.kills = data.kills_gungame || 0;
163
+ /**
164
+ * Assists
165
+ * @type {number}
166
+ */
167
+ this.assists = data.assists_gungame || 0;
168
+ /**
169
+ * Deaths
170
+ * @type {number}
171
+ */
172
+ this.deaths = data.deaths_gungame || 0;
173
+ /**
174
+ * Kill Death ratio
175
+ * @type {number}
176
+ */
177
+ this.KDRatio = divide(this.kills, this.deaths);
178
+ /**
179
+ * Wins
180
+ * @type {number}
181
+ */
182
+ this.wins = data.game_wins_gungame || 0;
183
+ /**
184
+ * Games played
185
+ * @type {number}
186
+ */
187
+ this.gamesPlayed = data.game_plays_gungame || 0;
188
+ /**
189
+ * Losses
190
+ * @type {number}
191
+ */
192
+ this.losses = this.gamesPlayed - this.wins;
193
+ /**
194
+ * Win Loss ratio
195
+ * @type {number}
196
+ */
197
+ this.WLRatio = divide(this.wins, this.losses);
198
+ /**
199
+ * Kills as Crim
200
+ * @type {number}
201
+ */
202
+ this.killsAsCrim = data.criminal_kills_gungame || 0;
203
+ /**
204
+ * Kills as Cop
205
+ * @type {number}
206
+ */
207
+ this.killsAsCop = data.cop_kills_gungame || 0;
208
+ /**
209
+ * Fastest Win
210
+ * ! WARNING This number is most likely wrong as it can be negative
211
+ * @type {number}
212
+ */
213
+ this.fastestWin = data.fastest_win_gungame || 0;
214
+ }
215
+ }
216
+ /**
217
+ * Cops and crims class
218
+ */
219
+ class CopsAndCrims {
220
+ /**
221
+ * @param {object} data Cops and crims data
222
+
223
+ */
224
+ constructor(data) {
225
+ /**
226
+ * Defusal stats
227
+ * @type {CopsAndCrimsDefusal}
228
+ */
229
+ this.defusal = new CopsAndCrimsDefusal(data);
230
+ /**
231
+ * Deathmatch stats
232
+ * @type {CopsAndCrimsDeathmatch}
233
+ */
234
+ this.deathmath = new CopsAndCrimsDeathmatch(data);
235
+ /**
236
+ * Gun Game stats
237
+ * @type {CopsAndCrimsGunGame}
238
+ */
239
+ this.gunGame = new CopsAndCrimsGunGame(data);
240
+ /**
241
+ * Coins
242
+ * @type {number}
243
+ */
244
+ this.coins = data.coins || 0;
245
+ /**
246
+ * Kills
247
+ * @type {number}
248
+ */
249
+ this.kills = this.defusal.kills + this.deathmath.kills + this.gunGame.kills;
250
+ /**
251
+ * Assists
252
+ * @type {number}
253
+ */
254
+ this.assists = this.defusal.assists + this.deathmath.assists + this.gunGame.assists;
255
+ /**
256
+ * Deaths
257
+ * @type {number}
258
+ */
259
+ this.deaths = this.defusal.deaths + this.deathmath.deaths + this.gunGame.deaths;
260
+ /**
261
+ * Kill Death ratio
262
+ * @type {number}
263
+ */
264
+ this.KDRatio = divide(this.kills, this.deaths);
265
+ /**
266
+ * Wins
267
+ * @type {number}
268
+ */
269
+ this.wins = this.defusal.wins + this.deathmath.wins + this.gunGame.wins;
270
+ /**
271
+ * Games played
272
+ * @type {number}
273
+ */
274
+ this.gamesPlayed = this.defusal.gamesPlayed + this.deathmath.gamesPlayed + this.gunGame.gamesPlayed;
275
+ /**
276
+ * Losses
277
+ * @type {number}
278
+ */
279
+ this.losses = this.gamesPlayed - this.wins;
280
+ /**
281
+ * Win Loss ratio
282
+ * @type {number}
283
+ */
284
+ this.WLRatio = divide(this.wins, this.losses);
285
+ /**
286
+ * Kills as Crim
287
+ * @type {number}
288
+ */
289
+ this.killsAsCrim = this.defusal.killsAsCrim + this.deathmath.killsAsCrim + this.gunGame.killsAsCrim;
290
+ /**
291
+ * Kills as Cop
292
+ * @type {number}
293
+ */
294
+ this.killsAsCop = this.defusal.killsAsCop + this.deathmath.killsAsCop + this.gunGame.killsAsCop;
295
+ /**
296
+ * Prefix Color
297
+ * @type {string}
298
+ */
299
+ this.prefixColor = data.lobbyPrefixColor || '';
300
+ /**
301
+ * Show Prefix
302
+ * @type {boolean}
303
+ */
304
+ this.showPrefix = data.show_lobby_prefix || false;
305
+ /**
306
+ * Selected Prefix
307
+ * @type {string}
308
+ */
309
+ this.selectedPrefix = data.selected_lobby_prefix || '';
310
+ /**
311
+ * Kills In Prefix
312
+ * @type {boolean}
313
+ */
314
+ this.killsInPrefix = data.show_kills_in_prefix || false;
315
+ }
316
+ }
317
+
91
318
  module.exports = CopsAndCrims;