Skip to content

Commit 2db88c5

Browse files
feat: add christmas 2025 to /events (#805)
* feat: add christmas 2025 to /events * fix: lint * bbB --------- Co-authored-by: jacobk999 <[email protected]>
1 parent c0728c9 commit 2db88c5

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

packages/schemas/src/player/gamemodes/general/events.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ export class Event {
3333
}
3434
}
3535

36-
export type EventType = { period: EventPeriod; year: number; key: Exclude<keyof Events, "silver"> };
36+
export type EventType = {
37+
period: EventPeriod;
38+
year: number;
39+
key: Exclude<keyof Events, "silver">;
40+
};
3741
export type EventPeriod = "summer" | "halloween" | "christmas" | "easter";
3842

3943
export const EVENT_TYPES: EventType[] = [
44+
{ period: "christmas", year: 2025, key: "christmas2025" },
4045
{ period: "halloween", year: 2025, key: "halloween2025" },
4146
{ period: "summer", year: 2025, key: "summer2025" },
4247
{ period: "easter", year: 2025, key: "easter2025" },
@@ -96,6 +101,9 @@ export class Events {
96101
@Field({ leaderboard: { name: "Halloween 2025" } })
97102
public halloween2025: Event;
98103

104+
@Field({ leaderboard: { name: "Christmas 2025" } })
105+
public christmas2025: Event;
106+
99107
@Field()
100108
public silver: number;
101109

@@ -114,6 +122,7 @@ export class Events {
114122
this.easter2025 = new Event(10_000, data.easter?.["2025"]);
115123
this.summer2025 = new Event(25_000, data.summer?.["2025"]);
116124
this.halloween2025 = new Event(10_000, data.halloween?.["2025"]);
125+
this.christmas2025 = new Event(10_000, data.christmas?.["2025"]);
117126

118127
this.silver = data.silver;
119128
}

packages/skin-renderer/src/skin_loader.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,22 @@ unsafe fn fix_opaque_skin(skin: &mut DynamicImage, original_format: SkinFormat)
147147
];
148148

149149
for &region in &REQUIRED_REGIONS {
150-
unsafe { unsafe_fill_rect(skin, region, transparent); }
150+
unsafe {
151+
unsafe_fill_rect(skin, region, transparent);
152+
}
151153
}
152154

153155
if matches!(original_format, SkinFormat::Modern) {
154156
for &region in &REQUIRED_REGIONS_MODERN {
155-
unsafe { unsafe_fill_rect(skin, region, transparent); }
157+
unsafe {
158+
unsafe_fill_rect(skin, region, transparent);
159+
}
156160
}
157161
}
158162
}
159163

160164
unsafe fn fix_transparent_skin(skin: &mut DynamicImage) {
161-
unsafe {
165+
unsafe {
162166
unsafe_remove_transparency(skin, rect!(0, 8, 32, 8));
163167
unsafe_remove_transparency(skin, rect!(8, 0, 16, 8));
164168
unsafe_remove_transparency(skin, rect!(0, 20, 56, 12));
@@ -174,7 +178,9 @@ unsafe fn fix_transparent_skin(skin: &mut DynamicImage) {
174178
unsafe fn unsafe_fill_rect(image: &mut DynamicImage, rect: Rect, pixel: Rgba<u8>) {
175179
for x in rect.x..rect.x + rect.width {
176180
for y in rect.y..rect.y + rect.height {
177-
unsafe { image.unsafe_put_pixel(x, y, pixel); }
181+
unsafe {
182+
image.unsafe_put_pixel(x, y, pixel);
183+
}
178184
}
179185
}
180186
}
@@ -196,7 +202,9 @@ unsafe fn unsafe_remove_transparency(image: &mut DynamicImage, rect: Rect) {
196202
pixel[2] = (opacity * pixel[2] as f32) as u8;
197203
pixel[3] = 255;
198204

199-
unsafe { image.unsafe_put_pixel(x, y, pixel); }
205+
unsafe {
206+
image.unsafe_put_pixel(x, y, pixel);
207+
}
200208
}
201209
}
202210
}

0 commit comments

Comments
 (0)