Added arclight and nanolimbo types and Meowice flags (#3485)

This commit is contained in:
kingcavespider1
2025-06-05 14:11:16 -04:00
committed by GitHub
parent f84171dca2
commit 0ad97c257a
19 changed files with 326 additions and 24 deletions

View File

@@ -274,6 +274,10 @@ case "${TYPE^^}" in
exec "${SCRIPTS:-/}start-deployLimbo" "$@"
;;
NANOLIMBO)
exec "${SCRIPTS:-/}start-deployNanoLimbo" "$@"
;;
CRUCIBLE)
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
;;
@@ -282,11 +286,19 @@ case "${TYPE^^}" in
exec "${SCRIPTS:-/}start-deployLeaf" "$@"
;;
ARCLIGHT)
exec "${SCRIPTS:-/}start-deployArcLight" "$@"
;;
POSEIDON)
exec "${SCRIPTS:-/}start-deployPoseidon" "$@"
;;
*)
logError "Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, CRUCIBLE, LEAF, YOUER, BANNER"
logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER"
exit 1
;;

41
scripts/start-deployArcLight Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
set -o pipefail
set -e
isDebugging && set -x
resolveVersion
: "${ARCLIGHT_RELEASE:=latest}"
: "${ARCLIGHT_TYPE:=neoforge}"
arclightReleasesUrl=https://api.github.com/repos/IzzelAliz/Arclight/releases
if [[ ${ARCLIGHT_RELEASE^^} = LATEST ]]; then
arclightReleaseUrl=${arclightReleasesUrl}/latest
else
arclightReleaseUrl=${arclightReleasesUrl}/tags/${ARCLIGHT_RELEASE}
fi
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.*\.jar/)].browser_download_url" \
--accept "application/vnd.github.v3+json" "$arclightReleaseUrl"); then
logError "Failed to access ${ARCLIGHT_RELEASE} release of Arclight"
exit 1
fi
if [[ $downloadUrl = null ]]; then
logError "Failed to locate Arclight jar for $VERSION from ${ARCLIGHT_RELEASE}"
exit 1
fi
log "Downloading Arclight from $downloadUrl"
if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then
logError "Arclight jar from $downloadUrl"
exit 1
fi
export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE="${ARCLIGHT_TYPE,,}"
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -28,5 +28,6 @@ if [ ! -f ${SERVER} ]; then
fi
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -56,5 +56,6 @@ fi
export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -40,5 +40,6 @@ fi
# Allow for overriding Family on custom for testing.
export FAMILY="${FAMILY:-HYBRID}"
export HYBRIDTYPE="${HYBRIDTYPE:-any}"
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -28,5 +28,6 @@ export EXTRA_ARGS
export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -25,5 +25,6 @@ fi
export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -34,5 +34,6 @@ fi
export SERVER
export FAMILY=HYBRID
export HYBRIDTYPE=forge
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -48,7 +48,17 @@ if [ ! -f "${SERVER}" ]; then
get -o "${SERVER}" "${downloadUrl}"
fi
export FAMILY=HYBRID
if [[ "${mohistType}" == "mohist" ]]; then
export HYBRIDTYPE=forge
elif [[ "${mohistType}" == "youer" ]]; then
export HYBRIDTYPE=neoforge
elif [[ "${mohistType}" == "banner" ]]; then
export HYBRIDTYPE=fabric
else
log "Unknown server type"
fi
export SERVER
export FAMILY=HYBRID
exec "${SCRIPTS:-/}start-spiget" "$@"

