Skip to content

Commit ab2dfc4

Browse files
committed
first commit
0 parents  commit ab2dfc4

File tree

18 files changed

+987
-0
lines changed

18 files changed

+987
-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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# This is needed to be able to run ./gradlew below
25+
# You can run `git update-index --chmod +x gradlew` then remove this step.
26+
- name: Make Gradle wrapper executable
27+
run: chmod +x ./gradlew
28+
29+
- name: Build with Gradle
30+
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

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/

TEMPLATE_LICENSE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright 2025 Mxpea&Jakeyang Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

build.gradle

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'net.neoforged.moddev' version '2.0.116'
5+
id 'idea'
6+
}
7+
8+
tasks.named('wrapper', Wrapper).configure {
9+
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
10+
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
11+
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
12+
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
13+
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
14+
distributionType = Wrapper.DistributionType.BIN
15+
}
16+
17+
version = mod_version
18+
group = mod_group_id
19+
20+
repositories {
21+
// Add here additional repositories if required by some of the dependencies below.
22+
}
23+
24+
base {
25+
archivesName = mod_id
26+
}
27+
28+
// Mojang ships Java 21 to end users in 1.21.1, so mods should target Java 21.
29+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
30+
31+
neoForge {
32+
// Specify the version of NeoForge to use.
33+
version = project.neo_version
34+
35+
parchment {
36+
mappingsVersion = project.parchment_mappings_version
37+
minecraftVersion = project.parchment_minecraft_version
38+
}
39+
40+
// This line is optional. Access Transformers are automatically detected
41+
// accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
42+
43+
// Default run configurations.
44+
// These can be tweaked, removed, or duplicated as needed.
45+
runs {
46+
client {
47+
client()
48+
49+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
50+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
51+
}
52+
53+
server {
54+
server()
55+
programArgument '--nogui'
56+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
57+
}
58+
59+
// This run config launches GameTestServer and runs all registered gametests, then exits.
60+
// By default, the server will crash when no gametests are provided.
61+
// The gametest system is also enabled by default for other run configs under the /test command.
62+
gameTestServer {
63+
type = "gameTestServer"
64+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
65+
}
66+
67+
data {
68+
data()
69+
70+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
71+
// gameDirectory = project.file('run-data')
72+
73+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
74+
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
75+
}
76+
77+
// applies to all the run configs above
78+
configureEach {
79+
// Recommended logging data for a userdev environment
80+
// The markers can be added/remove as needed separated by commas.
81+
// "SCAN": For mods scan.
82+
// "REGISTRIES": For firing of registry events.
83+
// "REGISTRYDUMP": For getting the contents of all registries.
84+
systemProperty 'forge.logging.markers', 'REGISTRIES'
85+
86+
// Recommended logging level for the console
87+
// You can set various levels here.
88+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
89+
logLevel = org.slf4j.event.Level.DEBUG
90+
}
91+
}
92+
93+
mods {
94+
// define mod <-> source bindings
95+
// these are used to tell the game which sources are for which mod
96+
// multi mod projects should define one per mod
97+
"${mod_id}" {
98+
sourceSet(sourceSets.main)
99+
}
100+
}
101+
}
102+
103+
// Include resources generated by data generators.
104+
sourceSets.main.resources { srcDir 'src/generated/resources' }
105+
106+
// Sets up a dependency configuration called 'localRuntime'.
107+
// This configuration should be used instead of 'runtimeOnly' to declare
108+
// a dependency that will be present for runtime testing but that is
109+
// "optional", meaning it will not be pulled by dependents of this mod.
110+
configurations {
111+
runtimeClasspath.extendsFrom localRuntime
112+
}
113+
114+
dependencies {
115+
// Example optional mod dependency with JEI
116+
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
117+
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
118+
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
119+
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
120+
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
121+
122+
// Example mod dependency using a mod jar from ./libs with a flat dir repository
123+
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
124+
// The group id is ignored when searching -- in this case, it is "blank"
125+
// implementation "blank:coolmod-${mc_version}:${coolmod_version}"
126+
127+
// Example mod dependency using a file as dependency
128+
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
129+
130+
// Example project dependency using a sister or child project:
131+
// implementation project(":myproject")
132+
133+
// For more info:
134+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
135+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
136+
}
137+
138+
// This block of code expands all declared replace properties in the specified resource targets.
139+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
140+
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
141+
var replaceProperties = [
142+
minecraft_version : minecraft_version,
143+
minecraft_version_range: minecraft_version_range,
144+
neo_version : neo_version,
145+
loader_version_range : loader_version_range,
146+
mod_id : mod_id,
147+
mod_name : mod_name,
148+
mod_license : mod_license,
149+
mod_version : mod_version,
150+
mod_authors : mod_authors,
151+
mod_description : mod_description
152+
]
153+
inputs.properties replaceProperties
154+
expand replaceProperties
155+
from "src/main/templates"
156+
into "build/generated/sources/modMetadata"
157+
}
158+
// Include the output of "generateModMetadata" as an input directory for the build
159+
// this works with both building through Gradle and the IDE.
160+
sourceSets.main.resources.srcDir generateModMetadata
161+
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
162+
neoForge.ideSyncTask generateModMetadata
163+
164+
// Example configuration to allow publishing using the maven-publish plugin
165+
publishing {
166+
publications {
167+
register('mavenJava', MavenPublication) {
168+
from components.java
169+
}
170+
}
171+
repositories {
172+
maven {
173+
url "file://${project.projectDir}/repo"
174+
}
175+
}
176+
}
177+
178+
tasks.withType(JavaCompile).configureEach {
179+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
180+
}
181+
182+
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
183+
idea {
184+
module {
185+
downloadSources = true
186+
downloadJavadoc = true
187+
}
188+
}

gradle.properties

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment
9+
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
10+
parchment_minecraft_version=1.21.1
11+
parchment_mappings_version=2024.11.17
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.1
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.1]
20+
# The Neo version must agree with the Minecraft version to get a valid artifact
21+
neo_version=21.1.215
22+
# The loader version range can only use the major version of FML as bounds
23+
loader_version_range=[1,)
24+
25+
## Mod Properties
26+
27+
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
28+
# Must match the String constant located in the main mod class annotated with @Mod.
29+
mod_id=fadingshadow
30+
# The human-readable display name for the mod.
31+
mod_name={Fading Shadow}
32+
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
33+
mod_license=All Rights Reserved
34+
# The mod version. See https://semver.org/
35+
mod_version=1.0.0
36+
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
37+
# This should match the base package used for the mod sources.
38+
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
39+
mod_group_id=io.github.mxpea.fadingshadow
40+
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
41+
mod_authors=YourNameHere, OtherNameHere
42+
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
43+
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.

gradle/wrapper/gradle-wrapper.jar

42.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)