Skip to content

Commit

Permalink
Support Minecraft 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrix-Shen committed Nov 27, 2022
1 parent 95333c9 commit 8fbc9f4
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ preprocess {
def mc116 = createNode("1.16.5", 1_16_05, "mojang")
def mc117 = createNode("1.17.1", 1_17_01, "mojang")
def mc118 = createNode("1.18.2", 1_18_02, "mojang")
def mc119 = createNode("1.19", 1_19_00, "mojang") // root
def mc119 = createNode("1.19.2", 1_19_02, "mojang") // root

mc114.link(mc115, null)
mc115.link(mc116, null)
Expand Down
38 changes: 37 additions & 1 deletion common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,48 @@ loom {
])
}

runConfigs.client {
programArgs([
"--width",
"1920",
"--height",
"1080",
])
runDir("run/client")
}

runConfigs.server {
runDir("run/server")
}

runClient {
defaultCharacterEncoding("UTF-8")
if (!new File("${projectDir}/run/client/options.txt").exists()) {
new File("${projectDir}/run/client").mkdirs()
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("${projectDir}/run/client/options.txt"))
bufferedWriter.write("autoJump:false\n")
bufferedWriter.write("enableVsync:false\n")
bufferedWriter.write("forceUnicodeFont:true\n")
bufferedWriter.write("fov:1.0\n")
bufferedWriter.write("gamma:16.0\n")
bufferedWriter.write("guiScale:2\n")
bufferedWriter.write("lang:zh_CN\n")
bufferedWriter.write("maxFps:260\n")
bufferedWriter.write("renderDistance:10\n")
bufferedWriter.write("soundCategory_master:0.0")
bufferedWriter.close()
}
}

runServer {
defaultCharacterEncoding("UTF-8")
// Auto agree EULA
if (!new File("${projectDir}/run/server/eula.txt").exists()) {
new File("${projectDir}/run/server").mkdirs()
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("${projectDir}/run/server/eula.txt"))
bufferedWriter.write("eula=true")
bufferedWriter.close()
}
}
}

Expand Down Expand Up @@ -88,7 +124,7 @@ processResources {
"minecraft_dependency": project.minecraft_dependency,
"minecraft_version_id": project.minecraft_version.replace(".", "_"),
"minecraft_version" : project.minecraft_version,
"magiclib_version" : project.magiclib_version
"magiclib_dependency" : project.magiclib_dependency
])
}
println("assets/${project.mod_id}/lang/*.json")
Expand Down
16 changes: 8 additions & 8 deletions fabricWrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ processResources {
jars.add(["file": "META-INF/jars/${project.archives_base_name}-${it.minecraft_version}-${project.version}.jar"])
})
filesMatching("fabric.mod.json") {
expand(["mod_version" : project.version,
"mod_id" : project.mod_id,
"mod_name" : project.mod_name,
"mod_homepage": project.mod_homepage,
"mod_sources" : project.mod_sources,
"mod_license" : project.mod_license,
"magiclib_version": project.magiclib_version,
"sub_jars" : new JsonBuilder(jars).toPrettyString(),
expand(["mod_version" : project.version,
"mod_id" : project.mod_id,
"mod_name" : project.mod_name,
"mod_homepage" : project.mod_homepage,
"mod_sources" : project.mod_sources,
"mod_license" : project.mod_license,
"magiclib_dependency": project.magiclib_dependency,
"sub_jars" : new JsonBuilder(jars).toPrettyString(),
])
}
}
Expand Down
2 changes: 1 addition & 1 deletion fabricWrapper/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]
},
"depends": {
"magiclib": ">=${magiclib_version}"
"magiclib": ">=${magiclib_dependency}"
},
"custom": {
"modmenu:clientsideOnly": true
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ maven_group=top.hendrixshen
archives_base_name=BilibiliDanmaku

# Development Environment
loader_version=0.14.7
loader_version=0.14.10

# Required Libraries
# MagicLib - 0.5.31
magiclib_version=0.5.31
# MagicLib - 0.5.37
magiclib_dependency=0.5.37
magiclib_version=0.6.193+84fd02e-beta
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def versions = Arrays.asList(
"1.16.5",
"1.17.1",
"1.18.2",
"1.19",
"1.19.2",
)

for (String version : versions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ private void handleBufferMessage(ByteBuf data) throws Exception {
}

private void handleStringMessage(String message) {
BilibiliDanmaku.getLogger().debug(message);
try {
String str = gson.fromJson(message, String.class);
if (str != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
],
"depends": {
"minecraft": "${minecraft_dependency}",
"magiclib-${minecraft_version_id}": ">=${magiclib_version}"
"magiclib-${minecraft_version_id}": ">=${magiclib_dependency}"
},
"custom": {
"modmenu:parent": "${mod_id}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Independent branch configuration
# Development Environment
minecraft_version=1.19
minecraft_version=1.19.2
minecraft_dependency=1.19.x

# Required Libraries
Expand Down
2 changes: 1 addition & 1 deletion versions/mainProject
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19
1.19.2

0 comments on commit 8fbc9f4

Please sign in to comment.