From 18b5deff3871f088c984a17aceb8d13f16027109 Mon Sep 17 00:00:00 2001 From: pluto7073 <20planetpluto05@gmail.com> Date: Mon, 23 Jan 2023 16:39:24 -0500 Subject: [PATCH] Started version detector thingy, will be in 1.19.3 version --- .../pluto7073/plutoscoffee/PlutosCoffee.java | 2 ++ .../plutoscoffee/VersionWarningScreen.java | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/main/java/ml/pluto7073/plutoscoffee/VersionWarningScreen.java diff --git a/src/main/java/ml/pluto7073/plutoscoffee/PlutosCoffee.java b/src/main/java/ml/pluto7073/plutoscoffee/PlutosCoffee.java index 7e7ceec..00f7506 100644 --- a/src/main/java/ml/pluto7073/plutoscoffee/PlutosCoffee.java +++ b/src/main/java/ml/pluto7073/plutoscoffee/PlutosCoffee.java @@ -6,6 +6,7 @@ import ml.pluto7073.plutoscoffee.potions.ModPotions; import ml.pluto7073.plutoscoffee.registry.ModStats; import net.fabricmc.api.ModInitializer; +import net.minecraft.client.gui.screen.WarningScreen; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,6 +14,7 @@ public class PlutosCoffee implements ModInitializer { public static final String MOD_ID = "plutoscoffee"; public static final Logger logger = LogManager.getLogger("PlutosCoffeeMod"); + public static final int MOD_VERSION = 5; @Override public void onInitialize() { diff --git a/src/main/java/ml/pluto7073/plutoscoffee/VersionWarningScreen.java b/src/main/java/ml/pluto7073/plutoscoffee/VersionWarningScreen.java new file mode 100644 index 0000000..abece0f --- /dev/null +++ b/src/main/java/ml/pluto7073/plutoscoffee/VersionWarningScreen.java @@ -0,0 +1,30 @@ +package ml.pluto7073.plutoscoffee; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.gui.screen.WarningScreen; +import net.minecraft.text.Text; + +@Environment(EnvType.CLIENT) +public class VersionWarningScreen extends WarningScreen { + + private static final Text HEADER; + private static final Text MESSAGE; + private static final Text NARRATED; + + public VersionWarningScreen() { + super(HEADER, MESSAGE, NARRATED); + } + + @Override + protected void initButtons(int yOffset) { + + } + + static { + HEADER = Text.translatable("plutoscoffee.version.header"); + MESSAGE = Text.translatable("plutoscoffee.version.message"); + NARRATED = HEADER.copy().append("\n").append(MESSAGE); + } + +}