架设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开发环境》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

决战618:探秘京东技术取胜之道

决战618:探秘京东技术取胜之道

京东集团618作战指挥中心 / 电子工业出版社 / 2017-11 / 99

《决战618:探秘京东技术取胜之道》以京东技术团队备战618为主线,集合京东数百位技术专家,对京东所有和618相关的关键技术系统进行了一次全面的梳理和总结,是京东技术体系的智慧结晶。 《决战618:探秘京东技术取胜之道》从前端的网站、移动入口到后端的结算、履约、物流、供应链等体系,系统展示了京东最新的技术成就。同时,也涵盖了京东正在充分运用大数据、人工智能等先进技术对所有技术体系架构进行整体......一起来看看 《决战618:探秘京东技术取胜之道》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换