Skip to content

Commit 698cb2f

Browse files
committed
Port to 1.21.4
0 parents  commit 698cb2f

File tree

166 files changed

+8123
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+8123
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Disable autocrlf on generated files, they always generate with LF
2+
# Add any extra files or paths here to make git stop saying they
3+
# are changed when only line endings change.
4+
src/generated/**/.cache/cache text eol=lf
5+
src/generated/**/*.json text eol=lf

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
fetch-tags: true
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
24+
- name: Build with Gradle
25+
run: ./gradlew build

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# eclipse
2+
bin
3+
*.launch
4+
.settings
5+
.metadata
6+
.classpath
7+
.project
8+
9+
# idea
10+
out
11+
*.ipr
12+
*.iws
13+
*.iml
14+
.idea
15+
16+
# gradle
17+
build
18+
.gradle
19+
20+
# other
21+
eclipse
22+
run
23+
runs
24+
run-data
25+
26+
repo

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Coders Down Under
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Installation information
3+
=======
4+
5+
This template repository can be directly cloned to get you started with a new
6+
mod. Simply create a new repository cloned from this one, by following the
7+
instructions provided by [GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
8+
9+
Once you have your clone, simply open the repository in the IDE of your choice. The usual recommendation for an IDE is either IntelliJ IDEA or Eclipse.
10+
11+
If at any point you are missing libraries in your IDE, or you've run into problems you can
12+
run `gradlew --refresh-dependencies` to refresh the local cache. `gradlew clean` to reset everything
13+
{this does not affect your code} and then start the process again.
14+
15+
Mapping Names:
16+
============
17+
By default, the MDK is configured to use the official mapping names from Mojang for methods and fields
18+
in the Minecraft codebase. These names are covered by a specific license. All modders should be aware of this
19+
license. For the latest license text, refer to the mapping file itself, or the reference copy here:
20+
https://github.com/NeoForged/NeoForm/blob/main/Mojang.md
21+
22+
Additional Resources:
23+
==========
24+
Community Documentation: https://docs.neoforged.net/
25+
NeoForged Discord: https://discord.neoforged.net/

build.gradle

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'net.neoforged.gradle.userdev' version '7.0.184'
5+
}
6+
7+
//tasks.named('wrapper', Wrapper).configure {
8+
// // Define wrapper values here so as to not have to always do so when updating gradlew.properties.
9+
// // Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
10+
// // documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
11+
// // file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
12+
// // (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
13+
// distributionType = Wrapper.DistributionType.BIN
14+
//}
15+
16+
version = mod_version
17+
group = mod_group_id
18+
19+
repositories {
20+
mavenLocal()
21+
}
22+
23+
base {
24+
archivesName = mod_id + "-" + minecraft_version
25+
}
26+
27+
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
28+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
29+
30+
//minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
31+
//minecraft.accessTransformers.entry public net.minecraft.client.Minecraft textureManager # textureManager
32+
sourceSets {
33+
main
34+
datagen
35+
generated
36+
gametest
37+
}
38+
39+
// Default run configurations.
40+
// These can be tweaked, removed, or duplicated as needed.
41+
runs {
42+
// applies to all the run configs below
43+
configureEach {
44+
// Recommended logging data for a userdev environment
45+
// The markers can be added/remove 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+
systemProperty '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+
systemProperty 'forge.logging.console.level', 'debug'
55+
56+
modSource project.sourceSets.main
57+
}
58+
59+
client {
60+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
61+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
62+
63+
}
64+
65+
server {
66+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
67+
argument '--nogui'
68+
}
69+
70+
// This run config launches GameTestServer and runs all registered gametests, then exits.
71+
// By default, the server will crash when no gametests are provided.
72+
// The gametest system is also enabled by default for other run configs under the /test command.
73+
gameTestServer {
74+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
75+
}
76+
77+
clientData {
78+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
79+
// workingDirectory project.file('run-data')
80+
81+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
82+
arguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
83+
modSource project.sourceSets.datagen
84+
}
85+
}
86+
87+
// Include resources generated by data generators.
88+
sourceSets.main.resources { srcDir 'src/generated/resources' }
89+
90+
// Sets up a dependency configuration called 'localRuntime'.
91+
// This configuration should be used instead of 'runtimeOnly' to declare
92+
// a dependency that will be present for runtime testing but that is
93+
// "optional", meaning it will not be pulled by dependents of this mod.
94+
configurations {
95+
96+
datagenCompileClasspath.extendsFrom(compileClasspath)
97+
datagenRuntimeClasspath.extendsFrom(runtimeClasspath)
98+
gametestCompileClasspath.extendsFrom(compileClasspath)
99+
gametestRuntimeClasspath.extendsFrom(runtimeClasspath)
100+
}
101+
102+
dependencies {
103+
// Specify the version of Minecraft to use.
104+
// Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
105+
// The group for userdev is net.neoforged, the module name is neoforge, and the version is the same as the neoforge version.
106+
// You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader.
107+
// And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
108+
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
109+
implementation "net.neoforged:neoforge:${neo_version}"
110+
111+
datagenImplementation sourceSets.main.output
112+
113+
// Example optional mod dependency with JEI
114+
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
115+
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
116+
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
117+
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
118+
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
119+
120+
// Example mod dependency using a mod jar from ./libs with a flat dir repository
121+
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
122+
// The group id is ignored when searching -- in this case, it is "blank"
123+
// implementation "blank:coolmod-${mc_version}:${coolmod_version}"
124+
125+
// Example mod dependency using a file as dependency
126+
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
127+
128+
// Example project dependency using a sister or child project:
129+
// implementation project(":myproject")
130+
131+
// For more info:
132+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
133+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
134+
}
135+
136+
// This block of code expands all declared replace properties in the specified resource targets.
137+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
138+
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
139+
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
140+
tasks.withType(ProcessResources).configureEach {
141+
var replaceProperties = [
142+
minecraft_version : minecraft_version,
143+
minecraft_version_range: minecraft_version_range,
144+
neo_version : neo_version,
145+
neo_version_range : neo_version_range,
146+
loader_version_range : loader_version_range,
147+
mod_id : mod_id,
148+
mod_name : mod_name,
149+
mod_license : mod_license,
150+
mod_version : mod_version,
151+
mod_authors : mod_authors,
152+
mod_description : mod_description
153+
]
154+
inputs.properties replaceProperties
155+
156+
filesMatching(['META-INF/neoforge.mods.toml']) {
157+
expand replaceProperties
158+
}
159+
}
160+
161+
// Example configuration to allow publishing using the maven-publish plugin
162+
publishing {
163+
publications {
164+
register('mavenJava', MavenPublication) {
165+
from components.java
166+
}
167+
}
168+
repositories {
169+
maven {
170+
url "file://${project.projectDir}/repo"
171+
}
172+
}
173+
}
174+
175+
tasks.withType(JavaCompile).configureEach {
176+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
177+
}
178+
179+
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
180+
idea {
181+
module {
182+
downloadSources = true
183+
downloadJavadoc = true
184+
}
185+
}

