我的世界Minecraft源码分析(6):forge环境配置

发表于2017-09-07
评论0 3.6k浏览
这个系列通过对我的世界Minecraft源码进行拆分讲解,让大家可以清除的了解一款游戏是怎么一步步被实现出来的,下面就介绍Minecraft源码第六篇关于forge环境配置。

OS Windows10 64bit

1.Java 
最好在1.8以上,这里用的jdk-8u71-windows-x64.exe,下载好之后直接双击安装,安装好之后命令行运行
java -version



2.gradle

从官方网站获取最新的zip包 
http://www.gradle.org/ 
2.将其解压并配置环境变量指向gralde目录 如 

%GRADLE_HOME%=E:\yourparh\gradle 

在path中设置bin目录 
%GRADLE_HOME%\bin; 

打开控制台,运行gradle -v ;配置成功 



3.forge mdk

直接去官网下载http://files.minecraftforge.net/

这里下载的稳定版forge-1.8-11.14.4.1563-mdk.zip


终端进入解压后的文件夹

命令行运行 gradlew setupDecompWorkspace
等待...
等待...
等待...


运行完事之后终端会显示 BUILD SUCCESSFUL.
如果爆connection error之类的,就检查下网络,要么用代理。


还有几种配置模式,具体区别如下,不翻译了


Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.


Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.



4.IDE配置
这里分Eclipse党和Intellij党。


Eclipse党
首先当然是下载eclipse,解压好。Version: Mars.1 Release (4.5.1)
继续在刚才的终端运行 gradlew eclipse
等待....
等待...
等待...
BUILD SUCCESSFUL


打开eclipse,workspace定位到forge文件夹下的eclipse文件夹,加载完成后是这样




等右下角的进度条走完,直接RUN->Client
起飞了。



Intellij
还是下载安装啊,ver 15.0.3


继续在刚才的终端运行 gradlew idea
等待....
等待...
等待...
BUILD SUCCESSFUL



打完收工。

如社区发表内容存在侵权行为,您可以点击这里查看侵权投诉指引

标签: