Skip to content

Commit ef72361

Browse files
committed
Initial commit
0 parents  commit ef72361

File tree

17 files changed

+980
-0
lines changed

17 files changed

+980
-0
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
10+
# Binary files should be left untouched
11+
*.jar binary
12+

.github/workflows/gradle.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Java CI
2+
3+
on: [ push ]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up JDK 21
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: temurin
18+
java-version: 21
19+
20+
- name: Restore Gradle cache
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.gradle/caches
24+
key: v2-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('gradle.properties') }}
25+
restore-keys: |
26+
v2-${{ runner.os }}-gradle-
27+
28+
- name: Build with Gradle
29+
run: ./gradlew build

.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+
20+
# other
21+
eclipse
22+
run
23+
24+
# Files from Forge MDK
25+
forge*changelog.txt

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Forge Render Type Test - Copyright (c) 2025 Choonster
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ForgeGradle 7 CI Test
2+
3+
This mod attempts to run the `build` task in a GitHub Actions workflow without running `syncMavenizer` first to
4+
demonstrate that this causes compilation errors.

build.gradle

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
plugins {
2+
id 'java'
3+
id 'idea'
4+
id 'eclipse'
5+
id 'maven-publish'
6+
id 'net.minecraftforge.accesstransformers' version '5.0.1'
7+
id 'net.minecraftforge.gradle' version '7.0.0-beta.46'
8+
id 'net.minecraftforge.jarjar' version '0.2.3'
9+
}
10+
11+
version = mod_version
12+
group = mod_group_id
13+
base.archivesName = mod_id
14+
15+
// Mojang ships Java 21 to end users in 1.20.5+, so your mod should target Java 21.
16+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
17+
18+
println "Java: ${providers.systemProperty('java.version').get()}, " +
19+
"JVM: ${providers.systemProperty('java.vm.version').get()} (${providers.systemProperty('java.vendor').get()}), " +
20+
"Arch: ${providers.systemProperty('os.arch').get()}"
21+
22+
minecraft {
23+
mappings channel: mapping_channel, version: mapping_version
24+
25+
accessTransformers = true
26+
27+
runs {
28+
configureEach {
29+
workingDir.convention layout.projectDirectory.dir('run')
30+
31+
//systemProperty 'forge.logging.markers', 'REGISTRIES'
32+
33+
systemProperty 'forge.logging.console.level', 'debug'
34+
35+
systemProperty 'eventbus.api.strictRuntimeChecks', 'true'
36+
37+
//args "-mixin.config=${mod_id}.mixins.json"
38+
}
39+
40+
register('client') {
41+
systemProperty 'forge.enabledGameTestNamespaces', mod_id
42+
}
43+
44+
register('server') {
45+
systemProperty 'forge.enabledGameTestNamespaces', mod_id
46+
args '--nogui'
47+
}
48+
49+
register('gameTestServer') {
50+
systemProperty 'forge.enabledGameTestNamespaces', mod_id
51+
}
52+
53+
register('data') {
54+
workingDir = layout.projectDirectory.dir('run-data')
55+
56+
args '--mod', mod_id, '--all', '--output', layout.projectDirectory.dir('src/generated/resources'), '--existing', layout.projectDirectory.dir('src/main/resources')
57+
}
58+
}
59+
}
60+
61+
// Include resources generated by data generators.
62+
sourceSets.main.resources { srcDir layout.projectDirectory.dir('src/generated/resources') }
63+
64+
// This methods registers jarJar for the default jar task.
65+
// The closure allows you to configure the task, instead of needing to do this:
66+
// tasks.named('jarJar', net.minecraftforge.jarjar.gradle.JarJar)
67+
jarJar.register() {
68+
archiveClassifier = null
69+
}
70+
71+
repositories {
72+
maven minecraft.mavenizer
73+
maven fg.forgeMaven
74+
maven fg.minecraftLibsMaven
75+
exclusiveContent {
76+
forRepository {
77+
maven {
78+
name = 'Sponge'
79+
url = 'https://repo.spongepowered.org/repository/maven-public'
80+
}
81+
}
82+
filter {
83+
includeGroupAndSubgroups('org.spongepowered')
84+
}
85+
}
86+
mavenCentral()
87+
mavenLocal()
88+
89+
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
90+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
91+
// NOTE: Support for local dependencies is still experimental in ForgeGradle 7.
92+
//flatDir {
93+
// dir 'libs'
94+
//}
95+
}
96+
97+
dependencies {
98+
// Specify the version of Minecraft to use.
99+
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
100+
// The "userdev" classifier will be requested and setup by ForgeGradle.
101+
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
102+
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
103+
implementation minecraft.dependency("net.minecraftforge:forge:$minecraft_version-$forge_version")
104+
105+
// Forge 1.21.6+ uses EventBus 7, which shifts most of its runtime validation to compile-time via an annotation processor
106+
// to improve performance in production environments. This line is required to enable said compile-time validation
107+
// in your development environment, helping you catch issues early.
108+
annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.10'
109+
110+
// Example mod dependency with JEI
111+
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
112+
//compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
113+
//compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
114+
//runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
115+
116+
// Example mod dependency using a mod jar from ./libs with a flat dir repository
117+
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
118+
// The group id is ignored when searching -- in this case, it is "blank"
119+
// NOTE: Support for deobfuscated dependencies has not yet been added in ForgeGradle 7.
120+
//implementation "blank:coolmod-${mc_version}:${coolmod_version}"
121+
122+
// For more info:
123+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
124+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
125+
}
126+
127+
tasks.withType(JavaCompile).configureEach {
128+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
129+
}
130+
131+
// This block of code expands all declared replace properties in the specified resource targets.
132+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
133+
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
134+
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
135+
tasks.named('processResources', ProcessResources) {
136+
var replaceProperties = [
137+
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
138+
forge_version: forge_version, forge_version_range: forge_version_range,
139+
loader_version_range: loader_version_range,
140+
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
141+
mod_authors: mod_authors, mod_description: mod_description,
142+
]
143+
inputs.property('replaceProperties', replaceProperties)
144+
145+
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
146+
expand replaceProperties
147+
}
148+
}
149+
150+
// Example for how to get properties into the manifest for reading at runtime.
151+
tasks.named('jar', Jar) {
152+
manifest {
153+
attributes([
154+
'Specification-Title' : mod_id,
155+
'Specification-Vendor' : mod_authors,
156+
'Specification-Version' : '1', // We are version 1 of ourselves
157+
'Implementation-Title' : project.name,
158+
'Implementation-Version' : project.jar.archiveVersion,
159+
'Implementation-Vendor' : mod_authors
160+
])
161+
//attributes['MixinConfigs'] = "${mod_id}.mixins.json"
162+
}
163+
164+
archiveClassifier = 'slim'
165+
}
166+
167+
// Example configuration to allow publishing using the maven-publish plugin
168+
publishing {
169+
repositories {
170+
maven { url = "file://${layout.projectDirectory.asFile}/mcmodsrepo" }
171+
}
172+
173+
publications.register('mavenJava', MavenPublication) {
174+
// the java component publishes the jar output as the primary artifact
175+
//from components.java
176+
177+
// the jarJar component publishes the jarJar output as the primary artifact
178+
from components.jarJar
179+
}
180+
}
181+
182+
// IntelliJ no longer downloads javadocs and sources by default, this tells Gradle to force IntelliJ to do it.
183+
idea.module { downloadJavadoc = downloadSources = true }
184+
185+
eclipse {
186+
// Eclipse no longer downloads javadocs and sources by default, this tells Gradle to force Eclipse to do it.
187+
classpath { downloadJavadoc = downloadSources = true }
188+
189+
// NOTE: ForgeGradle 7 does not yet support Eclipse run configurations
190+
// Run everytime eclipse builds the code
191+
//autoBuildTasks genEclipseRuns
192+
// Run when importing the project
193+
//synchronizationTasks 'genEclipseRuns'
194+
}
195+
196+
// NOTE: Merging of source sets is now controlled by the property 'net.minecraftforge.gradle.merge-source-sets'

