Skip to content

Commit fea5e6a

Browse files
committed
Port to 1.20.4
1 parent 7599125 commit fea5e6a

Some content is hidden

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

41 files changed

+566
-454
lines changed

.github/workflows/gradle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name: Java CI with Gradle
99

1010
on:
1111
push:
12-
branches: [ 1.20.1 ]
12+
branches: [ 1.20.4 ]
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ out/
1616
dep/
1717
RebornStorage_Client.launch
1818
RebornStorage_Server.launch
19+
runs/

build.gradle

+100-132
Original file line numberDiff line numberDiff line change
@@ -1,184 +1,152 @@
1-
buildscript {
2-
repositories {
3-
maven { url = 'https://files.minecraftforge.net/maven' }
4-
// jcenter()
5-
mavenCentral()
6-
}
7-
dependencies {
8-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1+', changing: true
9-
}
10-
}
111
plugins {
2+
id 'java-library'
123
id 'eclipse'
4+
id 'idea'
135
id 'maven-publish'
6+
id 'net.neoforged.gradle.userdev' version '7.0.57'
147
}
15-
apply plugin: 'net.minecraftforge.gradle'
16-
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
17-
18-
version = "${project.mc_version}-${project.mod_version}"
19-
group = "${project.maven_group}"
20-
archivesBaseName = "${project.mod_id}"
21-
22-
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
23-
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
24-
25-
minecraft {
26-
mappings channel: 'official', version: "${project.mc_version}"
27-
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
28-
29-
runs {
30-
client {
31-
workingDirectory project.file('run')
32-
property 'forge.logging.markers', 'SCAN,REGISTRIES'
33-
property 'forge.logging.console.level', 'debug'
34-
35-
property 'forge.enabledGameTestNamespaces', 'rebornstorage'
36-
37-
//Patchouli
38-
property 'mixin.env.remapRefMap', 'true'
39-
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
40-
41-
mods {
42-
rebornstorage {
43-
source sourceSets.main
44-
}
45-
}
46-
}
47-
48-
server {
49-
workingDirectory project.file('run')
50-
property 'forge.logging.markers', 'SCAN,REGISTRIES'
51-
property 'forge.logging.console.level', 'debug'
528

53-
property 'forge.enabledGameTestNamespaces', 'rebornstorage'
54-
55-
//Patchouli
56-
property 'mixin.env.remapRefMap', 'true'
57-
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
58-
59-
mods {
60-
rebornstorage {
61-
source sourceSets.main
62-
}
63-
}
64-
}
9+
def ENV = System.getenv()
6510

66-
gameTestServer {
67-
workingDirectory project.file('run')
11+
version = minecraft_version + "-" + mod_version + "-neoforge"
12+
group = mod_group_id
6813

69-
// Recommended logging data for a userdev environment
70-
// The markers can be added/remove as needed separated by commas.
71-
// "SCAN": For mods scan.
72-
// "REGISTRIES": For firing of registry events.
73-
// "REGISTRYDUMP": For getting the contents of all registries.
74-
property 'forge.logging.markers', 'REGISTRIES'
14+
repositories {
15+
mavenLocal()
16+
}
7517

76-
// Recommended logging level for the console
77-
// You can set various levels here.
78-
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
79-
property 'forge.logging.console.level', 'debug'
18+
base {
19+
archivesName = mod_id
20+
}
8021

81-
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
82-
property 'forge.enabledGameTestNamespaces', 'rebornstorage'
22+
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
23+
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
8324

84-
mods {
85-
rebornstorage {
86-
source sourceSets.main
87-
}
88-
}
89-
}
25+
//minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
26+
minecraft {
27+
accessTransformers {
28+
file('src/main/resources/META-INF/accesstransformer.cfg')
29+
}
30+
}
9031

91-
data {
92-
workingDirectory project.file('run')
32+
// Default run configurations.
33+
// These can be tweaked, removed, or duplicated as needed.
34+
runs {
35+
// applies to all the run configs below
36+
configureEach {
37+
// Recommended logging data for a userdev environment
38+
// The markers can be added/remove as needed separated by commas.
39+
// "SCAN": For mods scan.
40+
// "REGISTRIES": For firing of registry events.
41+
// "REGISTRYDUMP": For getting the contents of all registries.
42+
systemProperty 'forge.logging.markers', 'REGISTRIES'
43+
44+
// Recommended logging level for the console
45+
// You can set various levels here.
46+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
47+
systemProperty 'forge.logging.console.level', 'debug'
48+
49+
modSource project.sourceSets.main
50+
}
9351

94-
property 'forge.logging.markers', 'REGISTRIES'
52+
client {
53+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
54+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
55+
}
9556

96-
property 'forge.logging.console.level', 'debug'
57+
server {
58+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
59+
programArgument '--nogui'
60+
}
9761

98-
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
99-
args '--mod', 'rebornstorage', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
62+
// This run config launches GameTestServer and runs all registered gametests, then exits.
63+
// By default, the server will crash when no gametests are provided.
64+
// The gametest system is also enabled by default for other run configs under the /test command.
65+
gameTestServer {
66+
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
67+
}
10068

101-
//Patchouli
102-
property 'mixin.env.remapRefMap', 'true'
103-
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
69+
data {
70+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
71+
// workingDirectory project.file('run-data')
10472

105-
mods {
106-
rebornstorage {
107-
source sourceSets.main
108-
}
109-
}
110-
}
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()
11175
}
11276
}
11377

78+
// Include resources generated by data generators.
11479
sourceSets.main.resources { srcDir 'src/generated/resources' }
11580

11681
repositories {
11782
maven {
118-
url = "https://maven.creeperhost.net"
83+
name "CreeperHost"
84+
url 'https://maven.creeperhost.net'
85+
}
86+
maven {
87+
// location of the maven that hosts JEI files since January 2023
88+
name = "Jared's maven"
89+
url = "https://maven.blamejared.com/"
11990
}
12091
maven {
121-
url "https://www.cursemaven.com"
92+
url "https://cursemaven.com"
12293
content {
12394
includeGroup "curse.maven"
12495
}
12596
}
126-
maven {
127-
url = "https://maven.theillusivec4.top/"
128-
}
129-
130-
// flatDir {
131-
// dirs '/libs'
132-
// }
13397
}
13498

13599
dependencies {
136-
minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}"
137-
138-
implementation fg.deobf("com.refinedmods:refinedstorage:${project.rs_version}") {
100+
// Specify the version of Minecraft to use.
101+
// Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
102+
// The group for userdev is net.neoforged, the module name is neoforge, and the version is the same as the neoforge version.
103+
// You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader.
104+
// And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
105+
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
106+
implementation "net.neoforged:neoforge:${neo_version}"
107+
implementation "net.creeperhost:polylib-neoforge:${polylib_version}"
108+
implementation ("com.refinedmods:refinedstorage:${project.rs_version}") {
139109
transitive false
140110
}
141-
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}")
142-
143-
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}")
144-
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}:api")
145-
146-
// compileOnly fg.deobf("vazkii.patchouli:Patchouli:${project.patchouli_version}:api")
147-
// runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${project.patchouli_version}")
148-
149-
// compileOnly fg.deobf("team.chisel.ctm:CTM:${project.ctm_version}")
150-
// runtimeOnly fg.deobf("team.chisel.ctm:CTM:${project.ctm_version}")
151111
}
152112

153-
jar {
154-
manifest {
155-
attributes(["Specification-Title": archivesBaseName,
156-
"Specification-Vendor": "gigabit101",
157-
"Specification-Version": "${project.mod_version}",
158-
"Implementation-Title": archivesBaseName,
159-
"Implementation-Version": "${project.mod_version}",
160-
"Implementation-Vendor" :"gigabit101",
161-
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
113+
// This block of code expands all declared replace properties in the specified resource targets.
114+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
115+
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
116+
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
117+
tasks.withType(ProcessResources).configureEach {
118+
var replaceProperties = [
119+
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
120+
neo_version : neo_version, neo_version_range: neo_version_range,
121+
loader_version_range: loader_version_range,
122+
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
123+
mod_authors : mod_authors, mod_description: mod_description,
124+
]
125+
inputs.properties replaceProperties
126+
127+
filesMatching(['META-INF/mods.toml']) {
128+
expand replaceProperties + [project: project]
162129
}
163130
}
164131

165-
def ENV = System.getenv()
166-
132+
// Example configuration to allow publishing using the maven-publish plugin
167133
publishing {
168134
publications {
169135
register('mavenJava', MavenPublication) {
170-
groupId "net.gigabit101"
171-
artifactId = rootProject.archivesBaseName
136+
groupId "net.creeperhost"
137+
artifactId rootProject.archivesBaseName
138+
version version
172139
from components.java
173140
}
174141
}
175142
repositories {
176-
if (ENV.MAVEN_TOKEN) {
143+
if (ENV.CREEPERHOST_MAVEN_TOKEN) {
177144
maven {
178145
url "https://maven.creeperhost.net/release"
146+
allowInsecureProtocol = true
179147
credentials {
180-
username = "Gigabit101"
181-
password = "${ENV.MAVEN_TOKEN}"
148+
username = "githubci"
149+
password = "${ENV.CREEPERHOST_MAVEN_TOKEN}"
182150
}
183151
}
184152
}

gradle.properties

+43-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
1-
org.gradle.jvmargs=-Xmx3G
1+
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
2+
# This is required to provide enough memory for the Minecraft decompilation process.
23
org.gradle.daemon=false
4+
org.gradle.debug=false
35

4-
mod_version = 5.0.7
5-
mod_id = rebornstorage
6-
maven_group = gigabit101
7-
8-
mc_version = 1.20.1
9-
forge_version = 47.0.19
10-
jei_version=15.1.0.19
11-
rs_version=1.12.4
12-
curios_version=5.2.0-beta.3+1.20.1
13-
patchouli_version=1.19-75
14-
ctm_version=1.18.2-1.1.4+4
6+
7+
## Environment Properties
8+
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
9+
# The Minecraft version must agree with the Neo version to get a valid artifact
10+
minecraft_version=1.20.4
11+
# The Minecraft version range can use any release version of Minecraft as bounds.
12+
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
13+
# as they do not follow standard versioning conventions.
14+
minecraft_version_range=[1.20.4,1.21)
15+
# The Neo version must agree with the Minecraft version to get a valid artifact
16+
neo_version=20.4.173
17+
# The Neo version range can use any version of Neo as bounds
18+
neo_version_range=[20.4,)
19+
# The loader version range can only use the major version of FML as bounds
20+
loader_version_range=[2,)
21+
22+
## Mod Properties
23+
24+
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
25+
# Must match the String constant located in the main mod class annotated with @Mod.
26+
mod_id=rebornstorage
27+
# The human-readable display name for the mod.
28+
mod_name=Reborn Storage
29+
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
30+
mod_license=MIT
31+
# The mod version. See https://semver.org/
32+
mod_version=5.1.0
33+
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
34+
# This should match the base package used for the mod sources.
35+
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
36+
mod_group_id=net.gigabit101
37+
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
38+
mod_authors=Modmuss50, Gigabit101
39+
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
40+
mod_description=I like trains.
41+
42+
polylib_version=2004.0.3-build.117
43+
44+
#jei_version=15.1.0.19
45+
rs_version=1.13.0-beta.2

gradle/wrapper/gradle-wrapper.jar

1.99 KB
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)