Skip to content

Latest commit

 

History

History
149 lines (135 loc) · 7.08 KB

CONTRIBUTING.md

File metadata and controls

149 lines (135 loc) · 7.08 KB

Development and Contribution

Building

  1. Run ./gradlew setupDecompWorkspace clean build command.
  2. The built jars are all in ${rootprojectDir}/build/libs folder.

NOTICE: The jar file with specific Minecraft version is for the vanilla edition without Forge and Fabric. The json files are launcher profiles which only work when building with our CI server.

Running and Testing

For now, CustomSkinLoader is unable to run under self development environment, so it needs to add to another development environment as a library.
There are the available versions in different environments below:

Forge Fabric
Runtime Environment forge-1.8-11.14.0.1237 ~ 1.13.2-25.0.22
forge-1.13.2-25.0.42 ~ latest
fabric-loader-0.4.3+build.134 ~ latest
Minecraft 18w43b ~ latest
fabric-api is not required
Development Environment ForgeGradle-2.1-SNAPSHOT ~ latest
forge-1.8-11.14.3.1503 ~ 1.12.2-14.23.5.2860
forge-1.13.2-25.0.198 ~ latest
fabric-loom-(?) ~ latest
fabric-loader-0.12.0 ~ latest
Minecraft 18w49a ~ latest
fabric-api is not required

Preliminary steps for testing local builds

  1. Create a new empty minecraft development environment.
  2. Add below contents to build.gradle:
    repositories {
        maven {
            url = "file:/${projectDir}/local-repo"
        }
    }
  3. Create these folders in the new project directory, then copy the built jar and source jar into it:
    Forge 1.8    ~ 1.16.5:  ./local-repo/mods/CustomSkinLoader_ForgeLegacy/${version}
    Forge 1.17.1 ~ latest:  ./local-repo/mods/CustomSkinLoader_ForgeActive/${version}
    Fabric:                 ./local-repo/mods/CustomSkinLoader_Fabric/${version}
    
    ${version} should be repalced with something like 15.0-SNAPSHOT-00 manually
  4. Create a pom file in the same folder:
    • Forge 1.8 ~ 1.16.5: CustomSkinLoader_ForgeLegacy-${version}.pom
    <?xml version="1.0" encoding="UTF-8"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>mods</groupId>
        <artifactId>CustomSkinLoader_ForgeLegacy</artifactId>
        <!-- `${version}` should be repalced with something like `15.0-SNAPSHOT-00` manually -->
        <version>${version}</version>
    </project>
    • Forge 1.17.1 ~ latest: CustomSkinLoader_ForgeActive-${version}.pom
    <?xml version="1.0" encoding="UTF-8"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>mods</groupId>
        <artifactId>CustomSkinLoader_ForgeActive</artifactId>
        <!-- `${version}` should be repalced with something like `15.0-SNAPSHOT-00` manually -->
        <version>${version}</version>
    </project>
    • Fabric: CustomSkinLoader_Fabric-${version}.pom
    <?xml version="1.0" encoding="UTF-8"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>mods</groupId>
        <artifactId>CustomSkinLoader_Fabric</artifactId>
        <!-- `${version}` should be repalced with something like `15.0-SNAPSHOT-00` manually -->
        <version>${version}</version>
    </project>

For ForgeGradle 2.x ( forge-1.8-11.14.3.1503 ~ forge-1.12.2-14.23.5.2847 )

  1. Add below contents to build.gradle:
    dependencies {
        deobfCompile "mods:CustomSkinLoader_ForgeLegacy:15.0-SNAPSHOT-00"
    }
    
    minecraft {
        clientRunArgs += ["--tweakClass", "customskinloader.forge.ForgeDevTweaker", "--username", "<Your username>"]
    }
  2. Run ./gradlew setupDecompWorkspace command.
  3. Then you can debug the mod in IDE or through ./gradlew runClient command.

For ForgeGradle 3.x ~ 5.x ( forge-1.12.2-14.23.5.2851 ~ latest )

  1. Add below contents to build.gradle:
    dependencies {
        implementation fg.deobf("mods:CustomSkinLoader_ForgeLegacy:15.0-SNAPSHOT-00") // Only required for MinecraftForge 1.8 ~ 1.16.5
        implementation fg.deobf("mods:CustomSkinLoader_ForgeActive:15.0-SNAPSHOT-00") // Only required for MinecraftForge 1.17.1 ~ latest
    }
    
    minecraft {
        runs {
            client {
                args += ["--username", "<Your username>"]
                args += ["--tweakClass", "customskinloader.forge.ForgeDevTweaker"] // Only required for MinecraftForge 1.12.2
            }
        }
    }
  2. Setup the development environment and run the game as usual.

For fabric-loom ( fabric-loader-0.12.0 ~ latest )

  1. Add below contents to build.gradle:
    dependencies {
        modImplementation "mods:CustomSkinLoader_Fabric:15.0-SNAPSHOT-00"
    }
    
    tasks.runClient {
        args += ["--username", "<Your username>"]
    }
  2. Add --username <Your username> to CLI arguments in Run/Debug Configurations dialog.
  3. Run the game in IDE or through ./gradlew runClient command..

Depend on release builds

  1. Check the latest version in https://littlesk.in/csl-latest .
  2. Add below contents to build.gradle:
    // Before Gradle 5.x
    repositories {
        ivy {
            url = "https://csl.littleservice.cn/"
            layout "pattern", {
                artifact "[organisation]/[artifact]-[revision](-[classifier])(.[ext])"
            }
        }
    }
    
    // After Gradle 6.x
    repositories {
        ivy {
            url = "https://csl.littleservice.cn/"
            metadataSources {
                artifact()
            }
            patternLayout {
                artifact "[organisation]/[artifact]-[revision](-[classifier])(.[ext])"
            }
        }
    }
  3. Follow the same steps in Running and Testing.

Developing

  • CustomSkinLoader is based on forge-1.12.2-14.23.5.2768 currently, including Fabric edition. We use custom reobfuscation mappings such as Fabric.tsrg and mixin.tsrg to generate different editions jar and Mixin reference jsons.
  • The source codes are all in ${projectDir}/sources and resource files are in ${projectDir}/resources instead of src/main/java and src/main/resources.
  • Do not add other required mods.