Skip to content

Instantly share code, notes, and snippets.

@dashaw92
Last active June 11, 2020 06:06
Show Gist options
  • Save dashaw92/9656d0d8165877bfd6b25d5f8d56bc64 to your computer and use it in GitHub Desktop.
Save dashaw92/9656d0d8165877bfd6b25d5f8d56bc64 to your computer and use it in GitHub Desktop.
Paper + Kotlin server loader script (batch and bash)
:: This version is for 1.8.8
:: If you're using a modern version of paper, use the other scripts
:: Changes:
:: patched_%mc_ver%.jar -> patched.jar
:: paper main class changed to com.destroystokyo.paperclip.Paperclip
@echo off
setlocal enabledelayedexpansion
:: Paper + Kotlin loader by Danny
:::::::: Configure me ::::::::
set mc_ver=1.8.8
set paper_jar=paper.jar
set kotlin_jar=kotlin-stdlib.jar
set jvm_args=-Xms3G -Xmx5G -Xverify:none
::::::::::::::::::::::::::::::
::::::: Don't touch me :::::::
set cb_jar=cache/patched.jar
set paper_main=com.destroystokyo.paperclip.Paperclip
set classpath=%cb_jar%;%paper_jar%;%kotlin_jar%
::::::::::::::::::::::::::::::
:: Error checking (don't touch)
call :checkFile %paper_jar% Paper
if /I "%ERRORLEVEL%" neq "0" exit /B 1
call :checkFile %kotlin_jar% Kotlin
if /I "%ERRORLEVEL%" neq "0" exit /B 1
call :checkFile %cb_jar% Spigot
if /I "%ERRORLEVEL%" neq "0" exit /B 1
echo Starting Paper %mc_ver% with Kotlin
java %jvm_args% -cp %classpath% %paper_main% nogui
exit /B 0
:: Check if a file exists
:: %~1 = path to file
:: %~2 = display name for easier reading
:checkFile
if not exist %~1 (
echo Missing %~2 jar ^(set to %~1^)
echo Please fix this by adjusting the variable in this script
exit /B 1
)
exit /B
@echo off
setlocal enabledelayedexpansion
:: Paper + Kotlin loader by Danny
:::::::: Configure me ::::::::
set mc_ver=1.15.2
set paper_jar=paper.jar
set kotlin_jar=kotlin-stdlib.jar
set jvm_args=-Xms3G -Xmx5G -Xverify:none
::::::::::::::::::::::::::::::
::::::: Don't touch me :::::::
set cb_jar=cache/patched_%mc_ver%.jar
set paper_main=io.papermc.paperclip.Paperclip
set classpath=%cb_jar%;%paper_jar%;%kotlin_jar%
::::::::::::::::::::::::::::::
:: Error checking (don't touch)
call :checkFile %paper_jar% Paper
if /I "%ERRORLEVEL%" neq "0" exit /B 1
call :checkFile %kotlin_jar% Kotlin
if /I "%ERRORLEVEL%" neq "0" exit /B 1
call :checkFile %cb_jar% Spigot
if /I "%ERRORLEVEL%" neq "0" exit /B 1
echo Starting Paper %mc_ver% with Kotlin
java %jvm_args% -cp %classpath% %paper_main% nogui
exit /B 0
:: Check if a file exists
:: %~1 = path to file
:: %~2 = display name for easier reading
:checkFile
if not exist %~1 (
echo Missing %~2 jar ^(set to %~1^)
echo Please fix this by adjusting the variable in this script
exit /B 1
)
exit /B
#!/bin/bash
#Paper + Kotlin loader by Danny
#### Configure me: ####
mc_ver="1.15.2"
paper_jar="paper.jar"
kotlin_jar="kotlin-stdlib.jar"
jvm_args="-Xms3G -Xmx5G -Xverify:none"
#### Put variables here ####
#### Don't touch these unless you NEED to ####
cb_jar="cache/patched_${mc_ver}.jar"
paper_main="io.papermc.paperclip.Paperclip"
classpath="${cb_jar}:${paper_jar}:${kotlin_jar}"
##############################################
#Error checking (don't touch)
#checks if the jar exists
# $1 = path to file
# $2 = display name for easier reading
function checkFile {
if [ ! -f "${1}" ]; then
echo -e "\033[31mMissing ${2} jar (set to \033[00m${1}\033[31m)"
echo -e "Please fix this by adjusting the variable in \033[00m${0}"
exit 1
fi
}
checkFile ${paper_jar} "Paper"
checkFile ${kotlin_jar} "Kotlin Standard Library"
checkFile ${cb_jar} "Patched spigot"
#Start the server:
echo -e "\033[32mStarting Paper \033[33m${mc_ver}\033[32m with \033[35mKotlin\033[00m"
java ${jvm_args} -cp ${classpath} ${paper_main} nogui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment