-
Notifications
You must be signed in to change notification settings - Fork 0
/
bukkit.sh
54 lines (40 loc) · 1.24 KB
/
bukkit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# clone NMS
echo "[Build] Cloning NMS"
if [ ! -d "NMSClasses" ]; then
git clone git@github.com:speedcubing-top/NMSClasses.git
else
echo "NMSClasses folder exists, skipped."
fi
# clone bukkit
echo "[Build] Cloning Bukkit"
if [ ! -d "Bukkit" ]; then
git clone https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
mv bukkit Bukkit
cd Bukkit
git reset --hard 01d1820664a5f881665b84b28871dadd132deaef
cd ../
else
echo "Bukkit folder exists, skipped."
fi
# clone craftbukkit
echo "[Build] Cloning CraftBukkit"
if [ ! -d "CraftBukkit" ]; then
git clone -b version/1.8.8 --single-branch https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
mv craftbukkit CraftBukkit
# apply craftbukkit -> nms patches
echo "[Build] Applying CraftBukkit->NMS Patches"
cd CraftBukkit
mkdir -p src/main/java/net/minecraft/server
for patch in nms-patches/*.patch; do
base_name=$(basename "$patch" .patch)
cp ../NMSClasses/net/minecraft/server/$base_name.java src/main/java/net/minecraft/server/$base_name.java
echo "[CraftBukkit->NMS] Applying $base_name.patch"
cd src/main/java
git apply --whitespace=nowarn ../../../$patch
cd ../../../
done
cd ../
else
echo "CraftBukkit folder exists, skipped."
fi