Search in sources :

Example 1 with SubscribeEvent

use of com.jab125.thonkutil.api.annotations.SubscribeEvent in project ThonkUtil by LimeAppleBoat.

the class ThonkUtil method showMessage.

@SubscribeEvent
@Environment(EnvType.CLIENT)
public static void showMessage(TitleScreenRenderEvent event) {
    if (state.equals(State.RELEASE))
        return;
    Text text = new LiteralText("").append(new TranslatableText("thonkutil.warning.1").formatted(Formatting.RED)).append(new TranslatableText("thonkutil." + state).formatted(state.formatting)).append(new TranslatableText("thonkutil.warning.1.1").formatted(Formatting.RED));
    DrawableHelper.drawCenteredText(event.matrices(), MinecraftClient.getInstance().textRenderer, text, event.screen().width / 2, 4 + (0 * (MinecraftClient.getInstance().textRenderer.fontHeight + 1)), 0xFFFFFF | event.alpha());
    text = new TranslatableText(state.translationKeyDesc);
    DrawableHelper.drawCenteredText(event.matrices(), MinecraftClient.getInstance().textRenderer, text, event.screen().width / 2, 4 + (1 * (MinecraftClient.getInstance().textRenderer.fontHeight + 1)), 0xFFFFFF | event.alpha());
    text = new TranslatableText("thonkutil.warning.3");
    DrawableHelper.drawCenteredText(event.matrices(), MinecraftClient.getInstance().textRenderer, text, event.screen().width / 2, 4 + (2 * (MinecraftClient.getInstance().textRenderer.fontHeight + 1)), 0xFFFFFF | event.alpha());
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) LiteralText(net.minecraft.text.LiteralText) TranslatableText(net.minecraft.text.TranslatableText) Text(net.minecraft.text.Text) LiteralText(net.minecraft.text.LiteralText) SubscribeEvent(com.jab125.thonkutil.api.annotations.SubscribeEvent)

Aggregations

SubscribeEvent (com.jab125.thonkutil.api.annotations.SubscribeEvent)1 LiteralText (net.minecraft.text.LiteralText)1 Text (net.minecraft.text.Text)1 TranslatableText (net.minecraft.text.TranslatableText)1