forked from MrCrayfish/MrCrayfishDeviceMod
-
Notifications
You must be signed in to change notification settings - Fork 6
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
522 changed files
with
33,419 additions
and
2,892 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 |
---|---|---|
@@ -1,98 +1,192 @@ | ||
plugins { | ||
id "architectury-plugin" version "3.4-SNAPSHOT" | ||
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false | ||
id "io.github.pacifistmc.forgix" version "1.2.2" | ||
id "org.jetbrains.kotlin.jvm" version "1.7.10" | ||
// id 'org.jetbrains.kotlin.jvm' version '1.7.1' | ||
} | ||
repositories { | ||
gradlePluginPortal() | ||
buildscript { | ||
repositories { | ||
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below | ||
maven { | ||
name "SpongePowered" | ||
url 'https://repo.spongepowered.org/repository/maven-public/' | ||
} | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' | ||
} | ||
} | ||
|
||
architectury { | ||
minecraft = rootProject.minecraft_version | ||
plugins { | ||
id 'net.minecraftforge.gradle' version '5.1.+' | ||
id 'org.parchmentmc.librarian.forgegradle' version '1.+' | ||
} | ||
version = "${mod_version}" | ||
|
||
Object getIngame_version() { | ||
return "${mod_version}" | ||
apply plugin: 'org.spongepowered.mixin' | ||
|
||
group = 'com.ultreon.mods' | ||
version = '0.5.0-bp.116' | ||
|
||
java { | ||
archivesBaseName = 'devices-mod' | ||
toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
} | ||
|
||
forgix { | ||
group = "com.ultreon.mods" | ||
mergedJarName = "devices-${version}.jar" | ||
outputDir = "build/libs/merged" | ||
minecraft { | ||
// The mappings can be changed at any time and must be in the following format. | ||
// Channel: Version: | ||
// 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' 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: 'official', version: '1.16.5' | ||
|
||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
|
||
// Default run configurations. | ||
// These can be tweaked, removed, or duplicated as needed. | ||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
|
||
// Recommended logging data for a user-dev 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' | ||
|
||
// Comma-separated list of namespaces to load game-tests from. Empty = all namespaces. | ||
property 'forge.enabledGameTestNamespaces', 'device-mod' | ||
|
||
mods { | ||
devicemod { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
forge { | ||
projectName = "merge-forge" | ||
jarLocation = "build/libs/devices-${version}.jar" | ||
// additionalRelocate("com.ultreon.devices", "forge.com.ultreon.devices") | ||
server { | ||
workingDirectory project.file('run') | ||
|
||
// mixin "devices-common.mixins.json" | ||
// mixin "devices.mixins.json" | ||
} | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
|
||
fabric { | ||
projectName = "merge-fabric" | ||
jarLocation = "build/libs/devices-${version}.jar" | ||
// additionalRelocate("com.ultreon.devices", "fabric.com.ultreon.devices") | ||
} | ||
} | ||
property 'forge.logging.console.level', 'debug' | ||
|
||
println "forgix.outputDir = $forgix.outputDir" | ||
property 'forge.enabledGameTestNamespaces', 'device-mod' | ||
|
||
subprojects { | ||
apply plugin: "dev.architectury.loom" | ||
mods { | ||
devicemod { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
// This run config launches GameTestServer and runs all registered game-tests, then exits. | ||
// By default, the server will crash when no game-tests are provided. | ||
// The game-test system is also enabled by default for other run configs under the /test command. | ||
gameTestServer { | ||
workingDirectory project.file('run') | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" | ||
// The following line declares the mojmap mappings, you may use other mappings as well | ||
mappings loom.layered() { | ||
officialMojangMappings() | ||
parchment("org.parchmentmc.data:parchment-1.18.2:2022.06.26@zip") | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
|
||
property 'forge.logging.console.level', 'debug' | ||
|
||
property 'forge.enabledGameTestNamespaces', 'device-mod' | ||
|
||
mods { | ||
devicemod { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
// layered | ||
// The following line declares the yarn mappings you may select this one as well. | ||
// mappings "net.fabricmc:yarn:@YARN_MAPPINGS@:v2" | ||
} | ||
} | ||
data { | ||
workingDirectory project.file('run') | ||
|
||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "architectury-plugin" | ||
apply plugin: "maven-publish" | ||
property 'forge.logging.markers', 'REGISTRIES' | ||
|
||
archivesBaseName = rootProject.archives_base_name | ||
version = rootProject.version | ||
group = rootProject.maven_group | ||
property 'forge.logging.console.level', 'debug' | ||
|
||
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. | ||
maven { url = "https://maven.parchmentmc.org" } | ||
|
||
flatDir { | ||
dir "${rootProject.projectDir}/libs" | ||
// Specify the mod-id for data generation, where to output the resulting resource, and where to look for existing resources. | ||
args '--mod', 'devices', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') | ||
|
||
mods { | ||
devicemod { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
mixin { | ||
add sourceSets.main, "device-mod.refmap.json" | ||
|
||
java { | ||
withSourcesJar() | ||
config "device-mod.mixins.json" | ||
} | ||
|
||
// Include resources generated by data generators. | ||
sourceSets.main.resources { srcDir 'src/generated/resources' } | ||
|
||
repositories { | ||
// Put repositories for dependencies here | ||
// ForgeGradle automatically adds the Forge maven and Maven Central for you | ||
|
||
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so: | ||
// flatDir { | ||
// dir 'libs' | ||
// } | ||
} | ||
|
||
dependencies { | ||
// 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 user-dev artifact is a special name and will get all sorts of transformations applied to it. | ||
minecraft 'net.minecraftforge:forge:1.16.5-36.2.42' | ||
|
||
implementation "org.jetbrains:annotations:24.0.1" | ||
|
||
// Real mod deobf dependency examples - these get remapped to your current mappings | ||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency | ||
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency | ||
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency | ||
|
||
// Examples using mod jars from ./libs | ||
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") | ||
|
||
// For more info... | ||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html | ||
// http://www.gradle.org/docs/current/userguide/dependency_management.html | ||
|
||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' | ||
} | ||
|
||
// Example for how to get properties into the manifest for reading at runtime. | ||
jar { | ||
manifest { | ||
attributes([ | ||
"Specification-Title" : "devices", | ||
"Specification-Vendor" : "Ultreon Team", | ||
"Specification-Version" : "1", // We are version 1 of ourselves | ||
"Implementation-Title" : project.name, | ||
"Implementation-Version" : project.jar.archiveVersion, | ||
"Implementation-Vendor" : "Ultreon Team", | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
} | ||
|
||
mergeJars.mustRunAfter build | ||
//build.dependsOn mergeJars | ||
jar.finalizedBy('reobfJar') | ||
|
||
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
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.