Skip to content

Commit 43876b1

Browse files
committed
Neoforge 1.21.1
1 parent 6dddd6d commit 43876b1

269 files changed

Lines changed: 4681 additions & 780 deletions

File tree

Some content is hidden

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

.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: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1-
build/
1+
# eclipse
2+
bin
3+
*.launch
4+
.settings
5+
.metadata
6+
.classpath
7+
.project
8+
9+
# idea
10+
out
211
*.ipr
3-
run/
412
*.iws
5-
out/
613
*.iml
7-
.gradle/
8-
output/
9-
bin/
10-
libs/
14+
.idea
1115

12-
.classpath
13-
.project
14-
.settings/org.eclipse.core.resources.prefs
15-
.idea/
16-
classes/
16+
# gradle
17+
build
18+
.gradle
19+
20+
# other
21+
eclipse
22+
run
23+
runs
24+
run-data
1725

18-
.vscode/
19-
logs/
26+
repo

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1-
# Sledgehammers
2-
Adds Sledgehammers! Sledgehammer are multi-tools that are efficient against every block!
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MIT License
2+
3+
Copyright (c) 2023 NeoForged project
4+
5+
This license applies to the template files as supplied by github.com/NeoForged/MDK
6+
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in all
16+
copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
SOFTWARE.

build.gradle

Lines changed: 62 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,196 +1,108 @@
11
plugins {
2-
id 'eclipse'
3-
id 'idea'
2+
id 'java-library'
43
id 'maven-publish'
5-
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
6-
id "com.matthewprenger.cursegradle" version "${cursegradle_version}"
7-
id 'com.modrinth.minotaur' version "${minotaur_version}"
4+
id 'net.neoforged.gradle.userdev' version '7.0.181'
5+
}
6+
7+
tasks.named('wrapper', Wrapper).configure {
8+
distributionType = Wrapper.DistributionType.BIN
89
}
910

1011
version = mod_version
1112
group = mod_group_id
1213

14+
repositories {
15+
mavenLocal()
16+
maven {
17+
name "CurseMaven"
18+
url "https://www.cursemaven.com"
19+
}
20+
}
21+
1322
base {
1423
archivesName = mod_id
1524
}
1625

