Skip to content

Commit

Permalink
Removed changelogConfig
Browse files Browse the repository at this point in the history
Removed changelogConfig because the changelog screen is no longer showing anymore so there is no point of having the code.
  • Loading branch information
XDPXI committed Nov 19, 2024
1 parent 6ad2336 commit a53d3ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 94 deletions.
64 changes: 0 additions & 64 deletions src/client/java/dev/xdpxi/xdlib/config/changelogConfig.java

This file was deleted.

44 changes: 14 additions & 30 deletions src/client/java/dev/xdpxi/xdlib/mixin/client/TitleScreenMixin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dev.xdpxi.xdlib.mixin.client;

import dev.xdpxi.xdlib.config.changelogConfig;
import dev.xdpxi.xdlib.config.configManager;
import dev.xdpxi.xdlib.support;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
Expand All @@ -20,36 +18,22 @@ public class TitleScreenMixin {
@Unique
private static boolean Shown = false;

@Unique
private static int version = 12;

@Inject(method = "init", at = @At("TAIL"))
public void onInit(CallbackInfo ci) {
changelogConfig config = new changelogConfig();
changelogConfig.ConfigData loadedData = config.read();
int configVersion = loadedData.getVersion();
boolean firstStartup = version != configVersion;
boolean changelogEveryStartup = configManager.configData.isChangelogEveryStartup();
boolean disableChangelog = configManager.configData.isDisableChangelog();

if (((firstStartup || changelogEveryStartup) && !Shown) && !disableChangelog) {
// do nothing
} else {
if (!Shown) {
CompletableFuture.supplyAsync(() -> {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return 0;
}).thenAcceptAsync(result -> {
Shown = true;
MinecraftClient client = MinecraftClient.getInstance();
Screen currentScreen = client.currentScreen;
client.execute(() -> client.setScreen(new support(Text.empty(), currentScreen)));
}, MinecraftClient.getInstance());
}
if (!Shown) {
CompletableFuture.supplyAsync(() -> {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return 0;
}).thenAcceptAsync(result -> {
Shown = true;
MinecraftClient client = MinecraftClient.getInstance();
Screen currentScreen = client.currentScreen;
client.execute(() -> client.setScreen(new support(Text.empty(), currentScreen)));
}, MinecraftClient.getInstance());
}
}
}

0 comments on commit a53d3ff

Please sign in to comment.