gradle.properties

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
2+
org.gradle.jvmargs=-Xmx1G
3+
org.gradle.daemon=true
4+
org.gradle.parallel=true
5+
org.gradle.caching=true
6+
org.gradle.configuration-cache=true
7+
8+
#read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
9+
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
10+
neogradle.subsystems.parchment.minecraftVersion=1.21.4
11+
neogradle.subsystems.parchment.mappingsVersion=2025.03.23
12+
# Environment Properties
13+
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
14+
# The Minecraft version must agree with the Neo version to get a valid artifact
15+
minecraft_version=1.21.4
16+
# The Minecraft version range can use any release version of Minecraft as bounds.
17+
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
18+
# as they do not follow standard versioning conventions.
19+
minecraft_version_range=[1.21.4]
20+
# The Neo version must agree with the Minecraft version to get a valid artifact
21+
neo_version=21.4.124
22+
# The Neo version range can use any version of Neo as bounds
23+
neo_version_range=[21.4.124,)
24+
# The loader version range can only use the major version of FML as bounds
25+
loader_version_range=[1,)
26+
27+
## Mod Properties
28+
29+
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
30+
# Must match the String constant located in the main mod class annotated with @Mod.
31+
mod_id=flowerseeds2
32+
# The human-readable display name for the mod.
33+
mod_name=Flower Seeds 2
34+
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
35+
mod_license=MIT
36+
# The mod version. See https://semver.org/
37+
mod_version=3.0.0
38+
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
39+
# This should match the base package used for the mod sources.
40+
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
41+
mod_group_id=net.codersdownunder.flowerseeds2
42+
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
43+
mod_authors=YourNameHere, OtherNameHere
44+
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
45+
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.

0 commit comments

Comments
 (0)