├── .gitea └── pull_request_template.yml ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── api_support.yml │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── assets │ ├── MODRINTH.md │ ├── basic_example.jpg │ ├── full_example.jpg │ ├── logo.png │ ├── pr-comments │ │ ├── building.md │ │ ├── failed.md │ │ └── success.md │ └── version_1.5.0.jpg ├── labeler.yml └── workflows │ └── docs-deploy.yml ├── .gitignore ├── .woodpecker ├── pr_preview.yml ├── publish_assets.yml └── publish_docs.yml ├── LICENSE ├── README.md ├── addons └── banplugins │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── ch │ │ └── andre601 │ │ └── advancedserverlist │ │ └── banplugins │ │ ├── bungeecord │ │ ├── BungeeCordBanPlugins.java │ │ └── BungeeCordBanPluginsAddon.java │ │ ├── paper │ │ ├── PaperBanPlugins.java │ │ └── PaperBanPluginsAddon.java │ │ ├── placeholders │ │ ├── AdvancedBanPlaceholders.java │ │ └── LibertyBansPlaceholders.java │ │ ├── providers │ │ ├── AdvancedBanProvider.java │ │ ├── LibertyBansProvider.java │ │ └── PunishmentProvider.java │ │ └── velocity │ │ ├── VelocityBanPlugins.java │ │ └── VelocityBanPluginsAddon.java │ └── resources │ ├── bungee.yml │ ├── paper-plugin.yml │ └── velocity-plugin.json ├── bungeecord ├── pom.xml └── src │ └── main │ ├── java │ └── ch │ │ └── andre601 │ │ └── advancedserverlist │ │ └── bungeecord │ │ ├── BungeeCordCore.java │ │ ├── commands │ │ ├── BungeeCmdSender.java │ │ └── CmdAdvancedServerList.java │ │ ├── listeners │ │ ├── BungeeEventWrapper.java │ │ ├── JoinEvent.java │ │ ├── PingEvent.java │ │ └── PreServerListSetEventImpl.java │ │ ├── logging │ │ └── BungeeLogger.java │ │ └── objects │ │ ├── impl │ │ ├── BungeePlayerImpl.java │ │ └── BungeeProxyImpl.java │ │ └── placeholders │ │ ├── BungeePlayerPlaceholders.java │ │ └── BungeeServerPlaceholders.java │ └── resources │ └── bungee.yml ├── core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── ch │ │ │ └── andre601 │ │ │ └── advancedserverlist │ │ │ └── core │ │ │ ├── AdvancedServerList.java │ │ │ ├── check │ │ │ ├── UpdateCheckThread.java │ │ │ └── UpdateChecker.java │ │ │ ├── commands │ │ │ └── CommandHandler.java │ │ │ ├── compat │ │ │ ├── maintenance │ │ │ │ └── MaintenanceUtil.java │ │ │ └── papi │ │ │ │ ├── PAPICache.java │ │ │ │ └── PAPIUtil.java │ │ │ ├── events │ │ │ └── PingEventHandler.java │ │ │ ├── file │ │ │ ├── ConfigMigrator.java │ │ │ └── FileHandler.java │ │ │ ├── interfaces │ │ │ ├── PluginLogger.java │ │ │ ├── commands │ │ │ │ ├── CmdSender.java │ │ │ │ └── PluginCommand.java │ │ │ ├── core │ │ │ │ └── PluginCore.java │ │ │ └── events │ │ │ │ └── GenericEventWrapper.java │ │ │ ├── objects │ │ │ └── CachedPlayer.java │ │ │ ├── parsing │ │ │ └── ComponentParser.java │ │ │ └── profiles │ │ │ ├── ServerListProfile.java │ │ │ ├── conditions │ │ │ ├── ProfileConditionParser.java │ │ │ └── placeholders │ │ │ │ ├── reader │ │ │ │ ├── CustomTokenReader.java │ │ │ │ ├── PlaceholderTokenReader.java │ │ │ │ └── PlaceholderValueReader.java │ │ │ │ └── tokens │ │ │ │ ├── CustomExpressionTokenizer.java │ │ │ │ └── PlaceholderToken.java │ │ │ ├── favicon │ │ │ └── FaviconHandler.java │ │ │ ├── players │ │ │ ├── GenericPlayerImpl.java │ │ │ └── PlayerHandler.java │ │ │ ├── profile │ │ │ ├── ProfileManager.java │ │ │ └── ProfileSerializer.java │ │ │ └── replacer │ │ │ └── StringReplacer.java │ └── resources │ │ ├── config.yml │ │ ├── profiles │ │ └── default.yml │ │ └── version.properties │ └── test │ └── java │ └── ch │ └── andre601 │ └── advancedserverlist │ └── test │ ├── DummyPluginLogger.java │ ├── ExpressionParserTests.java │ └── FlexVerTests.java ├── docs ├── .hooks │ ├── badges.py │ └── replacer.py ├── .overrides │ ├── api-doc.html │ ├── api-objects │ │ └── info-template.html │ └── partials │ │ └── content.html ├── .snippets │ ├── api_version.md │ └── warn-header.md ├── addons │ ├── banplugins.md │ └── index.md ├── api │ ├── changelog.md │ ├── index.md │ ├── javadocs.md │ ├── reference │ │ ├── api │ │ │ ├── ch.andre601.advancedserverlist.api │ │ │ │ ├── advancedserverlistapi.md │ │ │ │ ├── events │ │ │ │ │ └── genericserverlistevent.md │ │ │ │ ├── exceptions │ │ │ │ │ └── invalidplaceholderproviderexception.md │ │ │ │ ├── objects │ │ │ │ │ ├── genericplayer.md │ │ │ │ │ ├── genericserver.md │ │ │ │ │ └── nullbool.md │ │ │ │ ├── placeholderprovider.md │ │ │ │ └── profiles │ │ │ │ │ └── profileentry │ │ │ │ │ ├── builder.md │ │ │ │ │ └── index.md │ │ │ └── index.md │ │ ├── index.md │ │ ├── platform-bukkit │ │ │ ├── ch.andre601.advancedserverlist.api.bukkit │ │ │ │ ├── events │ │ │ │ │ ├── postserverlistsetevent.md │ │ │ │ │ └── preserverlistsetevent.md │ │ │ │ └── objects │ │ │ │ │ ├── bukkitplayer.md │ │ │ │ │ └── bukkitserver.md │ │ │ └── index.md │ │ ├── platform-bungeecord │ │ │ ├── ch.andre601.advancedserverlist.api.bungeecord │ │ │ │ ├── events │ │ │ │ │ ├── postserverlistsetevent.md │ │ │ │ │ └── preserverlistsetevent.md │ │ │ │ └── objects │ │ │ │ │ ├── bungeeplayer.md │ │ │ │ │ └── bungeeproxy.md │ │ │ └── index.md │ │ ├── platform-velocity │ │ │ ├── ch.andre601.advancedserverlist.api.velocity │ │ │ │ ├── events │ │ │ │ │ ├── postserverlistsetevent.md │ │ │ │ │ └── preserverlistsetevent.md │ │ │ │ └── objects │ │ │ │ │ ├── velocityplayer.md │ │ │ │ │ └── velocityproxy.md │ │ │ └── index.md │ │ └── structure.md │ └── source.md ├── assets │ ├── images │ │ ├── examples │ │ │ ├── extraplayers-example.jpg │ │ │ ├── favicon-example.jpg │ │ │ ├── hideplayers-example.jpg │ │ │ ├── hover-example.jpg │ │ │ ├── maxplayers-example.jpg │ │ │ ├── motd-example.jpg │ │ │ ├── profiles-example-1.jpg │ │ │ ├── profiles-example-2.jpg │ │ │ └── text-example.jpg │ │ └── favicon.png │ ├── js │ │ └── repo-stats.js │ └── stylesheets │ │ ├── admo.css │ │ ├── admonition.css │ │ ├── api-docs.css │ │ └── custom.css ├── commands │ └── index.md ├── examples │ └── index.md ├── getting-started │ └── index.md ├── index.md ├── migration │ ├── index.md │ ├── pre-v3_7_0-to-v3_7_0.md │ ├── v1_5_3-to-v1_6_0.md │ ├── v1_9_0-to-v1_10_0.md │ ├── v3_7_0-to-v3_8_0.md │ └── v3_8_0-to-v3_9_0.md ├── placeholderapi │ └── index.md └── profiles │ ├── expressions.md │ ├── formatting.md │ ├── index.md │ └── placeholders.md ├── domains ├── mkdocs.yml ├── paper ├── pom.xml └── src │ └── main │ ├── java │ └── ch │ │ └── andre601 │ │ └── advancedserverlist │ │ └── paper │ │ ├── PaperCore.java │ │ ├── commands │ │ ├── CmdAdvancedServerList.java │ │ └── PaperCmdSender.java │ │ ├── listeners │ │ ├── JoinEvent.java │ │ ├── LoadEvent.java │ │ ├── PaperEventWrapper.java │ │ ├── PingEvent.java │ │ ├── PreServerListSetEventImpl.java │ │ └── WorldEvents.java │ │ ├── logging │ │ └── PaperLogger.java │ │ └── objects │ │ ├── WorldCache.java │ │ ├── impl │ │ ├── PaperPlayerImpl.java │ │ └── PaperServerImpl.java │ │ └── placeholders │ │ ├── PAPIPlaceholders.java │ │ ├── PaperPlayerPlaceholders.java │ │ └── PaperServerPlaceholders.java │ └── resources │ ├── paper-plugin.yml │ └── plugin.yml ├── pom.xml ├── renovate.json ├── requirements.txt ├── velocity ├── pom.xml └── src │ └── main │ ├── java │ └── ch │ │ └── andre601 │ │ └── advancedserverlist │ │ └── velocity │ │ ├── VelocityCore.java │ │ ├── commands │ │ ├── CmdAdvancedServerList.java │ │ └── VelocityCmdSender.java │ │ ├── listeners │ │ ├── JoinEvent.java │ │ ├── PingEvent.java │ │ ├── PreServerListSetEventImpl.java │ │ └── VelocityEventWrapper.java │ │ ├── logging │ │ └── VelocityLogger.java │ │ └── objects │ │ ├── impl │ │ ├── VelocityPlayerImpl.java │ │ └── VelocityProxyImpl.java │ │ └── placeholders │ │ ├── VelocityPlayerPlaceholders.java │ │ └── VelocityServerPlaceholders.java │ └── resources │ └── velocity-plugin.json └── version-uploader ├── pom.xml └── src └── main ├── java └── ch │ └── andre601 │ └── advancedserverlist │ └── versionuploader │ ├── PlatformInfo.java │ ├── ReleaseHolder.java │ ├── VersionUploader.java │ ├── data │ ├── CodebergRelease.java │ └── CodebergReleaseFetcher.java │ ├── hangar │ ├── HangarVersionUploader.java │ └── version │ │ ├── Dependency.java │ │ ├── MultipartObject.java │ │ ├── Platform.java │ │ └── Version.java │ └── modrinth │ └── ModrinthVersionUploader.java └── resources ├── logback.xml └── version.properties /.gitea/pull_request_template.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request 2 | description: Create a new Pull request 3 | 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: |- 8 | Thank you for creating a Pull request! 9 | 10 | Please be sure to fill out this template with all requested information to ensure it being valid and not being closed unmerged. 11 | - type: dropdown 12 | attributes: 13 | label: Type 14 | description: What kind of Pull request is this? 15 | options: 16 | - Enhancement 17 | - Bugfix 18 | - Documentation 19 | validations: 20 | required: true 21 | - type: dropdown 22 | attributes: 23 | label: Breaking Change? 24 | description: |- 25 | Is this a breaking change? 26 | A breaking change means that it becomes incompatible with previous server/proxy versions or plugin versions. 27 | options: 28 | - Yes 29 | - No 30 | validations: 31 | required: true 32 | - type: textarea 33 | attributes: 34 | label: Description 35 | description: Provide a detailed description of what this Pull request is doing. Link any issues this Pull request may fix/close. 36 | validations: 37 | required: true -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: andre_601 2 | ko_fi: andre_601 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/api_support.yml: -------------------------------------------------------------------------------- 1 | name: API support 2 | description: Ask for help with the API. 3 | 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: |- 8 | ## Before opening 9 | Please make sure you've checked the following things first: 10 | 11 | - You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)] and the right API version. 12 | - You're using a supported Proxy/Server version. As of right now is only 1.19+ supported. 13 | - The Feature you suggest hasn't been suggested before. 14 | - type: dropdown 15 | attributes: 16 | label: Platforms 17 | description: On what platform(s) are you using the API? 18 | multiple: true 19 | options: 20 | - Proxy (BungeeCord, Waterfall, ...) 21 | - Proxy (Velocity) 22 | - Server (Spigot, Paper, ...) 23 | validations: 24 | required: true 25 | - type: textarea 26 | attributes: 27 | label: Description 28 | description: |- 29 | Give a detailed description of what exactly you try to do, what steps you did and what you need help with. 30 | placeholder: I tried to... 31 | validations: 32 | required: true 33 | - type: textarea 34 | attributes: 35 | label: Code 36 | description: |- 37 | Provide code-snippets to help us better understand what you tried. 38 | The code is automatically parsed as Java Code. 39 | render: java 40 | validations: 41 | required: true 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report an issue with the plugin 3 | 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: |- 8 | ## Before opening 9 | Please make sure you've checked the following things first: 10 | 11 | - You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)] 12 | - You're using a supported Proxy/Server version. As of right now is only 1.19+ supported. 13 | - The issue happens with just AdvancedServerList installed. 14 | - type: dropdown 15 | attributes: 16 | label: Platform 17 | description: On what platform do you use the plugin? 18 | options: 19 | - BungeeCord 20 | - Other (Please specify) 21 | - Paper 22 | - Purpur 23 | - Spigot 24 | - Velocity 25 | - Waterfall 26 | validations: 27 | required: true 28 | - type: input 29 | attributes: 30 | label: Other platform 31 | description: |- 32 | Please provide the name of the platform (Proxy/Server) you use, if you selected `Other (Please specify)` in the above section. 33 | Leave empty otherwise. 34 | placeholder: SomeProxy 35 | - type: textarea 36 | attributes: 37 | label: What happened? 38 | description: |- 39 | Give a detailed description of what exactly happened. 40 | You can provide screenshots to further explain the issues. 41 | When sharing errors, make sure to use a site such as https://paste.helpch.at to do so. 42 | placeholder: When I do ... does ... happen. 43 | validations: 44 | required: true 45 | - type: textarea 46 | attributes: 47 | label: Steps to reproduce 48 | description: Provide a detailed step-by-step explanation on how to reproduce this issue. 49 | placeholder: |- 50 | 1. Do this 51 | 2. ... 52 | 3. Profit! 53 | validations: 54 | required: true 55 | - type: textarea 56 | attributes: 57 | label: Server List Profiles 58 | description: |- 59 | **Optional** 60 | Provide any Server List Profiles you use, if you believe those to be the cause of the issue. 61 | This text field will automatically render the text as YAML code. 62 | render: yaml 63 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Discord Server 4 | about: Ask questions about the plugin in the `#advancedserverlist` channel. 5 | url: https://discord.gg/6dazXp6 6 | - name: Wiki 7 | about: Check the Wiki for explanations about the features and examples. 8 | url: https://docs.andre601.ch/AdvancedServerList -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest a new feature for the plugin 3 | 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: |- 8 | ## Before opening 9 | Please make sure you've checked the following things first: 10 | 11 | - You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)] 12 | - You're using a supported Proxy/Server version. As of right now is only 1.19+ supported. 13 | - The Feature you suggest hasn't been suggested before. 14 | - type: dropdown 15 | attributes: 16 | label: Platforms 17 | description: What platforms should this feature be usable on 18 | multiple: true 19 | options: 20 | - Proxy (BungeeCord, Waterfall, ...) 21 | - Proxy (Velocity) 22 | - Server (Spigot, Paper, ...) 23 | validations: 24 | required: true 25 | - type: textarea 26 | attributes: 27 | label: Feature 28 | description: |- 29 | Give a detailed description of what exactly should be added and/or changed in AdvancedServerList. 30 | You can provide screenshots to further explain the idea. 31 | When sharing code snippets, make sure to use a site such as https://paste.helpch.at to do so. 32 | placeholder: AdvancedServerList should get ... because ... 33 | validations: 34 | required: true 35 | -------------------------------------------------------------------------------- /.github/assets/basic_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/.github/assets/basic_example.jpg -------------------------------------------------------------------------------- /.github/assets/full_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/.github/assets/full_example.jpg -------------------------------------------------------------------------------- /.github/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/.github/assets/logo.png -------------------------------------------------------------------------------- /.github/assets/pr-comments/building.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ![badge] 4 | 5 | Building jar file from Pull request. Please wait... 6 | 7 | [badge]: https://img.shields.io/badge/Building...-0d1117?style=for-the-badge&labelColor=7a8490&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNC43NSAyaDE0LjVhLjc1Ljc1IDAgMCAxIDAgMS41aC0uNzV2Mi45ODJhNC43NSA0Ljc1IDAgMCAxLTIuMjE1IDQuMDE3bC0yLjA0NCAxLjI5YS4yNS4yNSAwIDAgMCAwIC40MjJsMi4wNDQgMS4yOWE0Ljc1IDQuNzUgMCAwIDEgMi4yMTUgNC4wMTdWMjAuNWguNzVhLjc1Ljc1IDAgMCAxIDAgMS41SDQuNzVhLjc1Ljc1IDAgMCAxIDAtMS41aC43NXYtMi45ODJhNC43NSA0Ljc1IDAgMCAxIDIuMjE1LTQuMDE3bDIuMDQ0LTEuMjlhLjI1LjI1IDAgMCAwIDAtLjQyMmwtMi4wNDQtMS4yOUE0Ljc1IDQuNzUgMCAwIDEgNS41IDYuNDgyVjMuNWgtLjc1YS43NS43NSAwIDAgMSAwLTEuNVpNMTcgMy41SDd2Mi45ODJBMy4yNSAzLjI1IDAgMCAwIDguNTE2IDkuMjNsMi4wNDQgMS4yOWExLjc1IDEuNzUgMCAwIDEgMCAyLjk2bC0yLjA0NCAxLjI5QTMuMjUgMy4yNSAwIDAgMCA3IDE3LjUxOFYyMC41aDEwdi0yLjk4MmEzLjI1IDMuMjUgMCAwIDAtMS41MTYtMi43NDhsLTIuMDQ0LTEuMjlhMS43NSAxLjc1IDAgMCAxIDAtMi45NmwyLjA0NC0xLjI5QTMuMjUgMy4yNSAwIDAgMCAxNyA2LjQ4MloiPjwvcGF0aD48L3N2Zz4= 8 | -------------------------------------------------------------------------------- /.github/assets/pr-comments/failed.md: -------------------------------------------------------------------------------- 1 | 2 | ![badge] 3 | 4 | **Compiling of jar files failed!** 5 | Please check the logs below for any errors. 6 | 7 | | Name | Link | 8 | | ------ | -------------------------------- | 9 | | Commit | {{ .commit }} | 10 | | Logs | {{ .logs | mdlink "View Logs" }} | 11 | 12 | [badge]: https://img.shields.io/badge/Build_Failure!-0d1117?style=for-the-badge&labelColor=f85149&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNS43MiA1LjcyYS43NS43NSAwIDAgMSAxLjA2IDBMMTIgMTAuOTRsNS4yMi01LjIyYS43NDkuNzQ5IDAgMCAxIDEuMjc1LjMyNi43NDkuNzQ5IDAgMCAxLS4yMTUuNzM0TDEzLjA2IDEybDUuMjIgNS4yMmEuNzQ5Ljc0OSAwIDAgMS0uMzI2IDEuMjc1Ljc0OS43NDkgMCAwIDEtLjczNC0uMjE1TDEyIDEzLjA2bC01LjIyIDUuMjJhLjc1MS43NTEgMCAwIDEtMS4wNDItLjAxOC43NTEuNzUxIDAgMCAxLS4wMTgtMS4wNDJMMTAuOTQgMTIgNS43MiA2Ljc4YS43NS43NSAwIDAgMSAwLTEuMDZaIj48L3BhdGg+PC9zdmc+ 13 | -------------------------------------------------------------------------------- /.github/assets/pr-comments/success.md: -------------------------------------------------------------------------------- 1 | 2 | ![badge] 3 | 4 | The compiling of the jar files was successful! 5 | You can find a direct download for the artifact below. 6 | 7 | File expires: `{{ .expire | date "02 Jan 2006 15:04 MST" }}` 8 | 9 | | Name | Link | 10 | | -------- | -------------------------------------------- | 11 | | Commit | {{ .commit }} | 12 | | Logs | {{ .logs | mdlink "View Logs" }} | 13 | | Download | {{ .download | mdlink "Download Artifact" }} | 14 | 15 | [badge]: https://img.shields.io/badge/Build_Success!-0d1117?style=for-the-badge&labelColor=3fb950&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMjEuMDMgNS43MmEuNzUuNzUgMCAwIDEgMCAxLjA2bC0xMS41IDExLjVhLjc0Ny43NDcgMCAwIDEtMS4wNzItLjAxMmwtNS41LTUuNzVhLjc1Ljc1IDAgMSAxIDEuMDg0LTEuMDM2bDQuOTcgNS4xOTVMMTkuOTcgNS43MmEuNzUuNzUgMCAwIDEgMS4wNiAwWiI+PC9wYXRoPjwvc3ZnPg== 16 | -------------------------------------------------------------------------------- /.github/assets/version_1.5.0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/.github/assets/version_1.5.0.jpg -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | "Target: All": 2 | - all: ["bukkit/**", "bungeecord/**", "core/**", "velocity/**"] 3 | 4 | "Target: Bukkit": 5 | - all: ["bukkit/**", "!bungeecord/**", "!core/**", "!velocity/**"] 6 | 7 | "Target: BungeeCord": 8 | - all: ["!bukkit/**", "bungeecord/**", "!core/**", "!velocity/**"] 9 | 10 | "Target: Core": 11 | - all: ["!bukkit/**", "!bungeecord/**", "core/**", "!velocity/**"] 12 | 13 | "Target: Velocity": 14 | - all: ["!bukkit/**", "!bungeecord/**", "!core/**", "velocity/**"] 15 | -------------------------------------------------------------------------------- /.github/workflows/docs-deploy.yml: -------------------------------------------------------------------------------- 1 | name: 'Deploy Site (Push)' 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | permissions: 7 | contents: read 8 | pages: write 9 | id-token: write 10 | 11 | concurrency: 12 | group: "pages" 13 | cancel-in-progress: false 14 | 15 | env: 16 | GITHUB_REPO_INSTANCE: true 17 | 18 | jobs: 19 | build: 20 | runs-on: ubuntu-latest 21 | environment: 22 | name: github-pages 23 | url: ${{ steps.deployment.outputs.page_url }} 24 | steps: 25 | - uses: actions/checkout@v4 26 | - name: Set up Python 3.7 27 | uses: actions/setup-python@v5 28 | with: 29 | python-version: 3.x 30 | - name: Create/Get Cache 31 | uses: actions/cache@v4 32 | with: 33 | key: ${{ github.ref }} 34 | path: .cache 35 | - name: Install dependencies 36 | run: | 37 | python -m pip install --upgrade pip setuptools 38 | python -m pip install -r requirements.txt 39 | - name: Build docs 40 | run: mkdocs build 41 | - name: Configure GitHub Pages 42 | uses: actions/configure-pages@v5 43 | - name: Upload artifact 44 | uses: actions/upload-pages-artifact@v3 45 | with: 46 | path: 'site/' 47 | - name: Deploy to GitHub Pages 48 | id: deployment 49 | uses: actions/deploy-pages@v4 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /**/*.iml 2 | /.idea/ 3 | /**/dependency-reduced-pom.xml 4 | /**/target/ 5 | /**/__pycache__/ 6 | -------------------------------------------------------------------------------- /.woodpecker/pr_preview.yml: -------------------------------------------------------------------------------- 1 | when: 2 | - event: pull_request 3 | path: 4 | include: ['.woodpecker/pr_preview.yml', 'requirements.txt', 'mkdocs.yml', 'docs/**'] 5 | 6 | variables: 7 | setup_git: &setup_git 8 | - apk add git 9 | - git config --global user.email "andre@andre601.ch" 10 | - git config --global user.name "ASL Docs Builder" 11 | 12 | steps: 13 | cloneTargetRepo: 14 | image: alpine:3.18.4 15 | commands: 16 | - chmod -R a+w . 17 | - <<: *setup_git 18 | - git clone https://codeberg.org/Andre601/asl-docs.git site 19 | - chmod -R a+w site 20 | - cd site 21 | - git switch pr-${CI_COMMIT_PULL_REQUEST} 2>/dev/null || git switch -c pr-${CI_COMMIT_PULL_REQUEST} 22 | buildDocs: 23 | image: woodpeckerci/plugin-mkdocs:latest 24 | settings: 25 | pip_install_file: requirements.txt 26 | commitAndPush: 27 | image: alpine:3.18.4 28 | secrets: 29 | - bot_token 30 | commands: 31 | - <<: *setup_git 32 | - mv domains site/.domains 33 | - cd site 34 | - git remote add upstream https://$BOT_TOKEN@codeberg.org/Andre601/asl-docs.git 35 | - git add --all 36 | - git commit -m "Update Preview for PR ${CI_COMMIT_PULL_REQUEST} ($( env TZ=Europe/Zurich date +"%d.%m.%Y %Z" )) [SKIP CI]" 37 | - git push --set-upstream upstream pr-${CI_COMMIT_PULL_REQUEST} -f 38 | commentOnSuccess: 39 | image: mcs94/gitea-comment 40 | when: 41 | - status: ['success'] 42 | secrets: 43 | - bot_token 44 | settings: 45 | gitea_address: https://codeberg.org 46 | gitea_token: 47 | from_secret: BOT_TOKEN 48 | comment: |- 49 | Pull request Preview ready! 50 | 51 | | Name | Value | 52 | |--------|-------------------------------------------------------| 53 | | Commit | ${CI_COMMIT_SHA} | 54 | | Link | https://asl.andre601.ch/@pr-${CI_COMMIT_PULL_REQUEST} | 55 | commentOnFailure: 56 | image: mcs94/gitea-comment 57 | when: 58 | - status: ['failure'] 59 | secrets: 60 | - bot_token 61 | settings: 62 | gitea_address: https://codeberg.org 63 | gitea_token: 64 | from_secret: BOT_TOKEN 65 | comment: |- 66 | Issue while creating Pull request preview. 67 | Please check the CI logs for any reasons: ${CI_PIPELINE_URL} -------------------------------------------------------------------------------- /.woodpecker/publish_assets.yml: -------------------------------------------------------------------------------- 1 | when: 2 | - event: tag 3 | branch: master 4 | 5 | steps: 6 | createFiles: 7 | image: maven:3.9.6-eclipse-temurin-17 8 | secrets: 9 | - source: cb_token 10 | target: codeberg_api_token 11 | - source: modrinth_api_token 12 | target: modrinth_api_token 13 | - source: hangar_api_token 14 | target: hangar_api_token 15 | - source: discord_webhook_url 16 | target: discord_webhook_url 17 | commands: 18 | # Create the jar files. 19 | - mvn clean install 20 | # Move VersionUploader jar file 21 | - cd version-uploader/target/ 22 | - mv VersionUploader.jar ../../ 23 | - cd ../../ 24 | # Execute Jar file 25 | - java -jar VersionUploader.jar --all 26 | uploadToCodeberg: 27 | image: woodpeckerci/plugin-gitea-release 28 | settings: 29 | base_url: https://codeberg.org 30 | files: 31 | - "bungeecord/target/AdvancedServerList-*.jar" 32 | - "paper/target/AdvancedServerList-*.jar" 33 | - "velocity/target/AdvancedServerList-*.jar" 34 | - "addons/banplugins/target/AdvancedServerList-*.jar" 35 | api_key: 36 | from_secret: CB_TOKEN 37 | postOnMastodon: 38 | image: woodpeckerci/plugin-mastodon-post 39 | when: 40 | - status: ['success'] 41 | settings: 42 | server_url: https://blobfox.coffee 43 | access_token: 44 | from_secret: MASTODON_TOKEN 45 | status: '${CI_COMMIT_TAG} of #AdvancedServerList has been released and can be found on Modrinth (https://modrinth.com/plugin/AdvancedServerList), Hangar (https://hangar.papermc.io/Andre_601/AdvancedServerList) and Codeberg (https://codeberg.org/Andre601/AdvancedServerList).' 46 | visibility: public -------------------------------------------------------------------------------- /.woodpecker/publish_docs.yml: -------------------------------------------------------------------------------- 1 | when: 2 | - branch: '${CI_REPO_DEFAULT_BRANCH}' 3 | event: push 4 | path: 5 | include: ['.woodpecker/publish_docs.yml', 'requirements.txt', 'mkdocs.yml', 'docs/**'] 6 | 7 | variables: 8 | setup_git: &setup_git 9 | - apk add git 10 | - git config --global user.email "github@andre601.ch" 11 | - git config --global user.name "ASL Docs Builder" 12 | 13 | steps: 14 | cloneTargetRepo: 15 | image: alpine:3.18.4 16 | commands: 17 | - chmod -R a+w . 18 | - <<: *setup_git 19 | - git clone -b pages https://codeberg.org/Andre601/asl-docs site 20 | - chmod -R a+w site 21 | buildDocs: 22 | image: woodpeckerci/plugin-mkdocs:latest 23 | settings: 24 | pip_install_file: requirements.txt 25 | commitAndPush: 26 | image: alpine:3.18.4 27 | secrets: 28 | - bot_token 29 | commands: 30 | - <<: *setup_git 31 | - mv domains site/.domains 32 | - cd site 33 | - git remote set-url origin https://$BOT_TOKEN@codeberg.org/Andre601/asl-docs.git 34 | - git add --all 35 | - git commit -m "Update AdvancedServerList Docs ($( env TZ=Europe/Zurich date +"%d.%m.%Y %Z" )) [SKIP CI]" 36 | - git push -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2023 Andre_601 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /addons/banplugins/src/main/java/ch/andre601/advancedserverlist/banplugins/bungeecord/BungeeCordBanPlugins.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.banplugins.bungeecord; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.banplugins.placeholders.AdvancedBanPlaceholders; 30 | import ch.andre601.advancedserverlist.banplugins.placeholders.LibertyBansPlaceholders; 31 | 32 | import java.util.HashMap; 33 | import java.util.Map; 34 | 35 | public enum BungeeCordBanPlugins{ 36 | 37 | ADVANCED_BAN("AdvancedBan", new AdvancedBanPlaceholders()), 38 | LIBERTY_BANS("LibertyBans", new LibertyBansPlaceholders()); 39 | 40 | private final String plugin; 41 | private final PlaceholderProvider placeholderProvider; 42 | 43 | BungeeCordBanPlugins(String plugin, PlaceholderProvider placeholderProvider){ 44 | this.plugin = plugin; 45 | this.placeholderProvider = placeholderProvider; 46 | } 47 | 48 | public static Map getBanPlugins(){ 49 | Map content = new HashMap<>(); 50 | 51 | for(BungeeCordBanPlugins bungeeCordBanPlugins : BungeeCordBanPlugins.values()){ 52 | content.put(bungeeCordBanPlugins.plugin, bungeeCordBanPlugins.placeholderProvider); 53 | } 54 | 55 | return content; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /addons/banplugins/src/main/java/ch/andre601/advancedserverlist/banplugins/paper/PaperBanPlugins.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.banplugins.paper; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.banplugins.placeholders.AdvancedBanPlaceholders; 30 | import ch.andre601.advancedserverlist.banplugins.placeholders.LibertyBansPlaceholders; 31 | 32 | import java.util.HashMap; 33 | import java.util.Map; 34 | 35 | public enum PaperBanPlugins{ 36 | 37 | ADVANCED_BAN("AdvancedBan", new AdvancedBanPlaceholders()), 38 | LIBERTY_BANS("LibertyBans", new LibertyBansPlaceholders()); 39 | 40 | private final String plugin; 41 | private final PlaceholderProvider placeholderProvider; 42 | 43 | PaperBanPlugins(String plugin, PlaceholderProvider placeholderProvider){ 44 | this.plugin = plugin; 45 | this.placeholderProvider = placeholderProvider; 46 | } 47 | 48 | public static Map getBanPlugins(){ 49 | Map content = new HashMap<>(); 50 | 51 | for(PaperBanPlugins paperBanPlugins : PaperBanPlugins.values()){ 52 | content.put(paperBanPlugins.plugin, paperBanPlugins.placeholderProvider); 53 | } 54 | 55 | return content; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /addons/banplugins/src/main/java/ch/andre601/advancedserverlist/banplugins/providers/PunishmentProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.banplugins.providers; 27 | 28 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 29 | 30 | import java.text.SimpleDateFormat; 31 | import java.util.Date; 32 | 33 | public interface PunishmentProvider{ 34 | 35 | boolean muted(GenericPlayer player); 36 | 37 | boolean banned(GenericPlayer player); 38 | 39 | String muteReason(GenericPlayer player); 40 | 41 | String banReason(GenericPlayer player); 42 | 43 | String muteDuration(GenericPlayer player); 44 | 45 | String banDuration(GenericPlayer player); 46 | 47 | default String muteExpirationDate(GenericPlayer player){ 48 | return muteExpirationDate(player, "dd, MMM yyyy HH:mm:ss"); 49 | } 50 | 51 | String muteExpirationDate(GenericPlayer player, String pattern); 52 | 53 | default String banExpirationDate(GenericPlayer player){ 54 | return banExpirationDate(player, "dd, MMM yyyy HH:mm:ss"); 55 | } 56 | 57 | String banExpirationDate(GenericPlayer player, String pattern); 58 | 59 | default String returnDate(String pattern, long end){ 60 | Date date = new Date(end); 61 | try{ 62 | return new SimpleDateFormat(pattern).format(date); 63 | }catch(IllegalArgumentException ex){ 64 | return new SimpleDateFormat("dd, MMM yyyy HH:mm:ss").format(date); 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /addons/banplugins/src/main/java/ch/andre601/advancedserverlist/banplugins/velocity/VelocityBanPlugins.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.banplugins.velocity; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.banplugins.paper.PaperBanPlugins; 30 | import ch.andre601.advancedserverlist.banplugins.placeholders.LibertyBansPlaceholders; 31 | 32 | import java.util.HashMap; 33 | import java.util.Map; 34 | 35 | public enum VelocityBanPlugins{ 36 | 37 | LIBERTY_BANS("libertybans", new LibertyBansPlaceholders()); 38 | 39 | private final String plugin; 40 | private final PlaceholderProvider placeholderProvider; 41 | 42 | VelocityBanPlugins(String plugin, PlaceholderProvider placeholderProvider){ 43 | this.plugin = plugin; 44 | this.placeholderProvider = placeholderProvider; 45 | } 46 | 47 | public static Map getBanPlugins(){ 48 | Map content = new HashMap<>(); 49 | 50 | for(VelocityBanPlugins velocityBanPlugins : VelocityBanPlugins.values()){ 51 | content.put(velocityBanPlugins.plugin, velocityBanPlugins.placeholderProvider); 52 | } 53 | 54 | return content; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /addons/banplugins/src/main/resources/bungee.yml: -------------------------------------------------------------------------------- 1 | name: 'ASLBanPluginsAddon' 2 | author: 'Andre_601' 3 | version: '${plugin.version}' 4 | description: 'AdvancedBan Add-on for AdvancedServerList to add placeholders to use.' 5 | 6 | softDepends: 7 | - AdvancedServerList 8 | - AdvancedBan 9 | - LibertyBans 10 | 11 | main: 'ch.andre601.advancedserverlist.banplugins.bungeecord.BungeeCordBanPluginsAddon' -------------------------------------------------------------------------------- /addons/banplugins/src/main/resources/paper-plugin.yml: -------------------------------------------------------------------------------- 1 | name: 'ASLBanPluginsAddon' 2 | author: 'Andre_601' 3 | version: '${plugin.version}' 4 | 5 | main: 'ch.andre601.advancedserverlist.banplugins.paper.AdvancedBanPlaceholders' 6 | 7 | api-version: '1.19' 8 | 9 | dependencies: 10 | server: 11 | AdvancedServerList: 12 | required: false 13 | load: BEFORE 14 | AdvancedBans: 15 | required: false 16 | load: BEFORE 17 | LibertyBans: 18 | required: false 19 | load: BEFORE -------------------------------------------------------------------------------- /addons/banplugins/src/main/resources/velocity-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "aslbanpluginsaddon", 3 | "name": "ASLBanPluginsAddon", 4 | "version": "${plugin.version}", 5 | "description": "${plugin.description}", 6 | "authors": [ 7 | "Andre_601" 8 | ], 9 | "dependencies": [ 10 | { 11 | "id": "advancedserverlist", 12 | "optional": true 13 | }, 14 | { 15 | "id": "libertybans", 16 | "optional": true 17 | } 18 | ], 19 | "main": "ch.andre601.advancedserverlist.banplugins.velocity.VelocityBanPluginsAddon" 20 | } -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/commands/BungeeCmdSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.commands; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender; 29 | import ch.andre601.advancedserverlist.core.parsing.ComponentParser; 30 | import net.kyori.adventure.platform.bungeecord.BungeeAudiences; 31 | import net.md_5.bungee.api.CommandSender; 32 | 33 | public class BungeeCmdSender implements CmdSender{ 34 | 35 | private final CommandSender sender; 36 | private final BungeeAudiences bungeeAudiences; 37 | 38 | public BungeeCmdSender(CommandSender sender, BungeeAudiences bungeeAudiences){ 39 | this.sender = sender; 40 | this.bungeeAudiences = bungeeAudiences; 41 | } 42 | 43 | @Override 44 | public boolean hasPermission(String permission){ 45 | return sender.hasPermission(permission) || sender.hasPermission("advancedserverlist.admin"); 46 | } 47 | 48 | @Override 49 | public void sendMsg(String msg, Object... args){ 50 | bungeeAudiences.sender(sender).sendMessage(ComponentParser.text(String.format(msg, args)).toComponent()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/commands/CmdAdvancedServerList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.commands; 27 | 28 | import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore; 29 | import net.kyori.adventure.platform.bungeecord.BungeeAudiences; 30 | import net.md_5.bungee.api.CommandSender; 31 | import net.md_5.bungee.api.plugin.Command; 32 | 33 | public class CmdAdvancedServerList extends Command{ 34 | 35 | private final BungeeCordCore plugin; 36 | private final BungeeAudiences audiences; 37 | 38 | public CmdAdvancedServerList(BungeeCordCore plugin){ 39 | super("advancedserverlist", "advancedserverlist.command.asl", "asl"); 40 | this.plugin = plugin; 41 | this.audiences = BungeeAudiences.create(plugin); 42 | } 43 | 44 | @Override 45 | public void execute(CommandSender sender, String[] args){ 46 | plugin.getCore().getCommandHandler().handle(new BungeeCmdSender(sender, audiences), args); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/listeners/JoinEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.listeners; 27 | 28 | import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore; 29 | import net.md_5.bungee.api.connection.ProxiedPlayer; 30 | import net.md_5.bungee.api.event.PostLoginEvent; 31 | import net.md_5.bungee.api.plugin.Listener; 32 | import net.md_5.bungee.event.EventHandler; 33 | 34 | import java.net.InetSocketAddress; 35 | 36 | public class JoinEvent implements Listener{ 37 | 38 | private final BungeeCordCore plugin; 39 | 40 | public JoinEvent(BungeeCordCore plugin){ 41 | this.plugin = plugin; 42 | plugin.getProxy().getPluginManager().registerListener(plugin, this); 43 | } 44 | 45 | @EventHandler 46 | public void onJoin(PostLoginEvent event){ 47 | InetSocketAddress address = (InetSocketAddress)event.getPlayer().getPendingConnection().getSocketAddress(); 48 | ProxiedPlayer player = event.getPlayer(); 49 | 50 | plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getName(), player.getUniqueId()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/listeners/PingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.bungeecord.events.PostServerListSetEvent; 29 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 30 | import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore; 31 | import ch.andre601.advancedserverlist.core.events.PingEventHandler; 32 | import net.md_5.bungee.api.event.ProxyPingEvent; 33 | import net.md_5.bungee.api.plugin.Listener; 34 | import net.md_5.bungee.event.EventHandler; 35 | 36 | public class PingEvent implements Listener{ 37 | 38 | private final BungeeCordCore plugin; 39 | 40 | public PingEvent(BungeeCordCore plugin){ 41 | this.plugin = plugin; 42 | plugin.getProxy().getPluginManager().registerListener(plugin, this); 43 | } 44 | 45 | @EventHandler(priority = 90) // Maintenance has Event Priority 80, so we need to be AFTER it. 46 | public void onProxyPing(ProxyPingEvent event){ 47 | ProfileEntry entry = PingEventHandler.handleEvent(new BungeeEventWrapper(plugin, event)); 48 | 49 | plugin.getProxy().getPluginManager().callEvent(new PostServerListSetEvent(entry)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/listeners/PreServerListSetEventImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.bungeecord.events.PreServerListSetEvent; 29 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 30 | 31 | public class PreServerListSetEventImpl extends PreServerListSetEvent{ 32 | 33 | public PreServerListSetEventImpl(ProfileEntry entry){ 34 | super(entry); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/logging/BungeeLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.logging; 27 | 28 | import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore; 29 | import ch.andre601.advancedserverlist.core.interfaces.PluginLogger; 30 | 31 | import java.util.logging.Level; 32 | import java.util.logging.Logger; 33 | 34 | public class BungeeLogger implements PluginLogger{ 35 | 36 | private final BungeeCordCore plugin; 37 | private final Logger logger; 38 | 39 | public BungeeLogger(BungeeCordCore plugin){ 40 | this.plugin = plugin; 41 | this.logger = plugin.getLogger(); 42 | } 43 | 44 | @Override 45 | public void debug(Class clazz, String msg, Object... args){ 46 | if(plugin.isDebugEnabled()) 47 | info("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 48 | } 49 | 50 | @Override 51 | public void debugWarn(Class clazz, String msg, Object... args){ 52 | if(plugin.isDebugEnabled()) 53 | warn("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 54 | } 55 | 56 | @Override 57 | public void info(String msg, Object... args){ 58 | logger.info(String.format(msg, args)); 59 | } 60 | 61 | @Override 62 | public void warn(String msg, Object... args){ 63 | logger.warning(String.format(msg, args)); 64 | } 65 | 66 | @Override 67 | public void warn(String msg, Throwable throwable){ 68 | logger.log(Level.WARNING, msg, throwable); 69 | } 70 | 71 | @Override 72 | public void warn(String msg, Throwable throwable, Object... args){ 73 | logger.log(Level.WARNING, String.format(msg, args), throwable); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/objects/impl/BungeePlayerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.core.objects.CachedPlayer; 29 | import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayerImpl; 30 | 31 | public class BungeePlayerImpl extends GenericPlayerImpl{ 32 | 33 | public BungeePlayerImpl(CachedPlayer player, int protocol){ 34 | this.name = player.name(); 35 | this.protocol = protocol; 36 | this.uuid = player.uuid(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/objects/impl/BungeeProxyImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.api.bungeecord.objects.BungeeProxy; 29 | import net.md_5.bungee.api.config.ServerInfo; 30 | 31 | import java.util.Map; 32 | 33 | public record BungeeProxyImpl(Map servers, int playersOnline, int playersMax, String host) implements BungeeProxy{ 34 | @Override 35 | public Map getServers(){ 36 | return servers; 37 | } 38 | 39 | @Override 40 | public int getPlayersOnline(){ 41 | return playersOnline; 42 | } 43 | 44 | @Override 45 | public int getPlayersMax(){ 46 | return playersMax; 47 | } 48 | 49 | @Override 50 | public String getHost(){ 51 | return host; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/objects/placeholders/BungeePlayerPlaceholders.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.bungeecord.objects.placeholders; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 30 | import ch.andre601.advancedserverlist.api.objects.GenericServer; 31 | 32 | import java.util.Locale; 33 | 34 | public class BungeePlayerPlaceholders extends PlaceholderProvider{ 35 | 36 | private BungeePlayerPlaceholders(){ 37 | super("player"); 38 | } 39 | 40 | public static BungeePlayerPlaceholders init(){ 41 | return new BungeePlayerPlaceholders(); 42 | } 43 | 44 | @Override 45 | public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){ 46 | return switch(placeholder.toLowerCase(Locale.ROOT)){ 47 | case "name" -> player.getName(); 48 | case "protocol" -> String.valueOf(player.getProtocol()); 49 | case "uuid" -> String.valueOf(player.getUUID()); 50 | default -> null; 51 | }; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /bungeecord/src/main/resources/bungee.yml: -------------------------------------------------------------------------------- 1 | name: 'AdvancedServerList' 2 | author: 'Andre_601' 3 | version: '${plugin.version}' 4 | description: '${plugin.description}' 5 | 6 | softDepends: 7 | - PAPIProxyBridge 8 | - Maintenance 9 | 10 | main: 'ch.andre601.advancedserverlist.bungeecord.BungeeCordCore' -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/check/UpdateCheckThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.check; 27 | 28 | import org.jetbrains.annotations.NotNull; 29 | 30 | import java.util.concurrent.ThreadFactory; 31 | 32 | public class UpdateCheckThread implements ThreadFactory{ 33 | @Override 34 | public Thread newThread(@NotNull Runnable r){ 35 | Thread t = new Thread(r, "AdvancedServerList-UpdateThread"); 36 | t.setDaemon(true); 37 | return t; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/compat/maintenance/MaintenanceUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.compat.maintenance; 27 | 28 | import eu.kennytv.maintenance.api.Maintenance; 29 | import eu.kennytv.maintenance.api.MaintenanceProvider; 30 | 31 | public class MaintenanceUtil{ 32 | 33 | private final Maintenance api; 34 | 35 | public MaintenanceUtil(){ 36 | this.api = MaintenanceProvider.get(); 37 | } 38 | 39 | public boolean isMaintenanceEnabled(){ 40 | return api.isMaintenance(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/compat/papi/PAPICache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.compat.papi; 27 | 28 | import java.util.function.Supplier; 29 | 30 | public class PAPICache{ 31 | 32 | private CacheValue cache = null; 33 | 34 | public PAPICache(){} 35 | 36 | public String get(Supplier supplier){ 37 | if(cache == null || cache.isExpired()) 38 | cache = new CacheValue(supplier.get(), System.currentTimeMillis()); 39 | 40 | return cache.server(); 41 | } 42 | 43 | private record CacheValue(String server, long timestamp){ 44 | // Consider the cache expired if it is older than 5 seconds. 45 | public boolean isExpired(){ 46 | return (timestamp < 0L) || System.currentTimeMillis() - timestamp >= 5000L; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/interfaces/PluginLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.interfaces; 27 | 28 | public interface PluginLogger{ 29 | 30 | void debug(Class clazz, String msg, Object... args); 31 | 32 | void debugWarn(Class clazz, String msg, Object... args); 33 | 34 | void info(String msg, Object... args); 35 | 36 | void warn(String msg, Object... args); 37 | 38 | void warn(String msg, Throwable throwable); 39 | 40 | void warn(String msg, Throwable throwable, Object... args); 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/interfaces/commands/CmdSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.interfaces.commands; 27 | 28 | public interface CmdSender{ 29 | 30 | String prefix = "[AdvancedServerList] "; 31 | String errorPrefix = "[AdvancedServerList] "; 32 | 33 | boolean hasPermission(String permission); 34 | 35 | void sendMsg(String msg, Object... args); 36 | 37 | default void sendMsg(){ 38 | sendMsg(""); 39 | } 40 | 41 | default void sendPrefixedMsg(String msg, Object... args){ 42 | sendMsg(prefix + msg, args); 43 | } 44 | 45 | default void sendErrorMsg(String msg, Object... args){ 46 | sendMsg(errorPrefix + msg, args); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/interfaces/commands/PluginCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.interfaces.commands; 27 | 28 | import java.util.Locale; 29 | 30 | public abstract class PluginCommand{ 31 | 32 | private final String argument; 33 | 34 | public PluginCommand(String argument){ 35 | this.argument = argument; 36 | } 37 | 38 | public String getArgument(){ 39 | return argument; 40 | } 41 | 42 | public String getPermission(){ 43 | return "advancedserverlist.command." + getArgument().toLowerCase(Locale.ROOT); 44 | } 45 | 46 | public abstract void handle(CmdSender sender); 47 | } 48 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/interfaces/core/PluginCore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.interfaces.core; 27 | 28 | import ch.andre601.advancedserverlist.core.AdvancedServerList; 29 | import ch.andre601.advancedserverlist.core.interfaces.PluginLogger; 30 | import ch.andre601.advancedserverlist.core.profiles.favicon.FaviconHandler; 31 | 32 | import java.awt.image.BufferedImage; 33 | import java.nio.file.Path; 34 | 35 | public interface PluginCore{ 36 | 37 | void loadCommands(); 38 | 39 | void loadEvents(); 40 | 41 | void loadMetrics(); 42 | 43 | void loadFaviconHandler(AdvancedServerList core); 44 | 45 | void clearFaviconCache(); 46 | 47 | AdvancedServerList getCore(); 48 | 49 | Path getFolderPath(); 50 | 51 | PluginLogger getPluginLogger(); 52 | 53 | FaviconHandler getFaviconHandler(); 54 | 55 | String getPlatformName(); 56 | 57 | String getPlatformVersion(); 58 | 59 | String getLoader(); 60 | 61 | F createFavicon(BufferedImage image) throws Exception; 62 | 63 | default boolean isDebugEnabled(){ 64 | if(getCore() == null) 65 | return false; 66 | 67 | return getCore().getFileHandler().getBoolean("debug"); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/objects/CachedPlayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.objects; 27 | 28 | import java.util.UUID; 29 | 30 | public record CachedPlayer(String ip, String name, UUID uuid){} -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/parsing/ComponentParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.parsing; 27 | 28 | import net.kyori.adventure.text.Component; 29 | import net.kyori.adventure.text.minimessage.MiniMessage; 30 | import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; 31 | 32 | import java.util.List; 33 | import java.util.function.Function; 34 | 35 | public class ComponentParser{ 36 | 37 | private static final MiniMessage mm; 38 | private static final LegacyComponentSerializer legacy; 39 | 40 | static { 41 | mm = MiniMessage.miniMessage(); 42 | legacy = LegacyComponentSerializer.legacySection(); 43 | } 44 | 45 | private String text; 46 | 47 | private ComponentParser(String text){ 48 | this.text = text; 49 | } 50 | 51 | public static ComponentParser text(String text){ 52 | return new ComponentParser(text); 53 | } 54 | 55 | public static ComponentParser list(List lines){ 56 | return new ComponentParser(String.join("\n", lines)); 57 | } 58 | 59 | public ComponentParser modifyText(Function function){ 60 | this.text = function.apply(text); 61 | return this; 62 | } 63 | 64 | public Component toComponent(){ 65 | return mm.deserialize(text); 66 | } 67 | 68 | @Override 69 | public String toString(){ 70 | return legacy.serialize(toComponent()); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/profiles/conditions/placeholders/reader/CustomTokenReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.reader; 27 | 28 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 29 | import ch.andre601.advancedserverlist.api.objects.GenericServer; 30 | import ch.andre601.expressionparser.ParseWarnCollector; 31 | import ch.andre601.expressionparser.tokens.Token; 32 | import ch.andre601.expressionparser.tokens.readers.TokenReader; 33 | 34 | import java.text.ParsePosition; 35 | 36 | public abstract class CustomTokenReader extends TokenReader{ 37 | 38 | public CustomTokenReader(int priority){ 39 | super(priority); 40 | } 41 | 42 | @Override 43 | public Token read(String text, ParsePosition position, ParseWarnCollector collector){ 44 | return null; 45 | } 46 | 47 | public abstract Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server, ParseWarnCollector collector); 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/profiles/conditions/placeholders/reader/PlaceholderTokenReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.reader; 27 | 28 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 29 | import ch.andre601.advancedserverlist.api.objects.GenericServer; 30 | import ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.tokens.PlaceholderToken; 31 | import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer; 32 | import ch.andre601.expressionparser.ParseWarnCollector; 33 | import ch.andre601.expressionparser.tokens.Token; 34 | 35 | import java.text.ParsePosition; 36 | 37 | public class PlaceholderTokenReader extends CustomTokenReader{ 38 | 39 | public PlaceholderTokenReader(int priority){ 40 | super(priority); 41 | } 42 | 43 | @Override 44 | public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server, ParseWarnCollector collector){ 45 | if(position.getIndex() + 1 < text.length() && text.charAt(position.getIndex()) == '$' && text.charAt(position.getIndex() + 1) == '{'){ 46 | position.setIndex(position.getIndex() + 2); 47 | return new PlaceholderToken(StringReplacer.parsePlaceholder(text, position, player, server, collector)); 48 | } 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/profiles/conditions/placeholders/reader/PlaceholderValueReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.reader; 27 | 28 | import ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.tokens.PlaceholderToken; 29 | import ch.andre601.expressionparser.ParseWarnCollector; 30 | import ch.andre601.expressionparser.parsers.ExpressionTemplateParser; 31 | import ch.andre601.expressionparser.parsers.ValueReader; 32 | import ch.andre601.expressionparser.templates.ExpressionTemplate; 33 | import ch.andre601.expressionparser.tokens.Token; 34 | 35 | import java.util.List; 36 | 37 | public class PlaceholderValueReader extends ValueReader{ 38 | @Override 39 | public ExpressionTemplate read(ExpressionTemplateParser parser, List tokens, ParseWarnCollector collector){ 40 | if(tokens.get(0) instanceof PlaceholderToken){ 41 | PlaceholderToken token = (PlaceholderToken)tokens.remove(0); 42 | return token.getValue(); 43 | } 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /core/src/main/java/ch/andre601/advancedserverlist/core/profiles/players/GenericPlayerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.core.profiles.players; 27 | 28 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 29 | 30 | import java.util.UUID; 31 | 32 | public abstract class GenericPlayerImpl implements GenericPlayer{ 33 | 34 | protected String name = null; 35 | protected int protocol = 0; 36 | protected UUID uuid = null; 37 | 38 | @Override 39 | public String getName(){ 40 | return name; 41 | } 42 | 43 | @Override 44 | public int getProtocol(){ 45 | return protocol; 46 | } 47 | 48 | @Override 49 | public UUID getUUID(){ 50 | return uuid; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /core/src/main/resources/version.properties: -------------------------------------------------------------------------------- 1 | # 2 | # MIT License 3 | # 4 | # Copyright (c) 2022-2023 Andre_601 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in all 14 | # copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | # SOFTWARE. 23 | # 24 | # 25 | 26 | version=${plugin.version} 27 | config-version=${plugin.config.version} -------------------------------------------------------------------------------- /core/src/test/java/ch/andre601/advancedserverlist/test/DummyPluginLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.test; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.PluginLogger; 29 | 30 | public class DummyPluginLogger implements PluginLogger{ 31 | @Override 32 | public void debug(Class clazz, String msg, Object... args){ 33 | info("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 34 | } 35 | 36 | @Override 37 | public void debugWarn(Class clazz, String msg, Object... args){ 38 | warn("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 39 | } 40 | 41 | @Override 42 | public void info(String msg, Object... args){ 43 | System.out.printf((msg) + "%n", args); 44 | } 45 | 46 | @Override 47 | public void warn(String msg, Object... args){ 48 | System.out.printf((msg) + "%n", args); 49 | } 50 | 51 | @Override 52 | public void warn(String msg, Throwable throwable){ 53 | System.out.printf((msg) + "%n", throwable); 54 | } 55 | 56 | @Override 57 | public void warn(String msg, Throwable throwable, Object... args){ 58 | System.out.printf((msg) + "%n", args); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /docs/.hooks/badges.py: -------------------------------------------------------------------------------- 1 | # 2 | # Modified version of Squidfunk's shortcodes.py file for Material for MkDocs. 3 | # 4 | # It was altered to create compact admonition-like boxes to display in the documentation. 5 | # 6 | # Original shortcodes.py file: 7 | # https://github.com/squidfunk/mkdocs-material/blob/56b96b4d799174d48d36613d70ffac9b964171cc/material/overrides/hooks/shortcodes.py 8 | # 9 | 10 | from __future__ import annotations 11 | 12 | import re 13 | 14 | from mkdocs.config.defaults import MkDocsConfig 15 | from mkdocs.structure.files import File, Files 16 | from mkdocs.structure.pages import Page 17 | from re import Match 18 | 19 | def on_page_markdown( 20 | markdown: str, *, page: Page, config: MkDocsConfig, files: Files 21 | ): 22 | 23 | # Replace callback 24 | def replace(match: Match): 25 | type, args = match.groups() 26 | args = args.strip() 27 | if type == "abstract": return _admo(text = args, type = "abstract") 28 | elif type == "info": return _admo(text = args, type = "info") 29 | elif type == "tip": return _admo(text = args, type = "tip") 30 | elif type == "success": return _admo(text = args, type = "success") 31 | elif type == "question": return _admo(text = args, type = "question") 32 | elif type == "warning": return _admo(text = args, type = "warning") 33 | elif type == "failure": return _admo(text = args, type = "failure") 34 | elif type == "danger": return _admo(text = args, type = "danger") 35 | elif type == "bug": return _admo(text = args, type = "bug") 36 | elif type == "example": return _admo(text = args, type = "example") 37 | elif type == "quote": return _admo(text = args, type = "quote") 38 | elif type == "deprecated": return _admo(text = args, type = "deprecated") 39 | else: return _admo(text = args) 40 | 41 | # Find and replace all external asset URLs in current page 42 | return re.sub( 43 | r"", 44 | replace, markdown, flags = re.I | re.M 45 | ) 46 | 47 | def _admo(text: str = "", type: str = ""): 48 | classes = f"mdx-grid-wrapper mdx-admo--{type}" if type else "mdx-grid-wrapper" 49 | return "".join([ 50 | f"
", 51 | f"
", 52 | f"
{text}
" 53 | "
", 54 | ]) -------------------------------------------------------------------------------- /docs/.hooks/replacer.py: -------------------------------------------------------------------------------- 1 | # 2 | # A simple hook that replaces any appearances of \| with just |. 3 | # 4 | # There is an inconsistency between GitHub flavourited Markdown and Python Markdown 5 | # where the former treats | as part of a table, even if it is inside inline code 6 | # causing unwanted table rendering. 7 | # 8 | # The only way to prevent this is to escape it by prefixing it with a back slash (\). 9 | # Unfortunately does this cause issues on Python-Markdown, as it renders inline code 10 | # content as-is without special treatments whatsoever, meaning that `\|` will be 11 | # rendered as \| in the end. 12 | # 13 | # Using this hook, `\|` is being turned into `|` before further processing, resulting 14 | # in | being rendered in the end, while preserving proper table rendering 15 | # on GitHub and co. 16 | # 17 | import re 18 | 19 | from mkdocs.config.defaults import MkDocsConfig 20 | from mkdocs.structure.files import File, Files 21 | from mkdocs.structure.pages import Page 22 | 23 | def on_page_markdown( 24 | markdown: str, *, page: Page, config: MkDocsConfig, files: Files 25 | ): 26 | return re.sub(r"\\\|","|",markdown) -------------------------------------------------------------------------------- /docs/.overrides/api-doc.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% import "api-objects/info-template.html" as info %} 3 | 4 | {% block content %} 5 | {% include "partials/content.html" %} 6 | {% if page.meta %} 7 | 10 | {% if page.meta.constructors %} 11 | {{ info.summary('Constructor Summary', page.meta.constructors, details_type='constructor', defaults=page.meta.defaults) }} 12 | {% endif %} 13 | {% if page.meta.classes %} 14 | {{ info.summary('Class Summary', page.meta.classes, details_type='class', defaults=page.meta.defaults) }} 15 | {% endif %} 16 | {% if page.meta.enums %} 17 | {{ info.summary('Enum Constant Summary', page.meta.enums, details_type='enum', defaults=page.meta.defaults) }} 18 | {% endif %} 19 | {% if page.meta.methods or page.meta.inherits %} 20 | {{ info.summary('Method Summary', page.meta.methods, page.meta.inherits, details_type='method', defaults=page.meta.defaults) }} 21 | {% endif %} 22 | 25 | {% if page.meta.constructors %} 26 | {{ info.info('Constructor Detail', page.meta.constructors, 'constructor', defaults=page.meta.defaults) }} 27 | {% endif %} 28 | {% if page.meta.enums %} 29 | {{ info.info('Enum Constant Detail', page.meta.enums, 'enum', defaults=page.meta.defaults) }} 30 | {% endif %} 31 | {% if page.meta.methods %} 32 | {{ info.info('Method Detail', page.meta.methods, 'method', defaults=page.meta.defaults)}} 33 | {% endif %} 34 | {% endif %} 35 | {% endblock %} -------------------------------------------------------------------------------- /docs/.overrides/partials/content.html: -------------------------------------------------------------------------------- 1 | 2 | {% if "material/tags" in config.plugins and tags %} 3 | {% include "partials/tags.html" %} 4 | {% endif %} 5 | 6 | 7 | {% include "partials/actions.html" %} 8 | 9 | 13 | {% if "\x3ch1" not in page.content %} 14 |

