Skip to content

Commit

Permalink
Update to 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahwinsley committed Dec 1, 2021
1 parent 09d737a commit 4441345
Show file tree
Hide file tree
Showing 53 changed files with 741 additions and 642 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
59 changes: 22 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
Expand All @@ -12,12 +13,12 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time, and must be in the following format.
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
Expand All @@ -26,12 +27,11 @@ minecraft {
// You must be aware of the Mojang license when using the 'official' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Use non-default mappings at your own risk. they may not always work.
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.16.5'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
mappings channel: 'official', version: '1.18'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
Expand All @@ -40,7 +40,7 @@ minecraft {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
Expand All @@ -62,7 +62,7 @@ minecraft {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
Expand All @@ -84,7 +84,7 @@ minecraft {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
Expand Down Expand Up @@ -120,26 +120,12 @@ repositories {
}

dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.16.5-36.2.0'

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"

runtimeOnly fg.deobf("curse.maven:jei-238222:3414898")

// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
minecraft 'net.minecraftforge:forge:1.18-38.0.4'

// These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// runtimeOnly fg.deobf("curse.maven:jei-238222:3414898")

// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
Expand All @@ -150,22 +136,21 @@ dependencies {
jar {
manifest {
attributes([
"Specification-Title": mod_id,
"Specification-Vendor": group,
"Specification-Version": "1",
"Implementation-Title": "Pylons",
"Implementation-Version": "${project.version}",
"Implementation-Vendor" :"Jeremiah Winsley",
"Specification-Title" : mod_id,
"Specification-Vendor" : group,
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
}

// Example configuration to allow publishing using the maven-publish task
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
// publish.dependsOn('reobfJar')

publishing {
publications {
Expand All @@ -175,7 +160,7 @@ publishing {
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ org.gradle.daemon=false

group=net.permutated
mod_id=pylons
version=1.0.4
version=2.0.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 4441345

Please sign in to comment.