-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·101 lines (71 loc) · 2.18 KB
/
init.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
basedir=`pwd`
# clone NMS
echo "[Build] Cloning NMS"
if [ ! -d "NMSClasses" ]; then
git clone https://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 Bukkit
cd $basedir/Bukkit
git reset --hard 01d1820664a5f881665b84b28871dadd132deaef
cd $basedir
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 CraftBukkit
cd $basedir/CraftBukkit
git checkout -b master
# apply craftbukkit -> nms patches
echo "[Build] Applying CraftBukkit->NMS Patches"
cd $basedir/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
git branch -D patched
git checkout -B patched
git add src/main/java/net/
git commit -m "CraftBukkit $ $(date)"
git checkout 741a1bdf3db8c4d5237407df2872d9857427bfaf
cd $basedir
else
echo "CraftBukkit folder exists, skipped."
fi
# clone Paper
echo "[Build] Cloning Paper"
if [ ! -d "Paper" ]; then
git clone -b ver/1.8.8 --single-branch https://github.com/PaperMC/Paper.git Paper
cd $basedir/Paper
git checkout -b master
# move submodule
cd $basedir
git clone Bukkit Paper/Bukkit
git clone CraftBukkit Paper/CraftBukkit
cd $basedir/Paper/CraftBukkit
git checkout -b patched origin/patched
# apply patch
cd $basedir/Paper
./newApplyPatches.sh
cd $basedir
else
echo "Paper folder exists, skipped."
fi
if [ ! -d "CubingPaper-API" ]; then
git clone Paper/PaperSpigot-API CubingPaper-API
fi
if [ ! -d "CubingPaper-Server" ]; then
git clone Paper/PaperSpigot-Server CubingPaper-Server
fi