{
    "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL",
    "meta": {
        "version": "PLCN_v1",
        "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-sponge--sponge-vanilla.json"
    },
    "exported_at": "2025-04-25T06:05:10+00:00",
    "name": "Sponge",
    "author": "panel@example.com",
    "uuid": "f0d2f88f-1ff3-42a0-b03f-ac44c5571e6d",
    "description": "A community-driven open source Minecraft: Java Edition modding platform.",
    "tags": [
        "minecraft"
    ],
    "features": [
        "eula",
        "java_version",
        "pid_limit"
    ],
    "docker_images": {
        "Java 21": "ghcr.io\/parkervcp\/yolks:java_21",
        "Java 17": "ghcr.io\/parkervcp\/yolks:java_17",
        "Java 16": "ghcr.io\/parkervcp\/yolks:java_16",
        "Java 11": "ghcr.io\/parkervcp\/yolks:java_11",
        "Java 8": "ghcr.io\/parkervcp\/yolks:java_8"
    },
    "file_denylist": [],
    "startup": "java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}",
    "config": {
        "files": "{\r\n    \"server.properties\": {\r\n        \"parser\": \"properties\",\r\n        \"find\": {\r\n            \"server-ip\": \"0.0.0.0\",\r\n            \"server-port\": \"{{server.allocations.default.port}}\",\r\n            \"query.port\": \"{{server.allocations.default.port}}\"\r\n        }\r\n    }\r\n}",
        "startup": "{\r\n    \"done\": \")! For help, type \"\r\n}",
        "logs": "{}",
        "stop": "stop"
    },
    "scripts": {
        "installation": {
            "script": "#!\/bin\/ash\r\n# Sponge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\nif [ $MINECRAFT_VERSION = 'latest' ] || [ -z $MINECRAFT_VERSION ]; then\r\n  TARGET_VERSION_JSON=$(curl -sSL https:\/\/dl-api.spongepowered.org\/v2\/groups\/org.spongepowered\/artifacts\/${SPONGE_TYPE}\/latest?recommended=true)\r\n  if [ -z \"${TARGET_VERSION_JSON}\" ]; then\r\n    echo -e \"Failed to find latest recommended version!\"\r\n    exit 1\r\n  fi\r\n  echo -e \"Found latest version for ${SPONGE_TYPE}\"\r\nelse\r\n  if [ $SPONGE_TYPE = 'spongevanilla' ]; then \r\n    VERSIONS_JSON=$(curl -sSL https:\/\/dl-api.spongepowered.org\/v2\/groups\/org.spongepowered\/artifacts\/${SPONGE_TYPE}\/versions?tags=,minecraft:${MINECRAFT_VERSION}&offset=0&limit=1)\r\n  else\r\n    FORGETAG='forge'\r\n    if [ $SPONGE_TYPE = 'spongeneo' ]; then\r\n      FORGETAG='neoforge'\r\n    fi\r\n    VERSIONS_JSON=$(curl -sSL https:\/\/dl-api.spongepowered.org\/v2\/groups\/org.spongepowered\/artifacts\/${SPONGE_TYPE}\/versions?tags=,minecraft:${MINECRAFT_VERSION},${FORGETAG}:${FORGE_VERSION}&offset=0&limit=1)\r\n  fi\r\n  \r\n  if [ -z \"${VERSIONS_JSON}\" ]; then\r\n    echo -e \"Failed to find recommended ${MINECRAFT_VERSION} version for ${SPONGE_TYPE} ${FORGE_VERSION}!\"\r\n    exit 1\r\n  fi\r\n  \r\n  VERSION_KEY=$(echo $VERSIONS_JSON | jq -r '.artifacts | to_entries[0].key')\r\n  TARGET_VERSION_JSON=$(curl -sSL https:\/\/dl-api.spongepowered.org\/v2\/groups\/org.spongepowered\/artifacts\/${SPONGE_TYPE}\/versions\/${VERSION_KEY})\r\n  \r\n  if [ -z \"${TARGET_VERSION_JSON}\" ]; then\r\n    echo -e \"Failed to find ${VERSION_KEY} for ${SPONGE_TYPE} ${FORGE_VERSION}!\"\r\n    exit 1\r\n  fi\r\n\r\n  echo -e \"Found ${MINECRAFT_VERSION} for ${SPONGE_TYPE}\"\r\nfi\r\n\r\nTARGET_VERSION=`echo $TARGET_VERSION_JSON | jq '.assets[] | select(.classifier == \"universal\")'`\r\nif [ -z \"${TARGET_VERSION}\" ]; then\r\n  TARGET_VERSION=`echo $TARGET_VERSION_JSON  | jq '.assets[] | select(.classifier == \"\" and .extension == \"jar\")'`\r\nfi\r\n\r\nif [ -z \"${TARGET_VERSION}\" ]; then\r\n  echo -e \"Failed to get download url data from the selected version\"\r\n  exit 1\r\nfi\r\n\r\nSPONGE_URL=$(echo $TARGET_VERSION | jq -r '.downloadUrl')\r\nCHECKSUM=$(echo $TARGET_VERSION | jq -r '.md5')\r\necho -e \"Found file at ${SPONGE_URL} with checksum ${CHECKSUM}\"\r\n\r\necho -e \"running: curl -o ${SERVER_JARFILE} ${SPONGE_URL}\"\r\ncurl -o ${SERVER_JARFILE} ${SPONGE_URL}\r\n\r\nif [ $(basename $(md5sum ${SERVER_JARFILE})) = ${CHECKSUM} ] ; then\r\n  echo \"Checksum passed\"\r\nelse\r\n  echo \"Checksum failed\"\r\nfi\r\n\r\necho -e \"Install Complete\"",
            "container": "ghcr.io\/parkervcp\/installers:alpine",
            "entrypoint": "ash"
        }
    },
    "variables": [
        {
            "sort": 3,
            "name": "Forge\/Neoforge Version",
            "description": "The modding api target version if set to `spongeforge` or `spongeneo`. Leave blank if using `spongevanilla`",
            "env_variable": "FORGE_VERSION",
            "default_value": "",
            "user_viewable": true,
            "user_editable": true,
            "rules": [
                "string"
            ]
        },
        {
            "sort": 1,
            "name": "Minecraft Version",
            "description": "The version of Minecraft to target. Use \"latest\" to install the latest version. Go to Settings > Reinstall Server to apply.",
            "env_variable": "MINECRAFT_VERSION",
            "default_value": "latest",
            "user_viewable": true,
            "user_editable": true,
            "rules": [
                "required",
                "string",
                "between:3,15"
            ]
        },
        {
            "sort": 4,
            "name": "Server Jar File",
            "description": "The name of the Jarfile to use when running Sponge.",
            "env_variable": "SERVER_JARFILE",
            "default_value": "server.jar",
            "user_viewable": true,
            "user_editable": true,
            "rules": [
                "required",
                "regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
            ]
        },
        {
            "sort": 2,
            "name": "Sponge Type",
            "description": "SpongeVanilla if you are only using Sponge plugins.\nSpongeForge when using Forge mods and Sponge plugins.\nSpongeNeo when using NeoForge mods and Sponge plugins.",
            "env_variable": "SPONGE_TYPE",
            "default_value": "spongevanilla",
            "user_viewable": true,
            "user_editable": true,
            "rules": [
                "required",
                "in:spongevanilla,spongeforge,spongeneo"
            ]
        }
    ]
}
