Skip to content

Commit

Permalink
Ported to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GeheimagentNr1 committed Mar 10, 2022
1 parent d90dd28 commit bd49a6c
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 169 deletions.
58 changes: 42 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ buildscript {
classpath 'com.jaredsburrows:gradle-license-plugin:0.8.90'
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
plugins {
id 'eclipse'
id 'maven-publish'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'com.jaredsburrows.license'

delete "src/main/java/com"
Expand All @@ -34,17 +36,19 @@ archivesBaseName = "${mod_id}"
// 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'))
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.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' mappings.
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
//
// 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: "${mcp_channel}", version: "${mc_version}"
Expand All @@ -69,6 +73,9 @@ minecraft {
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', "${mod_id}"

mods {
"${mod_id}" {
source sourceSets.main
Expand All @@ -79,6 +86,26 @@ minecraft {
server {
workingDirectory project.file('run/server')

property 'forge.logging.markers', 'REGISTRIES'

property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', "${mod_id}"

mods {
"${mod_id}" {
source sourceSets.main
}
}
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
workingDirectory project.file('run/testserver')

// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
Expand All @@ -91,6 +118,9 @@ minecraft {
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', "${mod_id}"

mods {
"${mod_id}" {
source sourceSets.main
Expand All @@ -101,16 +131,8 @@ minecraft {
data {
workingDirectory project.file('run/data')

// Recommended logging data for a userdev environment
// 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.
property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
Expand Down Expand Up @@ -190,3 +212,7 @@ publishing {
}
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ minor_version=0
patch_version=0

mcp_channel=official
mc_version=1.18.1
forge_version=39.0.0
mc_version=1.18.2
forge_version=40.0.12
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit bd49a6c

Please sign in to comment.