Skip to content

Commit fced317

Browse files
committed
Updated Fully for 1.20.1
1 parent 3330196 commit fced317

File tree

7 files changed

+42
-23
lines changed

7 files changed

+42
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### :warning: WARNING :warning:: You **CANNOT** publish any code generated by this tool.
66

77
### Supported versions:
8-
1.13->1.20
8+
1.13->1.20.1
99

1010
### Important
1111
1.17< Needs JDK 16

build.gradle

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ buildscript {
66
gradlePluginPortal()
77
}
88
dependencies {
9-
classpath 'net.minecraftforge.gradle:ForgeGradle:5+'
9+
classpath 'net.minecraftforge.gradle:ForgeGradle:6+'
1010
classpath "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.3"
1111
}
1212
}
1313

14-
import net.minecraftforge.forge.tasks.*
14+
import net.minecraftforge.gradle.common.util.Utils
15+
import net.minecraftforge.gradle.common.util.VersionJson
1516
import org.jetbrains.gradle.ext.*
1617

1718
apply plugin: 'eclipse'
@@ -78,47 +79,52 @@ jar {
7879
}
7980
}
8081

81-
task runclient(type: JavaExec) {
82+
var assetsFolder = file('run/assets')
83+
84+
tasks.register('runclient', JavaExec) {
8285
group = "MCP"
8386
description = "Runs the client"
8487
classpath sourceSets.main.runtimeClasspath
8588
if (System.getProperty("os.name").toLowerCase().contains("mac")) {
8689
jvmArgs '-XstartOnFirstThread'
8790
}
91+
92+
var runFolder = file('run')
93+
var versionJson = Utils.loadJson(downloadAssets.getMeta().get().getAsFile(), VersionJson.class)
94+
95+
workingDir runFolder
8896
args '--gameDir', '.'
8997
args '--version', minecraft_version
90-
args '--assetsDir', downloadAssets.output
91-
args '--assetIndex', "1.20"
98+
args '--assetsDir', runFolder.relativePath(assetsFolder)
99+
args '--assetIndex', versionJson.assetIndex.id
92100
args '--accessToken', '0'
93101
main 'net.minecraft.client.main.Main'
94-
workingDir 'run'
95102
}
96103

97104

98-
99-
task setup() {
105+
tasks.register('setup') {
100106
group = "MCP"
101107
description = "Setups the dev workspace"
102108
dependsOn ':extractMapped'
103-
mkdir 'run/assets'
109+
mkdir assetsFolder
104110
copy {
105111
from downloadAssets.output.path
106-
into 'run/assets'
112+
into assetsFolder
107113
}
108114
}
109115

110-
task copyAssets {
116+
tasks.register('copyAssets') {
111117
group = "MCP"
112118
description = "Download and place the assets into the run folder"
113119
dependsOn ':downloadAssets'
114120
mkdir 'run/assets'
115121
copy {
116122
from downloadAssets.output.path
117-
into 'run/assets'
123+
into assetsFolder
118124
}
119125
}
120126

121-
task runserver(type: JavaExec) {
127+
tasks.register('runserver', JavaExec) {
122128
mkdir 'runserver'
123129
group = "MCP"
124130
description = "Runs the server"
@@ -136,4 +142,4 @@ idea.project.settings {
136142
moduleName = idea.module.name + '.main'
137143
}
138144
}
139-
}
145+
}

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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.
3+
org.gradle.jvmargs=-Xmx6G
4+
org.gradle.daemon=true
5+
org.gradle.parallel=true
6+
org.gradle.configureondemand=true

gradle/wrapper/gradle-wrapper.jar

1.29 KB
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-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: 12 additions & 7 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,13 +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##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
143140
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
143+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144+
# shellcheck disable=SC3045
146145
MAX_FD=$( ulimit -H -n ) ||
147146
warn "Could not query maximum file descriptor limit"
148147
esac
149148
case $MAX_FD in #(
150149
'' | soft) :;; #(
151150
*)
151+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152+
# shellcheck disable=SC3045
152153
ulimit -n "$MAX_FD" ||
153154
warn "Could not set maximum file descriptor limit to $MAX_FD"
154155
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
193194
done
194195
fi
195196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
196201
# Collect all arguments for the java command;
197202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198203
# shell script including quotes and variable substitutions, so put them in

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

0 commit comments

Comments
 (0)