|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + maven { url = 'https://files.minecraftforge.net/maven' } |
| 4 | + mavenCentral() |
| 5 | + } |
| 6 | + dependencies { |
| 7 | + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.9+', changing: true |
| 8 | + } |
| 9 | +} |
| 10 | +apply plugin: 'net.minecraftforge.gradle' |
| 11 | +apply plugin: 'eclipse' |
| 12 | +apply plugin: 'maven-publish' |
| 13 | + |
| 14 | +version = '1.0' |
| 15 | +group = 'com.master.mastermod' |
| 16 | +archivesBaseName = 'mastermod' |
| 17 | + |
| 18 | +java.toolchain.languageVersion = JavaLanguageVersion.of(8) |
| 19 | + |
| 20 | +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) |
| 21 | +minecraft { |
| 22 | + mappings channel: 'official', version: '1.16.5' |
| 23 | + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. |
| 24 | + |
| 25 | + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 26 | + |
| 27 | + // Default run configurations. |
| 28 | + // These can be tweaked, removed, or duplicated as needed. |
| 29 | + runs { |
| 30 | + client { |
| 31 | + workingDirectory project.file('run') |
| 32 | + |
| 33 | + // Recommended logging data for a userdev environment |
| 34 | + // The markers can be changed as needed. |
| 35 | + // "SCAN": For mods scan. |
| 36 | + // "REGISTRIES": For firing of registry events. |
| 37 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 38 | + property 'forge.logging.markers', 'REGISTRIES' |
| 39 | + |
| 40 | + // Recommended logging level for the console |
| 41 | + // You can set various levels here. |
| 42 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 43 | + property 'forge.logging.console.level', 'debug' |
| 44 | + property 'mixin.env.remapRefMap', 'true' |
| 45 | + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" |
| 46 | + |
| 47 | + mods { |
| 48 | + mastermod { |
| 49 | + source sourceSets.main |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + server { |
| 55 | + workingDirectory project.file('run') |
| 56 | + |
| 57 | + // Recommended logging data for a userdev environment |
| 58 | + // The markers can be changed as needed. |
| 59 | + // "SCAN": For mods scan. |
| 60 | + // "REGISTRIES": For firing of registry events. |
| 61 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 62 | + property 'forge.logging.markers', 'REGISTRIES' |
| 63 | + |
| 64 | + // Recommended logging level for the console |
| 65 | + // You can set various levels here. |
| 66 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 67 | + property 'forge.logging.console.level', 'debug' |
| 68 | + |
| 69 | + mods { |
| 70 | + mastermod { |
| 71 | + source sourceSets.main |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + data { |
| 77 | + workingDirectory project.file('run') |
| 78 | + |
| 79 | + // Recommended logging data for a userdev environment |
| 80 | + // The markers can be changed as needed. |
| 81 | + // "SCAN": For mods scan. |
| 82 | + // "REGISTRIES": For firing of registry events. |
| 83 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 84 | + property 'forge.logging.markers', 'REGISTRIES' |
| 85 | + |
| 86 | + // Recommended logging level for the console |
| 87 | + // You can set various levels here. |
| 88 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 89 | + property 'forge.logging.console.level', 'debug' |
| 90 | + |
| 91 | + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. |
| 92 | + args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') |
| 93 | + |
| 94 | + mods { |
| 95 | + mastermod { |
| 96 | + source sourceSets.main |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | +} |
| 102 | + |
| 103 | +sourceSets.main.resources { srcDir 'src/generated/resources' } |
| 104 | + |
| 105 | +repositories { |
| 106 | + maven { |
| 107 | + url "https://www.cursemaven.com" |
| 108 | + } |
| 109 | + maven { |
| 110 | + url "https://dvs1.progwml6.com/files/maven/" |
| 111 | + } |
| 112 | + maven{ |
| 113 | + url "https://modmaven.k-4u.nl" |
| 114 | + } |
| 115 | + maven { url 'https://maven.blamejared.com' } |
| 116 | +} |
| 117 | + |
| 118 | +dependencies { |
| 119 | + minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' |
| 120 | + |
| 121 | + // JEI dependencies |
| 122 | + compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") |
| 123 | + runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") |
| 124 | + |
| 125 | + // (modnmane-projectId:цифры_наверху_страницы_нужной_версии_мода) |
| 126 | + //runtimeOnly fg.deobf("curse.maven:mousetweaks-60089:3202662") // Mouse Tweaks |
| 127 | + runtimeOnly fg.deobf("curse.maven:appleskin-248787:3395800") // Apple Skin |
| 128 | + |
| 129 | + compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-53.1:api") |
| 130 | + runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-53.1") |
| 131 | +} |
| 132 | + |
| 133 | +jar { |
| 134 | + manifest { |
| 135 | + attributes([ |
| 136 | + "Specification-Title": "mastermod", |
| 137 | + "Specification-Vendor": "Master", |
| 138 | + "Specification-Version": "1", |
| 139 | + "Implementation-Title": project.name, |
| 140 | + "Implementation-Version": "${version}", |
| 141 | + "Implementation-Vendor" :"Master", |
| 142 | + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") |
| 143 | + ]) |
| 144 | + } |
| 145 | +} |
| 146 | + |
| 147 | +// Example configuration to allow publishing using the maven-publish task |
| 148 | +// This is the preferred method to reobfuscate your jar file |
| 149 | +jar.finalizedBy('reobfJar') |
| 150 | +// 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 |
| 151 | +//publish.dependsOn('reobfJar') |
| 152 | + |
| 153 | +publishing { |
| 154 | + publications { |
| 155 | + mavenJava(MavenPublication) { |
| 156 | + artifact jar |
| 157 | + } |
| 158 | + } |
| 159 | + repositories { |
| 160 | + maven { |
| 161 | + url "file:///${project.projectDir}/mcmodsrepo" |
| 162 | + } |
| 163 | + } |
| 164 | +compileJava.options.encoding = 'UTF-8' |
| 165 | + |
| 166 | +tasks.withType(JavaCompile) { |
| 167 | +options.encoding = 'UTF-8' |
| 168 | +} |
| 169 | +} |
0 commit comments