Skip to content

Commit 7ca6e2c

Browse files
Initial commit
0 parents  commit 7ca6e2c

File tree

15 files changed

+723
-0
lines changed

15 files changed

+723
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build / Test
2+
3+
on:
4+
push:
5+
branches: [ main, dev, "1.**" ]
6+
workflow_dispatch:
7+
inputs:
8+
skip_maven_publish:
9+
description: 'Skip Maven publishing'
10+
required: true
11+
default: 'false'
12+
13+
jobs:
14+
build:
15+
if: |
16+
!contains(github.event.head_commit.message, '[ciskip]')
17+
uses: FTBTeam/mods-meta/.github/workflows/standard-release.yml@main
18+
with:
19+
curse-publish-task: ""
20+
maven-snapshots: true
21+
java-version: 21
22+
secrets:
23+
ftb-maven-token: ${{ secrets.FTB_MAVEN_TOKEN }}
24+
saps-token: ${{ secrets.SAPS_TOKEN }}

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+\.[0-9]+\.[0-9]+'
7+
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+'
8+
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+\.[0-9]+'
9+
10+
jobs:
11+
build:
12+
if: |
13+
!contains(github.event.head_commit.message, '[ciskip]')
14+
uses: FTBTeam/mods-meta/.github/workflows/standard-release.yml@main
15+
with:
16+
curse-publish-task: publishMods
17+
java-version: 21
18+
secrets:
19+
ftb-maven-token: ${{ secrets.FTB_MAVEN_TOKEN }}
20+
curse-token: ${{ secrets.CURSEFORGE_KEY }}

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
logs
20+
21+
# other
22+
eclipse
23+
run
24+
.vscode
25+
runs

LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
All Rights Reserved
2+
3+
Copyright (c) 2025 Feed The Beast Ltd
4+
5+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# FTB (Mod Name)
2+
3+
Use https://github.com/FTBTeam/FTB-Mods-Issues for any mod issues
4+
5+
## Support
6+
7+
- For **Modpack** issues, please go here: https://go.ftb.team/support-modpack
8+
- For **Mod** issues, please go here: https://go.ftb.team/support-mod-issues
9+
- Just got a question? Check out our Discord: https://go.ftb.team/discord
10+
11+
## Licence
12+
13+
All Rights Reserved to Feed The Beast Ltd. Source code is `visible source`, please see our [LICENSE.md](/LICENSE.md) for more information. Any Pull Requests made to this mod must have the CLA (Contributor Licence Agreement) signed and agreed to before the request will be considered.
14+
15+
## Keep up to date
16+
17+
[![](https://cdn.feed-the-beast.com/assets/socials/icons/social-discord.webp)](https://go.ftb.team/discord) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-github.webp)](https://go.ftb.team/github) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-twitter-x.webp)](https://go.ftb.team/twitter) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-youtube.webp)](https://go.ftb.team/youtube) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-twitch.webp)](https://go.ftb.team/twitch) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-instagram.webp)](https://go.ftb.team/instagram) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-facebook.webp)](https://go.ftb.team/facebook) [![](https://cdn.feed-the-beast.com/assets/socials/icons/social-tiktok.webp)](https://go.ftb.team/tiktok)

build.gradle

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
plugins {
2+
id 'java-library'
3+
id 'idea'
4+
id 'maven-publish'
5+
id 'net.neoforged.moddev' version '2.0.78'
6+
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
7+
}
8+
9+
tasks.named('wrapper', Wrapper).configure {
10+
distributionType = Wrapper.DistributionType.BIN
11+
}
12+
13+
def mcMinorAndPatch = getMinorAndPatchFromMc()
14+
15+
version = "${mcMinorAndPatch}.${mod_version}"
16+
group = project.maven_group
17+
18+
base {
19+
archivesName = project.archives_base_name
20+
}
21+
22+
apply from: 'https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/changelog.gradle'
23+
apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/publishing.gradle"
24+
25+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
26+
27+
neoForge {
28+
version = "${mcMinorAndPatch}.${neo_version}"
29+
30+
parchment {
31+
mappingsVersion = project.parchment_mappings_version
32+
minecraftVersion = project.parchment_minecraft_version.replace("\${mc_version}", minecraft_version)
33+
}
34+
35+
runs {
36+
configureEach {
37+
systemProperty 'forge.logging.markers', 'REGISTRIES'
38+
logLevel = org.slf4j.event.Level.DEBUG
39+
}
40+
41+
client {
42+
client()
43+
44+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
45+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
46+
}
47+
48+
server {
49+
server()
50+
programArgument '--nogui'
51+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
52+
}
53+
54+
gameTestServer {
55+
type = "gameTestServer"
56+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
57+
}
58+
59+
data {
60+
data()
61+
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
62+
}
63+
}
64+
65+
mods {
66+
"${mod_id}" {
67+
sourceSet(sourceSets.main)
68+
}
69+
}
70+
}
71+
72+
sourceSets.main.resources { srcDir 'src/generated/resources' }
73+
74+
// Sets up a dependency configuration called 'localRuntime'.
75+
// This configuration should be used instead of 'runtimeOnly' to declare
76+
// a dependency that will be present for runtime testing but that is
77+
// "optional", meaning it will not be pulled by dependents of this mod.
78+
configurations {
79+
runtimeClasspath.extendsFrom localRuntime
80+
}
81+
82+
repositories {
83+
maven {
84+
url = "https://maven.ftb.dev/releases"
85+
content = {
86+
includeGroup("dev.ftb.mods")
87+
}
88+
}
89+
}
90+
91+
dependencies {
92+
implementation "dev.ftb.mods:ftb-library-neoforge:${ftb_library_version}"
93+
}
94+
95+
tasks.register("sourcesJar", Jar) {
96+
archiveClassifier.set("sources")
97+
from sourceSets.main.allJava
98+
}
99+
100+
// Uncomment this if you want to create an API jar
101+
// tasks.register("apiJar", Jar) {
102+
// archiveClassifier.set("api")
103+
104+
// from sourceSets.main.output
105+
106+
// include 'dev/ftb/mods/{package_name}/api/**'
107+
// }
108+
109+
tasks.named("jar") {
110+
dependsOn("sourcesJar")
111+
// Uncomment this if you want to create an API jar
112+
// dependsOn("apiJar")
113+
}
114+
115+
tasks.withType(ProcessResources).configureEach {
116+
var replaceProperties = [
117+
version: version,
118+
mod_id: mod_id,
119+
mod_name: mod_name,
120+
pack_format: pack_format,
121+
loader_version_range: loader_version_range,
122+
// 99.9% of the time we're only going to target a very vague version of neoforge so this is fine.
123+
mod_loader_range: mod_loader_range.replace("\${mc_base}", mcMinorAndPatch), // Replace the version in the mod loader range
124+
]
125+
126+
inputs.properties replaceProperties
127+
128+
filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
129+
expand replaceProperties
130+
}
131+
132+
// Copy in the repos license file
133+
from(project.rootDir) {
134+
include 'LICENSE.md'
135+
}
136+
}
137+
138+
tasks.withType(JavaCompile).configureEach {
139+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
140+
}
141+
142+
idea {
143+
module {
144+
downloadSources = true
145+
downloadJavadoc = true
146+
}
147+
}
148+
149+
def getMinorAndPatchFromMc() {
150+
String mcVersion = project.minecraft_version
151+
String[] split = mcVersion.split("\\.")
152+
return split[1] + "." + (split[2] ?: "0")
153+
}
154+
155+
publishMods {
156+
def CFToken = providers.environmentVariable("CURSEFORGE_KEY");
157+
158+
dryRun = !CFToken.isPresent()
159+
displayName = "[NEOFORGE] ${mod_name} ${version}"
160+
modLoaders.add("neoforge")
161+
162+
changelog = createChangelog(project)
163+
file = jar.archiveFile
164+
version = project.version // Pretty sure it defaults to this
165+
166+
def tag = providers.environmentVariable("TAG").getOrElse("release")
167+
type = tag.endsWith("-beta") ? BETA : (tag.endsWith("-alpha") ? ALPHA : STABLE)
168+
169+
curseforge {
170+
accessToken = CFToken.orElse("missing")
171+
projectId = project.curseforge_id
172+
minecraftVersions.add(project.minecraft_version)
173+
javaVersions.add(JavaVersion.VERSION_21)
174+
}
175+
}
176+
177+
publishing {
178+
publications {
179+
register('mavenJava', MavenPublication) {
180+
from components.java
181+
artifact sourcesJar
182+
// Uncomment this if you want to create an API jar
183+
// artifact apiJar
184+
}
185+
}
186+
187+
repositories {
188+
if (ftbPublishing.ftbToken) {
189+
maven {
190+
url ftbPublishing.ftbURL
191+
credentials {
192+
username = ftbPublishing.ftbUser
193+
password = ftbPublishing.ftbToken
194+
}
195+
}
196+
}
197+
}
198+
}

gradle.properties

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
org.gradle.jvmargs=-Xmx3G
2+
org.gradle.daemon=true
3+
org.gradle.parallel=true
4+
org.gradle.caching=true
5+
org.gradle.configuration-cache=true
6+
7+
parchment_minecraft_version=${mc_version}
8+
parchment_mappings_version=2024.11.17
9+
10+
mod_name=FTB Mod Name
11+
mod_id=ftbmodname
12+
mod_version=0
13+
14+
minecraft_version=1.21.1
15+
# https://minecraft.fandom.com/wiki/Pack_format
16+
pack_format=15
17+
18+
loader_version_range=[4,)
19+
mod_loader_range=[${mc_base},)
20+
neo_version=136
21+
22+
#Mod Stuff
23+
archives_base_name=ftb-mod-name
24+
maven_group=dev.ftb.mods
25+
26+
#CurseForge
27+
curseforge_id=-1
28+
29+
#Deps
30+
ftb_library_version=2101.1.12

gradle/wrapper/gradle-wrapper.jar

58.1 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-8.10-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)