架设Minecraft mod开发环境

栏目: 编程工具 · 发布时间: 6年前

内容简介:说了好几次要去学MC Mod开发,但是最后都咕咕咕了(好吧这次也没准会咕),今天在我内心对未知的强烈渴望的驱动之下,打开了IDEA,开工~好吧,作为一个从未开发过Java项目,或者说,连gradle都没听说过的一只小白来说,刚下载好MDK后,我蒙了,还好官方有详细的文档,我们来看下边这段:全英文!!!没事我看。。。看得懂的。大体上就是下载好MDK并解压,然后移动下面四个文件

说了好几次要去学MC Mod开发,但是最后都咕咕咕了(好吧这次也没准会咕),今天在我内心对未知的强烈渴望的驱动之下,打开了IDEA,开工~

好吧,作为一个从未开发过 Java 项目,或者说,连gradle都没听说过的一只小白来说,刚下载好MDK后,我蒙了,还好官方有详细的文档,我们来看下边这段:

  1. Obtain a source distribution from forge’s files site. (Look for the Mdk file type, or Src in older 1.8/1.7 versions).
  2. Extract the downloaded source distribution to an empty directory. You should see a bunch of files, and an example mod is placed in src/main/java for you to look at. Only a few of these files are strictly necessary for mod development, and you may reuse these files for all your projects These files are:
    build.gradle
    gradlew.bat
    gradlew
    gradle
    
  3. Move the files listed above to a new folder, this will be your mod project folder.
  4. Open up a command prompt in the folder you created in step (3), then run gradlew setupDecompWorkspace . This will download a bunch of artifacts from the internet needed to decompile and build Minecraft and forge. This might take some time, as it will download stuff and then decompile Minecraft. Note that, in general, these things will only need to be downloaded and decompiled once, unless you delete the gradle artifact cache.
  5. Choose your IDE: Forge explicitly supports developing with Eclipse or IntelliJ environments, but any environment, from Netbeans to vi/emacs, can be made to work.
    gradlew eclipse
    
  6. Load your project into your IDE.
    gradlew genIntellijRuns
    

全英文!!!没事我看。。。看得懂的。大体上就是下载好MDK并解压,然后移动下面四个文件

build.gradle
gradlew.bat
gradlew
gradle

到一个新的文件夹中组建你的新项目,然后跑命令行初始化,然后选IDE,然后。。。。

等待,实际上没有那么的复杂。我使用了IDEA,于是从步骤四开始是这样的:

  1. Launch IDEA and choose to open/import the build.gradle file, using the default gradle wrapper choice. While you wait for this process to finish, you can open the gradle panel, which will get filled with the gradle tasks once importing is completed.
  2. Run the setupDecompWorkspace task (inside the forgegradle task group). It will take a few minutes, and use quite a bit of RAM. If it fails, you can add -Xmx3G to the Gradle VM options in IDEA’s gradle settings window, or edit your global gradle properties.
  3. Once the setup task is done, you will want to run the genIntellijRuns task, which will configure the project’s run/debug targets.
  4. After it’s done, you should click the blue refresh icon on the gradle panel (there’s another refresh icon on the main toolbar, but that’s not it). This will re-synchronize the IDEA project with the Gradle data, making sure that all the dependencies and settings are up to date.

打开IDEA,打开你新创建的文件夹中的build.gradle,然后运行几个task(在gradle选项卡中)

setupDecompWorkspace
genIntellijRuns

一切都结束了之后,我们把src文件夹也复制过去,里边有一个示例Mod,然后跑 runClient 就好了~

注:关于调试,只要环境搭好了,直接就可以调试的(逃


以上所述就是小编给大家介绍的《架设Minecraft mod开发环境》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

TCP/IP网络编程

TCP/IP网络编程

[韩] 尹圣雨 / 金国哲 / 人民邮电出版社 / 2014-7 / 79.00元

第一部分主要介绍网络编程基础知识。此部分主要论述Windows和Linux平台网络编程必备基础知识,未过多涉及不同操作系统特性。 第二部分和第三部分与操作系统有关。第二部分主要是Linux相关内容,而第三部分主要是Windows相关内容。从事Windows编程的朋友浏览第二部分内容后,同样可以提高技艺。 第四部分对全书内容进行总结,包含了作者在自身经验基础上总结的学习建议,还介绍了网络......一起来看看 《TCP/IP网络编程》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

SHA 加密
SHA 加密

SHA 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具