aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java
blob: 3c4673849d8b1a431b30ac6d498ed19af627ac3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package dev.isxander.yacl.gui;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

public class RequireRestartScreen extends ConfirmScreen {
    public RequireRestartScreen(Screen parent) {
        super(option -> {
            if (option) MinecraftClient.getInstance().scheduleStop();
            else MinecraftClient.getInstance().setScreen(parent);
        }, Text.translatable("yacl.restart.title").formatted(Formatting.RED, Formatting.BOLD), Text.translatable("yacl.restart.message"), Text.translatable("yacl.restart.yes"), Text.translatable("yacl.restart.no"));
    }
}