3
3
import net .darkhax .splashy .Config ;
4
4
import net .darkhax .splashy .platform .Services ;
5
5
import net .minecraft .client .Minecraft ;
6
+ import net .minecraft .client .gui .components .SplashRenderer ;
6
7
import net .minecraft .client .resources .SplashManager ;
7
8
import net .minecraft .client .resources .language .I18n ;
8
9
import net .minecraft .server .packs .resources .ResourceManager ;
9
10
import net .minecraft .util .profiling .ProfilerFiller ;
10
11
import org .spongepowered .asm .mixin .Final ;
11
12
import org .spongepowered .asm .mixin .Mixin ;
12
13
import org .spongepowered .asm .mixin .Shadow ;
14
+ import org .spongepowered .asm .mixin .Unique ;
13
15
import org .spongepowered .asm .mixin .injection .At ;
14
16
import org .spongepowered .asm .mixin .injection .Inject ;
15
17
import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
22
24
@ Mixin (value = SplashManager .class )
23
25
public class MixinSplashManager {
24
26
27
+ @ Unique
28
+ private static final SplashRenderer JARED_BIRTHDAY = new SplashRenderer ("Happy Birthday Jared <3" );
29
+
25
30
@ Final
26
31
@ Shadow
27
32
private List <String > splashes ;
@@ -60,15 +65,15 @@ private void apply(List<String> vanillaValues, ResourceManager resources, Profil
60
65
}
61
66
}
62
67
63
- @ Inject (method = "getSplash()Ljava/lang/String ;" , at = @ At ("RETURN" ), cancellable = true )
64
- private void getSplash (CallbackInfoReturnable <String > cir ) {
68
+ @ Inject (method = "getSplash()Lnet/minecraft/client/gui/components/SplashRenderer ;" , at = @ At ("RETURN" ), cancellable = true )
69
+ private void getSplash (CallbackInfoReturnable <SplashRenderer > cir ) {
65
70
66
71
// Special Days
67
72
final LocalDateTime now = LocalDateTime .now ();
68
73
69
74
if (now .getMonth () == Month .JUNE && now .getDayOfMonth () == 29 ) {
70
75
71
- cir .setReturnValue ("Happy Birthday Jared <3" );
76
+ cir .setReturnValue (JARED_BIRTHDAY );
72
77
}
73
78
}
74
79
}
0 commit comments