FloppaMod

Форк
0
/
build.gradle 
181 строка · 7.7 Кб
1
buildscript {
2
    repositories {
3
        // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
4
        maven { url = 'https://maven.minecraftforge.net' }
5
        maven { url = 'https://maven.parchmentmc.org' }
6
        mavenCentral()
7
    }
8
    dependencies {
9
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
10
        classpath 'org.parchmentmc:librarian:1.+'
11
    }
12
}
13
apply plugin: 'net.minecraftforge.gradle'
14
apply 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.
16
apply plugin: 'eclipse'
17
apply plugin: 'maven-publish'
18

19
version = '1.17.1-0.1'
20
group = 'com.svyatoslavsvyatkin.firstmod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
21
archivesBaseName = '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.
24
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
25

26
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
27
minecraft {
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.
39
    mappings 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.
45
    runs {
46
        client {
47
            workingDirectory 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.
54
            property '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
59
            property 'forge.logging.console.level', 'debug'
60

61
            mods {
62
                firstmod {
63
                    source sourceSets.main
64
                }
65
            }
66
        }
67

68
        server {
69
            workingDirectory 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.
76
            property '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
81
            property 'forge.logging.console.level', 'debug'
82

83
            mods {
84
                firstmod {
85
                    source sourceSets.main
86
                }
87
            }
88
        }
89

90
        data {
91
            workingDirectory 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.
98
            property '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
103
            property '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.
106
            args '--mod', 'firstmod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
107

108
            mods {
109
                firstmod {
110
                    source sourceSets.main
111
                }
112
            }
113
        }
114
    }
115
}
116

117
// Include resources generated by data generators.
118
sourceSets.main.resources { srcDir 'src/generated/resources' }
119

120
repositories {
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

130
dependencies {
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.
134
    minecraft '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.
150
jar {
151
    manifest {
152
        attributes([
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
166
jar.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

170
publishing {
171
    publications {
172
        mavenJava(MavenPublication) {
173
            artifact jar
174
        }
175
    }
176
    repositories {
177
        maven {
178
            url "file://${project.projectDir}/mcmodsrepo"
179
        }
180
    }
181
}
182

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.