{{ page.title | d(config.site_name, true)}}

15 | {% endif %} 16 | 17 | 18 | {{ page.content }} 19 | 20 | 21 | {% if page.meta and ( 22 | page.meta.git_revision_date_localized or 23 | page.meta.revision_date 24 | ) %} 25 | {% include "partials/source-file.html" %} 26 | {% endif %} 27 | 28 | 29 | {% include "partials/feedback.html" %} 30 | 31 | 32 | {% include "partials/comments.html" %} -------------------------------------------------------------------------------- /docs/.snippets/api_version.md: -------------------------------------------------------------------------------- 1 |
[:octicons-tag-24:](changelog.md#v3.1.0 'View latest Release Changelog')[v3.1.0](changelog.md#v3.1.0 'View latest Release Changelog')
-------------------------------------------------------------------------------- /docs/.snippets/warn-header.md: -------------------------------------------------------------------------------- 1 |
[:octicons-alert-24:](changelog.md)[v3.1.0](changelog.md#v3.1.0 'View latest Release Changelog')
-------------------------------------------------------------------------------- /docs/addons/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/plus-circle-24 3 | --- 4 | 5 | # Addons 6 | 7 | This section contains a curated list of add-ons for AdvancedServerList which can be used to enhance the plugin in different ways. 8 | Do you have a plugin that hooks into AdvancedServerList that is not listed here? Contact Andre601 on Discord and it will be added! 9 | 10 | ## First-party Addons 11 | 12 | These Addons are made by Andre601 and available together with the plugin downloads. 13 | 14 |
15 | 16 | - [**BanPlugins**](banplugins.md) 17 | 18 | ---- 19 | 20 | Addon for different Punishment plugins such as AdvancedBan, that add new placeholders to use in AdvancedServerList. 21 | 22 |
23 | 24 | ## Third-party 25 | 26 | Third-party addons made by other people not working on AdvancedServerList. 27 | 28 | *Currently no entries* -------------------------------------------------------------------------------- /docs/api/javadocs.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: redirect.html 3 | 4 | location: https://jd.andre601.ch/asl-api 5 | 6 | title: Javadocs 7 | icon: octicons/link-external-24 8 | --- 9 | 10 | -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/advancedserverlistapi.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'get' 6 | description: | 7 | Retrieve the instance used of this API.
8 | If no instance has been made so far will a new one be created. 9 | returns: 'Instance of this API.' 10 | attributes: 11 | - static 12 | type: 13 | name: 'AdvancedServerListAPI' 14 | type: 'object' 15 | - name: 'addPlaceholderProvider' 16 | description: | 17 | Adds the provided PlaceholderProvider to the list, if it passes the following checks:
18 |
    19 |
  • Provided PlaceholderProvider instance is not null.
  • 20 |
  • The identifier is not null nor empty.
  • 21 |
  • The identifier does not contain any spaces.
  • 22 |
  • A PlaceholderProvider with the same identifier doesn't exist already.
  • 23 |
24 | Not passing any of the above checks results in a InvalidPlaceholderProviderException being thrown. 25 | parameters: 26 | - name: 'placeholderProvider' 27 | description: 'The PlaceholderProvider to add.' 28 | type: PlaceholderProvider 29 | attributes: 30 | - notnull 31 | throws: 32 | - name: 'InvalidPlaceholderProviderException' 33 | description: 'When the provided PlaceholderProvider instance is null, has a null or empty identifier, the identifier contains spaces, or another PlaceholderProvider with the same identifier is already in use.' 34 | type: 35 | name: 'void' 36 | - name: 'retrievePlaceholderProvider' 37 | description: 'Retrieves the PlaceholderProvider associated with the provided identifier, or null should no such entry exist.' 38 | parameters: 39 | - name: 'identifier' 40 | description: 'The identifier to find a matching PlaceholderProvider for.' 41 | type: String 42 | returns: 'Possibly-null PlaceholderProvider instance.' 43 | attributes: 44 | - nullable 45 | type: 46 | name: PlaceholderProvider 47 | type: object 48 | link: './../placeholderprovider' 49 | --- 50 | 51 | # AdvancedServerListAPI 52 | 53 | Core class of the API for AdvancedServerList. 54 | Use [`get()`](#get) to retrieve the instance currently used. -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getEntry' 6 | description: 'Gets the ProfileEntry currently set.' 7 | returns: The currently used ProfileEntry. 8 | type: 9 | name: ProfileEntry 10 | type: object 11 | link: '../../profiles/profileentry/' 12 | - name: 'setEntry' 13 | description: |- 14 | Sets the new ProfileEntry to use.
15 | This may not be null. 16 | parameters: 17 | - name: 'entry' 18 | description: 'The new ProfileEntry to use.' 19 | type: ProfileEntry 20 | attributes: 21 | - notnull 22 | throws: 23 | - name: 'IllegalArgumentException' 24 | description: 'When the provided ProfileEntry is null' 25 | type: 26 | name: 'void' 27 | - name: 'isCancelled' 28 | description: Returns whether this event has been cancelled or not. 29 | returns: Whether this event has been cancelled or not. 30 | type: 31 | name: boolean 32 | - name: 'setCancelled' 33 | description: Sets the event's cancel state 34 | parameters: 35 | - name: 'cancelled' 36 | description: 'Boolean to set the event''s cancelled state.' 37 | type: boolean 38 | type: 39 | name: 'void' 40 | --- 41 | 42 | # GenericServerListEvent 43 | 44 | Interface used for the platform-specific PreServerListSetEvent instances. 45 | This allows the plugin to pull common info such as ProfileEntry or if the event has been cancelled by another plugin. -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/exceptions/invalidplaceholderproviderexception.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: 'api-doc.html' 3 | 4 | constructors: 5 | - name: 'InvalidPlaceholderProviderException' 6 | parameters: 7 | - name: msg 8 | type: String 9 | --- 10 | 11 | # InvalidPlaceholderProviderException 12 | 13 | RuntimeException thrown whenever an invalid [`PlaceholderProvider`](../placeholderprovider.md) has been given. -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/objects/genericplayer.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getName' 6 | description: | 7 | Returns the name of the player.
8 | Note that on Spigot, Paper and other forks can the name differ from the one cached by AdvancedServerList, if the plugin was able to retrieve an OfflinePlayer instance from the server. On BungeeCord and Velocity will the returned String always be the name from the cache.
9 |
10 | Name may be whatever has been defined in AdvancedServerList's config.yml, should the player not be cached yet by the plugin. 11 | returns: 'String representing the player''s name' 12 | type: 13 | name: String 14 | type: object 15 | - name: 'getProtocol' 16 | description: | 17 | Returns the protocol ID the player is using.
18 | The protocol ID is an integer used by Minecraft to determine what version a server or client is running. 19 | returns: 'Integer representing the protocol version of this player.' 20 | type: 21 | name: int 22 | - name: 'getUUID' 23 | description: | 24 | Returns the unique ID associated with this player.
25 |
26 | UUID may be whatever has been defined in AdvancedServerList's config.yml, should the player not be cached yet by AdvancedServerList. 27 | returns: 'UUID of the player' 28 | type: 29 | name: UUID 30 | type: object 31 | --- 32 | 33 | # GenericPlayer 34 | 35 | A basic interface used to store generic player data to use in placeholder resolving. 36 | The different variants of AdvancedServerList implement this into their own class and may provide additional data not available through this interface. 37 | 38 | The following values will always be present, no matter the platform this interface is used on: 39 | 40 | - [Name of the Player](#getname()) 41 | - [Protocol version of the Player](#getprotocol()) 42 | - [UUID of the Player](#getuuid()) -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/objects/genericserver.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getPlayersOnline' 6 | description: 'Returns the number of players currently online on the server.' 7 | returns: 'Number of players online on the server.' 8 | type: 9 | name: int 10 | - name: 'getPlayersMax' 11 | description: 'Returns the number of total players that can join the server.' 12 | returns: 'Number of total players that can join the server.' 13 | type: 14 | name: int 15 | - name: 'getHost' 16 | description: 'Returns the IP/Domain that got pinged by the player.' 17 | returns: 'Possibly-null String containing the IP/Domain that got pinged by the player' 18 | attributes: 19 | - nullable 20 | type: 21 | name: 'String' 22 | type: 'object' 23 | --- 24 | 25 | # GenericServer 26 | 27 | Simple class used to wrap around some generic server data such as online player count, number of total players that can join and the host (IP/Domain) that got pinged by the player. -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/objects/nullbool.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | enums: 5 | - name: 'true' 6 | description: 'Boolean value true' 7 | - name: 'false' 8 | description: 'Boolean value false' 9 | - name: 'not_set' 10 | description: 'Boolean value null' 11 | 12 | methods: 13 | - name: 'resolve' 14 | description: | 15 | Returns a NullBool instance based on the provided Boolean value.
16 | In case of null being provided will NullBool.NOT_SET be returned, otherwise will the corresponding NullBool instance matching the Boolean value be returned. 17 | returns: 'NullBool instance based on the provided Boolean value.' 18 | parameters: 19 | - name: 'bool' 20 | description: 'The Boolean value to receive a NullBool instance for.' 21 | type: Boolean 22 | attributes: 23 | - nullable 24 | attributes: 25 | - static 26 | type: 27 | name: 'NullBool' 28 | type: 'object' 29 | - name: 'isNotSet' 30 | description: 'Returns whether the NullBool is NullBool.NOT_SET.' 31 | returns: 'True if the instance is NullBool.NOT_SET, otherwise false.' 32 | type: 33 | name: 'boolean' 34 | type: 'primitive' 35 | - name: 'getOrDefault' 36 | description: | 37 | Gets the corresponding boolean value associated with the NullBool instance.
38 | In the case of NullBool not being set will the provided default value be returned. 39 | returns: 'True or false depending on the NullBool instance and the provided default value.' 40 | parameters: 41 | - name: 'def' 42 | description: 'The default boolean value to return should the NullBool instance be NullBool.NOT_SET.' 43 | type: boolean 44 | type: 45 | name: 'boolean' 46 | type: 'primitive' 47 | --- 48 | 49 | # NullBool 50 | 51 | Enum used to return a `Boolean` value with a default one should no value be set. -------------------------------------------------------------------------------- /docs/api/reference/api/ch.andre601.advancedserverlist.api/placeholderprovider.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PlaceholderProvider' 6 | description: 'Constructor used to set the identifier for the class extending the PlaceholderProvider class itself.' 7 | parameters: 8 | - name: 'identifier' 9 | description: 'The identifier to use for the placeholder. Cannot be empty.' 10 | type: String 11 | attribute: 12 | - notnull 13 | 14 | methods: 15 | - name: 'parsePlaceholder' 16 | description: | 17 | Method called by AdvancedServerList's StringReplacer class to replace any appearances of ${<identifier> <placeholder>} with whatever value a matching PlaceholderProvider may return.
18 |
19 | Returning null will be treated as an invalid placeholder by the plugin, making it return the placeholder as-is without any changes. 20 | parameters: 21 | - name: 'placeholder' 22 | type: String 23 | description: 'The part of the Placeholder that comes after the identifier and before the closing curly bracket.' 24 | - name: 'player' 25 | type: GenericPlayer 26 | description: 'The GenericPlayer instance used.' 27 | - name: 'server' 28 | type: GenericServer 29 | description: 'The GenericServer instance used.' 30 | returns: 'Possibly-parsed or possibly-null String to replace the placeholder with.' 31 | attribute: 32 | - nullable 33 | - abstract 34 | type: 35 | name: 'String' 36 | type: 'object' 37 | - name: 'getIdentifier' 38 | description: 'Returns the identifier used by this PlaceholderProvider instance.' 39 | returns: 'String representing the identifier of this PlaceholderProvider instance.' 40 | type: 41 | name: 'String' 42 | type: 'object' 43 | --- 44 | 45 | # PlaceholderProvider 46 | 47 | Abstract class that is used to provide your own Placeholder patterns for AdvancedServerList to parse. 48 | 49 | In order for your class to be considered a valid PlaceholderProvider will you need to set the `identifier` to a non-null, non-empty value without having any spaces in it. 50 | Once set, use [`AdvancedServerListAPI#addPlaceholderProvider(PlaceholderProvider)`](advancedserverlistapi.md#addplaceholderprovider(placeholderprovider)) to register your class for AdvancedServerList to use. -------------------------------------------------------------------------------- /docs/api/reference/api/index.md: -------------------------------------------------------------------------------- 1 | # API Module 2 | 3 | The `api` module is the main part of the AdvancedServerList API. It contains all necessary classes and methods you would want to use to interact with AdvancedServerList. 4 | 5 | ## Module Structure 6 | 7 | {nav} -------------------------------------------------------------------------------- /docs/api/reference/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/file-code-24 3 | --- 4 | 5 | # API Reference 6 | 7 | This page contains the various classes and methods that the AdvancedServerList API provides to you for use. 8 | Please note that while the nav and page content is auto-generated, the data used for the page content is not. So information may be out of date. 9 | 10 | ## API Structure 11 | 12 | {nav} -------------------------------------------------------------------------------- /docs/api/reference/platform-bukkit/ch.andre601.advancedserverlist.api.bukkit/events/postserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PostServerListSetEvent' 6 | description: 'Constructor for creating a new PostServerListSetEvent instance.' 7 | parameters: 8 | - name: 'entry' 9 | description: 'The ProfileEntry used during the PingEvent.' 10 | type: ProfileEntry 11 | attribute: 12 | - nullable 13 | 14 | methods: 15 | - name: 'getHandlerList' 16 | description: 'Static HandlerList getter. Required by Paper.' 17 | returns: 'The static HandlerList instance of this event.' 18 | attributes: 19 | - static 20 | type: 21 | name: 'HandlerList' 22 | type: 'object' 23 | - name: 'getEntry' 24 | description: | 25 | The ProfileEntry that was used during the PingEvent handling.
26 |
27 | The returned value may be null should the PingEvent handling be cancelled at any point (i.e. due to an invalid protocol or because the PreServerListSetEvent has been cancelled).
28 | The values within the ProfileEntry also do not represent what is actually used within the Server list itself, but only the values provided for the PingEvent handling. 29 | returns: 'Possibly-null ProfileEntry used for the PingEvent.' 30 | attributes: 31 | - nullable 32 | type: 33 | name: 'ProfileEntry' 34 | type: 'object' 35 | link: '../../../../api/ch.andre601.advancedserverlist.api/profiles/profileentry/' 36 | 37 | inherits: 38 | 'org.bukkit.event.Event': 39 | link: 'https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/Event.html' 40 | list: 41 | - 'getHandlers()' 42 | --- 43 | 44 | # PostServerListSetEvent 45 | 46 | Called **after** the plugin has updated the Server List. 47 | 48 | The provided [`ProfileEntry`](#getentry()) may be null due to the PingEvent handling being cancelled (i.e. due to a invalid protocol or due to the [`PreServerListSetEvent`](preserverlistsetevent.md) being cancelled). 49 | The entry also only represents the values used during the PingEvent, not the actual content that is being displayed. -------------------------------------------------------------------------------- /docs/api/reference/platform-bukkit/ch.andre601.advancedserverlist.api.bukkit/events/preserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PreServerListSetEvent' 6 | parameters: 7 | - name: 'entry' 8 | type: ProfileEntry 9 | 10 | methods: 11 | - name: 'getHandlerList' 12 | returns: 'Static HandlerList instance.' 13 | attributes: 14 | - static 15 | type: 16 | name: 'HandlerList' 17 | type: 'object' 18 | 19 | inherits: 20 | 'ch.andre601.advancedserverlist.api.events.GenericServerListEvent': 21 | link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/' 22 | list: 23 | - 'getEntry()' 24 | - 'setEntry(ProfileEntry)' 25 | - 'isCancelled()' 26 | - 'setCancelled(boolean)' 27 | 'org.bukkit.event.Event': 28 | link: 'https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/Event.html' 29 | list: 30 | - 'getHandlers()' 31 | --- 32 | 33 | # PreServerListSetEvent 34 | 35 | Called **before** AdvancedServerList modifies the server list. 36 | The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list. -------------------------------------------------------------------------------- /docs/api/reference/platform-bukkit/ch.andre601.advancedserverlist.api.bukkit/objects/bukkitplayer.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getPlayer' 6 | description: 'Gives the OfflinePlayer embedded in this BukkitPlayer.' 7 | returns: 'OfflinePlayer instance' 8 | type: 9 | name: 'OfflinePlayer' 10 | type: 'object' 11 | - name: 'hasPlayedBefore' 12 | description: | 13 | Returns whether this player has played on the server before.
14 |
15 | The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance. 16 | returns: 'Boolean indicating whether this player has played on the server before.' 17 | type: 18 | name: 'boolean' 19 | - name: 'isBanned' 20 | description: | 21 | Returns whether this player has been banned from the server.
22 |
23 | The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance. 24 | returns: 'Boolean indicating whether this player has been banned from the server.' 25 | type: 26 | name: 'boolean' 27 | - name: 'isWhitelisted' 28 | description: | 29 | Returns whether this player is whitelisted on the server.
30 |
31 | The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance. 32 | returns: 'Boolean indicating whether this player is whitelisted on the server.' 33 | type: 34 | name: 'boolean' 35 | 36 | inherits: 37 | 'ch.andre601.advancedserverlist.api.objects.GenericPlayer': 38 | link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/' 39 | list: 40 | - 'getName()' 41 | - 'getProtocol()' 42 | - 'getUUID()' 43 | --- 44 | 45 | # BukkitPlayer 46 | 47 | [`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the SpigotMC/Paper server implementation of AdvancedServerList. 48 | This interface includes a [`OfflinePlayer` instance](#getplayer()) obtained from the server the plugin runs on alongside some getters to get if the player [has played on the server before](#hasplayedbefore()), [is banned](#isbanned()) or [is whitelisted](#iswhitelisted()). These options actually require a proper OfflinePlayer instance to be present or will otherwise default to `false`. 49 | 50 | This class is useful for cases where you want to use the OfflinePlayer. Simply cast the GenericPlayer instance to a SpigotPlayer (Granted that it actually is an instance of it to begin with). -------------------------------------------------------------------------------- /docs/api/reference/platform-bukkit/ch.andre601.advancedserverlist.api.bukkit/objects/bukkitserver.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getWorlds' 6 | description: 'Returns a Map<String, World> where the key is the name of the World and the value the world of the server.' 7 | returns: 'Possibly-empty Map containing pairs of Strings and Worlds.' 8 | type: 9 | name: 'Map' 10 | type: 'object' 11 | 12 | inherits: 13 | 'ch.andre601.advancedserverlist.api.objects.GenericServer': 14 | link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericserver/' 15 | list: 16 | - 'getPlayersOnline()' 17 | - 'getPlayersMax()' 18 | - 'getHost()' 19 | --- 20 | 21 | # BukkitServer 22 | 23 | Spigot/Paper specific instance of a [`GenericServer`](../../../api/ch.andre601.advancedserverlist.api/objects/genericserver.md). 24 | This interface includes a [Map of Worlds](#getworlds()) the server currently has. 25 | 26 | This interface is useful for cases where you want to get the worlds of the Server itself, by simply casting your GenericServer instance to a BukkitServer one. Make sure to do proper instanceof checks first before attempting to cast. -------------------------------------------------------------------------------- /docs/api/reference/platform-bukkit/index.md: -------------------------------------------------------------------------------- 1 | # Bukkit Module 2 | 3 | The `platform-bukkit` module contains classes for platform-specific things such as Server events or a Server-specific CachedPlayer instance. 4 | 5 | ## Module Structure 6 | 7 | {nav} -------------------------------------------------------------------------------- /docs/api/reference/platform-bungeecord/ch.andre601.advancedserverlist.api.bungeecord/events/postserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PostServerListSetEvent' 6 | description: 'Constructor for creating a new PostServerListSetEvent instance.' 7 | parameters: 8 | - name: 'entry' 9 | description: 'The ProfileEntry used during the PingEvent.' 10 | type: ProfileEntry 11 | attribute: 12 | - nullable 13 | 14 | methods: 15 | - name: 'getEntry' 16 | description: | 17 | The ProfileEntry that was used during the PingEvent handling.
18 |
19 | The returned value may be null should the PingEvent handling be cancelled at any point (i.e. due to an invalid protocol or because the PreServerListSetEvent has been cancelled).
20 | The values within the ProfileEntry also do not represent what is actually used within the Server list itself, but only the values provided for the PingEvent handling. 21 | returns: 'Possibly-null ProfileEntry used for the PingEvent.' 22 | attributes: 23 | - nullable 24 | type: 25 | name: 'ProfileEntry' 26 | type: 'object' 27 | link: '../../../../api/ch.andre601.advancedserverlist.api/profiles/profileentry/' 28 | --- 29 | 30 | # PostServerListSetEvent 31 | 32 | Called **after** the plugin has updated the Server List. 33 | 34 | The provided [`ProfileEntry`](#getentry()) may be null due to the PingEvent handling being cancelled (i.e. due to a invalid protocol or due to the [`PreServerListSetEvent`](preserverlistsetevent.md) being cancelled). 35 | The entry also only represents the values used during the PingEvent, not the actual content that is being displayed. -------------------------------------------------------------------------------- /docs/api/reference/platform-bungeecord/ch.andre601.advancedserverlist.api.bungeecord/events/preserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PreServerListSetEvent' 6 | parameters: 7 | - name: 'entry' 8 | type: ProfileEntry 9 | 10 | 11 | inherits: 12 | 'ch.andre601.advancedserverlist.api.events.GenericServerListEvent': 13 | link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/' 14 | list: 15 | - 'getEntry()' 16 | - 'setEntry(ProfileEntry)' 17 | - 'isCancelled()' 18 | - 'setCancelled(boolean)' 19 | --- 20 | 21 | # PreServerListSetEvent 22 | 23 | Called **before** AdvancedServerList modifies the server list. 24 | The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list. -------------------------------------------------------------------------------- /docs/api/reference/platform-bungeecord/ch.andre601.advancedserverlist.api.bungeecord/objects/bungeeplayer.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | inherits: 5 | 'ch.andre601.advancedserverlist.api.objects.GenericPlayer': 6 | link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/' 7 | list: 8 | - 'getName()' 9 | - 'getProtocol()' 10 | - 'getUUID()' 11 | --- 12 | 13 | # BungeePlayer 14 | 15 | [`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the BungeeCord proxy implementation of AdvancedServerList. 16 | 17 | To get an instance of this class from a GenericPlayer instance, simply cast it to a BungeePlayer (Granted that the GenericPlayer instance actually is a BungeePlayer instance). -------------------------------------------------------------------------------- /docs/api/reference/platform-bungeecord/ch.andre601.advancedserverlist.api.bungeecord/objects/bungeeproxy.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getServers' 6 | description: 'Returns a Map<String, ServerInfo> where the key is the name of the server and the value the ServerInfo of the proxy.' 7 | returns: 'Possibly-empty Map containing pairs of Strings and ServerInfos.' 8 | type: 9 | name: 'Map' 10 | type: 'object' 11 | 12 | inherits: 13 | 'ch.andre601.advancedserverlist.api.objects.GenericServer': 14 | link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericserver/' 15 | list: 16 | - 'getPlayersOnline()' 17 | - 'getPlayersMax()' 18 | - 'getHost()' 19 | --- 20 | 21 | # BungeeProxy -------------------------------------------------------------------------------- /docs/api/reference/platform-bungeecord/index.md: -------------------------------------------------------------------------------- 1 | # BungeeCord Module 2 | 3 | The `platform-bungeecord` module contains classes for platform-specific things such as Proxy events or a Proxy-specific CachedPlayer instance. 4 | 5 | ## Module Structure 6 | 7 | {nav} -------------------------------------------------------------------------------- /docs/api/reference/platform-velocity/ch.andre601.advancedserverlist.api.velocity/events/postserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PostServerListSetEvent' 6 | description: 'Constructor for creating a new PostServerListSetEvent instance.' 7 | parameters: 8 | - name: 'entry' 9 | description: 'The ProfileEntry used during the PingEvent.' 10 | type: ProfileEntry 11 | attribute: 12 | - nullable 13 | 14 | methods: 15 | - name: 'getEntry' 16 | description: | 17 | The ProfileEntry that was used during the PingEvent handling.
18 |
19 | The returned value may be null should the PingEvent handling be cancelled at any point (i.e. due to an invalid protocol or because the PreServerListSetEvent has been cancelled).
20 | The values within the ProfileEntry also do not represent what is actually used within the Server list itself, but only the values provided for the PingEvent handling. 21 | returns: 'Possibly-null ProfileEntry used for the PingEvent.' 22 | attributes: 23 | - nullable 24 | type: 25 | name: 'ProfileEntry' 26 | type: 'object' 27 | link: '../../../../api/ch.andre601.advancedserverlist.api/profiles/profileentry/' 28 | --- 29 | 30 | # PostServerListSetEvent 31 | 32 | Called **after** the plugin has updated the Server List. 33 | 34 | The provided [`ProfileEntry`](#getentry()) may be null due to the PingEvent handling being cancelled (i.e. due to a invalid protocol or due to the [`PreServerListSetEvent`](preserverlistsetevent.md) being cancelled). 35 | The entry also only represents the values used during the PingEvent, not the actual content that is being displayed. -------------------------------------------------------------------------------- /docs/api/reference/platform-velocity/ch.andre601.advancedserverlist.api.velocity/events/preserverlistsetevent.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | constructors: 5 | - name: 'PreServerListSetEvent' 6 | parameters: 7 | - name: 'entry' 8 | type: ProfileEntry 9 | 10 | inherits: 11 | 'ch.andre601.advancedserverlist.api.events.GenericServerListEvent': 12 | link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/' 13 | list: 14 | - 'getEntry()' 15 | - 'setEntry(ProfileEntry)' 16 | - 'isCancelled()' 17 | - 'setCancelled(boolean)' 18 | --- 19 | 20 | # PreServerListSetEvent 21 | 22 | Called **before** AdvancedServerList modifies the server list. 23 | The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list. -------------------------------------------------------------------------------- /docs/api/reference/platform-velocity/ch.andre601.advancedserverlist.api.velocity/objects/velocityplayer.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getVersion' 6 | description: 'Returns the protocol version of the player in a readable MC version format (i.e. 1.19.3).' 7 | returns: 'The readable MC version the player uses.' 8 | type: 9 | name: 'String' 10 | type: 'object' 11 | 12 | inherits: 13 | 'ch.andre601.advancedserverlist.api.objects.GenericPlayer': 14 | link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/' 15 | list: 16 | - 'getName()' 17 | - 'getProtocol()' 18 | - 'getUUID()' 19 | --- 20 | 21 | # VelocityPlayer 22 | 23 | [`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the Velocity proxy implementation of AdvancedServerList. 24 | Provides a [`getVersion()` method](#getversion()) to get the MC version used as a readable String (i.e. 1.19.3) rather than just the protocol version. 25 | 26 | To get an instance of this class from a GenericPlayer instance, simply cast it to a VelocityPlayer (Granted that the GenericPlayer instance actually is a VelocityPlayer instance). -------------------------------------------------------------------------------- /docs/api/reference/platform-velocity/ch.andre601.advancedserverlist.api.velocity/objects/velocityproxy.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: api-doc.html 3 | 4 | methods: 5 | - name: 'getServers' 6 | description: 'Returns a Map<String, RegisteredServer> where the key is the name of the server and the value the RegisteredServer of the proxy.' 7 | returns: 'Possibly-empty Map containing pairs of Strings and RegisteredServers.' 8 | type: 9 | name: 'Map' 10 | type: 'object' 11 | 12 | inherits: 13 | 'ch.andre601.advancedserverlist.api.objects.GenericServer': 14 | link: '../../../api/objects/genericserver/' 15 | list: 16 | - 'getPlayersOnline()' 17 | - 'getPlayersMax()' 18 | - 'getHost()' 19 | --- 20 | 21 | # VelocityProxy -------------------------------------------------------------------------------- /docs/api/reference/platform-velocity/index.md: -------------------------------------------------------------------------------- 1 | # Velocity Module 2 | 3 | The `platform-velocity` module contains classes for platform-specific things such as Proxy events or a Proxy-specific CachedPlayer instance. 4 | 5 | ## Module Structure 6 | 7 | {nav} -------------------------------------------------------------------------------- /docs/api/source.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: redirect.html 3 | 4 | location: https://codeberg.org/Andre601/asl-api 5 | 6 | title: Source Code 7 | icon: simple/codeberg 8 | --- 9 | 10 | -------------------------------------------------------------------------------- /docs/assets/images/examples/extraplayers-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/extraplayers-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/favicon-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/favicon-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/hideplayers-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/hideplayers-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/hover-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/hover-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/maxplayers-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/maxplayers-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/motd-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/motd-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/profiles-example-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/profiles-example-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/profiles-example-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/profiles-example-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/examples/text-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/examples/text-example.jpg -------------------------------------------------------------------------------- /docs/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andre601/AdvancedServerList/4071b304a09c0746702de5a799d6f995b8b4c026/docs/assets/images/favicon.png -------------------------------------------------------------------------------- /docs/assets/stylesheets/admonition.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --admonition-icon--file: url('data:image/svg+xml;charset=utf-8,'); 3 | 4 | --admonition-color-fg--file: #00c853; 5 | --admonition-color-bg--file: #00c8531a; 6 | } 7 | 8 | .md-typeset .admonition.file, 9 | .md-typeset details.file { 10 | border-color: var(--admonition-color-fg--file); 11 | } 12 | 13 | .md-typeset .file > .admonition-title, 14 | .md-typeset .file > summary { 15 | background-color: var(--admonition-color-bg--file); 16 | } 17 | 18 | .md-typeset .file > .admonition-title::before, 19 | .md-typeset .file > summary::before { 20 | background-color: var(--admonition-color-fg--file); 21 | -webkit-mask-image: var(--admonition-icon--file); 22 | mask-image: var(--admonition-icon--file); 23 | } -------------------------------------------------------------------------------- /docs/assets/stylesheets/custom.css: -------------------------------------------------------------------------------- 1 | .md-header__button.md-logo img { 2 | height: 2.5rem; 3 | } 4 | 5 | .md-header__button.md-logo { 6 | padding-right: unset; 7 | padding-left: unset; 8 | } 9 | 10 | .changelog-added { 11 | color: #2ea043; 12 | } 13 | 14 | .changelog-removed { 15 | color: #f85149; 16 | } 17 | 18 | .changelog-changed { 19 | color: #1f6feb; 20 | } 21 | 22 | .changelog-breaking { 23 | color: #9e6a03 24 | } 25 | 26 | .md-banner--warning__icon { 27 | color: #d29922; 28 | } 29 | 30 | .result { 31 | border: .05rem solid var(--md-code-bg-color); 32 | border-bottom-left-radius: .1rem; 33 | border-bottom-right-radius: .1rem; 34 | border-top-width: .1rem; 35 | margin-top: -1.125em; 36 | overflow: visible; 37 | padding: 0 1em; 38 | } 39 | 40 | /* Override mkdocs-material styling */ 41 | .md-banner--warning { 42 | background: rgba(187,128,9,0.15); 43 | } 44 | 45 | .md-source__repository .md-source__facts { 46 | animation: facts .25s ease-in; 47 | } -------------------------------------------------------------------------------- /docs/commands/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/rel-file-path-24 3 | --- 4 | 5 | # Commands 6 | 7 | The plugin adds commands to use for various things related to the plugin itself. 8 | The main command is `/advancedserverlist` but an alias called `/asl` is also registered to use. 9 | 10 | ## Permissions 11 | 12 | The main permission is `advancedserverlist.admin` for all commands, but you can also grant access to specific commands using `advancedserverlist.command.` instead (i.e. `advancedserverlist.command.help` to grant access to [`/asl help`](#help)). 13 | 14 | ## Subcommands 15 | 16 | The following subcommands are available (Subcommands are case-insensitive): 17 | 18 | - [`help`](#help) 19 | - [`reload`](#reload) 20 | - [`clearCache`](#clearcache) 21 | 22 | ### help 23 | 24 | /// info | 25 | **Permission:** `advancedserverlist.command.help` 26 | 27 | Shows a list of all available [subcommands](#subcommands) for AdvancedServerList. 28 | /// 29 | 30 | ### reload 31 | 32 | /// info | 33 | **Permission:** `advancedserverlist.command.reload` 34 | 35 | Reloads the plugin's `config.yml` and all available YAML files in the `profiles` folder. 36 | /// 37 | 38 | ### clearCache 39 | 40 | /// info | 41 | **Permission:** `advancedserverlist.command.clearcache` 42 | 43 | Clears the currently cached favicons and players. 44 | /// -------------------------------------------------------------------------------- /docs/migration/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/file-directory-symlink-24 3 | --- 4 | 5 | # Migration 6 | 7 | This page lists all migration guides for specific AdvancedServerList versions. 8 | 9 | Note that these pages only cover server list profile files. The config.yml is automatically being migrated (Feature since v3.1.0). 10 | 11 | ## Pages 12 | 13 |
14 | 15 | - [**v3.8.0 to v3.9.0**](v3_8_0-to-v3_9_0.md) 16 | 17 | ---- 18 | 19 | Migrate from version 3.8.0 to 3.9.0. 20 | 21 | - [**v3.7.0 to v3.8.0**](v3_7_0-to-v3_8_0.md) 22 | 23 | ---- 24 | 25 | Migrating from version 3.7.0 to 3.8.0. 26 | 27 | - [**< v3.7.0 to v3.7.0**](pre-v3_7_0-to-v3_7_0.md) 28 | 29 | ---- 30 | 31 | Migrate from any version prior to 3.7.0 to 3.7.0 or newer. 32 | 33 | - [**v1.9.0 to v1.10.0**](v1_9_0-to-v1_10_0.md) 34 | 35 | ---- 36 | 37 | Migrate from version 1.9.0 to 1.10.0. 38 | 39 | - [**v1.5.3 to v1.6.0**](v1_5_3-to-v1_6_0.md) 40 | 41 | ---- 42 | 43 | Migrate from version 1.5.3 to 1.6.0. 44 | 45 |
-------------------------------------------------------------------------------- /docs/migration/pre-v3_7_0-to-v3_7_0.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/arrow-right-24 3 | --- 4 | 5 | # < v3.7.0 to v3.7.0 6 | 7 | Version 3.7.0 of AdvancedServerList brought significant changes to its conditions system. 8 | Namely, the `conditions` option is now deprecated and planned for removal in a future release of the Plugin, and the new [`condition`](../profiles/index.md#condition) option should now be used instead. 9 | 10 | ## Migration 11 | 12 | To migrate, all you have to do is take the entries of the old conditions option and convert them into a single String connected with `and` operators in between. See the [Example below](#example). 13 | 14 | ## Example 15 | 16 | Here is a before and after example to help visualize the change: 17 | 18 | /// tab | Before 19 | ```yaml 20 | priority: 0 21 | 22 | conditions: 23 | - '${player protocol} > 763' 24 | - '${player isWhitelisted} == true' 25 | 26 | motd: 27 | - 'Welcome ${player name}!' 28 | ``` 29 | /// 30 | 31 | /// tab | After 32 | ```yaml 33 | priority: 0 34 | 35 | # The text can all be in one line. This is only for better readability. 36 | condition: | 37 | ${player protocol} >= 763 and 38 | ${player isWhitelisted} 39 | 40 | motd: 41 | - 'Welcome ${player name}!' 42 | ``` 43 | /// 44 | 45 | /// tab | Diff View 46 | ```diff 47 | priority: 0 48 | 49 | -conditions: 50 | - - '${player protocol} >= 763' 51 | - - '${player isWhitelisted} == true' 52 | +# The text can all be in one line. This is only for better readability. 53 | +condition: | 54 | + ${player protocol} >= 763 and 55 | + ${player isWhitelisted} 56 | 57 | motd: 58 | - 'Welcome ${player name}!' 59 | ``` 60 | /// -------------------------------------------------------------------------------- /docs/migration/v1_5_3-to-v1_6_0.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/arrow-right-24 3 | --- 4 | 5 | # v1.5.3 to v1.6.0 6 | 7 | v1.6.0 has some structural changes to the server list profile that requires you to do some updates on your files. 8 | 9 | ## Migration 10 | 11 | The migration should be fairly simple. [An example](#example) is available to look at. 12 | 13 | - `playerCount` is no longer a String but has been turned into a section containing the `hidePlayers` option and the following renamed options: 14 | - `players` -\> `hover` 15 | - `playerCount` -\> `text` 16 | - `xMore` has been removed. There is now a new section called `extraPlayers` in the `playerCount` section as a replacement. 17 | It contains the following options: 18 | - `enabled` - to enable/disable the feature. 19 | - `amount` - This is the former `xMore` option. Difference is, that it also allows negative numbers. 20 | 21 | ## Example 22 | 23 | Here is a before and after example to help visualize the change: 24 | 25 | /// tab | Before 26 | ```yaml 27 | priority: 0 28 | 29 | motd: 30 | - 'Line 1' 31 | - 'Line 2' 32 | 33 | favicon: '${player name}' 34 | 35 | hidePlayers: false 36 | 37 | players: 38 | - 'Line 1' 39 | - 'Line 2' 40 | - 'Line 3' 41 | 42 | playerCount: 'Hover Me!' 43 | 44 | xMore: 1 45 | ``` 46 | /// 47 | 48 | /// tab | After 49 | ```yaml 50 | priority: 0 51 | 52 | motd: 53 | - 'Line 1' 54 | - 'Line 2' 55 | 56 | favicon: '${player name}' 57 | 58 | playerCount: 59 | hidePlayers: false 60 | 61 | hover: 62 | - 'Line 1' 63 | - 'Line 2' 64 | - 'Line 3' 65 | 66 | text: 'Hover Me!' 67 | 68 | extraPlayers: 69 | enabled: true 70 | amount: 1 71 | ``` 72 | /// 73 | 74 | /// tab | Diff View 75 | ```diff 76 | priority: 0 77 | 78 | motd: 79 | - 'Line 1' 80 | - 'Line 2' 81 | 82 | favicon: '${player name}' 83 | 84 | -hidePlayers: false 85 | - 86 | -players: 87 | - - 'Line 1' 88 | - - 'Line 2' 89 | - - 'Line 3' 90 | - 91 | -playerCount: 'Hover Me!' 92 | - 93 | -xMore: 1 94 | +playerCount: 95 | + hidePlayers: false 96 | + 97 | + hover: 98 | + - 'Line 1' 99 | + - 'Line 2' 100 | + - 'Line 3' 101 | + 102 | + text: 'Hover Me!' 103 | + 104 | + extraPlayers: 105 | + enabled: true 106 | + amount: 1 107 | ``` 108 | /// -------------------------------------------------------------------------------- /docs/migration/v1_9_0-to-v1_10_0.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/arrow-right-24 3 | --- 4 | 5 | # v1.9.0 to v1.10.0 6 | 7 | v1.9.0 introduced a `motds` option to define multiple MOTDs to use. 8 | However, this option has been removed just one update later in v1.10.0, meaning any server list profile using the `motds` option will no longer work as expected. 9 | 10 | ## Migration 11 | 12 | To migrate all you have to do is use the new `profiles` option and add separate List entries with a `motd` option. 13 | 14 | ## Example 15 | 16 | Here is a before and after example to help visualize the change: 17 | 18 | /// tab | Before 19 | ```yaml 20 | priority: 0 21 | 22 | motds: 23 | - |- 24 | Line 1 25 | Line 2 26 | - |- 27 | Line A 28 | Line B 29 | 30 | favicon: '${player name}' 31 | 32 | playerCount: 33 | hidePlayers: false 34 | players: 35 | - 'Line 1' 36 | - 'Line 2' 37 | - 'Line 3' 38 | text: 'Hover Me!' 39 | extraPlayers: 40 | enabled: false 41 | amount: 0 42 | ``` 43 | /// 44 | 45 | /// tab | After 46 | ```yaml 47 | priority: 0 48 | 49 | profiles: 50 | # You can also use motd: ['Line 1', 'Line 2'] 51 | - motd: 52 | - 'Line 1' 53 | - 'Line 2' 54 | # You can also use motd: ['Line A', 'Line B'] 55 | - motd: 56 | - 'Line A' 57 | - 'Line B' 58 | 59 | favicon: '${player name}' 60 | 61 | playerCount: 62 | hidePlayers: false 63 | players: 64 | - 'Line 1' 65 | - 'Line 2' 66 | - 'Line 3' 67 | text: 'Hover Me!' 68 | extraPlayers: 69 | enabled: false 70 | amount: 0 71 | ``` 72 | /// 73 | 74 | /// tab | Diff View 75 | ```diff 76 | priority: 0 77 | 78 | -motds: 79 | - - |- 80 | - Line 1 81 | - Line 2 82 | - - |- 83 | - Line A 84 | - Line B 85 | +profiles: 86 | + # You can also use motd: ['Line 1', 'Line 2'] 87 | + - motd: 88 | + - 'Line 1' 89 | + - 'Line 2' 90 | + # You can also use motd: ['Line A', 'Line B'] 91 | + - motd: 92 | + - 'Line A' 93 | + - 'Line B' 94 | 95 | favicon: '${player name}' 96 | 97 | playerCount: 98 | hidePlayers: false 99 | players: 100 | - 'Line 1' 101 | - 'Line 2' 102 | - 'Line 3' 103 | text: 'Hover Me!' 104 | extraPlayers: 105 | enabled: false 106 | amount: 0 107 | ``` 108 | /// -------------------------------------------------------------------------------- /docs/migration/v3_7_0-to-v3_8_0.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/arrow-right-24 3 | --- 4 | 5 | # v3.7.0 to v3.8.0 6 | 7 | v3.8.0 brought a small yet important change to the condition system, which is the change of the "contains" operand from `<-` to `<_` to avoid possible issues with numbers. 8 | 9 | ## Migration 10 | 11 | To migrate, switch any appearances of `<-` with `<_` 12 | 13 | ## Example 14 | 15 | Here is a before and after example to help visualize the change: 16 | 17 | /// tab | Before 18 | ```yaml 19 | priority: 0 20 | 21 | condition: '${server host} <- "survival"' 22 | 23 | motd: 24 | - 'Welcome ${player name}!' 25 | ``` 26 | /// 27 | 28 | /// tab | After 29 | ```yaml 30 | priority: 0 31 | 32 | condition: '${server host} <_ "survival"' 33 | 34 | motd: 35 | - 'Welcome ${player name}!' 36 | ``` 37 | /// 38 | 39 | /// tab | Diff View 40 | ```diff 41 | priority: 0 42 | 43 | -condition: '${server host} <- "survival"' 44 | +condition: '${server host} <_ "survival"' 45 | 46 | motd: 47 | - 'Welcome ${player name}!' 48 | ``` 49 | /// -------------------------------------------------------------------------------- /docs/migration/v3_8_0-to-v3_9_0.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/arrow-right-24 3 | --- 4 | 5 | # v3.8.0 to v3.9.0 6 | 7 | v3.9.0 brings a small change to the `~=` operand by changing it to `=~` for sake of consistent pattern design. Additionally, was `~` added as a single-character equivalent to `=`. 8 | 9 | ## Migration 10 | 11 | To migrate, switch any appearances of `~=` with `=~` or `~`. 12 | 13 | ## Example 14 | 15 | Here is a before and after example to help visualize the change: 16 | 17 | /// tab | Before 18 | ```yaml 19 | priority: 0 20 | 21 | condition: '${player name} ~= "Someone"' 22 | 23 | motd: 24 | - 'Welcome ${player name}!' 25 | ``` 26 | /// 27 | 28 | /// tab | After 29 | ```yaml 30 | priority: 0 31 | 32 | condition: '${player name} =~ "Someone"' 33 | 34 | motd: 35 | - 'Welcome ${player name}!' 36 | ``` 37 | /// 38 | 39 | /// tab | Diff View 40 | ```diff 41 | priority: 0 42 | 43 | -condition: '${player name} ~= "Someone"' 44 | +condition: '${player name} =~ "Someone"' 45 | 46 | motd: 47 | - 'Welcome ${player name}!' 48 | ``` 49 | /// -------------------------------------------------------------------------------- /docs/placeholderapi/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: material/percent 3 | --- 4 | 5 | # PlaceholderAPI Placeholder support 6 | 7 | AdvancedServerList provides support for [PlaceholderAPI] placeholders to be used, while also providing its own set of placeholders. 8 | 9 | [placeholderapi]: https://hangar.papermc.io/HelpChat/PlaceholderAPI 10 | 11 | ## Own placeholders 12 | 13 | The below listed placeholders can be used through PlaceholderAPI in other plugins. 14 | Note that the values depend on the player it is used for, as AdvancedServerList will try and get a matching [Server List Profile](../profiles/index.md) to display values from. 15 | 16 | | Placeholder | Description | 17 | |----------------------------------|--------------------------------------------------------------------------------------------------------| 18 | | `%asl_favicon%` | Gives the value of `favicon` from a matching Profile. | 19 | | `%asl_motd%` | Gives the value of `motd` in the matching Profile as a single String. | 20 | | `%asl_playercount_extraplayers%` | Gives the value of `playerCount -> extraPlayers -> amount` from a matching Profile. Can return `null`. | 21 | | `%asl_playercount_hover%` | Gives the value of `playerCount -> hover` from a matching Profile as a single String. | 22 | | `%asl_playercount_maxplayers%` | Gives the value of `playerCount -> maxPlayers -> amount` from a matching profile. Can return `null`. | 23 | | `%asl_playercount_text%` | Gives the value of `playerCount -> text` from a matching Profile. | 24 | | `%asl_server_playersmax%` | Gives the output of `${server playersMax}` | 25 | 26 | ## Using Placeholders in Server List profiles 27 | 28 | You can use any PlaceholderAPI placeholder in a server list profile, if the following conditions are met: 29 | 30 | - The placeholder does not require the player to be online. 31 | - [PAPIProxyBridge] is installed alongside AdvancedServerList, if used on a Proxy. 32 | 33 | To use a placeholder, simply use its default `%identifier_parameters%` format. 34 | 35 | [papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge -------------------------------------------------------------------------------- /docs/profiles/formatting.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: octicons/pencil-24 3 | --- 4 | 5 | # Formatting 6 | 7 | All text options, with exception of [`Conditions`](index.md#condition), allow the usage of formatting options using [MiniMessage]. 8 | 9 | /// info | Online Tool 10 | The devs of the Adventure library provide a handy online tool to create the right formatting codes to display the text properly. 11 | You can find the tool at https://webui.advntr.dev/ 12 | /// 13 | 14 | ## Before starting 15 | 16 | Please make sure to surround your text with either single quotes (`'`) or double quotes (`"`). 17 | This avoids possible issues where the YAML parser would treat lines starting with specific characters as special options (i.e. `<` would be treated as a scolar value). 18 | 19 | ```yaml title="Wrong formatting" 20 | motd: 21 | - This will cause 22 | - Errors 23 | ``` 24 | 25 | ```yaml title="Right formatting" 26 | motd: 27 | - 'This will be formatted' 28 | - 'properly.' 29 | ``` 30 | 31 | ## Unsupported options 32 | 33 | The following options are **not** supported, no matter what option they are used in: 34 | 35 | - Hover Actions (Show text, Show Advancement, etc) 36 | - Click Actions (Run command, Suggest command, etc.) 37 | - Custom Fonts (May work if player already has the resource pack loaded) 38 | 39 | ## Colors 40 | 41 | ### Default colors 42 | 43 | Default colors such as ``, ``, ``, etc. may be used in all text options. 44 | 45 | ### Hex Colors 46 | 47 | Hexadecimal colors may be used in the [`motd`](index.md#motd) option using the `<#RRGGBB>` format. 48 | 49 | ### Gradients 50 | 51 | Gradients can be created by using `:>`, replacing `` with a starting color name or hex color value and `` with an ending color name or hex color value. 52 | Only the [`motd`](index.md#motd) option may support hex color gradients and in all other options will it be downsampled. 53 | 54 | ## Formatting 55 | 56 | Formatting options (``, ``, etc.) are available for all text options. 57 | 58 | [MiniMessage]: https://docs.adventure.kyori.net/minimessage/index.html 59 | -------------------------------------------------------------------------------- /domains: -------------------------------------------------------------------------------- 1 | asl.andre601.ch -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/commands/CmdAdvancedServerList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.commands; 27 | 28 | import ch.andre601.advancedserverlist.paper.PaperCore; 29 | import org.bukkit.command.Command; 30 | import org.bukkit.command.CommandSender; 31 | import org.jetbrains.annotations.NotNull; 32 | 33 | import java.util.Collections; 34 | 35 | public class CmdAdvancedServerList extends Command{ 36 | 37 | private final PaperCore plugin; 38 | 39 | public CmdAdvancedServerList(PaperCore plugin){ 40 | super( 41 | "advancedserverlist", 42 | "Main command of the plugin", 43 | "/asl [reload|help|clearCache]", 44 | Collections.singletonList("asl") 45 | ); 46 | this.plugin = plugin; 47 | } 48 | 49 | @Override 50 | public boolean execute(@NotNull CommandSender sender, @NotNull String s, @NotNull String[] args){ 51 | plugin.getCore().getCommandHandler().handle(new PaperCmdSender(sender), args); 52 | return true; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/commands/PaperCmdSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.commands; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender; 29 | import ch.andre601.advancedserverlist.core.parsing.ComponentParser; 30 | import org.bukkit.command.CommandSender; 31 | 32 | public class PaperCmdSender implements CmdSender{ 33 | 34 | private final CommandSender sender; 35 | 36 | public PaperCmdSender(CommandSender sender){ 37 | this.sender = sender; 38 | } 39 | 40 | @Override 41 | public boolean hasPermission(String permission){ 42 | return sender.hasPermission(permission) || sender.hasPermission("advancedserverlist.admin"); 43 | } 44 | 45 | @Override 46 | public void sendMsg(String msg, Object... args){ 47 | sender.sendMessage(ComponentParser.text(String.format(msg, args)).toComponent()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/listeners/JoinEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.listeners; 27 | 28 | import ch.andre601.advancedserverlist.paper.PaperCore; 29 | import org.bukkit.Bukkit; 30 | import org.bukkit.entity.Player; 31 | import org.bukkit.event.EventHandler; 32 | import org.bukkit.event.Listener; 33 | import org.bukkit.event.player.PlayerJoinEvent; 34 | 35 | import java.net.InetSocketAddress; 36 | 37 | public class JoinEvent implements Listener{ 38 | 39 | private final PaperCore plugin; 40 | 41 | public JoinEvent(PaperCore plugin){ 42 | this.plugin = plugin; 43 | Bukkit.getPluginManager().registerEvents(this, plugin); 44 | } 45 | 46 | @EventHandler 47 | public void onJoin(PlayerJoinEvent event){ 48 | InetSocketAddress address = event.getPlayer().getAddress(); 49 | if(address == null) 50 | return; 51 | 52 | Player player = event.getPlayer(); 53 | plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getName(), player.getUniqueId()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/listeners/LoadEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.listeners; 27 | 28 | import ch.andre601.advancedserverlist.paper.PaperCore; 29 | import org.bukkit.Bukkit; 30 | import org.bukkit.event.EventHandler; 31 | import org.bukkit.event.Listener; 32 | import org.bukkit.event.server.ServerLoadEvent; 33 | 34 | public class LoadEvent implements Listener{ 35 | 36 | private final PaperCore plugin; 37 | 38 | public LoadEvent(PaperCore plugin){ 39 | this.plugin = plugin; 40 | Bukkit.getPluginManager().registerEvents(this, plugin); 41 | } 42 | 43 | @EventHandler 44 | public void onLoad(ServerLoadEvent event){ 45 | new JoinEvent(plugin); 46 | new PingEvent(plugin); 47 | new WorldEvents(plugin); 48 | 49 | // Load currently loaded worlds into the WorldCache 50 | Bukkit.getWorlds().forEach(world -> plugin.getWorldCache().addWorld(world)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/listeners/PingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.bukkit.events.PostServerListSetEvent; 29 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 30 | import ch.andre601.advancedserverlist.core.events.PingEventHandler; 31 | import ch.andre601.advancedserverlist.paper.PaperCore; 32 | import com.destroystokyo.paper.event.server.PaperServerListPingEvent; 33 | import org.bukkit.event.EventHandler; 34 | import org.bukkit.event.EventPriority; 35 | import org.bukkit.event.Listener; 36 | 37 | public class PingEvent implements Listener{ 38 | 39 | private final PaperCore plugin; 40 | 41 | public PingEvent(PaperCore plugin){ 42 | this.plugin = plugin; 43 | plugin.getServer().getPluginManager().registerEvents(this, plugin); 44 | } 45 | 46 | @EventHandler(priority = EventPriority.HIGHEST) // Maintenance plugin has HIGHEST priority, so ASL needs too. 47 | public void onPaperServerListPing(PaperServerListPingEvent event){ 48 | ProfileEntry entry = PingEventHandler.handleEvent(new PaperEventWrapper(plugin, event)); 49 | 50 | plugin.getServer().getPluginManager().callEvent(new PostServerListSetEvent(entry)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/listeners/PreServerListSetEventImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.bukkit.events.PreServerListSetEvent; 29 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 30 | 31 | public class PreServerListSetEventImpl extends PreServerListSetEvent{ 32 | 33 | public PreServerListSetEventImpl(ProfileEntry entry){ 34 | super(entry); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/listeners/WorldEvents.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.listeners; 27 | 28 | import ch.andre601.advancedserverlist.paper.PaperCore; 29 | import org.bukkit.event.EventHandler; 30 | import org.bukkit.event.Listener; 31 | import org.bukkit.event.world.WorldLoadEvent; 32 | import org.bukkit.event.world.WorldUnloadEvent; 33 | 34 | public class WorldEvents implements Listener{ 35 | 36 | private final PaperCore plugin; 37 | 38 | public WorldEvents(PaperCore plugin){ 39 | this.plugin = plugin; 40 | } 41 | 42 | @EventHandler 43 | public void onWorldLoad(WorldLoadEvent event){ 44 | plugin.getWorldCache().addWorld(event.getWorld()); 45 | } 46 | 47 | @EventHandler 48 | public void onWorldUnload(WorldUnloadEvent event){ 49 | plugin.getWorldCache().removeWorld(event.getWorld().getName()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/logging/PaperLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.logging; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.PluginLogger; 29 | import ch.andre601.advancedserverlist.paper.PaperCore; 30 | 31 | import java.util.logging.Level; 32 | import java.util.logging.Logger; 33 | 34 | public class PaperLogger implements PluginLogger{ 35 | 36 | private final PaperCore plugin; 37 | private final Logger logger; 38 | 39 | public PaperLogger(PaperCore plugin){ 40 | this.plugin = plugin; 41 | this.logger = plugin.getLogger(); 42 | } 43 | 44 | @Override 45 | public void debug(Class clazz, String msg, Object... args){ 46 | if(plugin.isDebugEnabled()) 47 | info("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 48 | } 49 | 50 | @Override 51 | public void debugWarn(Class clazz, String msg, Object... args){ 52 | if(plugin.isDebugEnabled()) 53 | warn("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 54 | } 55 | 56 | @Override 57 | public void info(String msg, Object... args){ 58 | logger.info(String.format(msg, args)); 59 | } 60 | 61 | @Override 62 | public void warn(String msg, Object... args){ 63 | logger.warning(String.format(msg, args)); 64 | } 65 | 66 | @Override 67 | public void warn(String msg, Throwable throwable){ 68 | logger.log(Level.WARNING, msg, throwable); 69 | } 70 | 71 | @Override 72 | public void warn(String msg, Throwable throwable, Object... args){ 73 | logger.log(Level.WARNING, String.format(msg, args), throwable); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/WorldCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.objects; 27 | 28 | import org.bukkit.World; 29 | 30 | import java.util.HashMap; 31 | import java.util.Map; 32 | 33 | public record WorldCache(Map worlds){ 34 | 35 | public WorldCache(){ 36 | this(new HashMap<>()); 37 | } 38 | 39 | public boolean containsWorld(String name){ 40 | return this.worlds.containsKey(name); 41 | } 42 | 43 | public void addWorld(World world){ 44 | this.worlds.put(world.getName(), world); 45 | } 46 | 47 | public void removeWorld(String name){ 48 | this.worlds.remove(name); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/impl/PaperPlayerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitPlayer; 29 | import ch.andre601.advancedserverlist.core.objects.CachedPlayer; 30 | import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayerImpl; 31 | import org.bukkit.OfflinePlayer; 32 | 33 | public class PaperPlayerImpl extends GenericPlayerImpl implements BukkitPlayer{ 34 | 35 | private final OfflinePlayer player; 36 | private boolean playedBefore = false; 37 | private boolean banned = false; 38 | private boolean whitelisted = false; 39 | 40 | public PaperPlayerImpl(OfflinePlayer player, CachedPlayer cachedPlayer, int protocol){ 41 | this.player = player; 42 | 43 | this.name = player == null ? cachedPlayer.name() : player.getName(); 44 | this.protocol = protocol; 45 | this.uuid = player == null ? cachedPlayer.uuid() : player.getUniqueId(); 46 | 47 | if(player == null) 48 | return; 49 | 50 | this.playedBefore = player.hasPlayedBefore(); 51 | this.banned = player.isBanned(); 52 | this.whitelisted = player.isWhitelisted(); 53 | } 54 | 55 | @Override 56 | public OfflinePlayer getPlayer(){ 57 | return player; 58 | } 59 | 60 | @Override 61 | public boolean hasPlayedBefore(){ 62 | return playedBefore; 63 | } 64 | 65 | @Override 66 | public boolean isBanned(){ 67 | return banned; 68 | } 69 | 70 | @Override 71 | public boolean isWhitelisted(){ 72 | return whitelisted; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/impl/PaperServerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitServer; 29 | import org.bukkit.World; 30 | 31 | import java.util.Map; 32 | 33 | public record PaperServerImpl(Map worlds, int playersOnline, int playersMax, String host) implements BukkitServer { 34 | @Override 35 | public Map getWorlds(){ 36 | return worlds; 37 | } 38 | 39 | @Override 40 | public int getPlayersOnline(){ 41 | return playersOnline; 42 | } 43 | 44 | @Override 45 | public int getPlayersMax(){ 46 | return playersMax; 47 | } 48 | 49 | @Override 50 | public String getHost(){ 51 | return host; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/placeholders/PaperPlayerPlaceholders.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.paper.objects.placeholders; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 30 | import ch.andre601.advancedserverlist.api.objects.GenericServer; 31 | import ch.andre601.advancedserverlist.paper.objects.impl.PaperPlayerImpl; 32 | 33 | public class PaperPlayerPlaceholders extends PlaceholderProvider{ 34 | 35 | public PaperPlayerPlaceholders(){ 36 | super("player"); 37 | } 38 | 39 | @Override 40 | public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){ 41 | if(!(player instanceof PaperPlayerImpl paperPlayer)) 42 | return null; 43 | 44 | return switch(placeholder){ 45 | case "name" -> paperPlayer.getName(); 46 | case "protocol" -> String.valueOf(paperPlayer.getProtocol()); 47 | case "uuid" -> paperPlayer.getUUID().toString(); 48 | case "hasPlayedBefore" -> String.valueOf(paperPlayer.hasPlayedBefore()); 49 | case "isBanned" -> String.valueOf(paperPlayer.isBanned()); 50 | case "isWhitelisted" -> String.valueOf(paperPlayer.isWhitelisted()); 51 | default -> null; 52 | }; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /paper/src/main/resources/paper-plugin.yml: -------------------------------------------------------------------------------- 1 | name: 'AdvancedServerList' 2 | author: 'Andre_601' 3 | version: '${plugin.version}' 4 | description: '${plugin.description}' 5 | 6 | main: 'ch.andre601.advancedserverlist.paper.PaperCore' 7 | 8 | api-version: '1.19' 9 | 10 | folia-supported: true 11 | 12 | dependencies: 13 | server: 14 | PlaceholderAPI: 15 | load: BEFORE 16 | required: false 17 | ViaVersion: 18 | load: BEFORE 19 | required: false 20 | Maintenance: 21 | load: BEFORE 22 | required: false 23 | 24 | # The below stuff is NOT used by Paper plugin. 25 | commands: 26 | advancedserverlist: 27 | description: 'Main command of AdvancedServerList' 28 | usage: '/ [help|reload]' 29 | aliases: 30 | - 'asl' 31 | permission: 'advancedserverlist.admin' 32 | 33 | # This is actually supported(?) 34 | permissions: 35 | advancedserverlist.*: 36 | description: 'Grants access to all permissions' 37 | default: op 38 | children: 39 | - 'advancedserverlist.admin' 40 | advancedserverlist.admin: 41 | description: 'Grants access to all permissions' 42 | default: op 43 | children: 44 | - 'advancedserverlist.command.*' 45 | advancedserverlist.command.*: 46 | description: 'Grants access to all commands' 47 | default: op 48 | children: 49 | - 'advancedserverlist.command.help' 50 | - 'advancedserverlist.command.reload' 51 | advancedserverlist.command.help: 52 | description: 'Grants access to /asl help' 53 | default: op 54 | advancedserverlist.command.reload: 55 | description: 'Grants access to /asl reload' 56 | default: op -------------------------------------------------------------------------------- /paper/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This file is kept for Folia support. 3 | # 4 | 5 | name: 'AdvancedServerList' 6 | author: 'Andre_601' 7 | version: '${plugin.version}' 8 | description: '${plugin.description}' 9 | 10 | main: 'ch.andre601.advancedserverlist.paper.PaperCore' 11 | 12 | api-version: '1.19' 13 | 14 | folia-supported: true 15 | 16 | libraries: 17 | - 'org.spongepowered:configurate-yaml:4.1.2' 18 | - 'net.kyori:adventure-text-serializer-legacy:4.12.0' 19 | - 'com.squareup.okhttp3:okhttp:4.10.0' 20 | 21 | softdepend: 22 | - 'PlaceholderAPI' 23 | - 'Maintenance' 24 | 25 | commands: 26 | advancedserverlist: 27 | description: 'Main command of AdvancedServerList' 28 | usage: '/ [help|reload|clearCache]' 29 | aliases: 30 | - 'asl' 31 | permission: 'advancedserverlist.admin' 32 | 33 | permissions: 34 | advancedserverlist.*: 35 | description: 'Grants access to all permissions' 36 | default: op 37 | children: 38 | - 'advancedserverlist.admin' 39 | advancedserverlist.admin: 40 | description: 'Grants access to all permissions' 41 | default: op 42 | children: 43 | - 'advancedserverlist.command.*' 44 | advancedserverlist.command.*: 45 | description: 'Grants access to all commands' 46 | default: op 47 | children: 48 | - 'advancedserverlist.command.help' 49 | - 'advancedserverlist.command.reload' 50 | advancedserverlist.command.help: 51 | description: 'Grants access to /asl help' 52 | default: op 53 | advancedserverlist.command.reload: 54 | description: 'Grants access to /asl reload' 55 | default: op 56 | advancedserverlist.command.clearcache: 57 | description: 'Clears the Player and Favicon cache' 58 | default: op -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | 30 | 4.0.0 31 | 32 | ch.andre601.advancedserverlist 33 | parent 34 | pom 35 | parent 36 | 37 | 38 | UTF-8 39 | 40 | 4.6.1 41 | Create multiple Server lists based on conditions. 42 | 43 | 3.3.0 44 | 45 | 16 46 | 16 47 | 48 | 49 | 50 | 51 | jitpack 52 | https://jitpack.io/ 53 | 54 | 55 | codeberg 56 | https://codeberg.org/api/packages/Andre601/maven/ 57 | 58 | 59 | 60 | 61 | core 62 | bungeecord 63 | paper 64 | velocity 65 | version-uploader 66 | addons/banplugins 67 | 68 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "labels": ["PR Type/Dependency Update"], 4 | "ignoreDeps": [ 5 | "ch.andre601.advancedserverlist:parent", 6 | "ch.andre601.advancedserverlist:core" 7 | ], 8 | "packageRules": [ 9 | { 10 | "description": "Use Jitpack registry for AdvancedBan", 11 | "matchPackageNames": [ 12 | "com.github.DevLeoko:AdvancedBan" 13 | ], 14 | "registryUrls": [ 15 | "https://jitpack.io" 16 | ] 17 | }, 18 | { 19 | "description": "Use Codeberg packages for asl-api", 20 | "matchPackageNames": [ 21 | "ch.andre601.asl-api:api", 22 | "ch.andre601.asl-api:parent", 23 | "ch.andre601.asl-api:platform-bukkit", 24 | "ch.andre601.asl-api:platform-bungeecord", 25 | "ch.andre601.asl-api:platform-velocity", 26 | "ch.andre601:ExpressionParser" 27 | ], 28 | "registryUrls": [ 29 | "https://codeberg.org/api/packages/Andre601/maven" 30 | ] 31 | }, 32 | { 33 | "description": "Apply label for Bukkit platform", 34 | "matchFileNames": ["bukkit/pom.xml"], 35 | "addLabels": ["PR Target/Bukkit"] 36 | }, 37 | { 38 | "description": "Apply label for BungeeCord platform", 39 | "matchFileNames": ["bungeecord/pom.xml"], 40 | "addLabels": ["PR Target/BungeeCord"] 41 | }, 42 | { 43 | "description": "Apply label for Core platform", 44 | "matchFileNames": ["core/pom.xml"], 45 | "addLabels": ["PR Target/Core"] 46 | }, 47 | { 48 | "description": "Apply label for Velocity platform", 49 | "matchFileNames": ["velocity/pom.xml"], 50 | "addLabels": ["PR Target/Velocity"] 51 | }, 52 | { 53 | "description": "Apply label for GitHub Actions", 54 | "matchFileNames": [".github/workflows/*.yml"], 55 | "addLabels": ["PR Target/GitHub Action"] 56 | }, 57 | { 58 | "description": "Apply label for MkDocs", 59 | "matchFileNames": ["requirements.txt"], 60 | "addLabels": ["PR Target/MkDocs"] 61 | }, 62 | { 63 | "description": "Apply label for Woodpecker-CI", 64 | "matchFileNames": [".woodpecker/*.yml"], 65 | "addLabels": ["PR Target/Woodpecker-CI"] 66 | } 67 | ] 68 | } 69 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs-material==9.5.17 2 | mkdocs-glightbox==0.3.7 3 | git+https://github.com/Andre601/mkdocs-pagenav-generator -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/commands/CmdAdvancedServerList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.commands; 27 | 28 | import ch.andre601.advancedserverlist.velocity.VelocityCore; 29 | import com.velocitypowered.api.command.SimpleCommand; 30 | 31 | public class CmdAdvancedServerList implements SimpleCommand{ 32 | 33 | private final VelocityCore plugin; 34 | 35 | public CmdAdvancedServerList(VelocityCore plugin){ 36 | this.plugin = plugin; 37 | } 38 | 39 | @Override 40 | public void execute(Invocation invocation){ 41 | plugin.getCore().getCommandHandler().handle(new VelocityCmdSender(invocation.source()), invocation.arguments()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/commands/VelocityCmdSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.commands; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender; 29 | import ch.andre601.advancedserverlist.core.parsing.ComponentParser; 30 | import com.velocitypowered.api.command.CommandSource; 31 | 32 | public class VelocityCmdSender implements CmdSender{ 33 | 34 | private final CommandSource sender; 35 | 36 | public VelocityCmdSender(CommandSource sender){ 37 | this.sender = sender; 38 | } 39 | 40 | @Override 41 | public boolean hasPermission(String permission){ 42 | return sender.hasPermission(permission) || sender.hasPermission("advancedserverlist.admin"); 43 | } 44 | 45 | @Override 46 | public void sendMsg(String msg, Object... args){ 47 | sender.sendMessage(ComponentParser.text(String.format(msg, args)).toComponent()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/listeners/JoinEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.listeners; 27 | 28 | import ch.andre601.advancedserverlist.velocity.VelocityCore; 29 | import com.velocitypowered.api.event.Subscribe; 30 | import com.velocitypowered.api.event.connection.PostLoginEvent; 31 | import com.velocitypowered.api.proxy.Player; 32 | 33 | import java.net.InetSocketAddress; 34 | 35 | public class JoinEvent{ 36 | 37 | private final VelocityCore plugin; 38 | 39 | public JoinEvent(VelocityCore plugin){ 40 | this.plugin = plugin; 41 | plugin.getProxy().getEventManager().register(plugin, this); 42 | } 43 | 44 | @Subscribe 45 | public void onJoin(PostLoginEvent event){ 46 | InetSocketAddress address = event.getPlayer().getRemoteAddress(); 47 | Player player = event.getPlayer(); 48 | 49 | plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getUsername(), player.getUniqueId()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/listeners/PingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 29 | import ch.andre601.advancedserverlist.api.velocity.events.PostServerListSetEvent; 30 | import ch.andre601.advancedserverlist.core.events.PingEventHandler; 31 | import ch.andre601.advancedserverlist.velocity.VelocityCore; 32 | import com.velocitypowered.api.event.PostOrder; 33 | import com.velocitypowered.api.event.Subscribe; 34 | import com.velocitypowered.api.event.proxy.ProxyPingEvent; 35 | 36 | public class PingEvent{ 37 | 38 | private final VelocityCore plugin; 39 | 40 | public PingEvent(VelocityCore plugin){ 41 | this.plugin = plugin; 42 | plugin.getProxy().getEventManager().register(plugin, this); 43 | } 44 | 45 | @Subscribe(order = PostOrder.LAST) // Maintenance has LAST priority, so ASL needs it too. 46 | public void onProxyPing(ProxyPingEvent event){ 47 | ProfileEntry entry = PingEventHandler.handleEvent(new VelocityEventWrapper(plugin, event)); 48 | 49 | plugin.getProxy().getEventManager().fire(new PostServerListSetEvent(entry)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/listeners/PreServerListSetEventImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.listeners; 27 | 28 | import ch.andre601.advancedserverlist.api.profiles.ProfileEntry; 29 | import ch.andre601.advancedserverlist.api.velocity.events.PreServerListSetEvent; 30 | 31 | public class PreServerListSetEventImpl extends PreServerListSetEvent{ 32 | public PreServerListSetEventImpl(ProfileEntry entry){ 33 | super(entry); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/logging/VelocityLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.logging; 27 | 28 | import ch.andre601.advancedserverlist.core.interfaces.PluginLogger; 29 | import ch.andre601.advancedserverlist.velocity.VelocityCore; 30 | import org.slf4j.Logger; 31 | 32 | public class VelocityLogger implements PluginLogger{ 33 | 34 | private final VelocityCore plugin; 35 | private final Logger logger; 36 | 37 | public VelocityLogger(VelocityCore plugin, Logger logger){ 38 | this.plugin = plugin; 39 | this.logger = logger; 40 | } 41 | 42 | @Override 43 | public void debug(Class clazz, String msg, Object... args){ 44 | if(plugin.isDebugEnabled()) 45 | info("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 46 | } 47 | 48 | @Override 49 | public void debugWarn(Class clazz, String msg, Object... args){ 50 | if(plugin.isDebugEnabled()) 51 | warn("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args); 52 | } 53 | 54 | @Override 55 | public void info(String msg, Object... args){ 56 | logger.info(String.format(msg, args)); 57 | } 58 | 59 | @Override 60 | public void warn(String msg, Object... args){ 61 | logger.warn(String.format(msg, args)); 62 | } 63 | 64 | @Override 65 | public void warn(String msg, Throwable throwable){ 66 | logger.warn(msg, throwable); 67 | } 68 | 69 | @Override 70 | public void warn(String msg, Throwable throwable, Object... args){ 71 | logger.warn(String.format(msg, args), throwable); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/objects/impl/VelocityPlayerImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.api.velocity.objects.VelocityPlayer; 29 | import ch.andre601.advancedserverlist.core.objects.CachedPlayer; 30 | import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayerImpl; 31 | import com.velocitypowered.api.network.ProtocolVersion; 32 | 33 | public class VelocityPlayerImpl extends GenericPlayerImpl implements VelocityPlayer{ 34 | 35 | private final String version; 36 | 37 | public VelocityPlayerImpl(CachedPlayer player, int protocol){ 38 | this.name = player.name(); 39 | this.protocol = protocol; 40 | this.uuid = player.uuid(); 41 | this.version = ProtocolVersion.getProtocolVersion(protocol).getVersionIntroducedIn(); 42 | } 43 | 44 | @Override 45 | public String getVersion(){ 46 | return version; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/objects/impl/VelocityProxyImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.objects.impl; 27 | 28 | import ch.andre601.advancedserverlist.api.velocity.objects.VelocityProxy; 29 | import com.velocitypowered.api.proxy.server.RegisteredServer; 30 | 31 | import java.util.Map; 32 | 33 | public record VelocityProxyImpl(Map servers, int playersOnline, int playersMax, String host) implements VelocityProxy{ 34 | @Override 35 | public Map getServers(){ 36 | return servers; 37 | } 38 | 39 | @Override 40 | public int getPlayersOnline(){ 41 | return playersOnline; 42 | } 43 | 44 | @Override 45 | public int getPlayersMax(){ 46 | return playersMax; 47 | } 48 | 49 | @Override 50 | public String getHost(){ 51 | return host; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /velocity/src/main/java/ch/andre601/advancedserverlist/velocity/objects/placeholders/VelocityPlayerPlaceholders.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.velocity.objects.placeholders; 27 | 28 | import ch.andre601.advancedserverlist.api.PlaceholderProvider; 29 | import ch.andre601.advancedserverlist.api.objects.GenericPlayer; 30 | import ch.andre601.advancedserverlist.api.objects.GenericServer; 31 | import ch.andre601.advancedserverlist.api.velocity.objects.VelocityPlayer; 32 | 33 | public class VelocityPlayerPlaceholders extends PlaceholderProvider{ 34 | 35 | private VelocityPlayerPlaceholders(){ 36 | super("player"); 37 | } 38 | 39 | public static VelocityPlayerPlaceholders init(){ 40 | return new VelocityPlayerPlaceholders(); 41 | } 42 | 43 | @Override 44 | public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){ 45 | if(!(player instanceof VelocityPlayer velocityPlayer)) 46 | return null; 47 | 48 | return switch(placeholder){ 49 | case "name" -> velocityPlayer.getName(); 50 | case "protocol" -> String.valueOf(velocityPlayer.getProtocol()); 51 | case "uuid" -> String.valueOf(velocityPlayer.getUUID()); 52 | case "version" -> velocityPlayer.getVersion(); 53 | default -> null; 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /velocity/src/main/resources/velocity-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "advancedserverlist", 3 | "name": "AdvancedServerList", 4 | "version": "${plugin.version}", 5 | "description": "${plugin.description}", 6 | "authors": [ 7 | "Andre_601" 8 | ], 9 | "dependencies": [ 10 | { 11 | "id": "papiproxybridge", 12 | "optional": true 13 | }, 14 | { 15 | "id": "maintenance", 16 | "optional": true 17 | } 18 | ], 19 | "main": "ch.andre601.advancedserverlist.velocity.VelocityCore" 20 | } -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/ReleaseHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2024 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader; 27 | 28 | import java.util.ArrayList; 29 | import java.util.HashMap; 30 | import java.util.List; 31 | import java.util.Map; 32 | 33 | public class ReleaseHolder{ 34 | 35 | private final List releases = new ArrayList<>(); 36 | 37 | public void addRelease(String type, String platform, String url){ 38 | releases.add(new ReleaseInfo(type, platform, url)); 39 | } 40 | 41 | public List getReleases(){ 42 | return releases; 43 | } 44 | 45 | record ReleaseInfo(String type, String platform, String url){} 46 | } 47 | -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/data/CodebergRelease.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader.data; 27 | 28 | import com.google.gson.annotations.SerializedName; 29 | 30 | public record CodebergRelease(long id, @SerializedName("tag_name") String tagName, String body, boolean prerelease){} 31 | -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/hangar/version/Dependency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader.hangar.version; 27 | 28 | public record Dependency(String name, String externalUrl, boolean required){ 29 | 30 | public Dependency{ 31 | if(name == null && externalUrl == null) 32 | throw new IllegalStateException("Either a namespace or external URL needs to be defined."); 33 | } 34 | 35 | public static Dependency fromNamespace(String name, boolean required){ 36 | return new Dependency(name, null, required); 37 | } 38 | 39 | public static Dependency fromUrl(String url, boolean required){ 40 | return new Dependency(null, url, required); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/hangar/version/MultipartObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader.hangar.version; 27 | 28 | import java.util.List; 29 | 30 | public record MultipartObject(List platforms, String url){} -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/hangar/version/Platform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader.hangar.version; 27 | 28 | public enum Platform{ 29 | PAPER, 30 | WATERFALL, 31 | VELOCITY 32 | } 33 | -------------------------------------------------------------------------------- /version-uploader/src/main/java/ch/andre601/advancedserverlist/versionuploader/hangar/version/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2022-2023 Andre_601 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | */ 25 | 26 | package ch.andre601.advancedserverlist.versionuploader.hangar.version; 27 | 28 | import java.util.List; 29 | import java.util.Map; 30 | 31 | public record Version(String version, Map> pluginDependencies, 32 | Map> platformDependencies, String description, 33 | List files, String channel){ 34 | } 35 | -------------------------------------------------------------------------------- /version-uploader/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | %highlight([) %boldWhite(%d{dd.MM.yyyy HH:mm:ss}) %highlight(%-5level) %highlight(]) %cyan([%t]) %boldWhite([%logger{0}]) %boldRed(-) %white(%msg) %n 34 | 35 | 36 | 37 | 38 | 39 | 40 | INFO 41 | 42 | ${DEV_HOME}/HangarUploader.log 43 | 44 | %d{dd.MM.yyyy HH:mm:ss} [%thread] [ %-5level] [%logger{0}] %msg%n 45 | 46 | 47 | 48 | ${DEV_HOME}/archived/hangeruploader-%d{dd.MM.yyyy}.%i.log 49 | 100MB 50 | 60 51 | 20GB 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /version-uploader/src/main/resources/version.properties: -------------------------------------------------------------------------------- 1 | # 2 | # MIT License 3 | # 4 | # Copyright (c) 2022-2023 Andre_601 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in all 14 | # copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | # SOFTWARE. 23 | # 24 | # 25 | 26 | version=${plugin.version} --------------------------------------------------------------------------------