Skip to content

Commit

Permalink
feat(client): 1.20.3, 1.20.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Dec 30, 2023
1 parent f7c5e49 commit 15b0c63
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/1.20.3-1.20.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
net.minecraft.network.chat.contents.PlainTextContents$LiteralContents net.minecraft.network.chat.contents.LiteralContents
3 changes: 2 additions & 1 deletion client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ val universalCraft by configurations.creating {

fun uStatsVersion() = rootProject.libs.versions.ustats.map {
val minecraftVersion = when (platform.mcVersion) {
12001, 12002 -> "1.20"
12001, 12002, 12003 -> "1.20"
else -> platform.mcVersionStr
}

Expand All @@ -76,6 +76,7 @@ dependencies {
11904 -> "0.76.0+1.19.4"
12001 -> "0.84.0+1.20.1"
12002 -> "0.89.1+1.20.2"
12003 -> "0.91.1+1.20.3"
else -> throw GradleException("Unsupported platform $platform")
}

Expand Down
4 changes: 4 additions & 0 deletions client/root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ group = "$mavenGroup.client-root"

preprocess {

val fabric12003 = createNode("1.20.3-fabric", 12003, "official")

// val forge12002 = createNode("1.20.2-forge", 12002, "official")
val fabric12002 = createNode("1.20.2-fabric", 12002, "official")
val forge12001 = createNode("1.20.1-forge", 12001, "official")
Expand All @@ -19,6 +21,8 @@ preprocess {
val forge11902 = createNode("1.19.2-forge", 11902, "official")
val fabric11902 = createNode("1.19.2-fabric", 11902, "official")

fabric12003.link(fabric12002)

fabric12002.link(fabric12001, file("1.20.2-1.20.1.txt"))
// forge12002.link(fabric12002)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
import net.minecraft.client.Minecraft;
import net.minecraft.locale.Language;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.contents.LiteralContents;
import net.minecraft.network.chat.contents.TranslatableContents;
import org.jetbrains.annotations.NotNull;
import su.plo.lib.api.chat.MinecraftTextComponent;
import su.plo.voice.api.client.config.keybind.KeyBinding;

//#if MC>=12003
//$$ import net.minecraft.network.chat.contents.PlainTextContents;
//#else
import net.minecraft.network.chat.contents.LiteralContents;
//#endif

@UtilityClass
public class LanguageUtil {

Expand Down Expand Up @@ -48,7 +53,11 @@ public static String getSelectedLanguage() {
Component displayName = inputKey.getDisplayName();
if (displayName.getContents() instanceof TranslatableContents translatable) {
return MinecraftTextComponent.translatable(translatable.getKey(), translatable.getArgs());
//#if MC>=12003
//$$ } else if (displayName.getContents() instanceof PlainTextContents.LiteralContents literal) {
//#else
} else if (displayName.getContents() instanceof LiteralContents literal) {
//#endif
return MinecraftTextComponent.translatable(literal.text());
} else {
return MinecraftTextComponent.translatable("gui.none");
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
junit5 = "5.8.2"
crowdin = "1.0.1"
ustats = "1.0.2"
universalcraft = "312"
universalcraft = "320"
bstats = "3.0.2"

[libraries]
Expand Down

0 comments on commit 15b0c63

Please sign in to comment.