Skip to content

Commit 8070f3e

Browse files
committed
Release 1.21.6 Fabric
1 parent 98d7403 commit 8070f3e

File tree

15 files changed

+246
-422
lines changed

15 files changed

+246
-422
lines changed

.gitattributes

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.github/workflows/build.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
name: Build
1+
# Automatically build the project and run any configured tests for every push
2+
# and submitted pull request. This can help catch issues that only occur on
3+
# certain platforms or Java versions, and provides a first line of defence
4+
# against bad commits.
25

3-
on: [push, pull_request]
6+
name: build
7+
on: [pull_request, push]
48

59
jobs:
610
build:
7-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
812
steps:
9-
- name: Checkout repository
13+
- name: checkout repository
1014
uses: actions/checkout@v4
11-
with:
12-
fetch-depth: 0
13-
fetch-tags: true
14-
15-
- name: Setup JDK 21
15+
- name: validate gradle wrapper
16+
uses: gradle/actions/wrapper-validation@v4
17+
- name: setup jdk
1618
uses: actions/setup-java@v4
1719
with:
1820
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
21+
distribution: 'microsoft'
22+
- name: make gradle wrapper executable
2723
run: chmod +x ./gradlew
28-
29-
- name: Build with Gradle
30-
run: ./gradlew build
24+
- name: build
25+
run: ./gradlew build
26+
- name: capture build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: Artifacts
30+
path: build/libs/

.gitignore

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,40 @@
1+
# gradle
2+
3+
.gradle/
4+
build/
5+
out/
6+
classes/
7+
18
# eclipse
2-
bin
9+
310
*.launch
4-
.settings
5-
.metadata
6-
.classpath
7-
.project
811

912
# idea
10-
out
13+
14+
.idea/
15+
*.iml
1116
*.ipr
1217
*.iws
13-
*.iml
14-
.idea
1518

16-
# gradle
17-
build
18-
.gradle
19+
# vscode
20+
21+
.settings/
22+
.vscode/
23+
bin/
24+
.classpath
25+
.project
26+
27+
# macos
28+
29+
*.DS_Store
30+
31+
# fabric
32+
33+
run/
1934

20-
# other
21-
eclipse
22-
run
23-
runs
24-
run-data
35+
# java
2536

26-
repo
37+
hs_err_*.log
38+
replay_*.log
39+
*.hprof
40+
*.jfr

build.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd C:\Users\i5wea\Documents\GitHub\HUD-Manager
2+
gradlew build

build.gradle

Lines changed: 61 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,82 @@
11
plugins {
2-
id 'java-library'
3-
id 'maven-publish'
4-
id 'net.neoforged.moddev' version '2.0.107'
5-
id 'idea'
2+
id 'fabric-loom' version "${loom_version}"
3+
id 'maven-publish'
64
}
75

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-
}
6+
version = project.mod_version
7+
group = project.maven_group
168

17-
version = mod_version
18-
group = mod_group_id
9+
base {
10+
archivesName = project.archives_base_name
11+
}
1912

2013
repositories {
21-
// Add here additional repositories if required by some of the dependencies below.
14+
// Add repositories to retrieve artifacts from in here.
15+
// You should only use this when depending on other mods because
16+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18+
// for more information about repositories.
19+
maven { url "https://maven.terraformersmc.com/releases" }
20+
maven { url "https://maven.shedaniel.me/" }
2221
}
2322

24-
base {
25-
archivesName = mod_id
23+
dependencies {
24+
// To change the versions see the gradle.properties file
25+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
26+
mappings loom.officialMojangMappings()
27+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
28+
29+
// Fabric API. This is technically optional, but you probably want it anyway.
30+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
31+
modImplementation "com.terraformersmc:modmenu:15.0.0"
32+
modImplementation "me.shedaniel.cloth:cloth-config-fabric:19.0.147"
33+
2634
}
2735

28-
// Mojang ships Java 21 to end users in 1.21.6, 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-
clientData()
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-
}
36+
processResources {
37+
inputs.property "version", project.version
7638

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-
}
39+
filesMatching("fabric.mod.json") {
40+
expand "version": inputs.properties.version
41+
}
10142
}
10243

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
44+
tasks.withType(JavaCompile).configureEach {
45+
it.options.release = 21
11246
}
11347

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")
48+
java {
49+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
50+
// if it is present.
51+
// If you remove this line, sources will not be generated.
52+
withSourcesJar()
13253

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
54+
sourceCompatibility = JavaVersion.VERSION_21
55+
targetCompatibility = JavaVersion.VERSION_21
13656
}
13757

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-
mod_id : mod_id,
146-
mod_name : mod_name,
147-
mod_license : mod_license,
148-
mod_version : mod_version,
149-
mod_authors : mod_authors,
150-
mod_description : mod_description
151-
]
152-
inputs.properties replaceProperties
153-
expand replaceProperties
154-
from "src/main/templates"
155-
into "build/generated/sources/modMetadata"
156-
}
157-
// Include the output of "generateModMetadata" as an input directory for the build
158-
// this works with both building through Gradle and the IDE.
159-
sourceSets.main.resources.srcDir generateModMetadata
160-
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
161-
neoForge.ideSyncTask generateModMetadata
58+
jar {
59+
inputs.property "archivesName", project.base.archivesName
16260

163-
// Example configuration to allow publishing using the maven-publish plugin
164-
publishing {
165-
publications {
166-
register('mavenJava', MavenPublication) {
167-
from components.java
168-
}
169-
}
170-
repositories {
171-
maven {
172-
url "file://${project.projectDir}/repo"
173-
}
174-
}
61+
from("LICENSE") {
62+
rename { "${it}_${inputs.properties.archivesName}"}
63+
}
17564
}
17665

177-
tasks.withType(JavaCompile).configureEach {
178-
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
179-
}
180-
181-
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
182-
idea {
183-
module {
184-
downloadSources = true
185-
downloadJavadoc = true
186-
}
187-
}
66+
// configure the maven publication
67+
publishing {
68+
publications {
69+
create("mavenJava", MavenPublication) {
70+
artifactId = project.archives_base_name
71+
from components.java
72+
}
73+
}
74+
75+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
76+
repositories {
77+
// Add repositories to publish to here.
78+
// Notice: This block does NOT have the same function as the block in the top level.
79+
// The repositories here will be used for publishing your artifact, not for
80+
// retrieving dependencies.
81+
}
82+
}

0 commit comments

Comments
 (0)