mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-16 11:55:09 +01:00
fix: NeoForge 1.21.5 compat
Why tf does NeoForge change the MinecraftClient instance...
This commit is contained in:
@@ -21,10 +21,9 @@ public class PuzzleGui {
|
||||
|
||||
public static void init() {
|
||||
MidnightLib.hiddenMods.add("puzzle");
|
||||
MinecraftClient client = MinecraftClient.getInstance();
|
||||
PuzzleApi.addToMiscOptions(new PuzzleWidget(Text.of("\uD83E\uDDE9 Puzzle")));
|
||||
PuzzleApi.addToMiscOptions(new PuzzleWidget(Text.translatable("puzzle.midnightconfig.title"), (button) -> button.setMessage(Text.of("OPEN")), (button) -> {
|
||||
client.setScreen(PuzzleConfig.getScreen(client.currentScreen, "puzzle"));
|
||||
MinecraftClient.getInstance().setScreen(PuzzleConfig.getScreen(MinecraftClient.getInstance().currentScreen, "puzzle"));
|
||||
}));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("\uD83E\uDDE9 Puzzle")));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.translatable("puzzle.option.resourcepack_splash_screen"), (button) -> button.setMessage(PuzzleConfig.resourcepackSplashScreen ? YES : NO), (button) -> {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PuzzleSplashScreen {
|
||||
public static File CONFIG_PATH = new File(String.valueOf(PlatformFunctions.getConfigDirectory().resolve(".puzzle_cache")));
|
||||
public static Path LOGO_TEXTURE = Paths.get(CONFIG_PATH + "/mojangstudios.png");
|
||||
public static Path BACKGROUND_TEXTURE = Paths.get(CONFIG_PATH + "/splash_background.png");
|
||||
private static final MinecraftClient client = MinecraftClient.getInstance();
|
||||
private static MinecraftClient client = MinecraftClient.getInstance();
|
||||
private static boolean keepBackground = false;
|
||||
|
||||
public static void init() {
|
||||
@@ -55,6 +55,7 @@ public class PuzzleSplashScreen {
|
||||
|
||||
@Override
|
||||
public void reload(ResourceManager manager) {
|
||||
client = MinecraftClient.getInstance();
|
||||
if (PuzzleConfig.resourcepackSplashScreen) {
|
||||
PuzzleSplashScreen.resetColors();
|
||||
client.getTextureManager().registerTexture(LOGO, new LogoTexture(LOGO));
|
||||
|
||||
Reference in New Issue
Block a user