Skip to content

Commit 7674a1d

Browse files
committed
mdk
0 parents  commit 7674a1d

File tree

1,019 files changed

+23612
-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.

1,019 files changed

+23612
-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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
GNU LESSER GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org
5+
6+
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
7+
8+
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
9+
10+
0. Additional Definitions.
11+
As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License.
12+
13+
“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
14+
15+
An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
16+
17+
A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.
18+
19+
The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
20+
21+
The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
22+
23+
1. Exception to Section 3 of the GNU GPL.
24+
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
25+
26+
2. Conveying Modified Versions.
27+
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
28+
29+
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
30+
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
31+
3. Object Code Incorporating Material from Library Header Files.
32+
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
33+
34+
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
35+
b) Accompany the object code with a copy of the GNU GPL and this license document.
36+
4. Combined Works.
37+
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
38+
39+
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
40+
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
41+
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
42+
d) Do one of the following:
43+
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
44+
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
45+
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
46+
5. Combined Libraries.
47+
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
48+
49+
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
50+
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
51+
6. Revised Versions of the GNU Lesser General Public License.
52+
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
53+
54+
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
55+
56+
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

build.gradle

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
plugins {
2+
id 'idea'
3+
id 'java-library'
4+
id 'maven-publish'
5+
id 'net.neoforged.moddev.legacyforge' version '2.0.134'
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+
mavenLocal()
22+
}
23+
24+
base {
25+
archivesName = "TerraCurio"
26+
}
27+
28+
// Mojang ships Java 17 to end users in 1.20.1, so mods should target Java 17.
29+
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
30+
boolean isRunningInIdea = System.getProperty("idea.active") == "true"
31+
32+
legacyForge {
33+
// Specify the version of MinecraftForge to use.
34+
version = project.minecraft_version + '-' + project.forge_version
35+
36+
parchment {
37+
mappingsVersion = project.parchment_mappings_version
38+
minecraftVersion = project.parchment_minecraft_version
39+
}
40+
41+
// This line is optional. Access Transformers are automatically detected
42+
accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
43+
44+
// Default run configurations.
45+
// These can be tweaked, removed, or duplicated as needed.
46+
runs {
47+
client {
48+
client()
49+
50+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
51+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
52+
}
53+
54+
server {
55+
server()
56+
// programArgument '--nogui'
57+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
58+
}
59+
60+
// This run config launches GameTestServer and runs all registered gametests, then exits.
61+
// By default, the server will crash when no gametests are provided.
62+
// The gametest system is also enabled by default for other run configs under the /test command.
63+
gameTestServer {
64+
type = "gameTestServer"
65+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
66+
}
67+
68+
data {
69+
data()
70+
71+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
72+
// gameDirectory = project.file('run-data')
73+
74+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
75+
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
76+
}
77+
78+
// applies to all the run configs above
79+
configureEach {
80+
// Recommended logging data for a userdev environment
81+
// The markers can be added/remove as needed separated by commas.
82+
// "SCAN": For mods scan.
83+
// "REGISTRIES": For firing of registry events.
84+
// "REGISTRYDUMP": For getting the contents of all registries.
85+
systemProperty 'forge.logging.markers', 'REGISTRIES'
86+
87+
// Recommended logging level for the console
88+
// You can set various levels here.
89+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
90+
logLevel = org.slf4j.event.Level.DEBUG
91+
92+
jvmArguments.addAll([
93+
// 忽略无效指令,避免有的人没安装 JetBrain Runtime 无法启动游戏
94+
"-XX:+IgnoreUnrecognizedVMOptions",
95+
// 启用 JetBrain Runtime 热重载功能
96+
"-XX:+AllowEnhancedClassRedefinition"
97+
])
98+
if (isRunningInIdea) {
99+
systemProperty "terminal.jline", "true"
100+
}
101+
}
102+
}
103+
104+
mods {
105+
// define mod <-> source bindings
106+
// these are used to tell the game which sources are for which mod
107+
// mostly optional in a single mod project
108+
// but multi mod projects should define one per mod
109+
"${mod_id}" {
110+
sourceSet(sourceSets.main)
111+
}
112+
}
113+
}
114+
115+
// Include resources generated by data generators.
116+
sourceSets.main.resources { srcDir 'src/generated/resources' }
117+
118+
// Sets up a dependency configuration called 'localRuntime' and a deobfuscating one called 'modLocalRuntime'
119+
// These configurations should be used instead of 'runtimeOnly' to declare
120+
// a dependency that will be present for runtime testing but that is
121+
// "optional", meaning it will not be pulled by dependents of this mod.
122+
configurations {
123+
runtimeClasspath.extendsFrom localRuntime
124+
}
125+
obfuscation {
126+
createRemappingConfiguration(configurations.localRuntime)
127+
}
128+
129+
repositories {
130+
maven {
131+
url "https://maven.theillusivec4.top/"
132+
}
133+
maven {
134+
// location of the maven that hosts JEI files
135+
name = "Jared's maven"
136+
url = "https://maven.blamejared.com/"
137+
}
138+
maven {
139+
name = "Modrinth"
140+
url = uri("https://api.modrinth.com/maven")
141+
content {
142+
includeGroup("maven.modrinth")
143+
}
144+
}
145+
exclusiveContent {
146+
forRepository {
147+
maven {
148+
url "https://cursemaven.com"
149+
}
150+
}
151+
filter {
152+
includeGroup "curse.maven"
153+
}
154+
}
155+
}
156+
157+
dependencies {
158+
modCompileOnly "top.theillusivec4.curios:curios-forge:${curios_version}:api"
159+
modImplementation "top.theillusivec4.curios:curios-forge:${curios_version}"
160+
161+
modCompileOnly "mezz.jei:jei-1.20.1-common-api:${jei_version}"
162+
modCompileOnly "mezz.jei:jei-1.20.1-forge-api:${jei_version}"
163+
modLocalRuntime "mezz.jei:jei-1.20.1-forge:${jei_version}"
164+
165+
modCompileOnly "maven.modrinth:tetra:v6cyAXIJ"
166+
167+
modCompileOnly "maven.modrinth:spartan-weaponry:1.20.1-3.2.1"
168+
}
169+
170+
// Uncomment the lines below if you wish to configure mixin. The mixin file should be named modid.mixins.json.
171+
mixin {
172+
add sourceSets.main, "${mod_id}.refmap.json"
173+
config "${mod_id}.mixins.json"
174+
}
175+
176+
dependencies {
177+
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.0"))
178+
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.5.0"))
179+
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
180+
}
181+
182+
jar {
183+
manifest.attributes([
184+
"MixinConfigs": "${mod_id}.mixins.json"
185+
])
186+
}
187+
188+
// This block of code expands all declared replace properties in the specified resource targets.
189+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
190+
tasks.withType(ProcessResources).configureEach {
191+
var replaceProperties = [
192+
minecraft_version : minecraft_version,
193+
minecraft_version_range: minecraft_version_range,
194+
forge_version : forge_version,
195+
forge_version_range : forge_version_range,
196+
loader_version_range : loader_version_range,
197+
mod_id : mod_id,
198+
mod_name : mod_name,
199+
mod_license : mod_license,
200+
mod_version : mod_version,
201+
mod_authors : mod_authors,
202+
mod_description : mod_description
203+
]
204+
inputs.properties replaceProperties
205+
206+
filesMatching(['META-INF/mods.toml']) {
207+
expand replaceProperties
208+
}
209+
}
210+
java.withSourcesJar()
211+
212+
// Example configuration to allow publishing using the maven-publish plugin
213+
publishing {
214+
publications {
215+
register('mavenJava', MavenPublication) {
216+
from components.java
217+
}
218+
}
219+
repositories {
220+
maven {
221+
url "file://${project.projectDir}/repo"
222+
}
223+
}
224+
}
225+
226+
tasks.withType(JavaCompile).configureEach {
227+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
228+
}
229+
230+
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
231+
idea {
232+
module {
233+
downloadSources = true
234+
downloadJavadoc = true
235+
}
236+
}

0 commit comments

Comments
 (0)