Skip to content

Commit 497d539

Browse files
committed
Version for 1.20.1
1 parent 3e3717c commit 497d539

File tree

10 files changed

+139
-89
lines changed

10 files changed

+139
-89
lines changed

build.gradle

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,109 @@
1-
buildscript
2-
{
3-
repositories
4-
{
5-
maven { url = 'https://maven.minecraftforge.net' }
6-
mavenCentral()
7-
}
8-
9-
dependencies
10-
{
11-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
12-
classpath 'org.spongepowered:mixingradle:0.7.+'
13-
}
14-
}
15-
161
plugins
172
{
18-
id 'eclipse'
19-
id 'maven-publish'
20-
id 'net.minecraftforge.gradle' version '5.1.+'
3+
id 'eclipse'
4+
id 'idea'
5+
id 'maven-publish'
6+
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
7+
id 'org.spongepowered.mixin' version '0.7.+'
218
}
229

23-
apply plugin: 'net.minecraftforge.gradle'
24-
apply plugin: 'org.spongepowered.mixin'
25-
10+
version = mod_version
11+
group = mod_group_id
2612

27-
version = '1.2.1'
28-
group = 'com.mt1006.mocap'
29-
archivesBaseName = 'Mocap-FORGE-1.20'
13+
base
14+
{
15+
archivesName = "${mod_jar_name}-FORGE-${minecraft_version}"
16+
}
3017

3118
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
3219

3320
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
34-
3521
minecraft
3622
{
37-
mappings channel: 'official', version: '1.20'
23+
mappings channel: mapping_channel, version: mapping_version
24+
copyIdeResources = true
3825

39-
runs
26+
runs
4027
{
41-
client
28+
client
4229
{
43-
workingDirectory project.file('run')
30+
workingDirectory project.file('run')
4431

45-
property 'forge.logging.markers', 'REGISTRIES'
46-
property 'forge.logging.console.level', 'debug'
47-
property 'forge.enabledGameTestNamespaces', 'mocap'
32+
property 'forge.logging.markers', 'REGISTRIES'
33+
property 'forge.logging.console.level', 'debug'
34+
property 'forge.enabledGameTestNamespaces', mod_id
4835

49-
mods
36+
mods
5037
{
51-
mocap { source sourceSets.main }
52-
}
53-
}
38+
"${mod_id}" { source sourceSets.main }
39+
}
40+
}
5441

55-
server
42+
server
5643
{
57-
workingDirectory project.file('run')
44+
workingDirectory project.file('run')
5845

59-
property 'forge.logging.markers', 'REGISTRIES'
60-
property 'forge.logging.console.level', 'debug'
61-
property 'forge.enabledGameTestNamespaces', 'mocap'
46+
property 'forge.logging.markers', 'REGISTRIES'
47+
property 'forge.logging.console.level', 'debug'
48+
property 'forge.enabledGameTestNamespaces', mod_id
6249

63-
mods
50+
mods
6451
{
65-
mocap { source sourceSets.main }
66-
}
67-
}
68-
}
52+
"${mod_id}" { source sourceSets.main }
53+
}
54+
}
55+
}
6956
}
7057

7158
sourceSets.main.resources { srcDir 'src/generated/resources' }
7259

7360
dependencies
7461
{
75-
minecraft 'net.minecraftforge:forge:1.20-46.0.2'
76-
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
62+
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
63+
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
7764
}
7865

7966
mixin
8067
{
81-
add sourceSets.main, 'mixins.mocap.refmap.json'
82-
config 'mixins.mocap.json'
68+
add sourceSets.main, "mixins.${mod_id}.refmap.json"
69+
config "mixins.${mod_id}.json"
70+
}
71+
72+
def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
73+
def replaceProperties =
74+
[
75+
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
76+
forge_version: forge_version, forge_version_range: forge_version_range,
77+
loader_version_range: loader_version_range,
78+
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
79+
mod_authors: mod_authors, mod_description: mod_description,
80+
mod_url: mod_url, mod_issues: mod_issues, mod_credits: mod_credits
81+
]
82+
83+
processResources
84+
{
85+
inputs.properties replaceProperties
86+
replaceProperties.put 'project', project
87+
88+
filesMatching(resourceTargets) { expand replaceProperties }
8389
}
8490

