FloppaMod
/
build.gradle
181 строка · 7.7 Кб
1buildscript {
2repositories {
3// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
4maven { url = 'https://maven.minecraftforge.net' }
5maven { url = 'https://maven.parchmentmc.org' }
6mavenCentral()
7}
8dependencies {
9classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
10classpath 'org.parchmentmc:librarian:1.+'
11}
12}
13apply plugin: 'net.minecraftforge.gradle'
14apply plugin: 'org.parchmentmc.librarian.forgegradle'
15// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
16apply plugin: 'eclipse'
17apply plugin: 'maven-publish'
18
19version = '1.17.1-0.1'
20group = 'com.svyatoslavsvyatkin.firstmod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
21archivesBaseName = 'firstmod'
22
23// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
24java.toolchain.languageVersion = JavaLanguageVersion.of(16)
25
26println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
27minecraft {
28// The mappings can be changed at any time and must be in the following format.
29// Channel: Version:
30// snapshot YYYYMMDD Snapshot are built nightly.
31// stable # Stables are built at the discretion of the MCP team.
32// official MCVersion Official field/method names from Mojang mapping files
33//
34// You must be aware of the Mojang license when using the 'official' mappings.
35// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
36//
37// Use non-default mappings at your own risk. They may not always work.
38// Simply re-run your setup task after changing the mappings to update your workspace.
39mappings channel: 'parchment', version: '2021.09.05-1.17.1'
40
41// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
42
43// Default run configurations.
44// These can be tweaked, removed, or duplicated as needed.
45runs {
46client {
47workingDirectory project.file('run')
48
49// Recommended logging data for a userdev environment
50// The markers can be added/remove as needed separated by commas.
51// "SCAN": For mods scan.
52// "REGISTRIES": For firing of registry events.
53// "REGISTRYDUMP": For getting the contents of all registries.
54property 'forge.logging.markers', 'REGISTRIES'
55
56// Recommended logging level for the console
57// You can set various levels here.
58// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
59property 'forge.logging.console.level', 'debug'
60
61mods {
62firstmod {
63source sourceSets.main
64}
65}
66}
67
68server {
69workingDirectory project.file('run')
70
71// Recommended logging data for a userdev environment
72// The markers can be added/remove as needed separated by commas.
73// "SCAN": For mods scan.
74// "REGISTRIES": For firing of registry events.
75// "REGISTRYDUMP": For getting the contents of all registries.
76property 'forge.logging.markers', 'REGISTRIES'
77
78// Recommended logging level for the console
79// You can set various levels here.
80// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
81property 'forge.logging.console.level', 'debug'
82
83mods {
84firstmod {
85source sourceSets.main
86}
87}
88}
89
90data {
91workingDirectory project.file('run')
92
93// Recommended logging data for a userdev environment
94// The markers can be added/remove as needed separated by commas.
95// "SCAN": For mods scan.
96// "REGISTRIES": For firing of registry events.
97// "REGISTRYDUMP": For getting the contents of all registries.
98property 'forge.logging.markers', 'REGISTRIES'
99
100// Recommended logging level for the console
101// You can set various levels here.
102// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
103property 'forge.logging.console.level', 'debug'
104
105// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
106args '--mod', 'firstmod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
107
108mods {
109firstmod {
110source sourceSets.main
111}
112}
113}
114}
115}
116
117// Include resources generated by data generators.
118sourceSets.main.resources { srcDir 'src/generated/resources' }
119
120repositories {
121// Put repositories for dependencies here
122// ForgeGradle automatically adds the Forge maven and Maven Central for you
123
124// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
125// flatDir {
126// dir 'libs'
127// }
128}
129
130dependencies {
131// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
132// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
133// The userdev artifact is a special name and will get all sorts of transformations applied to it.
134minecraft 'net.minecraftforge:forge:1.17.1-37.1.1'
135
136// Real mod deobf dependency examples - these get remapped to your current mappings
137// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
138// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
139// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
140
141// Examples using mod jars from ./libs
142// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
143
144// For more info...
145// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
146// http://www.gradle.org/docs/current/userguide/dependency_management.html
147}
148
149// Example for how to get properties into the manifest for reading at runtime.
150jar {
151manifest {
152attributes([
153"Specification-Title" : "firstmod",
154"Specification-Vendor" : "firstmodsareus",
155"Specification-Version" : "1", // We are version 1 of ourselves
156"Implementation-Title" : project.name,
157"Implementation-Version" : project.jar.archiveVersion,
158"Implementation-Vendor" : "firstmodsareus",
159"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
160])
161}
162}
163
164// Example configuration to allow publishing using the maven-publish plugin
165// This is the preferred method to reobfuscate your jar file
166jar.finalizedBy('reobfJar')
167// 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
168// publish.dependsOn('reobfJar')
169
170publishing {
171publications {
172mavenJava(MavenPublication) {
173artifact jar
174}
175}
176repositories {
177maven {
178url "file://${project.projectDir}/mcmodsrepo"
179}
180}
181}
182