本帖最后由 abRoy 于 2025-1-12 18:37 编辑 4 c" T& n1 g' t. `
) O: x" A' e( x7 I7 f3 l
从mtr4.0.0B8就一直困扰我到现在的问题终于解决了,分享一下防止其他和我相同问题的人踩坑
0 f# ]8 v! p" x+ k; F) h/ S3 s; p/ S* |0 p
6 Q. n2 }- f) t; c0 `
原mc(1.20.1)在3.2.2版本的mtr下运行一切正常。升级到4.0.0B13后概率出现部分车站/线路的铁轨,站台门不可见的情况,但是又有一些车站是完全正常的。所有的列车都不可见。4 s3 k2 a4 @6 [( T H( O$ l! Y4 M
' |3 s. z4 d/ K- G' v) {3 E0 k
0 R- d; L% w! E6 n9 ]& {↑这里应该有张图片但是我不知道插入成功没有 看不到
4 m- Y9 i9 Z- r) s% v$ }0 r$ m
! c! Q$ `7 i( `; W3 I/ i% M
# K# h0 M; h, s# q) A8 C% V原本以为是mtr的问题但是等了很久都没有修复,遂自己看一下日志,发现以下报错频繁出现+ S# O$ T: k; f: b) w; i
- [121��2025 16:54:18.818] [Render thread/ERROR] [MinecraftMappings/]:
: [, s# s' ^% W7 G6 Q3 R - java.lang.ClassCastException: class org.mtr.mapping.render.vertex.CapturingVertexConsumer cannot be cast to class me.jellysquid.mods.sodium.client.render.vertex.VertexBufferWriter (org.mtr.mapping.render.vertex.CapturingVertexConsumer is in module mtr@4.0.0-beta.13 of loader 'TRANSFORMER' @62c46e53; me.jellysquid.mods.sodium.client.render.vertex.VertexBufferWriter is in module rubidium@0.6.5 of loader 'TRANSFORMER' @62c46e53)
' C8 K) W$ d! Q( S" ?! v U1 C - at me.jellysquid.mods.sodium.client.render.vertex.VertexBufferWriter.of(VertexBufferWriter.java:8) ~[%5B�%5D%20rubidium-0.6.5.jar%23246!/:?]. w* H* Y3 Y+ l
- at net.minecraft.client.model.geom.ModelPart.m_104290_(ModelPart.java:563) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]% y) [6 W z( V/ T
- at net.minecraft.client.model.geom.ModelPart.m_104306_(ModelPart.java:124) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]) @( }4 s; a# x$ r3 |
- at net.minecraft.client.model.geom.ModelPart.m_104301_(ModelPart.java:109) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]7 g' q7 ~" ~' g9 I' m( y
- at org.mtr.mapping.mapper.OptimizedModel$MaterialGroup.lambda$addCube$0(OptimizedModel.java:99) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]- ? ]1 f# F/ `) p4 s
- at org.mtr.mapping.mapper.OptimizedModel.lambda$fromMaterialGroups$0(OptimizedModel.java:47) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
* m3 l9 V- M8 z. C - at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]3 U2 L* d8 o& P1 W/ z/ l, E
- at org.mtr.mapping.mapper.OptimizedModel.lambda$fromMaterialGroups$1(OptimizedModel.java:47) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
2 c/ o# f% Z1 l - at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]! f/ u+ R) _' @" k$ d' L
- at org.mtr.mapping.mapper.OptimizedModel.fromMaterialGroups(OptimizedModel.java:45) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]5 l3 `, X9 \: b2 _* {& u8 ^6 d
- at org.mtr.mod.resource.OptimizedModelWrapper.fromMaterialGroups(OptimizedModelWrapper.java:20) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
. O- h' Z8 n. b" i; D - at org.mtr.mod.resource.ModelPropertiesPart.writeCache(ModelPropertiesPart.java:135) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]2 X0 C+ \# y/ s; `3 {0 D
- at org.mtr.mod.render.DynamicVehicleModel.lambda$new$3(DynamicVehicleModel.java:68) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]. A3 \7 {4 X4 ?& t! K* V) E; d
- at org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectArrayList.forEach(ObjectArrayList.java:749) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]& j( w9 J3 f9 Z7 l7 s
- at org.mtr.mod.resource.ModelProperties.iterateParts(ModelProperties.java:135) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]2 c% c3 u* P: Z( ?# w9 O) l1 g
- at org.mtr.mod.render.DynamicVehicleModel.<init>(DynamicVehicleModel.java:68) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
# Z' j& l( b2 Q4 ~ G7 i, u; q - at org.mtr.mod.resource.VehicleModel.createModel(VehicleModel.java:121) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
8 {8 k: y K$ y r, E - at org.mtr.mod.resource.VehicleModel.lambda$new$0(VehicleModel.java:30) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
. x8 O4 k, a6 N5 c& ?. r - at org.mtr.mod.resource.CachedResource.getData(CachedResource.java:31) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?], Q* H) u' \0 R& z: y
- at org.mtr.mod.resource.VehicleResource.lambda$forEachNonNull$20(VehicleResource.java:503) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
7 O- B7 G' W+ x1 X' `: F. a: ?6 S - at org.mtr.libraries.it.unimi.dsi.fastutil.objects.ObjectArrayList.forEach(ObjectArrayList.java:749) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]* D8 ~' {( c( u( o% T
- at org.mtr.mod.resource.VehicleResource.forEachNonNull(VehicleResource.java:502) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]# Q; B: s' t p( e- D
- at org.mtr.mod.resource.VehicleResource.lambda$cachedVehicleResourceInitializer$15(VehicleResource.java:390) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]6 [8 A$ v+ [( x' N$ s
- at org.mtr.mod.resource.CachedResource.getData(CachedResource.java:31) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]9 w# H" D( q9 v( h+ c
- at org.mtr.mod.resource.VehicleResource.queueBogie(VehicleResource.java:206) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
5 @# p# M, w* s, y - at org.mtr.mod.render.RenderVehicles.lambda$render$3(RenderVehicles.java:81) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
4 a% L$ z, h4 G: w, V9 Z$ P9 ^5 h - at org.mtr.mod.render.RenderVehicleHelper.renderModel(RenderVehicleHelper.java:92) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
& ]& k$ E. y& x( @1 @7 @- q; @ - at org.mtr.mod.render.RenderVehicles.lambda$render$6(RenderVehicles.java:81) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
0 ^2 _# M* q* l) f/ x - at org.mtr.mod.render.RenderVehicles.iterateWithIndex(RenderVehicles.java:330) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
4 C. Y6 k! o& x$ l+ d W: a g - at org.mtr.mod.render.RenderVehicles.lambda$render$12(RenderVehicles.java:78) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]/ A8 V2 R; N6 a' `7 i8 L
- at org.mtr.mod.client.CustomResourceLoader.getVehicleById(CustomResourceLoader.java:161) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]1 f# U6 L4 O0 R) K' b
- at org.mtr.mod.render.RenderVehicles.lambda$render$13(RenderVehicles.java:72) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
3 @. L$ s: P& y7 e- P - at org.mtr.mod.render.RenderVehicles.iterateWithIndex(RenderVehicles.java:330) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
1 _+ i; a# t6 R. _8 H* T - at org.mtr.mod.render.RenderVehicles.lambda$render$14(RenderVehicles.java:53) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
& j1 H1 V% y: ?- p+ E - at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
& z9 _9 _* k- v: w2 E( Z. U - at org.mtr.mod.render.RenderVehicles.render(RenderVehicles.java:42) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]0 ?$ S3 S8 e: ~7 b$ E
- at org.mtr.mod.render.MainRenderer.render(MainRenderer.java:102) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
: w% e) [8 S% B ^; ^ - at org.mtr.mod.render.MainRenderer.render(MainRenderer.java:60) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]. C2 H5 n! h4 M
- at org.mtr.mod.render.MainRenderer.render(MainRenderer.java:26) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
' L5 P6 m5 Z. j# b9 J7 b- U. W - at org.mtr.mapping.mapper.EntityRenderer.lambda$render$0(EntityRenderer.java:21) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]6 y: i1 q- F3 D0 P* b4 @
- at org.mtr.mapping.mapper.GraphicsHolder.createInstanceSafe(GraphicsHolder.java:50) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
P2 [$ X6 [5 ]( Z" e9 Y( i - at org.mtr.mapping.mapper.GraphicsHolder.createInstanceSafe(GraphicsHolder.java:40) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]
( _$ I' Y |) x% {% u - at org.mtr.mapping.mapper.EntityRenderer.render(EntityRenderer.java:21) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]' k. i" T3 h6 d7 Q
- at org.mtr.mapping.mapper.EntityRenderer.m_7392_(EntityRenderer.java:11) ~[MTR-forge-4.0.0-beta.13+1.20.1.jar%23287!/:?]2 ^' K; b% J8 t4 Q1 m: l7 `* v5 V
- at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:140) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?] L! f; U) ?+ o: ]/ f$ S
- at net.minecraft.client.renderer.LevelRenderer.m_109517_(LevelRenderer.java:1440) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
+ A' D# _& T; K( Q" {! S& Q% P - at net.minecraft.client.renderer.LevelRenderer.invokeRenderEntity(LevelRenderer.java) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]9 Q- |7 U. V. \0 \6 n$ M% Z
- at net.coderbot.iris.pipeline.ShadowRenderer.renderEntities(ShadowRenderer.java:606) ~[oculus-mc1.20-1.6.4.jar%23288!/:?]
2 l) d \+ a$ {4 M' I0 E3 l9 P5 G - at net.coderbot.iris.pipeline.ShadowRenderer.renderShadows(ShadowRenderer.java:483) ~[oculus-mc1.20-1.6.4.jar%23288!/:?]& M- Z* O" ]7 K/ x& P; c( f
- at net.coderbot.iris.pipeline.newshader.NewWorldRenderingPipeline.renderShadows(NewWorldRenderingPipeline.java:1033) ~[oculus-mc1.20-1.6.4.jar%23288!/:?]3 q6 T @& R0 f' }
- at net.minecraft.client.renderer.LevelRenderer.handler$zob000$iris$renderTerrainShadows(LevelRenderer.java:11680) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
( a* N8 o& J! X - at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1155) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
( n% B* D0 @1 x# t- x5 l- _. q - at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1126) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]# n0 C8 ]) n& p+ G. Z' U
- at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:909) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
' j8 r1 ]: D4 S8 n& J - at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1146) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
7 F3 p3 h( \$ Y3 q: h - at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23300!/:?]
' n6 H" \" }5 o1 m% E( }6 p - at net.minecraft.client.main.Main.main(Main.java:218) ~[Harvista%201.24.jar:?]" L" n* d- x0 @7 I
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
6 C* k8 E A7 A - at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]( ]! U" q3 E V9 n* \# Z
- at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]( b3 ]1 a8 N/ [; \: C1 O! o2 u
- at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
, b6 t% C% H. E0 L3 l - at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.1.30.jar:?]
! S9 g5 [+ _8 o - at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.1.30.jar:?]9 l7 L8 v3 u* i
- at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25) ~[fmlloader-1.20.1-47.1.30.jar:?]8 }4 C) \; x7 A/ u
- at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?]
[0 p) _. R8 V! d! n, ? - at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?]8 W! N. h+ A6 @6 p5 v U& W, \9 o
- at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?]! m6 c' ]: q9 Q% u
- at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?]
; F+ m4 c2 L3 e; r3 k/ A - at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?]
8 @) U" F0 e( w# `; d - at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?]
2 D. w, q; p0 D4 o" K7 P1 |! v - at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?]
6 ], Q% D6 p/ \/ Q3 A( g/ q: X - at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]2 z' a( q. e r
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]* f* Y c* w9 W# g
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]9 {$ d. r6 g5 O9 Y8 m
- at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
+ \" R6 t) M2 _ - at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
- @0 |) Y. N0 j, y( ~ - at oolloo.jlw.Wrapper.invokeMain(Wrapper.java:112) ~[?:?]9 p6 w2 B2 k7 g$ J9 x, _. g
- at oolloo.jlw.Wrapper.main(Wrapper.java:105) ~[?:?]
复制代码 简单说就是MTR尝试将一个 CapturingVertexConsumer 对象强制转换为Rubidium的类 VertexBufferWriter,但这两个类不兼容。4 j! ~( H3 ]. f7 ]0 x0 j
7 ]1 ^1 G; o( S [Rubidium和oculus这两个模组是整合包原有的,支持性能优化和光影的模组。但是Rubidium自 2023 年12月起已经停止更新,不再维护。
1 a+ q! V' T# ]7 ~1 }4 M4 {经过研究,我将 Rubidium 替换为 Embeddium 。Embeddium是 Rubidium 的非官方分支,仍在活跃维护中,并包含更多兼容性补丁和新功能。! P. r+ A3 L1 v( W% a1 D
当 Embeddium 配合 oculus使用时,所有功能都可以正常运行,且日志中未出现任何报错。" w9 C( k' a1 {1 D% Z) @0 \% l) ]* x
( t4 j0 `4 f2 H3 H$ v, G2 q
此问题也已提交至mtr的GitHub(https://github.com/Minecraft-Tra ... Railway/issues/1028) ,考虑到Rubidium已经停止维护,mtr是否可以主动兼容Rubidium?
7 E* s& t9 e: |% S8 g4 ~ |