简体   繁体   English

Minecraft Forge Mod使gradlew构建不起作用

[英]Minecraft Forge mod making gradlew build not working

When I run the command "gradlew build" in my mods folder it returns "BUILD SUCCESSFUL" and when i open the folder build/libs i get two files one NAME-VER.jar and one NAME-VER--sources.jar so i copied NAME-VER.jar into my minecraft mod folder and the game starts okay but in minecraft all i get is "mercuries_updater" could it be to do with build.gradle file? 当我在mods文件夹中运行命令“ gradlew build”时,它返回“ BUILD SUCCESSFUL”,而当我打开build / libs文件夹时,我得到两个文件,一个是NAME-VER.jar,另一个是NAME-VER--sources.jar,所以我将NAME-VER.jar复制到我的Minecraft Mod文件夹中,然后游戏开始正常,但是在Minecraft中,我得到的只是“ mercuries_updater”,可能与build.gradle文件有关吗? Info: Windows10, eclipse ide, Minecraft 1.11.2, ForgeGradle 2.2-SNAPSHOT-d13a6c8 信息:Windows10,eclipse ide,Minecraft 1.11.2,ForgeGradle 2.2-SNAPSHOT-d13a6c8

A couple of things: 有两件事:

  1. You must build using gradlew build , Eclipse doesn't know about the reobfuscation task and as such, anything that Eclipse compiles (without using Gradle) will fail. 您必须使用gradlew build ,Eclipse不了解重新混淆任务,因此,Eclipse编译(不使用Gradle)进行的任何操作都会失败。

  2. The two output files in your build/libs folder are: build / libs文件夹中的两个输出文件是:

    1. The compiled jar file (your mod that you will distribute). 编译的jar文件(您将分发的mod)。
    2. The source files jar, which you do not need to do anything with. 源文件 jar,您无需执行任何操作。 This file will not run correctly when put in the Minecraft mods folder. 放入Minecraft mods文件夹后,该文件将无法正确运行。

I am not sure why your mod is not showing up properly when you add the jar file to the mods folder, I would need to see the Forge log from that attempt. 我不确定将jar文件添加到mods文件夹时,为什么您的mod无法正确显示,我需要查看该尝试的Forge日志。

通过将源文件夹移动到src/main/javasrc/main/resources修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM