8000 Fixed minecraft vanilla download URL and added support for Paper MC by dpakman · Pull Request #187 · Ahtenus/minecraft-init · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed minecraft vanilla download URL and added support for Paper MC #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions config.dpexample
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/bin/bash
#
# Settings file for minecraft-init
# ================================
#
# Make a copy of this file named config
# and edit the variables to your needs.
#

# Name of vanilla server jar (no need to change if you're running craftbukkit and vice versa)
MC_JAR="server.jar"

# Name of craftbukkit jar
CB_JAR="craftbukkit.jar"

#Name of paper jar
PAPER_JAR="paper.jar&q 10000 uot;

# Define the release of CraftBukkit to use (stable or unstable)
CB_RELEASE="stable"

# Name of server.jar to use (either $MC_JAR, $CB_JAR, $PAPER_JAR)
SERVICE=$PAPER_JAR

# Name to use for the screen instance
SCREEN="minecraftserver"

# User that should run the server
USERNAME="minecraft"

# Path to minecraft server directory
MCPATH="/home/${USERNAME}/minecraft19"

# Path to server log file ($MCPATH/server.log on older versions)
SERVERLOG="${MCPATH}/logs/latest.log"

# Where the worlds are located on the disk. Can not be the same as MCPATH.
# You need to move your worlds to this directory manually, the script
# will then handle the nessessay symlinks.
WORLDSTORAGE="${MCPATH}/worlds"

# Number of CPUs/cores to use
CPU_COUNT=6

OPTIONS="nogui"

# Initial memory usage
INITMEM="8192M"

# Maximum amount of memory to use
# Remember: give the ramdisk enough space, subtract from the total amount
# of RAM available the size of your map and the RAM-consumption of your base system.
MAXMEM="10240M"

# Whether to output commands for the plugin ConsoleLikeChat ($1 is the command to run)
FORMAT='$1'

# Settings for backups
# ===============================

# Location for world backups
BACKUPPATH="/home/${USERNAME}/mcbackup/worlds"

# Where the whole minecraft directory is copied when whole-backup is executed
# whole-backup is a complete uncompressed backup of the whole server folder.
WHOLEBACKUP="/home/${USERNAME}/mcbackup/server"

# Format for world backup (tar or zip).
BACKUPFORMAT="tar"

# Normally backups will be put in a subfolder to $BACKUPPATH with todays date
# and the backups themselves will have a timestamp.

# But if BACKUPSCRIPTCOMPATIBLE is set the world backups will be put directly
# in $BACKUPPATH without timestamp to be compatible with
# [backup rotation script](https://github.com/adamfeuer/rotate-backups)
#
#BACKUPSCRIPTCOMPATIBLE=YES

# If WORLDEDITCOMPATIBLE is set the world backups will be created compatible to WorldEdit
# in $BACKUPPATH as WORLD_NAME/DATE.(tar.bz2|zip) with the requested directory structure
#
# WORLDEDITCOMPATIBLE=YES

# Compress the whole backup with bzip2?
# Note that this may not save a lot of disk space since there can be a lot of files
# in your server directory, that are already compressed, but it can slow down the
# backup a bit. This highly depends on the plugins you're using.
#
# For example: The png files generated by Dynmap are already compressed and still use
# a lot of space in your server directory, so the compression ratio of the compressed
# backup will not be very high.
COMPRESS_WHOLEBACKUP=YES


# Settings for log rolling
# ===============================

# Location for old logs
# Used by the log-roll command
LOGPATH="/home/${USERNAME}/mcbackup/logs"

# Whether or not to gzip logs (must be commented out for no - DO NOT CHANGE TO NO)
#
GZIPLOGS=YES

# What to append to the logfile name (Leave blank for nothing)
LOGFILEAPPEND="logfile_"


# Settings for overviewer command
# ===============================

# Where the Map is generated
OUTPUTMAP="/home/${USERNAME}/mc-overviewer/render"

# Path to Minecraft-Overviewer
OVPATH="/home/${USERNAME}/mc-overviewer/Minecraft-Overviewer"

# Path for the config file of Overviewer
OVCONFIGPATH="/home/${USERNAME}/mc-overviewer"

# Name of Overviewer config file
OVCONFIGNAME="config.py"

# Path for backup worlds
OVBACKUP="/home/${USERNAME}/mc-overviewer/overviewerbackups"

# Things to leave alone ;)
# =====================

#INVOCATION="java -Xmx$MAXMEM -Xms$INITMEM -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE nogui"

INVOCATION="java -Xmx$MAXMEM -Xms$INITMEM \
-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 \
-XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 \
-XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch \
-XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs \
-Djline.terminal=jline.UnsupportedTerminal -jar $SERVICE $OPTIONS"


# Path to the the mounted ramdisk (the default will work in most senarios).
RAMDISK="/dev/shm"
7 changes: 5 additions & 2 deletions config.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ CB_JAR="craftbukkit.jar"
# Define the release of CraftBukkit to use (stable or unstable)
CB_RELEASE="stable"

# Name of server.jar to use (either $MC_JAR or $CB_JAR)
SERVICE=$CB_JAR
#Name of paper jar
PAPER_JAR="paper.jar"

# Name of server.jar to use (either $MC_JAR, $CB_JAR or $PAPER_JAR)
SERVICE=$PAPER_JAR

# Name to use for the screen instance
SCREEN="server_screen"
Expand Down
35 changes: 34 additions & 1 deletion minecraft
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ to_disk() {
}

check_update_vanilla() {
MC_SERVER_URL=`wget -q -O - http://minecraft.net/download | grep minecraft_server.jar\ | cut -d \" -f 6`
MC_SERVER_URL=`wget -q -O - https://www.minecraft.net/en-us/download/server/ | grep server.jar | cut -d \" -f 2`

echo "Checking for update for minecraft_server.jar (Vanilla)"
as_user "cd $MCPATH && wget -q -O $MCPATH/minecraft_server.jar.update $MC_SERVER_URL"
Expand Down Expand Up @@ -480,6 +480,25 @@ check_update_craftbukkit() {
fi
}

check_update_paper() {
echo "Checking for update for paper.jar"

as_user "cd $MCPATH && wget -q -O $MCPATH/paper.jar.update https://papermc.io/api/v1/paper/1.14.3/latest/download"
if [ -r "$MCPATH/paper.jar.update" ]
then
if `diff $MCPATH/$PAPER_JAR $MCPATH/paper.jar.update >/dev/null`
then
echo "You are already running the latest version of paper.jar."
return 1
else
echo "Update of $PAPER_JAR is needed."
return 0
fi
else
echo "Something went wrong. Couldn't download paper.jar"
fi
}

mc_update() {
if is_running
then
Expand Down Expand Up @@ -512,6 +531,20 @@ mc_update() {
echo "Not updating $CB_JAR. It's not necessary"
as_user "rm $MCPATH/craftbukkit.jar.update"
fi

if check_update_paper
then
if [ -r "$MCPATH/paper.jar.update" ]
then
as_user "mv $MCPATH/paper.jar.update $MCPATH/$PAPER_JAR"
echo "Thats it. Update of $PAPER_JAR done."
else
echo "Something went wrong. Couldn't replace your original $PAPER_JAR with paper.jar.update"
fi
else
echo "Not updating $PAPER_JAR. It's not necessary"
as_user "rm $MCPATH/paper.jar.update"
fi
fi
}

Expand Down
0