{"id":20380842,"url":"https://github.com/kamesuta/bungeepteropower","last_synced_at":"2025-04-12T08:35:10.143Z","repository":{"id":220165879,"uuid":"750929733","full_name":"Kamesuta/BungeePteroPower","owner":"Kamesuta","description":"BungeePteroPower is a plugin that can automatically start/stop servers based on the number of players.","archived":false,"fork":false,"pushed_at":"2025-01-18T10:11:22.000Z","size":206,"stargazers_count":23,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T03:41:44.457Z","etag":null,"topics":["bungeecord","bungeecord-plugin","minecraft","pterodactyl","pterodactyl-panel-api"],"latest_commit_sha":null,"homepage":"https://www.spigotmc.org/resources/%E2%9A%A1-bungeepteropower-%E2%9A%A1-start-stop-servers-when-player-join-leave.114883/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kamesuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T15:51:00.000Z","updated_at":"2025-03-20T16:51:42.000Z","dependencies_parsed_at":"2024-02-14T10:27:50.209Z","dependency_job_id":"0d7cef4d-8991-4e4f-a238-5edf1b3954e0","html_url":"https://github.com/Kamesuta/BungeePteroPower","commit_stats":null,"previous_names":["kamesuta/bungeepteropower"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamesuta%2FBungeePteroPower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamesuta%2FBungeePteroPower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamesuta%2FBungeePteroPower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamesuta%2FBungeePteroPower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kamesuta","download_url":"https://codeload.github.com/Kamesuta/BungeePteroPower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248541049,"owners_count":21121487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bungeecord","bungeecord-plugin","minecraft","pterodactyl","pterodactyl-panel-api"],"created_at":"2024-11-15T02:09:20.729Z","updated_at":"2025-04-12T08:35:10.123Z","avatar_url":"https://github.com/Kamesuta.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BungeePteroPower\r\n![LogoArt](https://github.com/Kamesuta/BungeePteroPower/assets/16362824/e8914f79-806b-436c-a0e6-e4eaf8ad5eca)  \r\n[![License: MIT](https://img.shields.io/github/license/Kamesuta/BungeePteroPower?label=License)](LICENSE)\r\n[![Spigotmc Version](https://img.shields.io/spiget/version/114883?logo=spigotmc\u0026label=Spigotmc%20Version)](https://www.spigotmc.org/resources/%E2%9A%A1-bungeepteropower-%E2%9A%A1-start-stop-servers-when-player-join-leave.114883/)\r\n[![JitPack](https://img.shields.io/jitpack/version/com.github.Kamesuta/BungeePteroPower?logo=jitpack\u0026label=JitPack)](https://jitpack.io/#Kamesuta/BungeePteroPower)  \r\n[![Spigotmc Downloads](https://img.shields.io/spiget/downloads/114883?logo=spigotmc\u0026label=Spigotmc%20Downloads)](https://www.spigotmc.org/resources/%E2%9A%A1-bungeepteropower-%E2%9A%A1-start-stop-servers-when-player-join-leave.114883/)\r\n[![bStats Servers](https://img.shields.io/bstats/servers/20917?label=bStats%20Servers)](https://bstats.org/plugin/bungeecord/BungeePteroPower/20917)  \r\n\r\nBungeePteroPower is a plugin that can automatically start/stop servers based on the number of players.  \r\nIt can start and stop servers on the [Pterodactyl panel](https://pterodactyl.io/) when players join or leave the Bungeecord proxy server.  \r\nThis helps to save server resources and manage servers more efficiently.  \r\n\r\nhttps://github.com/Kamesuta/BungeePteroPower/assets/16362824/019fdfc5-f0fc-4532-89f3-3342b5812593\r\n\r\n## Key Features\r\n\r\n- Automatically stops servers using Pterodactyl's API when there are no players on the server for a certain period of time.\r\n    - The time until shutdown can be configured for each server.\r\n- Automatically starts servers using Pterodactyl's API when players join the server.\r\n- Permissions settings allow for specifying players who can manually start servers and players for whom automatic startup is enabled upon joining.\r\n- You can reset the server from a backup when it shuts down.\r\n    - This is useful when creating mini-game servers that reset once played.\r\n\r\n![Overview](https://github.com/Kamesuta/BungeePteroPower/assets/16362824/3cece79e-b41a-4119-a6cd-4800dd4f705d)\r\n\r\n## Download\r\n\r\n- You can download it from [Spigot](https://www.spigotmc.org/resources/%E2%9A%A1-bungeepteropower-%E2%9A%A1-start-stop-servers-when-player-join-leave.114883/) or [GitHub Releases](https://github.com/Kamesuta/BungeePteroPower/releases).\r\n\r\n## Requirements\r\n\r\n- Java 11 or higher\r\n    - uses `java.net.http.HttpClient` in Java 11 for REST API communication with Pterodactyl.\r\n\r\n## Getting Started\r\n\r\n1. Obtain an API key in the Pterodactyl panel.\r\n    - The client API key for Pterodactyl can be found in the \"API Credentials\" tab on the account page.\r\n2. Add the plugin to the BungeeCord server and start it.\r\n3. Configure the [Required Settings](#required-settings) in the generated `plugins/BungeePteroPower/config.yml` file.\r\n    ```yml\r\n    # Pterodactyl configuration\r\n    pterodactyl:\r\n      # The URL of your pterodactyl panel\r\n      # If you use Cloudflare Tunnel, you need to allow the ip in the bypass setting.\r\n      url: \"https://panel.example.com\"\r\n      # The client api key of your pterodactyl panel. It starts with \"ptlc_\".\r\n      # You can find the client api key in the \"API Credentials\" tab of the \"Account\" page.\r\n      apiKey: \"ptlc_000000000000000000000000000000000000000000\"\r\n    \r\n    # Per server configuration\r\n    servers:\r\n      pvp:\r\n        # Pterodactyl server ID\r\n        # You can find the Pterodactyl server ID in the URL of the server page.\r\n        # For example, if the URL is https://panel.example.com/server/1234abcd, the server ID is 1234abcd.\r\n        id: 1234abcd\r\n        # The time in seconds to stop the server after the last player leaves.\r\n        # If you don't want to stop the server automatically, set it to -1.\r\n        # If you set it to 0, the server will be stopped immediately after the last player leaves.\r\n        timeout: 30\r\n    ```\r\n4. Reload the config with the `/ptero reload` command.\r\n5. Configure the [Permission Settings](#permission-settings).  \r\n    (You **MUST** configure permission to use this plugin, otherwise the player will not be able to do anything!)  \r\n    You can use either of the following methods.  \r\n    - Use a permission plugin like [LuckPerms](https://luckperms.net/).\r\n        1. For LuckPerms, use the following commands to set permissions:\r\n            ```\r\n            # The player can start all servers\r\n            /lp user \u003cplayer_name\u003e permission set ptero.autostart.*\r\n            # The player can start specific server\r\n            /lp user \u003cplayer_name\u003e permission set ptero.autostart.\u003cserver_name\u003e\r\n            # All players can start all servers\r\n            /lp group default permission set ptero.autostart.*\r\n            ```\r\n            ※ `\u003cplayer_name\u003e` refers to the player's name, `\u003cserver_name\u003e` refers to the server name specified in BungeeCord's `config.yml`.\r\n    - Use built-in permission settings.\r\n        1. Open `config.yml`.\r\n        2. Add the following settings to the `config.yml` file.\r\n            ```yml\r\n            permissions:\r\n                default:\r\n                # All players can start all server\r\n                - ptero.autostart.*\r\n                # All players can start specific server\r\n                - ptero.autostart.\u003cserver_name\u003e\r\n            ```  \r\n            ※ `\u003cserver_name\u003e` refers to the server name specified in BungeeCord's `config.yml`.\r\n        3. Restart the BungeeCord server.\r\n  \r\n## Usage\r\n\r\n### Automatic Startup\r\n\r\n- Servers will automatically start when players attempt to join each server on BungeeCord.\r\n    - This feature is available only to players with the `ptero.autostart.\u003cserver_name\u003e` permission.\r\n\r\n### Manual Start/Stop\r\n\r\n- Use the `/ptero start \u003cserver_name\u003e` command to manually start a server.\r\n    - This command is available only to players with the `ptero.start.\u003cserver_name\u003e` permission.\r\n- Use the `/ptero stop \u003cserver_name\u003e` command to manually stop a server.\r\n    - This command is available only to players with the `ptero.stop.\u003cserver_name\u003e` permission.\r\n\r\n※ `\u003cserver_name\u003e` refers to the server name specified in BungeeCord's `config.yml`.\r\n\r\n### Reloading config.yml/Language files\r\n\r\n- Use `/ptero reload` to reload the config.yml and language files.\r\n\r\n## Configuration\r\n\r\nThe `config.yml` file includes the following settings, but not all items need to be configured.\r\n\r\n### Required Settings\r\n\r\n- `pterodactyl`: Configure settings for Pterodactyl, including URL and API key.\r\n    - `url`: Set the URL of your Pterodactyl panel. (Example: https://panel.example.com/)\r\n        - If you are using services like Cloudflare Tunnel, ensure proper bypass settings for IP-based communication.\r\n    - `apiKey`: Set the client API key for Pterodactyl.\r\n        - It begins with `ptlc_`.\r\n        - Client API keys for Pterodactyl can be found in the \"API Credentials\" tab on the account page.\r\n- `servers`: Configure settings for each server. Set the server ID and the time until automatic shutdown.\r\n    - `id`: Set the server ID on Pterodactyl.\r\n        - Server IDs on Pterodactyl can be found in the URL of the server page.\r\n        - For example, if the URL is https://panel.example.com/server/1234abcd, the server ID is 1234abcd.\r\n\r\n### Optional Settings\r\n\r\n- `version`: Set the version of the plugin.\r\n    - When updating the plugin, a warning will be displayed if this value does not match the plugin version.\r\n    - A `config.new.yml` file will be generated, and manual migration of settings using a merge tool is required.\r\n    - After migration, please change this value to the new version.\r\n- `checkUpdate`: Set whether to check for plugin updates. The default is `true`.\r\n- `language`: Set the language to be used. The default is English (`en`).\r\n    - Refer to the comments in the [config file](./src/main/resources/config.yml) for supported languages.\r\n- `startTimeout`: After starting a server with this plugin, it will stop the server if there are no players for a certain period. The unit is seconds.\r\n    - After starting, the server will stop after the `startTimeout` plus the server's timeout duration.\r\n    - Setting it to 1 keeps the server running until players join and leave.\r\n- `powerControllerType`: Set the type of power controller to be used.\r\n    - The built-in PowerController currently supports only `pterodactyl`, which operates Pterodactyl.\r\n    - By adding add-ons, you can add your own custom PowerController.\r\n      Certainly! Here's the English translation of the provided description:\r\n- `useSynchronousPing`: This setting determines whether to perform **synchronous** pinging to the server during login. (Experimental feature)\r\n    - When enabled, pinging the server during login will happen synchronously rather than asynchronously.\r\n    - This allows displaying BungeePteroPower messages (`join_autostart_login` in messages.yml) instead of the \"Could not connect to a default or fallback server\" message upon login.\r\n    - The default value is `false`. Enabling this can be useful if you want to set servers (such as lobby servers) to a suspended state in BungeePteroPower immediately after login.\r\n- `startupJoin`: After server startup, it is used to automatically join players to the server and check the server's status.\r\n    - `timeout`: Set the maximum waiting time for players to join after server startup.\r\n        - Set this value to the maximum time it takes for the server to start.\r\n        - Setting it to 0 disables this feature, and players will not automatically join after startup.\r\n    - `joinDelay`: Once the server is pingable, wait the specified amount of seconds before sending the player to the server\r\n        - This is useful to wait for plugins like Luckperms to fully load\r\n        - If you set it to 0, the player will be connected as soon as the server is pingable\r\n    - `pingInterval`: Set the interval for checking the server's status.\r\n- `restoreOnStop`: Configure settings for the feature to reset the server from a backup when it is stopped.\r\n    - `timeout`: Set the maximum waiting time after sending the stop signal for the server to stop. (The restore will be performed after the server stops)\r\n    - `pingInterval`: Set the interval for checking if the server is offline after sending the stop signal.\r\n- `servers`: Configure settings for each server. Set the server ID and the time until automatic shutdown.\r\n    - `timeout`: When there are no players on the server, it will stop after a certain period. The unit is seconds.\r\n    - `backupId`: The UUID of the backup to restore when the server stops.\r\n        - If this setting is empty or removed, no restore from backup will be performed when the server stops.\r\n        - Useful for servers that need to be reset after each game.\r\n\r\n### Permission Settings\r\n\r\nBungeePteroPower plugin allows fine-grained control over commands available to players for each server using permissions.\r\n\r\n- `ptero.autostart.\u003cserver_name\u003e`: Servers will automatically start when players join each server on BungeeCord for players with this permission.\r\n- `ptero.start.\u003cserver_name\u003e`: Allows the `/ptero start \u003cserver_name\u003e` command to manually start a server.\r\n    - If a player doesn't have `ptero.autostart.\u003cserver_name\u003e` permission but has this permission, they will see a manual start button when they join the server.\r\n- `ptero.stop.\u003cserver_name\u003e`: Allows the `/ptero stop \u003cserver_name\u003e` command to manually stop a server.\r\n- `ptero.reload`: Allows the `/ptero reload` command to reload the config.\r\n\r\n※ `\u003cserver_name\u003e` refers to the server name specified in BungeeCord's `config.yml`.\r\n※ Specify `*` for `\u003cserver_name\u003e` to apply permissions to all servers.\r\n\r\n### About Language Files\r\n\r\n- You can set the language in config.yml using the language option.\r\n    - Please refer to the comments in the config file for the supported languages.\r\n- Upon startup, a file for the language set in config.yml will be generated.\r\n    - This file allows you to define only the messages you want to change.\r\n    - Messages that are not defined will be loaded from the language file set within the plugin.\r\n- You can edit and then reload the plugin's language by using the `/ptero reload` command.\r\n- Contributions via Pull Requests for additional language files are welcome.\r\n\r\n## Information for Plugin Developers\r\n\r\n### About Power Controllers\r\n\r\nBungeePteroPower provides a Power Controller API for supporting platforms other than Pterodactyl.  \r\nBy creating add-ons, you can add power controllers for platforms other than Pterodactyl!\r\n\r\nWe also welcome pull requests for adding built-in power controllers!  \r\nIdeally, we would like to support the following:\r\n- Power controllers that can start servers locally\r\n- Power controllers compatible with management software other than Pterodactyl.  \r\n    For example, we would like to support the following:\r\n    - PufferPanel\r\n    - Minecraft Server Manager\r\n    - MCSManager\r\n    - MC Server Soft\r\n    - AMP\r\n\r\n### Creating Add-ons\r\n\r\n- BungeePteroPower provides an API for integration with other plugins.\r\n    - If you want to support platforms other than Pterodactyl, it is possible by implementing the API.\r\n- You can use the BungeePteroPower API by adding dependencies.\r\n    1. Add the JitPack repository inside the pom.xml of your add-on:\r\n        ```xml\r\n        \u003crepositories\u003e\r\n            \u003crepository\u003e\r\n                \u003cid\u003ejitpack.io\u003c/id\u003e\r\n                \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\r\n            \u003c/repository\u003e\r\n        \u003c/repositories\u003e\r\n        ```\r\n    2. Add BungeePteroPower as a dependency:\r\n        ```xml\r\n        \u003cdependency\u003e\r\n            \u003cgroupId\u003ecom.github.Kamesuta\u003c/groupId\u003e\r\n            \u003cartifactId\u003eBungeePteroPower\u003c/artifactId\u003e\r\n            \u003cversion\u003eversion\u003c/version\u003e\r\n        \u003c/dependency\u003e\r\n        ```\r\n    3. Add the dependency to your plugin.yml:\r\n        ```yml\r\n        depends:\r\n          - BungeePteroPower\r\n        ```\r\n    4. Use the API:\r\n        ```java\r\n        import com.kamesuta.bungeepteropower.api.BungeePteroPowerAPI;\r\n\r\n        public class YourPlugin extends JavaPlugin {\r\n            @Override\r\n            public void onEnable() {\r\n                // Get an instance of BungeePteroPowerAPI\r\n                BungeePteroPowerAPI api = BungeePteroPowerAPI.getInstance();\r\n                // Register your custom PowerController\r\n                api.registerPowerController(\"your_service\", new YourPowerController());\r\n            }\r\n        }\r\n        ```\r\n        For an example implementation of a PowerController for Pterodactyl, please refer to [PterodactylController.java](./src/main/java/com/kamesuta/bungeepteropower/power/PterodactylController.java).\r\n- If you want your PowerController to be added to BungeePteroPower, please send a pull request.\r\n\r\n### Building\r\n\r\nPull requests are welcome for BungeePteroPower.  \r\nYou can build it using the following steps:\r\n\r\n```bash\r\ngit clone https://github.com/Kamesuta/BungeePteroPower.git\r\ncd BungeePteroPower\r\nmvn install\r\n```\r\n- This plugin needs to be built with Java 11 or higher.\r\n- After building, a `BungeePteroPower-\u003cversion\u003e.jar` file will be generated in the `target` directory.\r\n\r\n## About Statistics Data\r\n\r\nBungeePteroPower collects anonymous statistical data using [bStats](https://bstats.org/).  \r\nYou can find the statistics data [here](https://bstats.org/plugin/bungeecord/BungeePteroPower/20917).\r\n\r\nbStats is used to understand the usage of the plugin and help improve it.  \r\nTo disable the collection of statistical data, please set `enabled` to `false` in `plugins/bStats/config.yml`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamesuta%2Fbungeepteropower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamesuta%2Fbungeepteropower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamesuta%2Fbungeepteropower/lists"}