commit a0d984111233b359c22e89c5676e8ae550d5942c Author: 3944Realms Date: Sat May 24 21:16:43 2025 +0800 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5f737e --- /dev/null +++ b/.gitignore @@ -0,0 +1,119 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +.gradle +build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Cache of project +.gradletasknamecache + +**/build/ + +# Common working directory +run/ +runs/ + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1cb5d6d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2025 FoundationGames, R3944Realms + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..7242058 --- /dev/null +++ b/build.gradle @@ -0,0 +1,71 @@ +plugins { + id 'dev.architectury.loom' version '1.10-SNAPSHOT' apply false + id 'architectury-plugin' version '3.4-SNAPSHOT' + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false +} + +architectury { + minecraft = project.minecraft_version +} + +allprojects { + group = rootProject.maven_group + version = rootProject.mod_version +} + +subprojects { + apply plugin: 'dev.architectury.loom' + apply plugin: 'architectury-plugin' + apply plugin: 'maven-publish' + + base { + // Set up a suffixed format for the mod jar names, e.g. `example-fabric`. + archivesName = "$rootProject.archives_name-$project.name" + } + + repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. + } + + dependencies { + minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" + mappings loom.officialMojangMappings() + } + + java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + tasks.withType(JavaCompile).configureEach { + it.options.encoding = "UTF-8" + it.options.release = 17 + } + + // Configure Maven publishing. + publishing { + publications { + mavenJava(MavenPublication) { + artifactId = base.archivesName.get() + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } + } +} diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 0000000..db182e6 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,12 @@ +architectury { + common rootProject.enabled_platforms.split(',') +} + +dependencies { + // We depend on Fabric Loader here to use the Fabric @Environment annotations, + // which get remapped to the correct annotations on each platform. + // Do NOT use other classes from Fabric Loader. + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" + + modImplementation "dev.architectury:architectury:$rootProject.architectury_api_version" +} diff --git a/common/src/main/java/com/leisuretimedock/jsonem/Jsonem.java b/common/src/main/java/com/leisuretimedock/jsonem/Jsonem.java new file mode 100644 index 0000000..dd2120a --- /dev/null +++ b/common/src/main/java/com/leisuretimedock/jsonem/Jsonem.java @@ -0,0 +1,9 @@ +package com.leisuretimedock.jsonem; + +public final class Jsonem { + public static final String MOD_ID = "jsonem"; + + public static void init() { + // Write common init code here. + } +} diff --git a/common/src/main/resources/jsonem.mixins.json b/common/src/main/resources/jsonem.mixins.json new file mode 100644 index 0000000..596aa72 --- /dev/null +++ b/common/src/main/resources/jsonem.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "package": "com.leisuretimedock.jsonem.mixin", + "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/fabric/build.gradle b/fabric/build.gradle new file mode 100644 index 0000000..7905a9c --- /dev/null +++ b/fabric/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.github.johnrengelman.shadow' +} + +architectury { + platformSetupLoomIde() + fabric() +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentFabric.extendsFrom common + + // Files in this configuration will be bundled into your mod using the Shadow plugin. + // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. + shadowBundle { + canBeResolved = true + canBeConsumed = false + } +} + +dependencies { + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" + + modImplementation "net.fabricmc.fabric-api:fabric-api:$rootProject.fabric_api_version" + + modImplementation "dev.architectury:architectury-fabric:$rootProject.architectury_api_version" + + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionFabric') +} + +processResources { + inputs.property 'version', project.version + + filesMatching('fabric.mod.json') { + expand version: project.version + } +} + +shadowJar { + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' +} + +remapJar { + input.set shadowJar.archiveFile +} diff --git a/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/JsonemFabric.java b/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/JsonemFabric.java new file mode 100644 index 0000000..7735d40 --- /dev/null +++ b/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/JsonemFabric.java @@ -0,0 +1,16 @@ +package com.leisuretimedock.jsonem.fabric; + +import com.leisuretimedock.jsonem.Jsonem; +import net.fabricmc.api.ModInitializer; + +public final class JsonemFabric implements ModInitializer { + @Override + public void onInitialize() { + // This code runs as soon as Minecraft is in a mod-load-ready state. + // However, some things (like resources) may still be uninitialized. + // Proceed with mild caution. + + // Run our common setup. + Jsonem.init(); + } +} diff --git a/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/client/JsonemFabricClient.java b/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/client/JsonemFabricClient.java new file mode 100644 index 0000000..978c72b --- /dev/null +++ b/fabric/src/main/java/com/leisuretimedock/jsonem/fabric/client/JsonemFabricClient.java @@ -0,0 +1,10 @@ +package com.leisuretimedock.jsonem.fabric.client; + +import net.fabricmc.api.ClientModInitializer; + +public final class JsonemFabricClient implements ClientModInitializer { + @Override + public void onInitializeClient() { + // This entrypoint is suitable for setting up client-specific logic, such as rendering. + } +} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..5145b6f --- /dev/null +++ b/fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,38 @@ +{ + "schemaVersion": 1, + "id": "jsonem", + "version": "${version}", + "name": "JsonEM_Neo_Forge_1_20_1", + "description": "Migrate from Fabric 1.20.1", + "authors": [ + "FoundationGames", + "R3944Realms" + ], + "contact": { + "homepage": "" + }, + "license": "MIT", + "icon": "assets/jsonem/icon.png", + "environment": "*", + "entrypoints": { + "main": [ + "com.leisuretimedock.jsonem.fabric.JsonemFabric" + ], + "client": [ + "com.leisuretimedock.jsonem.fabric.client.JsonemFabricClient" + ] + }, + "mixins": [ + "jsonem.mixins.json" + ], + "depends": { + "fabricloader": ">=0.16.14", + "minecraft": "~1.20.1", + "java": ">=17", + "architectury": ">=9.2.14", + "fabric-api": "*" + }, + "suggests": { + "another-mod": "*" + } +} diff --git a/forge/build.gradle b/forge/build.gradle new file mode 100644 index 0000000..af89834 --- /dev/null +++ b/forge/build.gradle @@ -0,0 +1,57 @@ +plugins { + id 'com.github.johnrengelman.shadow' +} + +loom { + forge { + mixinConfig "jsonem.mixins.json" + } +} + +architectury { + platformSetupLoomIde() + forge() +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentForge.extendsFrom common + + // Files in this configuration will be bundled into your mod using the Shadow plugin. + // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. + shadowBundle { + canBeResolved = true + canBeConsumed = false + } +} + +dependencies { + forge "net.minecraftforge:forge:$rootProject.forge_version" + + modImplementation "dev.architectury:architectury-forge:$rootProject.architectury_api_version" + + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionForge') +} + +processResources { + inputs.property 'version', project.version + + filesMatching('META-INF/mods.toml') { + expand version: project.version + } +} + +shadowJar { + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' +} + +remapJar { + input.set shadowJar.archiveFile +} diff --git a/forge/gradle.properties b/forge/gradle.properties new file mode 100644 index 0000000..8242585 --- /dev/null +++ b/forge/gradle.properties @@ -0,0 +1 @@ +loom.platform=forge diff --git a/forge/src/main/java/com/leisuretimedock/jsonem/forge/JsonemForge.java b/forge/src/main/java/com/leisuretimedock/jsonem/forge/JsonemForge.java new file mode 100644 index 0000000..4e5f15f --- /dev/null +++ b/forge/src/main/java/com/leisuretimedock/jsonem/forge/JsonemForge.java @@ -0,0 +1,18 @@ +package com.leisuretimedock.jsonem.forge; + +import com.leisuretimedock.jsonem.Jsonem; +import dev.architectury.platform.forge.EventBuses; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; + +@Mod(Jsonem.MOD_ID) +public final class JsonemForge { + @SuppressWarnings("removal") + public JsonemForge() { + // Submit our event bus to let Architectury API register our content on the right time. + EventBuses.registerModEventBus(Jsonem.MOD_ID, FMLJavaModLoadingContext.get().getModEventBus()); + + // Run our common setup. + Jsonem.init(); + } +} diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..0ba0e0d --- /dev/null +++ b/forge/src/main/resources/META-INF/mods.toml @@ -0,0 +1,35 @@ +modLoader = "javafml" +loaderVersion = "[47,)" +#issueTrackerURL = "" +license = "MIT" + +[[mods]] +modId = "jsonem" +version = "${version}" +displayName = "JsonEM_Neo_Forge_1_20_1" +authors = "FoundationGames, R3944Realms" +description = ''' +Migrate from Fabric 1.20.1 +''' +#logoFile = "" + +[[dependencies.jsonem]] +modId = "forge" +mandatory = true +versionRange = "[47,)" +ordering = "NONE" +side = "BOTH" + +[[dependencies.jsonem]] +modId = "minecraft" +mandatory = true +versionRange = "[1.20.1,)" +ordering = "NONE" +side = "BOTH" + +[[dependencies.jsonem]] +modId = "architectury" +mandatory = true +versionRange = "[9.2.14,)" +ordering = "AFTER" +side = "BOTH" diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..53a18d3 --- /dev/null +++ b/forge/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "jsonem resources", + "pack_format": 15 + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..40e99f2 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,15 @@ +# Done to increase the memory available to Gradle. +org.gradle.jvmargs=-Xmx2G +org.gradle.parallel=true +# Mod properties +mod_version=1.0-SNAPSHOT +maven_group=com.leisuretimedock +archives_name=jsonem_neo_forge_1_20_1 +enabled_platforms=fabric,neoforge +# Minecraft properties +minecraft_version=1.20.1 +# Dependencies +architectury_api_version=9.2.14 +fabric_loader_version=0.16.14 +fabric_api_version=0.92.5+1.20.1 +forge_version=1.20.1-47.4.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b83712d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.12.1-bin.zip diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..1b9240f --- /dev/null +++ b/settings.gradle @@ -0,0 +1,14 @@ +pluginManagement { + repositories { + maven { url "https://maven.fabricmc.net/" } + maven { url "https://maven.architectury.dev/" } + maven { url "https://files.minecraftforge.net/maven/" } + gradlePluginPortal() + } +} + +rootProject.name = 'jsonem' + +include 'common' +include 'fabric' +include 'forge'