Skip to content

Commit 8c68471

Browse files
committed
1.20.2-12.0.0
1 parent f78cca2 commit 8c68471

20 files changed

+147
-243
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ build
2020
# other
2121
eclipse
2222
run
23+
runs
24+
run-data
2325

24-
# Files from Forge MDK
25-
forge*changelog.txt
26+
repo

build.gradle

+66-135
Original file line numberDiff line numberDiff line change
@@ -1,168 +1,114 @@
11
plugins {
2+
id 'java-library'
23
id 'eclipse'
34
id 'idea'
45
id 'maven-publish'
5-
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
6-
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
6+
id 'net.neoforged.gradle.userdev' version '[7.0.5,)'
7+
id 'net.neoforged.gradle.mixin' version '[7.0.5,)'
8+
id "com.modrinth.minotaur" version "2.+"
79
}
810

9-
apply plugin: "net.neoforged.gradle"
10-
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
11-
apply plugin: 'eclipse'
12-
apply plugin: 'maven-publish'
13-
apply plugin: "org.spongepowered.mixin"
14-
1511
version = mod_version
1612
group = mod_group_id
1713

14+
repositories {
15+
mavenLocal()
16+
}
17+
1818
base {
1919
archivesName = mod_id
2020
}
2121

2222
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
2323
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
2424

