-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatapack
executable file
·48 lines (43 loc) · 1.1 KB
/
datapack
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
#!/bin/bash
setup_dirs(){
echo -n "$1: "
read minecraft
echo -n "$2: "
read world
echo -n "$3: "
read name
echo "" > config
echo "minecraft=$minecraft" >> config
echo "world=$world" >> config
echo "name=$name" >> config
}
setup(){
echo -n "select language [en/ru]: "
read lang
if [[ "$lang" == "ru" ]]; then
setup_dirs "укажите путь до minecraft'а без ковычек (например /home/kirbo/.minecraft)" "укажите название мира для теста" "Укажите название датапака"
elif [[ "$lang" == "en" ]]; then
setup_dirs "enter minecraft directory without quotes (e.g. /home/kirbo/.minecraft)" "enter test world name" "enter datapack name"
else
echo "wrong input"
fi
}
build(){
dp=$minecraft/saves/$world/datapacks/$name
rp=$minecraft/resourcepacks/$name
rm -r $dp
rm -r $rp
cp -avr dp $dp
cp -avr rp $rp
}
if [ ! -e config ]
then
touch config
chmod +x config
setup
else
source config
fi
if [[ "$1" == "build" ]]; then
build
fi