blob: 8a6942e3eee32daa165a784daa395c1e4a2b89f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package com.arslaancodes.arslaansmagichax.mixin;
import net.minecraft.client.gui.screen.SplashTextRenderer;
import net.minecraft.client.resource.SplashTextResourceSupplier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Random;
@Mixin(SplashTextResourceSupplier.class)
public class SplashTextResourceSupplierMixin {
private static final Random RANDOM = new Random();
@Inject(method = "get", at = @At("HEAD"), cancellable = true)
public void onGet(CallbackInfoReturnable<SplashTextRenderer> cir) {
String[] splashes = {"\"one can only hope.\"", "hackerman approved", "Cheater!", "totally not malware", "cheats for block game", "dont use /surprise"};
String selected = splashes[RANDOM.nextInt(splashes.length)];
cir.setReturnValue(new SplashTextRenderer(selected));
}
}
|