Modrinth as default Update location (can be configured to revert to curseforge as default)
This commit is contained in:
parent
f63f0ef5fc
commit
4d626b23b2
7 changed files with 81 additions and 14 deletions
|
@ -80,8 +80,47 @@ public class UpdatesScreen extends BCLibLayoutScreen {
|
||||||
row.addText(fit(), fit(), Component.literal(" -> "));
|
row.addText(fit(), fit(), Component.literal(" -> "));
|
||||||
row.addText(fit(), fit(), Component.literal(updated)).setColor(ColorUtil.GREEN);
|
row.addText(fit(), fit(), Component.literal(updated)).setColor(ColorUtil.GREEN);
|
||||||
row.addFiller();
|
row.addFiller();
|
||||||
if (nfo != null && nfo.getMetadata().getContact().get("homepage").isPresent()) {
|
boolean createdDownloadLink = false;
|
||||||
row.addButton(fit(), fit(), Component.translatable("bclib.updates.curseforge_link"))
|
if (nfo != null
|
||||||
|
&& nfo.getMetadata().getCustomValue("bclib") != null
|
||||||
|
&& nfo.getMetadata().getCustomValue("bclib").getAsObject().get("downloads") != null) {
|
||||||
|
CustomValue.CvObject downloadLinks = nfo.getMetadata()
|
||||||
|
.getCustomValue("bclib")
|
||||||
|
.getAsObject()
|
||||||
|
.get("downloads")
|
||||||
|
.getAsObject();
|
||||||
|
String link = null;
|
||||||
|
Component name = null;
|
||||||
|
if (Configs.CLIENT_CONFIG.preferModrinthForUpdates() && downloadLinks.get("modrinth") != null) {
|
||||||
|
link = downloadLinks.get("modrinth").getAsString();
|
||||||
|
name = Component.translatable("bclib.updates.modrinth_link");
|
||||||
|
// row.addButton(fit(), fit(), Component.translatable("bclib.updates.modrinth_link"))
|
||||||
|
// .onPress((bt) -> {
|
||||||
|
// this.openLink(downloadLinks.get("modrinth").getAsString());
|
||||||
|
// }).centerVertical();
|
||||||
|
// createdDownloadLink = true;
|
||||||
|
} else if (downloadLinks.get("curseforge") != null) {
|
||||||
|
link = downloadLinks.get("curseforge").getAsString();
|
||||||
|
name = Component.translatable("bclib.updates.curseforge_link");
|
||||||
|
// row.addButton(fit(), fit(), Component.translatable("bclib.updates.curseforge_link"))
|
||||||
|
// .onPress((bt) -> {
|
||||||
|
// this.openLink(downloadLinks.get("curseforge").getAsString());
|
||||||
|
// }).centerVertical();
|
||||||
|
// createdDownloadLink = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (link != null) {
|
||||||
|
createdDownloadLink = true;
|
||||||
|
final String finalLink = link;
|
||||||
|
row.addButton(fit(), fit(), name)
|
||||||
|
.onPress((bt) -> {
|
||||||
|
this.openLink(finalLink);
|
||||||
|
}).centerVertical();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!createdDownloadLink && nfo != null && nfo.getMetadata().getContact().get("homepage").isPresent()) {
|
||||||
|
row.addButton(fit(), fit(), Component.translatable("bclib.updates.download_link"))
|
||||||
.onPress((bt) -> {
|
.onPress((bt) -> {
|
||||||
this.openLink(nfo.getMetadata().getContact().get("homepage").get());
|
this.openLink(nfo.getMetadata().getContact().get("homepage").get());
|
||||||
}).centerVertical();
|
}).centerVertical();
|
||||||
|
|
|
@ -11,7 +11,6 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
"didShowWelcome",
|
"didShowWelcome",
|
||||||
"version"
|
"version"
|
||||||
);
|
);
|
||||||
@ConfigUI(topPadding = 12)
|
|
||||||
public static final ConfigToken<Boolean> CHECK_VERSIONS = ConfigToken.Boolean(
|
public static final ConfigToken<Boolean> CHECK_VERSIONS = ConfigToken.Boolean(
|
||||||
true,
|
true,
|
||||||
"check",
|
"check",
|
||||||
|
@ -24,12 +23,20 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
"ui"
|
"ui"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ConfigUI(leftPadding = 8)
|
||||||
|
public static final ConfigToken<Boolean> PREFER_MODRINTH_FOR_UPDATES = ConfigToken.Boolean(
|
||||||
|
true,
|
||||||
|
"preferModrinthForUpdates",
|
||||||
|
"ui"
|
||||||
|
);
|
||||||
|
|
||||||
@ConfigUI(hide = true)
|
@ConfigUI(hide = true)
|
||||||
public static final ConfigToken<Boolean> FORCE_BETTERX_PRESET = ConfigToken.Boolean(
|
public static final ConfigToken<Boolean> FORCE_BETTERX_PRESET = ConfigToken.Boolean(
|
||||||
true,
|
true,
|
||||||
"forceBetterXPreset",
|
"forceBetterXPreset",
|
||||||
"ui"
|
"ui"
|
||||||
);
|
);
|
||||||
|
@ConfigUI(topPadding = 12)
|
||||||
public static final ConfigToken<Boolean> SUPPRESS_EXPERIMENTAL_DIALOG = ConfigToken.Boolean(
|
public static final ConfigToken<Boolean> SUPPRESS_EXPERIMENTAL_DIALOG = ConfigToken.Boolean(
|
||||||
false,
|
false,
|
||||||
"suppressExperimentalDialogOnLoad",
|
"suppressExperimentalDialogOnLoad",
|
||||||
|
@ -107,6 +114,8 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
"rendering",
|
"rendering",
|
||||||
(config) -> config.get(CUSTOM_FOG_RENDERING)
|
(config) -> config.get(CUSTOM_FOG_RENDERING)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ConfigUI(topPadding = 12)
|
||||||
public static final ConfigToken<Boolean> SURVIES_ON_HINT = ConfigToken.Boolean(
|
public static final ConfigToken<Boolean> SURVIES_ON_HINT = ConfigToken.Boolean(
|
||||||
true,
|
true,
|
||||||
"survives_on_hint",
|
"survives_on_hint",
|
||||||
|
@ -194,8 +203,12 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
public void setForceBetterXPreset(boolean v) {
|
public void setForceBetterXPreset(boolean v) {
|
||||||
set(FORCE_BETTERX_PRESET, v);
|
set(FORCE_BETTERX_PRESET, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean survivesOnHint() {
|
public boolean survivesOnHint() {
|
||||||
return get(ClientConfig.SURVIES_ON_HINT);
|
return get(ClientConfig.SURVIES_ON_HINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean preferModrinthForUpdates() {
|
||||||
|
return get(ClientConfig.PREFER_MODRINTH_FOR_UPDATES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,7 @@ package org.betterx.bclib.config;
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
|
||||||
public class MainConfig extends NamedPathConfig {
|
public class MainConfig extends NamedPathConfig {
|
||||||
public static final ConfigToken<Boolean> VERBOSE_LOGGING = ConfigToken.Boolean(
|
|
||||||
true,
|
|
||||||
"verbose",
|
|
||||||
Configs.MAIN_INFO_CATEGORY
|
|
||||||
);
|
|
||||||
|
|
||||||
public static final ConfigToken<Boolean> APPLY_PATCHES = ConfigToken.Boolean(
|
public static final ConfigToken<Boolean> APPLY_PATCHES = ConfigToken.Boolean(
|
||||||
true,
|
true,
|
||||||
|
@ -15,7 +11,7 @@ public class MainConfig extends NamedPathConfig {
|
||||||
Configs.MAIN_PATCH_CATEGORY
|
Configs.MAIN_PATCH_CATEGORY
|
||||||
);
|
);
|
||||||
|
|
||||||
@ConfigUI(leftPadding = 8, topPadding = 8)
|
@ConfigUI(leftPadding = 8)
|
||||||
public static final ConfigToken<Boolean> REPAIR_BIOMES = DependendConfigToken.Boolean(
|
public static final ConfigToken<Boolean> REPAIR_BIOMES = DependendConfigToken.Boolean(
|
||||||
false,
|
false,
|
||||||
"repairBiomesOnLoad",
|
"repairBiomesOnLoad",
|
||||||
|
@ -24,6 +20,13 @@ public class MainConfig extends NamedPathConfig {
|
||||||
APPLY_PATCHES)
|
APPLY_PATCHES)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ConfigUI(topPadding = 8)
|
||||||
|
public static final ConfigToken<Boolean> VERBOSE_LOGGING = ConfigToken.Boolean(
|
||||||
|
true,
|
||||||
|
"verbose",
|
||||||
|
Configs.MAIN_INFO_CATEGORY
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
public MainConfig() {
|
public MainConfig() {
|
||||||
super(BCLib.MOD_ID, "main", true, true);
|
super(BCLib.MOD_ID, "main", true, true);
|
||||||
|
|
|
@ -131,10 +131,10 @@ public class VersionChecker implements Runnable {
|
||||||
}
|
}
|
||||||
if (mod.n != null && mod.v != null && KNOWN_MODS.contains(mod.n)) {
|
if (mod.n != null && mod.v != null && KNOWN_MODS.contains(mod.n)) {
|
||||||
String installedVersion = ModUtil.getModVersion(mod.n);
|
String installedVersion = ModUtil.getModVersion(mod.n);
|
||||||
boolean isNew = ModUtil.isLargerVersion(mod.v, installedVersion) && !installedVersion.equals(
|
boolean isNew = ModUtil.isLargerVersion(mod.v, installedVersion)
|
||||||
"0.0.0");
|
&& !installedVersion.equals("0.0.0");
|
||||||
BCLib.LOGGER.info(" - " + mod.n + ":" + mod.v + (isNew ? " (update available)" : ""));
|
BCLib.LOGGER.info(" - " + mod.n + ":" + mod.v + (isNew ? " (update available)" : ""));
|
||||||
if (isNew)
|
if (true || isNew)
|
||||||
NEW_VERSIONS.add(mod);
|
NEW_VERSIONS.add(mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@
|
||||||
"title.config.bclib.client.rendering.customFogRendering": "Angepasster Nebel",
|
"title.config.bclib.client.rendering.customFogRendering": "Angepasster Nebel",
|
||||||
"title.config.bclib.client.rendering.netherThickFog": "Dicker Nether-Nebel",
|
"title.config.bclib.client.rendering.netherThickFog": "Dicker Nether-Nebel",
|
||||||
"bclib.updates.curseforge_link": "[CurseForge]",
|
"bclib.updates.curseforge_link": "[CurseForge]",
|
||||||
|
"bclib.updates.modrinth_link": "[Modrinth]",
|
||||||
|
"bclib.updates.download_link": "Herunterladen",
|
||||||
"bclib.updates.title": "Mod Aktualisierungen",
|
"bclib.updates.title": "Mod Aktualisierungen",
|
||||||
"bclib.updates.disable_check": "Nicht Prüfen",
|
"bclib.updates.disable_check": "Nicht Prüfen",
|
||||||
"bclib.updates.donate_pre": "Gefallen Dir unsere Inhalte?\nDann erwäge eine kleine Spende :)",
|
"bclib.updates.donate_pre": "Gefallen Dir unsere Inhalte?\nDann erwäge eine kleine Spende :)",
|
||||||
|
@ -88,6 +90,7 @@
|
||||||
"title.config.bclib.main.infos.verbose": "Ausführliche Logs",
|
"title.config.bclib.main.infos.verbose": "Ausführliche Logs",
|
||||||
"title.config.bclib.client.infos.survives_on_hint": "Zeige 'Überlebt auf' Tooltip",
|
"title.config.bclib.client.infos.survives_on_hint": "Zeige 'Überlebt auf' Tooltip",
|
||||||
"description.config.bclib.client.ui.suppressExperimentalDialogOnLoad": "Der Warnbildschirm wird immer dann angezeigt, wenn Deine Welt nicht die Einstellungen der Vanilla-Version verwendet. Dies kann passieren, wenn Du eine Welt in einer Vorschauversion startest, aber auch wenn Du Mods verwendest, um die Welterzeugung zu verändern. Wenn diese Option aktiviert ist, wird die Warnung übersprungen, wenn Du eine bestehende Welt lädst. Sie wird weiterhin angezeigt (als Erinnerung), wenn eine neue Welt erstellt wird.",
|
"description.config.bclib.client.ui.suppressExperimentalDialogOnLoad": "Der Warnbildschirm wird immer dann angezeigt, wenn Deine Welt nicht die Einstellungen der Vanilla-Version verwendet. Dies kann passieren, wenn Du eine Welt in einer Vorschauversion startest, aber auch wenn Du Mods verwendest, um die Welterzeugung zu verändern. Wenn diese Option aktiviert ist, wird die Warnung übersprungen, wenn Du eine bestehende Welt lädst. Sie wird weiterhin angezeigt (als Erinnerung), wenn eine neue Welt erstellt wird.",
|
||||||
|
"title.config.bclib.client.ui.preferModrinthForUpdates": "Bevorzuge Updates über Modrinth",
|
||||||
"title.config.bclib.client.ui.forceBetterXPreset": "BetterX als Standard-Welt-Typ verwenden",
|
"title.config.bclib.client.ui.forceBetterXPreset": "BetterX als Standard-Welt-Typ verwenden",
|
||||||
"description.config.bclib.client.ui.forceBetterXPreset": "Der Welt-Typ bestimmt, wie eine Welt generiert wird. In den meisten Fällen solltet BetterX als Standardeinstellung beibehalten werden (Du kannst den Typ jederzeit im Welt-Erstellen-Bildschirm ändern). Dieser Typ ist für maximale Kompatibilität zwischen DataPacks, unserer Mod und anderen Fabric-Mods optimiert. Außerdem bietet er einige einzigartige Funktionen für BetterNether und BetterEnd. Du solltest diese Option nur deaktivieren, wenn Du einen Grund dazu hast!",
|
"description.config.bclib.client.ui.forceBetterXPreset": "Der Welt-Typ bestimmt, wie eine Welt generiert wird. In den meisten Fällen solltet BetterX als Standardeinstellung beibehalten werden (Du kannst den Typ jederzeit im Welt-Erstellen-Bildschirm ändern). Dieser Typ ist für maximale Kompatibilität zwischen DataPacks, unserer Mod und anderen Fabric-Mods optimiert. Außerdem bietet er einige einzigartige Funktionen für BetterNether und BetterEnd. Du solltest diese Option nur deaktivieren, wenn Du einen Grund dazu hast!",
|
||||||
"warning.config.bclib.client.ui.forceBetterXPreset": "IN DEN MEISTEN FÄLLEN SOLLTE DIESE OPTION AKTIVIERT BLEIBEN.\n",
|
"warning.config.bclib.client.ui.forceBetterXPreset": "IN DEN MEISTEN FÄLLEN SOLLTE DIESE OPTION AKTIVIERT BLEIBEN.\n",
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
"title.config.bclib.main.patches.applyPatches": "Automatically apply patches when loading level",
|
"title.config.bclib.main.patches.applyPatches": "Automatically apply patches when loading level",
|
||||||
"title.config.bclib.main.patches.repairBiomesOnLoad": "Fix Biomesource on level load",
|
"title.config.bclib.main.patches.repairBiomesOnLoad": "Fix Biomesource on level load",
|
||||||
"title.config.bclib.client.ui.suppressExperimentalDialogOnLoad": "Disable Experimental Warning Screen on Load",
|
"title.config.bclib.client.ui.suppressExperimentalDialogOnLoad": "Disable Experimental Warning Screen on Load",
|
||||||
|
"title.config.bclib.client.ui.preferModrinthForUpdates": "Prefere Modrinth for Updates",
|
||||||
"title.bclib.syncfiles.modInfo": "Mod Info",
|
"title.bclib.syncfiles.modInfo": "Mod Info",
|
||||||
"title.bclib.syncfiles.modlist": "Mod Information",
|
"title.bclib.syncfiles.modlist": "Mod Information",
|
||||||
"message.bclib.syncfiles.modlist": "The following shows the state of your installed Mods.\n\nAll Mods that do not exist locally, or have a different version on the Server will be synchronized.",
|
"message.bclib.syncfiles.modlist": "The following shows the state of your installed Mods.\n\nAll Mods that do not exist locally, or have a different version on the Server will be synchronized.",
|
||||||
|
@ -75,6 +76,8 @@
|
||||||
"title.screen.bclib.worldgen.central_radius": "Central Void Radius (in Chunks)",
|
"title.screen.bclib.worldgen.central_radius": "Central Void Radius (in Chunks)",
|
||||||
"title.screen.bclib.worldgen.end_void": "Generate Small Islands",
|
"title.screen.bclib.worldgen.end_void": "Generate Small Islands",
|
||||||
"bclib.updates.curseforge_link": "[CurseForge]",
|
"bclib.updates.curseforge_link": "[CurseForge]",
|
||||||
|
"bclib.updates.modrinth_link": "[Modrinth]",
|
||||||
|
"bclib.updates.download_link": "Download",
|
||||||
"bclib.updates.title": "Mod Updates",
|
"bclib.updates.title": "Mod Updates",
|
||||||
"bclib.updates.disable_check": "Disable Check",
|
"bclib.updates.disable_check": "Disable Check",
|
||||||
"bclib.updates.donate_pre": "Like our Content?\nPlease consider a small Donation :)",
|
"bclib.updates.donate_pre": "Like our Content?\nPlease consider a small Donation :)",
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"Bulldog83"
|
"Bulldog83"
|
||||||
],
|
],
|
||||||
"contact": {
|
"contact": {
|
||||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/bclib",
|
"homepage": "https://modrinth.com/mod/bclib",
|
||||||
"issues": "https://github.com/quiqueck/bclib/issues",
|
"issues": "https://github.com/quiqueck/bclib/issues",
|
||||||
"sources": "https://github.com/quiqueck/bclib"
|
"sources": "https://github.com/quiqueck/bclib"
|
||||||
},
|
},
|
||||||
|
@ -55,6 +55,12 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"custom": {
|
"custom": {
|
||||||
|
"bclib": {
|
||||||
|
"downloads": {
|
||||||
|
"modrinth": "https://modrinth.com/mod/bclib",
|
||||||
|
"curseforge": "https://www.curseforge.com/minecraft/mc-mods/bclib"
|
||||||
|
}
|
||||||
|
},
|
||||||
"modmenu": {
|
"modmenu": {
|
||||||
"links": {
|
"links": {
|
||||||
"title.link.bclib.discord": "https://discord.gg/kYuATbYbKW"
|
"title.link.bclib.discord": "https://discord.gg/kYuATbYbKW"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue