diff --git a/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx b/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx
index 8e8d9c2..c4b9c3a 100644
--- a/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx
+++ b/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx
@@ -32,8 +32,8 @@ export default function PitStats({ stats }: { stats: NonNullStats["Pit"] }) {
stat: (
[
- {romanize(prestige)}
- {`-${level}`}
+ {prestige > 0 && {romanize(prestige)}}
+ {`${prestige === 0 ? "" : "-"}${level}`}
]
)
diff --git a/src/app/(stats)/player/[ign]/_stats/pit/stats.tsx b/src/app/(stats)/player/[ign]/_stats/pit/stats.tsx
index 2161481..0fa276e 100644
--- a/src/app/(stats)/player/[ign]/_stats/pit/stats.tsx
+++ b/src/app/(stats)/player/[ign]/_stats/pit/stats.tsx
@@ -1,5 +1,5 @@
-import { formatNumber } from "@/lib/formatters"
-import { romanize } from "@/lib/hypixel/general"
+import { formatNumber, formatSecondsToTime } from "@/lib/formatters"
+import { devide, romanize } from "@/lib/hypixel/general"
import { getLevelColor, getPrestige, getPrestigeColor } from "@/lib/hypixel/pit/general"
import { getPitLevel } from "@/lib/hypixel/pit/level"
import { NonNullStats } from "@/lib/schema/player"
@@ -10,11 +10,19 @@ export default function PitGeneralStats({ stats }: { stats: NonNullable
-
+
@@ -23,8 +31,46 @@ export default function PitGeneralStats({ stats }: { stats: NonNullable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/formatters.ts b/src/lib/formatters.ts
index 4f78fbf..564802d 100644
--- a/src/lib/formatters.ts
+++ b/src/lib/formatters.ts
@@ -33,10 +33,7 @@ export function formatSecondsToTime(seconds: number) {
if (minutes) parts.push(minutes + "m")
if (secs || parts.length === 0) parts.push(secs + "s")
- if (parts.length === 1) return parts[0]
- if (parts.length === 2) return parts[0] + " and " + parts[1]
- // For 3+ parts: separate first n-1 by comma+space, last preceded by 'and'
- return parts.slice(0, -1).join(", ") + " and " + parts[parts.length - 1]
+ return parts.join(" ")
}
export function formatRelativeTime(timestamp: number, type: "past" | "future") {
diff --git a/src/lib/hypixel/pit/general.ts b/src/lib/hypixel/pit/general.ts
index dabaf4a..293e039 100644
--- a/src/lib/hypixel/pit/general.ts
+++ b/src/lib/hypixel/pit/general.ts
@@ -18,5 +18,5 @@ export function getPrestigeColor(prestige: number) {
}
export function getPrestige(stats: NonNullable) {
- return stats.profile.prestiges.length
+ return stats.profile.prestiges === undefined ? 0 : stats.profile.prestiges.length
}
diff --git a/src/lib/schema/stats.ts b/src/lib/schema/stats.ts
index 53603be..e464669 100644
--- a/src/lib/schema/stats.ts
+++ b/src/lib/schema/stats.ts
@@ -450,14 +450,30 @@ export const pitStats = z.looseObject({
pit_stats_ptl: z.looseObject({
kills: z.number().default(0),
deaths: z.number().default(0),
- cash_earned: z.number().default(0)
+ cash_earned: z.number().default(0),
+ playtime_minutes: z.number().default(0),
+ assists: z.number().default(0),
+ max_streak: z.number().default(0),
+ damage_dealt: z.number().default(0),
+ damage_received: z.number().default(0),
+ melee_damage_dealt: z.number().default(0),
+ melee_damage_received: z.number().default(0),
+ bow_damage_dealt: z.number().default(0),
+ bow_damage_received: z.number().default(0),
+ sword_hits: z.number().default(0),
+ left_clicks: z.number().default(0),
+ arrow_hits: z.number().default(0),
+ arrows_fired: z.number().default(0),
+ contracts_completed: z.number().default(0),
+ jumped_into_pit: z.number().default(0),
+ launched_by_launchers: z.number().default(0)
}),
profile: z.looseObject({
prestiges: z.array(z.looseObject({
index: z.number(),
xp_on_prestige: z.number(),
timestamp: z.number()
- })),
+ })).optional(),
xp: z.number().default(0),
cash: z.number().default(0),
renown: z.number().default(0)