25-
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
26-
minecraft {
27-
// The mappings can be changed at any time and must be in the following format.
28-
// Channel: Version:
29-
// official MCVersion Official field/method names from Mojang mapping files
30-
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
31-
//
32-
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
33-
// See more information here: https://github.com/NeoForged/NeoForm/blob/main/Mojang.md
34-
//
35-
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
36-
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
37-
//
38-
// Use non-default mappings at your own risk. They may not always work.
39-
// Simply re-run your setup task after changing the mappings to update your workspace.
40-
mappings channel: mapping_channel, version: mapping_version
41-
42-
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
43-
// In most cases, it is not necessary to enable.
44-
// enableEclipsePrepareRuns = true
45-
enableIdeaPrepareRuns = true
46-
47-
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
48-
// It is REQUIRED to be set to true for this template to function.
49-
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
50-
copyIdeResources = true
51-
52-
// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
53-
// The folder name can be set on a run configuration using the "folderName" property.
54-
// By default, the folder name of a run configuration is the name of the Gradle project containing it.
55-
// generateRunFolders = true
56-
57-
// This property enables access transformers for use in development.
58-
// They will be applied to the Minecraft artifact.
59-
// The access transformer file can be anywhere in the project.
60-
// However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
61-
// This default location is a best practice to automatically put the file in the right place in the final jar.
62-
// See https://docs.neoforged.net/docs/1.20.x/advanced/accesstransformers/ for more information.
63-
64-
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
65-
66-
// Default run configurations.
67-
// These can be tweaked, removed, or duplicated as needed.
68-
runs {
69-
// applies to all the run configs below
70-
configureEach {
71-
workingDirectory project.file('run')
72-
73-
// Recommended logging data for a userdev environment
74-
// The markers can be added/remove as needed separated by commas.
75-
// "SCAN": For mods scan.
76-
// "REGISTRIES": For firing of registry events.
77-
// "REGISTRYDUMP": For getting the contents of all registries.
78-
property 'forge.logging.markers', 'REGISTRIES'
79-
80-
// Recommended logging level for the console
81-
// You can set various levels here.
82-
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
83-
property 'forge.logging.console.level', 'debug'
84-
property "mixin.env.remapRefMap", "true"
85-
mods {
86-
"${mod_id}" {
87-
source sourceSets.main
88-
}
89-
}
90-
}
25+
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
26+
// Default run configurations.
27+
// These can be tweaked, removed, or duplicated as needed.
28+
runs {
29+
// applies to all the run configs below
30+
configureEach {
31+
// Recommended logging data for a userdev environment
32+
// The markers can be added/remove as needed separated by commas.
33+
// "SCAN": For mods scan.
34+
// "REGISTRIES": For firing of registry events.
35+
// "REGISTRYDUMP": For getting the contents of all registries.
36+
systemProperty 'forge.logging.markers', 'REGISTRIES'
37+
38+
// Recommended logging level for the console
39+
// You can set various levels here.
40+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
41+
systemProperty 'forge.logging.console.level', 'debug'
42+
43+
modSource project.sourceSets.main
44+
}
9145

92-
client {
93-
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
94-
property 'forge.enabledGameTestNamespaces', mod_id
95-
}
46+
client {
47+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
48+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
49+
}
9650

97-
server {
98-
property 'forge.enabledGameTestNamespaces', mod_id
99-
args '--nogui'
100-
}
51+
server {
52+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
53+
programArgument '--nogui'
54+
}
10155

102-
// This run config launches GameTestServer and runs all registered gametests, then exits.
103-
// By default, the server will crash when no gametests are provided.
104-
// The gametest system is also enabled by default for other run configs under the /test command.
105-
gameTestServer {
106-
property 'forge.enabledGameTestNamespaces', mod_id
107-
}
56+
// This run config launches GameTestServer and runs all registered gametests, then exits.
57+
// By default, the server will crash when no gametests are provided.
58+
// The gametest system is also enabled by default for other run configs under the /test command.
59+
gameTestServer {
60+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
61+
}
10862

109-
data {
110-
// example of overriding the workingDirectory set in configureEach above
111-
workingDirectory project.file('run-data')
63+
data {
64+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
65+
// workingDirectory project.file('run-data')
11266

113-
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
114-
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
115-
}
67+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
68+
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
11669
}
11770
}
11871

119-
// Include resources generated by data generators.
120-
sourceSets.main.resources { srcDir 'src/generated/resources' }
121-
12272
repositories {
123-
// Put repositories for dependencies here
124-
// NeoGradle automatically adds the Forge maven and Maven Central for you
125-
126-
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
127-
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
128-
// flatDir {
129-
// dir 'libs'
130-
// }
13173
maven {
13274
url = "https://api.modrinth.com/maven"
13375
}
13476
}
13577

78+
// Include resources generated by data generators.
79+
sourceSets.main.resources { srcDir 'src/generated/resources' }
80+
13681
dependencies {
13782
// Specify the version of Minecraft to use.
13883
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
13984
// The "userdev" classifier will be requested and setup by NeoGradle.
14085
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
14186
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
142-
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}"
87+
implementation "net.neoforged:neoforge:${neo_version}"
14388
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
89+
implementation "maven.modrinth:bagus-lib:1.20.2-6.0.1"
14490
// Example mod dependency using a mod jar from ./libs with a flat dir repository
14591
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
14692
// The group id is ignored when searching -- in this case, it is "blank"
14793
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
148-
implementation(fg.deobf("maven.modrinth:bagus-lib:${bagus_lib_version}"))
94+
14995
// For more info:
15096
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
15197
// http://www.gradle.org/docs/current/userguide/dependency_management.html
15298
}
15399

154100
// This block of code expands all declared replace properties in the specified resource targets.
155-
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
101+
// A missing systemProperty will result in an error. Properties are expanded using ${} Groovy notation.
156102
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
157103
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
158-
tasks.named('processResources', ProcessResources).configure {
104+
tasks.withType(ProcessResources).configureEach {
159105
var replaceProperties = [
160106
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
161107
neo_version : neo_version, neo_version_range: neo_version_range,
162108
loader_version_range: loader_version_range,
163109
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
164110
mod_authors : mod_authors, mod_description: mod_description, pack_format_number: pack_format_number,
165-
bagus_lib_version : bagus_lib_version, bagus_lib_version_range: bagus_lib_version_range
111+
mod_credits: mod_credits,
166112
]
167113
inputs.properties replaceProperties
168114

@@ -171,43 +117,28 @@ tasks.named('processResources', ProcessResources).configure {
171117
}
172118
}
173119

174-
// Example for how to get properties into the manifest for reading at runtime.
175-
tasks.named('jar', Jar).configure {
176-
manifest {
177-
attributes([
178-
'Specification-Title' : mod_id,
179-
'Specification-Vendor' : mod_authors,
180-
'Specification-Version' : '1', // We are version 1 of ourselves
181-
'Implementation-Title' : project.name,
182-
'Implementation-Version' : project.jar.archiveVersion,
183-
'Implementation-Vendor' : mod_authors,
184-
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
185-
])
186-
}
187-
188-
// This is the preferred method to reobfuscate your jar file
189-
finalizedBy 'reobfJar'
190-
}
191-
192-
// 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:
193-
// tasks.named('publish').configure {
194-
// dependsOn 'reobfJar'
195-
// }
196-
197120
// Example configuration to allow publishing using the maven-publish plugin
198121
publishing {
199122
publications {
200123
register('mavenJava', MavenPublication) {
201-
artifact jar
124+
from components.java
202125
}
203126
}
204127
repositories {
205128
maven {
206-
url "file://${project.projectDir}/mcmodsrepo"
129+
url "file://${project.projectDir}/repo"
207130
}
208131
}
209132
}
210133

211134
tasks.withType(JavaCompile).configureEach {
212135
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
136+
}
137+
138+
if (System.getProperty("idea.sync.active") == "true") {
139+
afterEvaluate {
140+
tasks.withType(JavaCompile).all {
141+
it.options.annotationProcessorPath = files()
142+
}
143+
}
213144
}

gradle.properties

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
# This is required to provide enough memory for the Minecraft decompilation process.
33
org.gradle.jvmargs=-Xmx3G
44
org.gradle.daemon=false
5+
org.gradle.debug=false
56
## Environment Properties
67
# The Minecraft version must agree with the Neo version to get a valid artifact
7-
minecraft_version=1.20.1
8+
minecraft_version=1.20.2
89
# The Minecraft version range can use any release version of Minecraft as bounds.
910
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
1011
# as they do not follow standard versioning conventions.
11-
bagus_lib_version_range=[1.20.1-3.5.2,)
12-
minecraft_version_range=[1.20.1,)
12+
minecraft_version_range=[1.20.2,)
1313
# The Neo version must agree with the Minecraft version to get a valid artifact
14-
neo_version=47.1.55
14+
neo_version=20.2.14-beta
1515
# The Neo version range can use any version of Neo as bounds or match the loader version range
16-
neo_version_range=[47.1,)
16+
neo_version_range=[20.2,)
1717
# The loader version range can only use the major version of Neo/FML as bounds
18-
loader_version_range=[47,)
18+
loader_version_range=[1,)
1919
# The mapping channel to use for mappings.
2020
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
2121
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
@@ -33,25 +33,25 @@ loader_version_range=[47,)
3333
mapping_channel=official
3434
# The mapping version to query from the mapping channel.
3535
# This must match the format required by the mapping channel.
36-
mapping_version=1.20.1
37-
bagus_lib_version=1.20.1-3.5.2
36+
mapping_version=1.20.2
3837
## Mod Properties
3938
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
4039
# Must match the String constant located in the main mod class annotated with @Mod.
4140
mod_id=hunters_return
4241
# The human-readable display name for the mod.
43-
mod_name=Hunters Returns
42+
mod_name=Hunters Return
4443
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
4544
mod_license=GNU Lesser General Public License v3.0
4645
# The mod version. See https://semver.org/
47-
mod_version=1.20.1-11.2.0
46+
mod_version=1.20.2-12.0.0
4847
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
4948
# This should match the base package used for the mod sources.
5049
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
5150
mod_group_id=baguchan.hunters_return
5251
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
53-
mod_authors=bagu_chan, Evo
52+
mod_authors=bagu_chan
53+
mod_credits=MCVinnyq and Fuffles, andrejulio90, mcfella, ilyymira for contributing texture
5454
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
5555
mod_description=Add evil Hunter's! They attack the animals while making a cheeky laugh...
5656
# Pack version - this changes each minecraft release, in general.
57-
pack_format_number=15
57+
pack_format_number=18

settings.gradle

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
pluginManagement {
22
repositories {
3+
mavenLocal()
34
gradlePluginPortal()
4-
maven {
5-
name = 'NeoForged'
6-
url = 'https://maven.neoforged.net/releases'
7-
}
8-
maven {
9-
url "https://repo.spongepowered.org/repository/maven-public/"
10-
}
5+
maven { url = 'https://maven.neoforged.net/releases' }
116
}
127
}
8+
9+
1310
plugins {
1411
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
1512
}

0 commit comments

Comments
 (0)