buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.74' } } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'minecraft_mod_player_statistics' archivesBaseName = 'playerstats' java.toolchain.languageVersion = JavaLanguageVersion.of(17) // Create a configuration for including dependencies in the JAR configurations { shade implementation.extendsFrom shade } minecraft { mappings channel: 'official', version: '1.18.2' runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { playerstats { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { playerstats { source sourceSets.main } } } } } repositories { mavenCentral() maven { name = 'Forge' url = 'https://maven.minecraftforge.net/' } } dependencies { minecraft 'net.minecraftforge:forge:1.18.2-40.2.4' // Add MySQL connector to the shade configuration shade 'mysql:mysql-connector-java:8.0.27' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' testImplementation 'org.mockito:mockito-core:4.3.1' testImplementation 'org.mockito:mockito-junit-jupiter:4.3.1' } jar { manifest { attributes([ "Specification-Title": "playerstats", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", "Implementation-Title": project.name, "Implementation-Version": project.jar.archiveVersion, "Implementation-Vendor": "examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } // Include shaded dependencies from { configurations.shade.collect { it.isDirectory() ? it : zipTree(it) } } // Exclude META-INF from dependencies exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' } test { useJUnitPlatform() }