11buildscript {
22 repositories {
3- // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
43 maven { url = ' https://repo.spongepowered.org/repository/maven-public/' }
54 mavenCentral()
65 }
@@ -10,59 +9,38 @@ buildscript {
109}
1110
1211plugins {
13- id ' net.minecraftforge.gradle' version ' 5.1.+'
12+ id ' net.minecraftforge.gradle' version ' 5.+'
13+ id ' com.github.johnrengelman.shadow' version ' 7.+'
14+ id ' java'
1415}
1516
1617apply plugin : ' org.spongepowered.mixin'
1718
18- jarJar. enable()
19-
2019group = ' pl.panszelescik'
21- version = ' 1.0.2 -forge-1.19.2 '
20+ version = ' 1.1.0 -forge'
2221
2322java {
2423 archivesBaseName = ' proxy_protocol_support'
2524 toolchain. languageVersion = JavaLanguageVersion . of(17 )
2625}
2726
27+ configurations {
28+ shade
29+ implementation. extendsFrom shade
30+ }
31+
2832minecraft {
29- // The mappings can be changed at any time and must be in the following format.
30- // Channel: Version:
31- // official MCVersion Official field/method names from Mojang mapping files
32- // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
33- //
34- // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
35- // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
36- //
37- // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
38- // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
39- //
40- // Use non-default mappings at your own risk. They may not always work.
41- // Simply re-run your setup task after changing the mappings to update your workspace.
42- mappings channel : ' official' , version : ' 1.19.2'
43-
44- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
45-
46- // Default run configurations.
47- // These can be tweaked, removed, or duplicated as needed.
33+ mappings channel : ' official' , version : ' 1.19.4'
34+
4835 runs {
4936 client {
5037 workingDirectory project. file(' run' )
5138
52- // Recommended logging data for a userdev environment
53- // The markers can be added/remove as needed separated by commas.
54- // "SCAN": For mods scan.
55- // "REGISTRIES": For firing of registry events.
56- // "REGISTRYDUMP": For getting the contents of all registries.
5739 property ' forge.logging.markers' , ' REGISTRIES'
5840
5941
60- // Recommended logging level for the console
61- // You can set various levels here.
62- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
6342 property ' forge.logging.console.level' , ' debug'
6443
65- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
6644 property ' forge.enabledGameTestNamespaces' , ' proxy_protocol_support'
6745
6846 mods {
@@ -88,9 +66,6 @@ minecraft {
8866 }
8967 }
9068
91- // This run config launches GameTestServer and runs all registered gametests, then exits.
92- // By default, the server will crash when no gametests are provided.
93- // The gametest system is also enabled by default for other run configs under the /test command.
9469 gameTestServer {
9570 workingDirectory project. file(' run' )
9671
@@ -114,7 +89,6 @@ minecraft {
11489
11590 property ' forge.logging.console.level' , ' debug'
11691
117- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
11892 args ' --mod' , ' proxy_protocol_support' , ' --all' , ' --output' , file(' src/generated/resources/' ), ' --existing' , file(' src/main/resources/' )
11993
12094 mods {
@@ -132,49 +106,24 @@ mixin {
132106 config " proxy_protocol_support.mixins.json"
133107}
134108
135- // Include resources generated by data generators.
136109sourceSets. main. resources { srcDir ' src/generated/resources' }
137110
138111repositories {
139- // Put repositories for dependencies here
140- // ForgeGradle automatically adds the Forge maven and Maven Central for you
141-
142- // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
143- // flatDir {
144- // dir 'libs'
145- // }
146112}
147113
148114dependencies {
149- // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed
150- // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
151- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
152- minecraft ' net.minecraftforge:forge:1.19.2-43.0.15'
153-
154- // Real mod deobf dependency examples - these get remapped to your current mappings
155- // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
156- // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
157- // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
158-
159- // Examples using mod jars from ./libs
160- // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
161-
162- // For more info...
163- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
164- // http://www.gradle.org/docs/current/userguide/dependency_management.html
165-
166- // https://mvnrepository.com/artifact/io.netty/netty-codec-haproxy
167- implementation group : ' io.netty' , name : ' netty-codec-haproxy' , version : ' 4.1.79.Final'
168- jarJar(group : ' io.netty' , name : ' netty-codec-haproxy' , version : ' [4.1.79.Final]' ) {
169- jarJar. pin(it, ' 4.1.79.Final' )
170- transitive = false
115+ minecraft ' net.minecraftforge:forge:1.19.4-45.0.47'
116+
117+ implementation(' io.netty:netty-codec-haproxy:4.1.91.Final' )
118+ shade(' io.netty:netty-codec-haproxy:4.1.91.Final' ) {
119+ exclude group : ' *' , module : ' *'
171120 }
172121
173122 annotationProcessor ' org.spongepowered:mixin:0.8.5:processor'
174123}
175124
176- // Example for how to get properties into the manifest for reading at runtime.
177125jar {
126+ archiveClassifier = ' slim'
178127 manifest {
179128 attributes([
180129 " Specification-Title" : " proxy_protocol_support" ,
@@ -188,12 +137,20 @@ jar {
188137 }
189138}
190139
191- jar. finalizedBy(' reobfJar' )
140+ shadowJar {
141+ archiveClassifier = ' '
142+ configurations = [project. configurations. shade]
143+ finalizedBy ' reobfShadowJar'
144+ }
145+
146+ assemble. dependsOn shadowJar
192147
193- build {
194- dependsOn ' jarJar '
148+ reobf {
149+ shadowJar {}
195150}
196151
152+ jar. finalizedBy(' reobfJar' )
153+
197154tasks. withType(JavaCompile ). configureEach {
198155 options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
199156}
0 commit comments