From d305b932ed8f13fc3790e867b888f9c9bf2079f8 Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Thu, 29 May 2025 03:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=AC=E5=9B=9B=E9=83=A8?= =?UTF-8?q?=E5=88=86=20=E4=BF=AE=E5=A4=8D=E5=85=B6mod.toml=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=86=85=E5=AE=B9=E4=B8=8D=E8=83=BD=E8=A2=AB=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=9B=BF=E4=BB=A3=E9=97=AE=E9=A2=98=EF=BC=8C=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E7=89=88=E6=9C=AC=E5=8F=B7=20ForgeP?= =?UTF-8?q?latformHelper=20shouldDumpModels()=E6=96=B9=E6=B3=95=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=BC=9A=E5=9C=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E8=AF=BB=E5=8F=96=E9=85=8D=E7=BD=AE=E5=87=BA=E9=94=99?= =?UTF-8?q?=EF=BC=8C=E8=8B=A5=E5=87=BA=E9=94=99=E5=88=99=E8=BF=94=E5=9B=9E?= =?UTF-8?q?false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 7 +++++ build.gradle | 31 ++++++++++--------- .../forge/platform/ForgePlatformHelper.java | 6 +++- forge/src/main/resources/META-INF/mods.toml | 2 +- gradle.properties | 2 +- 5 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 README.MD diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..b3e4e67 --- /dev/null +++ b/README.MD @@ -0,0 +1,7 @@ +# JsonEM (Json Entity Models) +Port from [JsonEM](https://github.com/FoundationGames/JsonEM) + +Support Forge Mod Loader (Recommended FML Version is 1.20.1-47.4.1) + +# License +MIT \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5006d3a..67a570b 100644 --- a/build.gradle +++ b/build.gradle @@ -55,23 +55,24 @@ subprojects { tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" it.options.release = 17 - } - def resourceTargets=["fabric.mod.json",'META-INF/mods.toml']; - def replaceProperties = [ - mod_name: mod_name, - mod_version: mod_version, - mod_source:mod_source, - mod_credits:mod_credits, - mod_authors: mod_authors, - mod_description: mod_description, - mod_licence:mod_licence, - group:maven_group] - processResources{ - inputs.properties replaceProperties - filesMatching(resourceTargets) { - expand replaceProperties + def resourceTargets=["fabric.mod.json",'META-INF/mods.toml']; + def replaceProperties = [ + mod_name: mod_name, + mod_version: mod_version, + mod_source:mod_source, + mod_credits:mod_credits, + mod_authors: mod_authors, + mod_description: mod_description, + mod_licence:mod_licence, + group:maven_group] + processResources { + inputs.properties replaceProperties + filesMatching(resourceTargets) { + expand replaceProperties + } } } + // Configure Maven publishing. publishing { publications { diff --git a/forge/src/main/java/com/leisuretimedock/jsonem/forge/platform/ForgePlatformHelper.java b/forge/src/main/java/com/leisuretimedock/jsonem/forge/platform/ForgePlatformHelper.java index 992e952..a961b41 100644 --- a/forge/src/main/java/com/leisuretimedock/jsonem/forge/platform/ForgePlatformHelper.java +++ b/forge/src/main/java/com/leisuretimedock/jsonem/forge/platform/ForgePlatformHelper.java @@ -9,7 +9,11 @@ import java.nio.file.Path; public class ForgePlatformHelper implements IPlatFormHelper { @Override public boolean shouldDumpModels() { - return JsonEmConfig.INSTANCE.DUMP_MODELS.get(); + try { + return JsonEmConfig.INSTANCE.DUMP_MODELS.get(); + } catch (Exception e) { + return false; + } } @Override diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index d4ed17e..e1d3247 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -12,7 +12,7 @@ credits = "${mod_credits}" authors = "${mod_authors}" description = ''' ${mod_description} - ''' +''' [[dependencies.jsonem]] diff --git a/gradle.properties b/gradle.properties index ec089a4..dad958b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.parallel=true # Mod properties mod_id=jsonem mod_name=jsonEM -mod_version=1.0-SNAPSHOT +mod_version=0.2.1+1.20-fabrge mod_source=https://github.com/LeisureTimeDock/JsonEM_Neo_Forge mod_credits= mod_authors= FoundationGames, R3944Realms