Skip to content

Commit

Permalink
Merge branch 'architectury-1.19.3' into architectury-1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Aug 21, 2023
2 parents b1461d7 + f6eae8b commit 8370f26
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/src/main/resources/assets/pfm/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,8 @@
"keybindings.category.pfm": "Paladin's Furniture",
"key.pfm.toiletUse": "Use Toilet",

"pfm.compat.failure.reason.arrpNotFound": "To use Sandwichable and Paladin's Furniture Mod together you will need to install ARRP. Please download it, place it on your mods folder, then re-launch the game.",
"pfm.compat.failure.arrpDownload": "Download ARRP",
"pfm.compat.failure.reason.indiumNotFound": "To use Paladin's Furniture mod with Sodium you will need Indium. Please download the latest version of it, place it on your mods folder, then re-launch the game.",
"pfm.compat.failure.indiumDownload": "Download Indium",
"pfm.compat.failure.title": "Paladin's Furniture Mod failed to load!",

"emi.category.pfm.freezer": "Freezing",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.unlikepaladin.pfm.mixin.fabric;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.Util;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.net.URI;
import java.net.URISyntaxException;

@Mixin(TitleScreen.class)
public class PFMTitleScreenMixin {
@Unique
private static boolean pfm$firstInit;

@Inject(method = "init", at = @At("RETURN"))
public void pfm$showMissingDependencyScreen(CallbackInfo ci) {
if (pfm$firstInit) {
return;
}

pfm$firstInit = true;

String reason;

if (FabricLoader.getInstance().isModLoaded("sodium") && !FabricLoader.getInstance().isModLoaded("indium")) {
reason = "pfm.compat.failure.reason.indiumNotFound";
}
else {
return;
}

MinecraftClient.getInstance().setScreen(new ConfirmScreen(
(boolean accepted) -> {
if (accepted) {
try {
Util.getOperatingSystem().open(new URI("https://modrinth.com/mod/indium/versions?g=1.17.1"));
} catch (URISyntaxException e) {
throw new IllegalStateException(e);
}
} else {
MinecraftClient.getInstance().stop();
}
},
new TranslatableText("pfm.compat.failure.title").formatted(Formatting.RED),
new TranslatableText(reason),
new TranslatableText("pfm.compat.failure.indiumNotFound"),
new TranslatableText("menu.quit")));
}
}
1 change: 1 addition & 0 deletions fabric/src/main/resources/pfm.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"package": "com.unlikepaladin.pfm.mixin.fabric",
"compatibilityLevel": "JAVA_16",
"client": [
"PFMTitleScreenMixin"
],
"mixins": [
"PFMAbstractTagProvider$ObjectBuilderMixin",
Expand Down

0 comments on commit 8370f26

Please sign in to comment.