aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java b/src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java
new file mode 100644
index 0000000..807292e
--- /dev/null
+++ b/src/main/java/dev/isxander/yacl/gui/RequireRestartScreen.java
@@ -0,0 +1,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 {
+ protected 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"));
+ }
+}