Skip to content

Commit 665ca9c

Browse files
authored
Added support for skript resources via SPIGET_RESOURCES (#2764)
1 parent cec8027 commit 665ca9c

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

examples/skript/docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
mc:
3+
image: itzg/minecraft-server
4+
environment:
5+
EULA: true
6+
TYPE: PAPER
7+
PLUGINS: https://github.com/SkriptLang/Skript/releases/download/2.8.4/Skript.jar
8+
SPIGET_RESOURCES: 103749
9+
ports:
10+
- "25565:25565"

scripts/start-spiget

+13-8
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,20 @@ downloadResourceFromSpiget() {
108108
log "ERROR: failed to retrieve file type of resource $resource"
109109
exit 1
110110
fi
111-
if containsPlugin "${outfile}"; then
112-
log "Moving resource ${resource} into plugins"
113-
mv "$outfile" /data/plugins
114-
elif containsJars "${outfile}"; then
115-
log "Extracting contents of resource ${resource} into plugins"
116-
extract "$outfile" /data/plugins
111+
if [[ $fileType = .sk ]]; then
112+
mkdir -p /data/plugins/Skript/scripts
113+
mv "$outfile" /data/plugins/Skript/scripts
117114
else
118-
log "ERROR: file for resource ${resource} has an unexpected file type: ${fileType}"
119-
exit 2
115+
if containsPlugin "${outfile}"; then
116+
log "Moving resource ${resource} into plugins"
117+
mv "$outfile" /data/plugins
118+
elif containsJars "${outfile}"; then
119+
log "Extracting contents of resource ${resource} into plugins"
120+
extract "$outfile" /data/plugins
121+
else
122+
log "ERROR: file for resource ${resource} has an unexpected file type: ${fileType}"
123+
exit 2
124+
fi
120125
fi
121126
rm -rf "$tempDir"
122127
}

0 commit comments

Comments
 (0)