8591
jar
8692
{
87-
manifest
93+
manifest
8894
{
89-
attributes([
90-
"Specification-Title": "mocap",
91-
"Specification-Vendor": "mt1006",
92-
"Specification-Version": "${archiveVersion}",
93-
"Implementation-Title": "mocap",
94-
"Implementation-Version": "${archiveVersion}",
95-
"Implementation-Vendor": "mt1006",
96-
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
97-
])
98-
}
95+
attributes([
96+
"Specification-Title" : mod_id,
97+
"Specification-Vendor" : mod_authors,
98+
"Specification-Version" : "1",
99+
"Implementation-Title" : project.name,
100+
"Implementation-Version" : project.jar.archiveVersion,
101+
"Implementation-Vendor" : mod_authors,
102+
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
103+
])
104+
}
99105
}
100106

101107
jar.finalizedBy('reobfJar')
102108

103-
tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' }
109+
tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' }

gradle.properties

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
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.
31
org.gradle.jvmargs=-Xmx3G
4-
org.gradle.daemon=false
2+
org.gradle.daemon=false
3+
4+
minecraft_version=1.20.1
5+
forge_version=47.0.1
6+
7+
minecraft_version_range=[1.20,1.20.2)
8+
forge_version_range=[46,)
9+
loader_version_range=[46,)
10+
11+
mapping_channel=official
12+
mapping_version=1.20.1
13+
14+
15+
## Mod Properties
16+
mod_id=mocap
17+
mod_version=1.2.1
18+
19+
mod_group_id=com.mt1006.mocap
20+
mod_jar_name=Mocap
21+
22+
mod_name=Motion Capture Mod (mocap)
23+
mod_license=GNU Lesser General Public License v3.0
24+
25+
mod_authors=mt1006 (mt1006x)
26+
mod_credits=Thanks to khitahi for making mod icon
27+
mod_description=Allows you to record and replay player movements
28+
mod_url=https://github.com/mt1006/mc-mocap-mod
29+
mod_issues=https://github.com/mt1006/mc-mocap-mod/issues

gradle/wrapper/gradle-wrapper.jar

818 Bytes
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

settings.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
pluginManagement {
2-
repositories {
1+
pluginManagement
2+
{
3+
repositories
4+
{
35
gradlePluginPortal()
4-
maven { url = 'https://maven.minecraftforge.net/' }
6+
maven
7+
{
8+
name = 'MinecraftForge'
9+
url = 'https://maven.minecraftforge.net/'
10+
}
511
}
12+
}
13+
14+
plugins
15+
{
16+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
617
}

src/main/java/com/mt1006/mocap/MocapMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class MocapMod
1515
{
1616
public static final String MOD_ID = "mocap";
1717
public static final String VERSION = "1.2.1";
18-
public static final String FOR_VERSION = "1.20";
18+
public static final String FOR_VERSION = "1.20.1";
1919
public static final String FOR_LOADER = "Forge";
2020
public static final Logger LOGGER = LogManager.getLogger();
2121

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
modLoader="javafml"
2-
loaderVersion="[46,)"
3-
license="GNU Lesser General Public License v3.0"
2+
loaderVersion="${loader_version_range}"
3+
license="${mod_license}"
4+
issueTrackerURL="${mod_issues}"
45

56
[[mods]]
6-
modId="mocap"
7-
version="1.2.1"
8-
displayName="Motion Capture Mod (mocap)"
7+
modId="${mod_id}"
8+
version="${mod_version}"
9+
displayName="${mod_name}"
10+
displayURL="${mod_url}"
911
logoFile="logo.png"
10-
authors="mt1006 (mt1006x)"
11-
credits="Thanks to khitahi for making mod icon"
12-
description="Allows you to record and replay player movements"
12+
authors="${mod_authors}"
13+
credits="${mod_credits}"
14+
description='''${mod_description}'''
1315

14-
[[dependencies.mocap]]
16+
[[dependencies.${mod_id}]]
1517
modId="forge"
1618
mandatory=true
17-
versionRange="[46,)"
19+
versionRange="${forge_version_range}"
1820
ordering="NONE"
1921
side="BOTH"
20-
21-
[[dependencies.mocap]]
22+
23+
[[dependencies.${mod_id}]]
2224
modId="minecraft"
2325
mandatory=true
24-
versionRange="[1.20,1.20.1)"
26+
versionRange="${minecraft_version_range}"
2527
ordering="NONE"
26-
side="BOTH"
28+
side="BOTH"

src/main/resources/pack.mcmeta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"pack":
33
{
4-
"description": {"text": "Mod resources" },
4+
"description": {"text": "${mod_id} resources" },
55
"pack_format": 15
66
}
77
}

0 commit comments

Comments
 (0)