-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
191 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ build | |
# other | ||
eclipse | ||
run | ||
cottonly-main | ||
runs | ||
run-data | ||
|
||
# Files from Forge MDK | ||
forge*changelog.txt | ||
repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,83 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'eclipse' | ||
id 'idea' | ||
id 'maven-publish' | ||
id 'net.minecraftforge.gradle' version '5.1.+' | ||
id 'com.matthewprenger.cursegradle' version '1.4.0' | ||
id 'net.neoforged.gradle.userdev' version '7.0.57' | ||
id "me.modmuss50.mod-publish-plugin" version "0.4.5" | ||
} | ||
|
||
def ENV = System.getenv() | ||
version = "${ENV.GITHUB_RUN_NUMBER}" ? "${mod_version}.${ENV.GITHUB_RUN_NUMBER}" : "${mod_version}.nobuildnumber" | ||
group = project.maven_group | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://www.cursemaven.com" | ||
url "https://maven.curse.tools" | ||
} | ||
} | ||
def ENV = System.getenv() | ||
version = "${ENV.GITHUB_RUN_NUMBER}" ? "${mod_version}.${ENV.GITHUB_RUN_NUMBER}" : "${mod_version}.nobuildnumber" | ||
group = 'net.manmaed.cottonly' | ||
archivesBaseName = 'cottonly' | ||
|
||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. | ||
base { | ||
archivesName = project.archives_base_name + "-neo" | ||
} | ||
|
||
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 { | ||
mappings channel: "${minecraft_mappings}", version: "${minecraft_version}" | ||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
property 'forge.logging.console.level', 'debug' | ||
property 'forge.enabledGameTestNamespaces', 'cottonly' | ||
mods { | ||
cottonly { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
configureEach { | ||
systemProperty 'forge.logging.markers', 'REGISTRIES' | ||
systemProperty 'forge.logging.console.level', 'debug' | ||
modSource project.sourceSets.main | ||
} | ||
|
||
server { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
property 'forge.logging.console.level', 'debug' | ||
property 'forge.enabledGameTestNamespaces', 'cottonly' | ||
mods { | ||
cottonly { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
client { | ||
systemProperty 'forge.enabledGameTestNamespaces', project.archives_base_name | ||
} | ||
|
||
gameTestServer { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
property 'forge.logging.console.level', 'debug' | ||
property 'forge.enabledGameTestNamespaces', 'cottonly' | ||
mods { | ||
cottonly { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
server { | ||
systemProperty 'forge.enabledGameTestNamespaces', project.archives_base_name | ||
programArgument '--nogui' | ||
} | ||
|
||
data { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
property 'forge.logging.console.level', 'debug' | ||
args '--mod', 'cottonly', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') | ||
mods { | ||
cottonly { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
data { | ||
programArguments.addAll '--mod', project.archives_base_name, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() | ||
} | ||
} | ||
|
||
sourceSets.main.resources { srcDir 'src/generated/resources' } | ||
|
||
repositories { | ||
} | ||
sourceSets.main.resources { | ||
srcDir 'src/generated/resources' | ||
} | ||
|
||
dependencies { | ||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes([ | ||
"Specification-Title" : "cottonly", | ||
"Specification-Vendor" : "manmaed", | ||
"Specification-Version" : "1", // We are version 1 of ourselves | ||
"Implementation-Title" : project.name, | ||
"Implementation-Version" : project.jar.archiveVersion, | ||
"Implementation-Vendor" : "manmaed", | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
implementation "net.neoforged:neoforge:${neo_version}" | ||
} | ||
tasks.withType(ProcessResources).configureEach { | ||
var replaceProperties = [ | ||
version: version | ||
] | ||
inputs.properties replaceProperties | ||
|
||
jar.finalizedBy('reobfJar') | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifact jar | ||
} | ||
} | ||
repositories { | ||
maven { | ||
url "file://${project.projectDir}/mcmodsrepo" | ||
} | ||
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { | ||
expand replaceProperties + [project: project] | ||
} | ||
} | ||
|
||
if (ENV.CURSE_DEPLOY) { | ||
publishMods { | ||
dryRun = providers.environmentVariable("CURSE_DEPLOY").getOrNull() == null | ||
file = jar.archiveFile | ||
modLoaders.add("neoforge") | ||
type = BETA | ||
changelog = "changeme" | ||
displayName = "${mod_name} v${project.version} - NeoForge - ${minecraft_version}" | ||
curseforge { | ||
apiKey = ENV.CURSE_DEPLOY | ||
project { | ||
id = project.curseforge_id | ||
releaseType = "${curseforge_releasetype}" | ||
addGameVersion "Forge" | ||
addGameVersion "Java 17" | ||
addGameVersion "${minecraft_version}" | ||
mainArtifact(jar) { | ||
displayName = "${mod_name} v${version} - ${minecraft_version}" | ||
} | ||
changelog = "changeme" | ||
|
||
} | ||
accessToken = providers.environmentVariable("CURSE_DEPLOY") | ||
projectId = project.curseforge_id | ||
minecraftVersions.add("Java 17") | ||
minecraftVersions.add("${minecraft_version}") | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
maven { url = 'https://forge.modpacks.ch/maven' } | ||
maven { url = 'https://maven.minecraftforge.net/' } | ||
maven { url = 'https://maven.creeperhost.net/' } | ||
} | ||
} | ||
plugins { | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.