gradle.properties

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
org.gradle.caching=true
2+
org.gradle.parallel=true
3+
org.gradle.configureondemand=true
4+
5+
org.gradle.configuration-cache=true
6+
org.gradle.configuration-cache.parallel=true
7+
org.gradle.configuration-cache.problems=warn
8+
9+
net.minecraftforge.gradle.merge-source-sets=true
10+
11+
## Environment Properties
12+
13+
# The Minecraft version must agree with the Forge version to get a valid artifact
14+
minecraft_version=1.21.11
15+
# The Minecraft version range can use any release version of Minecraft as bounds.
16+
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
17+
# as they do not follow standard versioning conventions.
18+
minecraft_version_range=[1.21.11,1.22)
19+
# The Forge version must agree with the Minecraft version to get a valid artifact
20+
forge_version=61.0.1
21+
# The Forge version range can use any version of Forge as bounds or match the loader version range
22+
forge_version_range=[61,)
23+
# The loader version range can only use the major version of Forge/FML as bounds
24+
loader_version_range=[61,)
25+
# The mapping channel to use for mappings.
26+
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
27+
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
28+
#
29+
# | Channel | Version | |
30+
# |-----------|----------------------|--------------------------------------------------------------------------------|
31+
# | official | MCVersion | Official field/method names from Mojang mapping files |
32+
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
33+
#
34+
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
35+
# See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
36+
#
37+
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
38+
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
39+
mapping_channel=official
40+
# The mapping version to query from the mapping channel.
41+
# This must match the format required by the mapping channel.
42+
mapping_version=1.21.11
43+
44+
45+
## Mod Properties
46+
47+
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
48+
# Must match the String constant located in the main mod class annotated with @Mod.
49+
mod_id=forge_gradle_7_ci_test
50+
# The human-readable display name for the mod.
51+
mod_name=ForgeGradle 7 CI Test
52+
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
53+
mod_license=MIT Licence
54+
# The mod version. See https://semver.org/
55+
mod_version=1.0.0
56+
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
57+
# This should match the base package used for the mod sources.
58+
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
59+
mod_group_id=com.example.examplemod
60+
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
61+
mod_authors=Choonster
62+
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
63+
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.

gradle/wrapper/gradle-wrapper.jar

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

0 commit comments

Comments
 (0)