17-
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
18-
19-
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
20-
minecraft {
21-
22-
mappings channel: mapping_channel, version: mapping_version
23-
copyIdeResources = true
24-
25-
runs {
26-
client {
26+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
2727

28-
workingDirectory project.file('run')
29-
30-
property 'forge.logging.markers', 'REGISTRIES'
31-
property 'forge.logging.console.level', 'debug'
32-
property 'forge.enabledGameTestNamespaces', mod_id
33-
34-
mods {
35-
"${mod_id}" {
36-
source sourceSets.main
37-
}
38-
}
39-
}
40-
41-
server {
42-
workingDirectory project.file('run')
43-
44-
property 'forge.logging.markers', 'REGISTRIES'
45-
property 'forge.logging.console.level', 'debug'
46-
property 'forge.enabledGameTestNamespaces', mod_id
47-
48-
mods {
49-
"${mod_id}" {
50-
source sourceSets.main
51-
}
52-
}
53-
}
54-
55-
gameTestServer {
56-
workingDirectory project.file('run')
57-
58-
property 'forge.logging.markers', 'REGISTRIES'
59-
property 'forge.logging.console.level', 'debug'
60-
property 'forge.enabledGameTestNamespaces', mod_id
28+
runs {
29+
configureEach {
30+
systemProperty 'forge.logging.markers', 'REGISTRIES'
31+
systemProperty 'forge.logging.console.level', 'debug'
32+
modSource project.sourceSets.main
33+
}
6134

62-
mods {
63-
"${mod_id}" {
64-
source sourceSets.main
65-
}
66-
}
67-
}
35+
client {
36+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
37+
}
6838

69-
data {
70-
workingDirectory project.file('run')
39+
server {
40+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
41+
argument '--nogui'
42+
}
7143

72-
property 'forge.logging.markers', 'REGISTRIES'
73-
property 'forge.logging.console.level', 'debug'
74-
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
44+
gameTestServer {
45+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
46+
}
7547

76-
mods {
77-
"${mod_id}" {
78-
source sourceSets.main
79-
}
80-
}
81-
}
48+
data {
49+
arguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
8250
}
8351
}
8452

8553
sourceSets.main.resources { srcDir 'src/generated/resources' }
8654

87-
repositories {
88-
maven {
89-
name "CurseMaven"
90-
url "https://www.cursemaven.com"
91-
}
55+
configurations {
56+
runtimeClasspath.extendsFrom localRuntime
9257
}
9358

9459
dependencies {
95-
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
60+
implementation "net.neoforged:neoforge:${neo_version}"
9661

97-
implementation fg.deobf("curse.maven:ccore-573646:${rootProject.ccore_file_id}")
98-
runtimeOnly fg.deobf("curse.maven:jei-238222:${rootProject.jei_file_id}")
62+
runtimeOnly "curse.maven:jei-238222:${project.jei_file_id}"
9963
}
10064

101-
def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
102-
def replaceProperties = [
103-
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
104-
forge_version: forge_version, forge_version_range: forge_version_range,
105-
loader_version_range: loader_version_range,
106-
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
107-
mod_authors: mod_authors, mod_description: mod_description
108-
]
109-
110-
processResources {
65+
tasks.withType(ProcessResources).configureEach {
66+
var replaceProperties = [
67+
minecraft_version : minecraft_version,
68+
minecraft_version_range: minecraft_version_range,
69+
neo_version : neo_version,
70+
neo_version_range : neo_version_range,
71+
loader_version_range : loader_version_range,
72+
mod_id : mod_id,
73+
mod_name : mod_name,
74+
mod_license : mod_license,
75+
mod_version : mod_version,
76+
mod_authors : mod_authors,
77+
mod_description : mod_description
78+
]
11179
inputs.properties replaceProperties
112-
replaceProperties.put 'project', project
11380

114-
filesMatching(resourceTargets) {
81+
filesMatching(['META-INF/neoforge.mods.toml']) {
11582
expand replaceProperties
11683
}
11784
}
11885

119-
jar {
120-
manifest {
121-
attributes([
122-
"Specification-Title" : mod_id,
123-
"Specification-Vendor" : mod_authors,
124-
"Specification-Version" : mod_version,
125-
"Implementation-Title" : project.name,
126-
"Implementation-Version" : project.jar.archiveVersion,
127-
"Implementation-Vendor" : mod_authors,
128-
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
129-
])
130-
}
131-
}
132-
133-
jar.finalizedBy('reobfJar')
134-
13586
publishing {
13687
publications {
137-
mavenJava(MavenPublication) {
138-
artifact jar
88+
register('mavenJava', MavenPublication) {
89+
from components.java
13990
}
14091
}
14192
repositories {
14293
maven {
143-
url "file://${project.projectDir}/mcmodsrepo"
94+
url "file://${project.projectDir}/repo"
14495
}
14596
}
14697
}
14798

148-
curseforge {
149-
150-
apiKey = project.findProperty('curseforge_apikey') ?: '0'
151-
152-
project {
153-
154-
id = curseforge_project_id
155-
releaseType = mod_release_type
156-
157-
changelog = file("changelog.txt")
158-
159-
addGameVersion "${minecraft_version}"
160-
addGameVersion "Java 8"
161-
162-
mainArtifact(jar) {
163-
displayName = "[${rootProject.minecraft_version}] v${rootProject.mod_version}"
164-
}
165-
166-
relations {
167-
requiredDependency 'ccore'
168-
}
169-
}
170-
}
171-
172-
tasks.modrinth.configure({
173-
group = 'upload'
174-
})
175-
176-
modrinth {
177-
178-
token = project.findProperty('modrinth_apikey') ?: '0'
179-
180-
projectId = modrinth_project_id
181-
versionType = mod_release_type.toUpperCase()
182-
183-
changelog = file('changelog.txt').text
184-
185-
versionNumber = "forge-${mod_version}"
186-
versionName = "${mod_name} ${mod_version}"
187-
uploadFile = jar
188-
189-
gameVersions = [minecraft_version]
190-
loaders = ['forge']
99+
tasks.withType(JavaCompile).configureEach {
100+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
191101
}
192-
tasks.modrinth.dependsOn(build)
193102

194-
tasks.withType(JavaCompile).configureEach {
195-
options.encoding = 'UTF-8'
103+
idea {
104+
module {
105+
downloadSources = true
106+
downloadJavadoc = true
107+
}
196108
}

0 commit comments

Comments
 (0)