相關(guān)文檔
使用說明
使用gitbash打開當(dāng)前目錄,輸入java -jar BuildTools.jar --rev 1.8
,這里的1.8可以替換成其它版本搭儒,如1.10,1.10.2等沪悲。
流程一获洲,下載代碼
- 克隆git代碼bukkit 到
bukkit
目錄 - 克隆git代碼craftbukkit 到
craftbukkit
目錄 - 克隆git代碼spigot 到
Spigot
目錄 - 克隆git代碼buildata到
BuildData
目錄 - 下載maven工具
- 從服務(wù)器上查詢命令行中指定的rev對應(yīng)的各代碼庫的分支,如
Attempting to build version: '1.8' use --rev <version> to override
Found version
{
"name": "1.8",
"description": "Backport of fixes from 1.8.3",
"information": "Last build of Spigot 1.8.0. To update please see http://www.spigotmc.org/",
"warning": "***** Please ensure your BuildTools is at least #35 *****",
"refs": {
"BuildData": "0630ea462a82fdbd93018de7d5ec5e9d3b3c732b",
"Bukkit": "1d2509b99fb10b3bd6f597e63805f85b49d5a055",
"CraftBukkit": "7019900e276b7c9f6e940debf8529094c7f4da0c",
"Spigot": "550ebace4b43adc73854d7d5976e1343eba6fb98"
}
}
- 將4個文件夾中的代碼更新到指定標(biāo)簽
目錄說明
BuildData
反編譯工具及反編譯minecraft使用的代碼映射殿如。
CraftBukkit
對minecraft server的魔改贡珊,改善性能,并支持插件等涉馁。
Bukkit
Bukkit是服務(wù)器插件編程接口门岔,封裝不同版本minecraft server的細節(jié),統(tǒng)一接口烤送,便于開發(fā)插件固歪。
Spigot目錄
spigot服務(wù)器是一個改良服務(wù)器,在文件夾里是兩個補丁目錄,CraftBukkit-Patches存放對craftBukkit代碼的補丁牢裳,Bukkit-Patches存放對Bukkit代碼的補丁逢防。
流程二,下載minecraft server并反編譯
- 下載純凈版本minecraft服務(wù)器jar包(此處應(yīng)有梯子)蒲讯。
Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.8, accessTransforms=bukkit-1.8.at, classMappings=bukkit-1.8-cl.csrg, memberMappings=bukkit-1.8-members.csrg, packageMappings=package.srg, minecraftHash=null, decompileCommand=null, serverUrl=null)
Starting download of https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar
如果下載不下來忘朝,也可以迅雷下載后直接放在work目錄中,如果已經(jīng)存在判帮,則會提示:
Found good Minecraft hash (5b19d1a562a8a7c5f9a787ad96c8148b)
Found good Minecraft hash (5b19d1a562a8a7c5f9a787ad96c8148b)
- 反編譯代碼
Final mapped jar: work\mapped.8eb82bde.jar does not exist, creating!
Loading mappings
Loading mappings
1 packages, 0 classes, 0 fields, 0 methods
INFO: merging AccessMap net/minecraft/server/CraftingManager/recipes from AccessChange(clear=16, set=0, vis=1) with AccessChange(clear=0, set=0, vis=1)
INFO: merging AccessMap net/minecraft/server/PropertyManager/properties from AccessChange(clear=0, set=0, vis=1) with AccessChange(clear=0, set=0, vis=1)
INFO: merging AccessMap net/minecraft/server/TileEntityBrewingStand/items from AccessChange(clear=0, set=0, vis=1) with AccessChange(clear=0, set=0, vis=1)
INFO: merging AccessMap net/minecraft/server/WorldServer/tracker from AccessChange(clear=16, set=0, vis=1) with AccessChange(clear=0, set=0, vis=1)
INFO: merging AccessMap net/minecraft/server/WorldManager/world from AccessChange(clear=0, set=0, vis=1) with AccessChange(clear=0, set=0, vis=1)
Remapping final jar
- 將minecraft-server的class文件釋放到work目錄下的
decompile-xxxxxxxx
目錄的classes
子目錄局嘁。 - 根據(jù)map文件,將釋放的class文件晦墙,反編譯到work目錄下的
decompile-xxxxxxxx
中悦昵。 - 將生成的java文件,編譯并生成minecraft-server-1.8-SNAPSHOT.jar到mvn的代碼倉庫目錄
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing D:\mc\spigotmc_build\work\mapped.8eb82bde.jar to D:\repo\repository\org\spigotmc\minecraft-server\1.8-SNAPSHOT\minecraft-server-1.8-SNAPSHOT.jar
[INFO] Installing C:\Users\terry\AppData\Local\Temp\mvninstall1056450265315348368.pom to D:\repo\repository\org\spigotmc\minecraft-server\1.8-SNAPSHOT\minecraft-server-1.8-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
extract ....*.class
Decomiling ***.java
Applying CraftBukkit Patches
- 應(yīng)用代碼補丁
Applying CraftBukkit Patches
Patching with BiomeDecorator.patch
Patching with BiomeTheEndDecorator.patch
- 并各種文件夾合并,將Bukkit和CraftBukkit的代碼都checkout一份到Spigot目錄晌畅。
流程三但指,編譯代碼
- 編譯Bukkit和CraftBukkit,并且都輸出到Maven本地倉庫。
- 將Bukkit和CraftBukkit的代碼check out到Spigot中的Spigot-API和Spigot-Server抗楔,然后分別打上補丁(Bukkit-Patches和CraftBukkit-Patches)棋凳。
Rebuilding Forked projects....
From file:///D:\mc\spigotmc_build\Bukkit
* [new branch] spigot -> origin/spigot
HEAD is now at 1d2509b Revert finite checks in locations. Fixes SPIGOT-628 and others
Cloning into 'Spigot-API'...
done.
Resetting Spigot-API to Bukkit...
...
HEAD is now at 36052f0 CraftBukkit $ Fri Aug 04 14:37:11 CST 2017
Cloning into 'Spigot-Server'...
done.
Resetting Spigot-Server to CraftBukkit...
- 編譯輸出 craftbukkit-1.8.jar 和 spigot-1.8.jar 等
Success! Everything compiled successfully. Copying final .jar files now.
Copying craftbukkit-1.8-R0.1-SNAPSHOT-remapped.jar to D:\mc\spigotmc_build\.
- Saved as craftbukkit-1.8.jar
Copying craftbukkit-1.8-R0.1-SNAPSHOT.jar to D:\mc\spigotmc_build\.
- Saved as craftbukkit-1.8.jar
Copying spigot-1.8-R0.1-SNAPSHOT-remapped.jar to D:\mc\spigotmc_build\.
- Saved as spigot-1.8.jar
Copying spigot-1.8-R0.1-SNAPSHOT.jar to D:\mc\spigotmc_build\.
- Saved as spigot-1.8.jar