|
| 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 | + mavenCentral() |
| 6 | + } |
| 7 | + dependencies { |
| 8 | + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true |
| 9 | + } |
| 10 | +} |
| 11 | + |
| 12 | +apply plugin: 'net.minecraftforge.gradle' |
| 13 | + |
| 14 | +group = 'fr.mireole' |
| 15 | +version = '1.0-SNAPSHOT' |
| 16 | + |
| 17 | +java { |
| 18 | + archivesBaseName = 'emotions' |
| 19 | + toolchain.languageVersion = JavaLanguageVersion.of(17) |
| 20 | +} |
| 21 | + |
| 22 | +minecraft { |
| 23 | + // The mappings can be changed at any time and must be in the following format. |
| 24 | + // Channel: Version: |
| 25 | + // snapshot YYYYMMDD Snapshot are built nightly. |
| 26 | + // stable # Stables are built at the discretion of the MCP team. |
| 27 | + // official MCVersion Official field/method names from Mojang mapping files |
| 28 | + // |
| 29 | + // You must be aware of the Mojang license when using the 'official' mappings. |
| 30 | + // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md |
| 31 | + // |
| 32 | + // Use non-default mappings at your own risk. They may not always work. |
| 33 | + // Simply re-run your setup task after changing the mappings to update your workspace. |
| 34 | + mappings channel: 'official', version: '1.18.1' |
| 35 | + |
| 36 | + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 37 | + |
| 38 | + // Default run configurations. |
| 39 | + // These can be tweaked, removed, or duplicated as needed. |
| 40 | + runs { |
| 41 | + client { |
| 42 | + workingDirectory project.file('run') |
| 43 | + |
| 44 | + // Recommended logging data for a userdev environment |
| 45 | + // The markers can be added/removed as needed separated by commas. |
| 46 | + // "SCAN": For mods scan. |
| 47 | + // "REGISTRIES": For firing of registry events. |
| 48 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 49 | + property 'forge.logging.markers', 'REGISTRIES' |
| 50 | + |
| 51 | + // Recommended logging level for the console |
| 52 | + // You can set various levels here. |
| 53 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 54 | + property 'forge.logging.console.level', 'debug' |
| 55 | + |
| 56 | + mods { |
| 57 | + emotions { |
| 58 | + source sourceSets.main |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + server { |
| 64 | + workingDirectory project.file('run') |
| 65 | + |
| 66 | + // Recommended logging data for a userdev environment |
| 67 | + // The markers can be added/removed as needed separated by commas. |
| 68 | + // "SCAN": For mods scan. |
| 69 | + // "REGISTRIES": For firing of registry events. |
| 70 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 71 | + property 'forge.logging.markers', 'REGISTRIES' |
| 72 | + |
| 73 | + // Recommended logging level for the console |
| 74 | + // You can set various levels here. |
| 75 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 76 | + property 'forge.logging.console.level', 'debug' |
| 77 | + |
| 78 | + mods { |
| 79 | + emotions { |
| 80 | + source sourceSets.main |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + |
| 85 | + data { |
| 86 | + workingDirectory project.file('run') |
| 87 | + |
| 88 | + // Recommended logging data for a userdev environment |
| 89 | + // The markers can be added/removed as needed separated by commas. |
| 90 | + // "SCAN": For mods scan. |
| 91 | + // "REGISTRIES": For firing of registry events. |
| 92 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 93 | + property 'forge.logging.markers', 'REGISTRIES' |
| 94 | + |
| 95 | + // Recommended logging level for the console |
| 96 | + // You can set various levels here. |
| 97 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 98 | + property 'forge.logging.console.level', 'debug' |
| 99 | + |
| 100 | + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. |
| 101 | + args '--mod', 'emotions', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') |
| 102 | + |
| 103 | + mods { |
| 104 | + emotions { |
| 105 | + source sourceSets.main |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | +} |
| 111 | + |
| 112 | +// Include resources generated by data generators. |
| 113 | +sourceSets.main.resources { srcDir 'src/generated/resources' } |
| 114 | + |
| 115 | +repositories { |
| 116 | + // Put repositories for dependencies here |
| 117 | + // ForgeGradle automatically adds the Forge maven and Maven Central for you |
| 118 | + |
| 119 | + // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: |
| 120 | + // flatDir { |
| 121 | + // dir 'libs' |
| 122 | + // } |
| 123 | +} |
| 124 | + |
| 125 | +dependencies { |
| 126 | + // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed |
| 127 | + // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. |
| 128 | + // The userdev artifact is a special name and will get all sorts of transformations applied to it. |
| 129 | + minecraft 'net.minecraftforge:forge:1.18.1-39.0.10' |
| 130 | + |
| 131 | + // Real mod deobf dependency examples - these get remapped to your current mappings |
| 132 | + // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency |
| 133 | + // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency |
| 134 | + // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency |
| 135 | + |
| 136 | + // Examples using mod jars from ./libs |
| 137 | + // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") |
| 138 | + |
| 139 | + // For more info... |
| 140 | + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html |
| 141 | + // http://www.gradle.org/docs/current/userguide/dependency_management.html |
| 142 | +} |
| 143 | + |
| 144 | +// Example for how to get properties into the manifest for reading at runtime. |
| 145 | +jar { |
| 146 | + manifest { |
| 147 | + attributes([ |
| 148 | + "Specification-Title" : "emotions", |
| 149 | + "Specification-Vendor" : "Mireole", |
| 150 | + "Specification-Version" : "1", // We are version 1 of ourselves |
| 151 | + "Implementation-Title" : project.name, |
| 152 | + "Implementation-Version" : project.jar.archiveVersion, |
| 153 | + "Implementation-Vendor" : "Mireole", |
| 154 | + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") |
| 155 | + ]) |
| 156 | + } |
| 157 | +} |
| 158 | + |
| 159 | +jar.finalizedBy('reobfJar') |
0 commit comments