Skip to content

Commit

Permalink
Support Minecraft 1.20.4
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <[email protected]>
  • Loading branch information
Hendrix-Shen committed Dec 13, 2023
1 parent 165f6f3 commit 96910c4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 17 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ preprocess {
def mc1194 = createNode("1.19.4", 1_19_04, "mojang")
def mc1201 = createNode("1.20.1", 1_20_01, "mojang")
def mc1202 = createNode("1.20.2", 1_20_02, "mojang")
def mc1204 = createNode("1.20.4", 1_20_04, "mojang")

mc1144.link(mc1152, file("versions/mapping-1.14.4-1.15.2.txt"))
mc1152.link(mc1165, file("versions/mapping-1.15.2-1.16.5.txt"))
Expand All @@ -28,6 +29,7 @@ preprocess {
mc1193.link(mc1194, file("versions/mapping-1.19.3-1.19.4.txt"))
mc1194.link(mc1201, file("versions/mapping-1.19.4-1.20.1.txt"))
mc1201.link(mc1202, file("versions/mapping-1.20.1-1.20.2.txt"))
mc1202.link(mc1204, file("versions/mapping-1.20.2-1.20.4.txt"))
}

ext {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod_version=0.7

# Development Environment
fabric_installer_version=0.11.2
fabric_loader_version=0.14.22
fabric_loader_version=0.15.1

# Annotation processor
lombok_version=1.18.30
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def versions = Arrays.asList(
"1.19.4",
"1.20.1",
"1.20.2",
"1.20.4",
)

for (String version : versions) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
package top.hendrixshen.magiclib.compat.minecraft.api.network.chat;

import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.contents.LiteralContents;
import net.minecraft.network.chat.contents.TranslatableContents;
import net.minecraft.network.chat.*;

import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import top.hendrixshen.magiclib.compat.api.UnImplCompatApiException;

//#if MC < 11900
//$$ import net.minecraft.network.chat.BaseComponent;
//#endif

//#if MC > 11502
import net.minecraft.network.chat.MutableComponent;
//#endif

public interface ComponentCompatApi {
@Contract("_ -> new")
//#if MC > 11802
Expand All @@ -24,7 +14,7 @@ public interface ComponentCompatApi {
//$$ static @NotNull BaseComponent literal(String string) {
//#endif
//#if MC > 11802
return MutableComponent.create(new LiteralContents(string));
return Component.literal(string);
//#else
//$$ return new TextComponent(string);
//#endif
Expand All @@ -36,10 +26,8 @@ public interface ComponentCompatApi {
//#else
//$$ static @NotNull BaseComponent translatable(String string, Object... objects) {
//#endif
//#if MC > 11903
return MutableComponent.create(new TranslatableContents(string, null, objects));
//#elseif MC > 11802
//$$ return MutableComponent.create(new TranslatableContents(string, objects));
//#if MC > 11802
return Component.translatable(string, objects);
//#else
//$$ return new TranslatableComponent(string, objects);
//#endif
Expand Down
32 changes: 32 additions & 0 deletions versions/1.20.4/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Independent branch configuration
# Development Environment
minecraft_version=1.20.4
minecraft_dependency=1.20.4

# Required Libraries
# Carpet - 1.20.3-1.4.128+v231205
# fabric-carpet-1.20.3-1.4.128+v231205.jar
carpet_version=1.20.3-1.4.128+v231205
# Fabric API 0.91.2+1.20.4
fabric_version=0.91.2+1.20.4
# Malilib - 0.18.0
# malilib-fabric-1.20.4-0.18.0.jar
malilib_version=4946328
# Mod Menu - 9.0.0-pre.1
# modmenu-9.0.0-pre.1.jar
modmenu_version=9.0.0-pre.1

# Runtime Libraries - Only for development environment
# IMBlockerFabric 1.0.24
# imblockerfabric-1.0.24.jar
imblockerfabric_version=1.0.24
# In-Game Account Switcher
# InGameAccountSwitcher-Fabric-1.20.2-8.0.2.jar
inGameAccountSwitcher_version=8.0.2-fabric1.20.2
# LazyDFU 0.1.3
# https://www.curseforge.com/minecraft/mc-mods/lazydfu/files/3821870
# lazydfu-0.1.3.jar
lazydfu_version=0.1.3
# ThreadTweak - 0.1.1
# threadtweak-fabric-1.20.2-0.1.1.jar
threadtweak_version=0.1.1+mc1.20.2
Empty file.

0 comments on commit 96910c4

Please sign in to comment.