19
scripts/start-deployNanoLimbo Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x
if ! SERVER=$(mc-image-helper github download-latest-asset \
--output-directory=/data \
--name-pattern="NanoLimbo-.+?(?<!-sources)\.jar" \
Nan1t/NanoLimbo
); then
logError "Failed to download NanoLimbo"
exit 1
fi
export SERVER
export FAMILY=LIMBO
exec ${SCRIPTS:-/}start-setupMounts $@

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
set -o pipefail
set -e
isDebugging && set -x
resolveVersion
if [ "${VERSION}" != "b1.7.3" ]; then
logError "Poseidon server type only supports VERSION=b1.7.3"
exit 1
fi
# : "${POSEIDON_RELEASE:=latest}" placeholder until I figure out how to add version selection with mc-image-helper
: "${POSEIDON_TYPE:=poseidon}"
if [[ ${POSEIDON_TYPE^^} = UBERBUKKIT ]]; then
poseidonRepo="Moresteck/uberbukkit"
else
poseidonRepo="retromcorg/Project-Poseidon"
fi
if ! SERVER=$(mc-image-helper github download-latest-asset \
--output-directory=/data \
--name-pattern="^(?!original-).+\.jar" \
${poseidonRepo}
); then
logError "Failed to download ${POSEIDON_TYPE}"
exit 1
fi
export SERVER
export FAMILY=SPIGOT
exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -151,16 +151,38 @@ if isTrue "${ENABLE_JMX}"; then
log "JMX is enabled. Make sure you have port forwarding for ${JMX_PORT}"
fi
if isTrue "${USE_MEOWICE_FLAGS}"; then
java_major_version=$(mc-image-helper java-release)
if [[ $java_major_version -gt 16 ]]; then
USE_MEOWICE_GRAALVM_FLAGS="${USE_MEOWICE_GRAALVM_FLAGS:-TRUE}"
log "Java version $java_major_version using MeowIce's flags for Java 17+"
else
log "Your Java version is $java_major_version, MeowIce's flags are for Java 17+ falling back to Aikar's"
USE_MEOWICE_FLAGS=FALSE
fi
USE_AIKAR_FLAGS=TRUE
fi
if isTrue "${USE_AIKAR_FLAGS}"; then
# From https://mcflags.emc.gs/
if [[ $MAX_MEMORY ]] && (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then
if isTrue "${USE_MEOWICE_FLAGS}"; then
log "Using MeowIce's flags"
G1NewSizePercent=28
G1MaxNewSizePercent=50
G1HeapRegionSize=16M
G1ReservePercent=15
InitiatingHeapOccupancyPercent=20
G1MixedGCCountTarget=3
G1RSetUpdatingPauseTimePercent=0
elif [[ $MAX_MEMORY ]] && (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then
log "Using Aikar's >12GB flags"
G1NewSizePercent=40
G1MaxNewSizePercent=50
G1HeapRegionSize=16M
G1ReservePercent=15
InitiatingHeapOccupancyPercent=20
G1MixedGCCountTarget=4
G1RSetUpdatingPauseTimePercent=5
else
log "Using Aikar's flags"
G1NewSizePercent=30
@@ -168,6 +190,8 @@ if isTrue "${USE_AIKAR_FLAGS}"; then
G1HeapRegionSize=8M
G1ReservePercent=20
InitiatingHeapOccupancyPercent=15
G1MixedGCCountTarget=4
G1RSetUpdatingPauseTimePercent=5
fi
JVM_XX_OPTS="${JVM_XX_OPTS}
@@ -182,10 +206,10 @@ if isTrue "${USE_AIKAR_FLAGS}"; then
-XX:G1HeapRegionSize=${G1HeapRegionSize}
-XX:G1ReservePercent=${G1ReservePercent}
-XX:G1HeapWastePercent=5
-XX:G1MixedGCCountTarget=4
-XX:G1MixedGCCountTarget=${G1MixedGCCountTarget}
-XX:InitiatingHeapOccupancyPercent=${InitiatingHeapOccupancyPercent}
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=5
-XX:G1RSetUpdatingPauseTimePercent=${G1RSetUpdatingPauseTimePercent}
-XX:SurvivorRatio=32
-XX:+PerfDisableSharedMem
-XX:MaxTenuringThreshold=1
@@ -194,6 +218,110 @@ if isTrue "${USE_AIKAR_FLAGS}"; then
"
fi
if isTrue "${USE_MEOWICE_FLAGS}"; then
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UnlockDiagnosticVMOptions
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5
-XX:+UseNUMA
-XX:-DontCompileHugeMethods
-XX:MaxNodeLimit=240000
-XX:NodeLimitFudgeFactor=8000
-XX:ReservedCodeCacheSize=400M
-XX:NonNMethodCodeHeapSize=12M
-XX:ProfiledCodeHeapSize=194M
-XX:NonProfiledCodeHeapSize=194M
-XX:NmethodSweepActivity=1
-XX:+UseFastUnorderedTimeStamps
-XX:+UseCriticalJavaThreadPriority
-XX:AllocatePrefetchStyle=3
-XX:+AlwaysActAsServerClassMachine
-XX:+UseTransparentHugePages
-XX:LargePageSizeInBytes=2M
-XX:+UseLargePages
-XX:+EagerJVMCI
-XX:+UseStringDeduplication
-XX:+UseAES
-XX:+UseAESIntrinsics
-XX:+UseFMA
-XX:+UseLoopPredicate
-XX:+RangeCheckElimination
-XX:+OptimizeStringConcat
-XX:+UseCompressedOops
-XX:+UseThreadPriorities
-XX:+OmitStackTraceInFastThrow
-XX:+RewriteBytecodes
-XX:+RewriteFrequentPairs
-XX:+UseFPUForSpilling
-XX:+UseFastStosb
-XX:+UseNewLongLShift
-XX:+UseVectorCmov
-XX:+UseXMMForArrayCopy
-XX:+UseXmmI2D
-XX:+UseXmmI2F
-XX:+UseXmmLoadAndClearUpper
-XX:+UseXmmRegToRegMoveAll
-XX:+EliminateLocks
-XX:+DoEscapeAnalysis
-XX:+AlignVector
-XX:+OptimizeFill
-XX:+EnableVectorSupport
-XX:+UseCharacterCompareIntrinsics
-XX:+UseCopySignIntrinsic
-XX:+UseVectorStubs
-XX:UseAVX=2
-XX:UseSSE=4
"
fi
if isTrue "${USE_MEOWICE_GRAALVM_FLAGS}"; then
if [[ $java_major_version -lt 25 ]]; then
log "Java 24 or higher detected, using modified GraalVM flags"
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UseFastJNIAccessors
-XX:+UseInlineCaches
-XX:+SegmentedCodeCache
-Djdk.nio.maxCachedBufferSize=262144
-Djdk.graal.UsePriorityInlining=true
-Djdk.graal.Vectorization=true
-Djdk.graal.OptDuplication=true
-Djdk.graal.DetectInvertedLoopsAsCounted=true
-Djdk.graal.LoopInversion=true
-Djdk.graal.VectorizeHashes=true
-Djdk.graal.EnterprisePartialUnroll=true
-Djdk.graal.VectorizeSIMD=true
-Djdk.graal.StripMineNonCountedLoops=true
-Djdk.graal.SpeculativeGuardMovement=true
-Djdk.graal.TuneInlinerExploration=1
-Djdk.graal.LoopRotation=true
-Djdk.graal.CompilerConfiguration=enterprise
--enable-native-access=ALL-UNNAMED
"
else
log "Using MeowIce's flags for Graalvm"
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UseFastJNIAccessors
-XX:+UseInlineCaches
-XX:+SegmentedCodeCache
-Djdk.nio.maxCachedBufferSize=262144
-Dgraal.UsePriorityInlining=true
-Dgraal.Vectorization=true
-Dgraal.OptDuplication=true
-Dgraal.DetectInvertedLoopsAsCounted=true
-Dgraal.LoopInversion=true
-Dgraal.VectorizeHashes=true
-Dgraal.EnterprisePartialUnroll=true
-Dgraal.VectorizeSIMD=true
-Dgraal.StripMineNonCountedLoops=true
-Dgraal.SpeculativeGuardMovement=true
-Dgraal.TuneInlinerExploration=1
-Dgraal.LoopRotation=true
-Dgraal.OptWriteMotion=true
-Dgraal.CompilerConfiguration=enterprise
"
fi
fi
if isTrue "${USE_FLARE_FLAGS}"; then
JVM_XX_OPTS="${JVM_XX_OPTS}
-XX:+UnlockDiagnosticVMOptions
@@ -360,4 +488,3 @@ else
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}"
fi
fi

View File

@@ -264,7 +264,7 @@ function handleModrinthProjects() {
if [[ $MODRINTH_PROJECTS ]]; then
if isFamily HYBRID; then
loader=forge
loader=${HYBRIDTYPE}
elif isFamily VANILLA; then
loader=datapack
else
@@ -297,7 +297,7 @@ function handleCurseForgeFiles() {
if isFamily HYBRID; then
# To disambiguate mc-mods we'll assume that hybrid servers
# are blending Forge (rather than Fabric or NeoForge)
args+=(--mod-loader "forge")
args+=(--mod-loader "${HYBRIDTYPE}")
fi
;;
esac