修改第四部分

修复其mod.toml部分内容不能被正确替代问题,
更新了版本号
ForgePlatformHelper shouldDumpModels()方法可能会在初始化环境读取配置出错,若出错则返回false
This commit is contained in:
叁玖领域 2025-05-29 03:06:16 +08:00
parent ffb2dcca4c
commit d305b932ed
5 changed files with 30 additions and 18 deletions

7
README.MD Normal file
View File

@ -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

View File

@ -55,23 +55,24 @@ subprojects {
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
it.options.release = 17 it.options.release = 17
} def resourceTargets=["fabric.mod.json",'META-INF/mods.toml'];
def resourceTargets=["fabric.mod.json",'META-INF/mods.toml']; def replaceProperties = [
def replaceProperties = [ mod_name: mod_name,
mod_name: mod_name, mod_version: mod_version,
mod_version: mod_version, mod_source:mod_source,
mod_source:mod_source, mod_credits:mod_credits,
mod_credits:mod_credits, mod_authors: mod_authors,
mod_authors: mod_authors, mod_description: mod_description,
mod_description: mod_description, mod_licence:mod_licence,
mod_licence:mod_licence, group:maven_group]
group:maven_group] processResources {
processResources{ inputs.properties replaceProperties
inputs.properties replaceProperties filesMatching(resourceTargets) {
filesMatching(resourceTargets) { expand replaceProperties
expand replaceProperties }
} }
} }
// Configure Maven publishing. // Configure Maven publishing.
publishing { publishing {
publications { publications {

View File

@ -9,7 +9,11 @@ import java.nio.file.Path;
public class ForgePlatformHelper implements IPlatFormHelper { public class ForgePlatformHelper implements IPlatFormHelper {
@Override @Override
public boolean shouldDumpModels() { public boolean shouldDumpModels() {
return JsonEmConfig.INSTANCE.DUMP_MODELS.get(); try {
return JsonEmConfig.INSTANCE.DUMP_MODELS.get();
} catch (Exception e) {
return false;
}
} }
@Override @Override

View File

@ -12,7 +12,7 @@ credits = "${mod_credits}"
authors = "${mod_authors}" authors = "${mod_authors}"
description = ''' description = '''
${mod_description} ${mod_description}
''' '''
[[dependencies.jsonem]] [[dependencies.jsonem]]

View File

@ -4,7 +4,7 @@ org.gradle.parallel=true
# Mod properties # Mod properties
mod_id=jsonem mod_id=jsonem
mod_name=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_source=https://github.com/LeisureTimeDock/JsonEM_Neo_Forge
mod_credits= mod_credits=
mod_authors= FoundationGames, R3944Realms mod_authors= FoundationGames, R3944Realms