Small_Miao
本帖最后由 Small_Miao 于 2022-6-19 21:22 编辑

Farbic 环境配置
配置完毕后 测试时启动游戏时 FarbicLoader抛出错误求解补充 当Gradlew 执行remapping sources 时出现
:remapping sources
Status ERROR: org.eclipse.jdt.core code=4 Could not retrieve declared methods org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(324) The type net.minecraft.class_2960 cannot be resolved. It is indirectly referenced from required .class files
Could not remap fabric-content-registries-v0-3.1.0+4a3ec384a9-sources.jar fully!
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

错误
下面是DEBUG启动错误
net.fabricmc.loader.impl.FormattedException: java.lang.NoSuchMethodError: 'net.minecraft.util.Identifier net.minecraft.util.registry.RegistryKey.method_29177()'
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462) ~[fabric-loader-0.14.6.jar:?]
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.6.jar:?]
        at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.6.jar:?]
        at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.util.Identifier net.minecraft.util.registry.RegistryKey.method_29177()'
        at net.minecraft.util.registry.SimpleRegistry.handler$zdl000$setPre(SimpleRegistry.java:651) ~[[email protected]:?]
        at net.minecraft.util.registry.SimpleRegistry.set(SimpleRegistry.java) ~[[email protected]:?]
        at net.minecraft.util.registry.SimpleRegistry.set(SimpleRegistry.java:88) ~[[email protected]:?]
        at net.minecraft.util.registry.SimpleRegistry.add(SimpleRegistry.java:128) ~[[email protected]:?]
        at net.minecraft.util.registry.Registry.create(Registry.java:365) ~[[email protected]:?]
        at net.minecraft.util.registry.Registry.create(Registry.java:359) ~[[email protected]:?]
        at net.minecraft.util.registry.Registry.create(Registry.java:343) ~[[email protected]:?]
        at net.minecraft.util.registry.Registry.<clinit>(Registry.java:207) ~[[email protected]:?]
        at net.minecraft.Bootstrap.initialize(Bootstrap.java:50) ~[[email protected]:?]
        at net.minecraft.client.main.Main.main(Main.java:148) ~[[email protected]:?]
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:460) ~[fabric-loader-0.14.6.jar:?]
        ... 3 more




aiusyudiyab
什么叫 fabric 环境,你是在 eclipse 里? fabric-example-mod 还是?
(其实现在用idea的人更多)

Small_Miao
aiusyudiyab 发表于 2022-6-19 21:25
什么叫 fabric 环境,你是在 eclipse 里? fabric-example-mod 还是?
(其实现在用idea的人更多) ...

使用的IDEA 后面用了VSCODE 两个都是1.19配置出现问题

Small_Miao
aiusyudiyab 发表于 2022-6-19 21:25
什么叫 fabric 环境,你是在 eclipse 里? fabric-example-mod 还是?
(其实现在用idea的人更多) ...

现在切换到了 1.18.1 的话 就直接游戏找不到class 我也不知道要怎么解决好了

aiusyudiyab
本帖最后由 aiusyudiyab 于 2022-6-19 22:18 编辑
Small_Miao 发表于 2022-6-19 21:37
使用的IDEA 后面用了VSCODE 两个都是1.19配置出现问题

那写java,特别mc,必然无脑idea,还有mc插件
eclipse也就算了,还算能用,vscode就是个编辑器,用他写java恐怕像样的补全都没有,这怎么用,你写一个mod的时间人家都写了10个了,效率太低


aiusyudiyab
Small_Miao 发表于 2022-6-19 21:38
现在切换到了 1.18.1 的话 就直接游戏找不到class 我也不知道要怎么解决好了
...

你的提问让人摸不着头脑,啥都不说,我也不知道你干了什么,怎么解决呢

Small_Miao
aiusyudiyab 发表于 2022-6-19 22:17
你的提问让人摸不着头脑,啥都不说,我也不知道你干了什么,怎么解决呢 ...

这么说吧 我用IDEA 1.19版本 全部配置完毕后 启动游戏会报错
报错上面我给了
游戏直接crash
我切换到VSCODE 并且转换到1.18版本
启动runClient项目 farbic会提示无法找到MC主类 无法启动

Small_Miao
[22:23:24] [ERROR] [FabricLoader/GameProvider]: Minecraft game provider couldn't locate the game! The game may be absent from the class path, lacks some expected files, suffers from jar corruption or is of an unsupported variety/version.
[22:23:24] [ERROR] [FabricLoader/]: Uncaught exception in thread "main"
java.lang.RuntimeException: Minecraft game provider couldn't locate the game! The game may be absent from the class path, lacks some expected files, suffers from jar corruption or is of an unsupported variety/version.
        at net.fabricmc.loader.impl.launch.knot.Knot.createGameProvider(Knot.java:214)
        at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:130)
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68)
        at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
        at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
1.18.1 启动报错

下一页 最后一页