Skip to content

Commit 5ad3176

Browse files
committed
upstream:update upstream and README.md
1 parent 49cf17f commit 5ad3176

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
|---------|-------------|-----------|-------------------|----------------------|
1515
| 1.21.1 | Active | Poor | Poor | Poor |
1616

17+
### Upstream Update Progress
18+
Current synced commit:
19+
- [**NeoForge 1.21.1**] - [ceff3d](https://github.com/neoforged/NeoForge/commit/ceff3d20430e6a6653a83adae68ca11464e6335b)
1720

1821
### Running?
1922
It could be compilable and running, but the compatibility with plugins is poor.

neotaiyitistlauncher/build.gradle

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,42 @@ plugins {
55
group = 'org.taiyitistmc'
66
version = rootProject.version
77

8+
base {
9+
archivesName = "neotaiyitist"
10+
}
811

912
dependencies {
1013
compileOnly "cpw.mods:bootstraplauncher:${project.bootstraplauncher_version}"
1114
}
1215

16+
// 使用 layout API 定义文件路径
17+
def neotaiyitistProjectDir = rootProject.layout.projectDirectory.dir("projects/neotaiyitist")
18+
def installerJarDir = neotaiyitistProjectDir.dir("build/libs")
19+
def installerJarFile = installerJarDir.file("neotaiyitist-${version}-installer.jar")
20+
21+
// 创建一个新的任务 launcherJar
22+
tasks.register('launcherJar', Jar) {
23+
// 设置 jar 文件的分类器,避免与默认 jar 文件名冲突
24+
archiveClassifier = 'launcher'
1325

14-
jar {
26+
// 复制默认 jar 的配置
1527
manifest {
1628
attributes(
1729
"Implementation-Title": project.name,
1830
"Implementation-Version": version,
19-
"Main-Class": "org.taiyitistmc.LauncherMain",
31+
"Main-Class": "org.taiyitistmc.launcher.NeoTaiyitistLauncher",
2032
)
2133
}
22-
// TODO: 将 universal jar 打包进 launcher 内
2334

24-
}
35+
// 包含当前项目编译后的类文件
36+
from sourceSets.main.output
2537

26-
// Wait for neoforge build
27-
tasks.named("build").get().dependsOn(project(":neotaiyitist").tasks.named("build").get())
38+
// 在执行此任务前先执行 neotaiyitist 项目的 installerJar 任务
39+
dependsOn project(':neotaiyitist').tasks.named('installerJar')
40+
41+
// 将 installer jar 添加到 resources 中,使其被打包进最终的 jar
42+
from(installerJarFile.asFile) {
43+
// 可以指定在 jar 中的路径
44+
into('META-INF/installer')
45+
}
46+
}

patches/net/minecraft/client/renderer/GameRenderer.java.patch

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,25 @@
5252
RenderSystem.applyModelViewMatrix();
5353
Lighting.setupFor3DItems();
5454
GuiGraphics guigraphics = new GuiGraphics(this.minecraft, this.renderBuffers.bufferSource());
55-
@@ -1070,7 +_,8 @@
55+
@@ -1070,8 +_,8 @@
5656

5757
if (this.minecraft.getOverlay() != null) {
5858
try {
5959
- this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
60+
- } catch (Throwable throwable2) {
6061
+ // Neo: Fix https://bugs.mojang.com/browse/MC-273464
61-
+ this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getGameTimeDeltaPartialTick(false));
62-
} catch (Throwable throwable2) {
62+
+ this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getGameTimeDeltaTicks()); } catch (Throwable throwable2) {
6363
CrashReport crashreport = CrashReport.forThrowable(throwable2, "Rendering overlay");
6464
CrashReportCategory crashreportcategory = crashreport.addCategory("Overlay render details");
65+
crashreportcategory.setDetail("Overlay name", () -> this.minecraft.getOverlay().getClass().getCanonicalName());
6566
@@ -1079,7 +_,9 @@
6667
}
6768
} else if (flag && this.minecraft.screen != null) {
6869
try {
6970
- this.minecraft.screen.renderWithTooltip(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
7071
+ // Neo: Wrap Screen#render to allow for GUI Layers and ScreenEvent.Render.[Pre/Post]
7172
+ // Also fixes https://bugs.mojang.com/browse/MC-273464
72-
+ net.neoforged.neoforge.client.ClientHooks.drawScreen(this.minecraft.screen, guigraphics, i, j, p_348648_.getGameTimeDeltaPartialTick(false));
73+
+ net.neoforged.neoforge.client.ClientHooks.drawScreen(this.minecraft.screen, guigraphics, i, j, p_348648_.getGameTimeDeltaTicks());
7374
} catch (Throwable throwable1) {
7475
CrashReport crashreport1 = CrashReport.forThrowable(throwable1, "Rendering screen");
7576
CrashReportCategory crashreportcategory1 = crashreport1.addCategory("Screen render details");

0 commit comments

Comments
 (0)