{"id":24306773,"url":"https://github.com/efekos/popularconfigurations","last_synced_at":"2026-05-29T12:03:31.685Z","repository":{"id":270227295,"uuid":"908328984","full_name":"efekos/PopularConfigurations","owner":"efekos","description":"Only configuration library you will ever need.","archived":false,"fork":false,"pushed_at":"2025-02-17T01:14:28.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T02:23:30.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efekos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-25T18:50:34.000Z","updated_at":"2025-02-17T01:11:23.000Z","dependencies_parsed_at":"2025-02-17T02:22:15.116Z","dependency_job_id":"cd9ee067-6672-4d65-98f1-765d8ae2a912","html_url":"https://github.com/efekos/PopularConfigurations","commit_stats":null,"previous_names":["efekos/popularconfigurations"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efekos%2FPopularConfigurations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efekos%2FPopularConfigurations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efekos%2FPopularConfigurations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efekos%2FPopularConfigurations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efekos","download_url":"https://codeload.github.com/efekos/PopularConfigurations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242261821,"owners_count":20098834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-17T03:48:35.169Z","updated_at":"2026-05-29T12:03:26.648Z","avatar_url":"https://github.com/efekos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](assets/PopularConfigurations.png)\n# PopularConfigurations\n\n![](https://badgen.net/github/license/efekos/PopularConfigurations)\n![](https://badgen.net/github/stars/efekos/PopularConfigurations)\n![](https://badgen.net/github/release/efekos/PopularConfigurations)\n![](https://badgen.net/github/releases/efekos/PopularConfigurations)\n![](https://badgen.net/github/merged-prs/efekos/PopularConfigurations)\n![](https://badgen.net/github/issues/efekos/PopularConfigurations)\n\n\u003c!-- TOC --\u003e\n* [PopularConfigurations](#popularconfigurations)\n  * [Installation](#installation)\n    * [Maven](#maven)\n    * [Gradle](#gradle)\n* [Usage](#usage)\n  * [Options](#options)\n* [License](#license)\n\u003c!-- TOC --\u003e\n\nA lightweight, basic configuration library to use in Spigot or Paper plugins.\n\n## Installation\n\n### Maven\n\n1. Add this repository if you don't have it:\n\n````xml\n\u003crepository\u003e\n    \u003cid\u003eefekosdev\u003c/id\u003e\n    \u003curl\u003ehttps://efekos.dev/maven\u003c/url\u003e\n\u003c/repository\u003e\n````\n\n2. Add this dependency. Use the latest release as the version. You can also replace `pc-paper` with `pc-spigot` if you use Spigot.\n\n````xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.efekos.pc\u003c/groupId\u003e\n    \u003cartifactId\u003epc-paper\u003c/artifactId\u003e\n    \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n````\n\n### Gradle\n\n1. Add this repository if you don't have it.\n\n````gradle\nmaven { url = 'https://efekos.dev/maven' }\n````\n\n2. Add this dependency. Use the latest release as the version. You can also replace `pc-paper` with `pc-spigot` if you use Spigot.\n\n````gradle\nimplementation 'dev.efekos.pc:pc-paper:1.0'\n````\n\n# Usage\n\nThere are currently three types of configurations in PopularConfigurations. **JsonConfig**s, **YamlConfig**s and\n**MessageProvider**s. YAML and JSON config classes are pretty self-explanatory, they are the same thing but in different\nformats. **MessageProvider**s on the other hand, lets you translate colors and apply placeholders with ease. Here is a \nfull example of both a normal config and a **MessageProvider**.\n\n````java\n\nimport dev.efekos.pc.YamlConfig;\nimport dev.efekos.pc.Placeholder;\nimport dev.efekos.pc.MessagePortionHider;\n\nimport java.util.List;\n\npublic class MyPlugin extends JavaPlugin {\n\n    private YamlConfig config;\n    private static MessageProvider provider;\n\n    public static String format(String key, Placeholder... placeholders) {\n        return provider.format(key, placeholders);\n    }\n\n    public static List\u003cString\u003e format(String key, MessagePortionHider hider, Placeholder... placeholders) {\n        return provider.formatList(key, hider, placeholders);\n    }\n\n    @Override\n    public void onEnable() {\n        config = new YamlConfig(\"config.yml\", this);\n        config.setup();\n        if (isDebugModeEnabled()) config.override();\n\n        JsonConfig messageConfig = new JsonConfig(\"messages.json\", this);\n        messageConfig.setup();\n        provider = messageConfig.asMessageProvider();\n    }\n\n    public boolean isDebugModeEnabled() {\n        //\n    }\n\n}\n````\n\n## Options\n\nOther than basic configuration classes and **MessageProviders**, this library has one more type of configuration,\n**OptionLoader**. **OptionLoader**s only work with **YamlConfig**s. In order to use **OptionLoader**s, you have to\ncreate **Option**s to load. Like this:\n\n````java\nimport dev.efekos.pc.option.Option;\nimport dev.efekos.pc.option.OptionType;\n\nimport java.util.List;\n\npublic class MyPluginOptions {\n    \n    public static final Option\u003cString\u003e PREFIX = Option.of(\"prefix\", OptionType.STRING, \"\u00266MP: \u0026r\");\n    public static final Option\u003cBoolean\u003e CLEAR_CACHE = Option.of(\"clear-cache.enabled\", OptionType.BOOLEAN, true);\n    public static final Option\u003cInteger\u003e CLEAR_CACHE_INTERVAL = Option.of(\"clear-cache.interval\", OptionType.INTEGER, 10);\n    public static final Option\u003cList\u003cOfflinePlayer\u003e\u003e MANAGERS = Option.of(\"managers\", OptionType.OFFLINE_PLAYER.array(), List.of());\n    \n}\n````\n\nThen, you can use `YamlConfig#asOptionLoader()` to get an **OptionLoader** and use options like this:\n\n````java\n\nimport dev.efekos.pc.option.OptionLoader;\nimport dev.efekos.mp.MyPluginOptions;\n\npublic class Utilities {\n    \n    public static OptionLoader OPTION_LOADER;\n    \n    public static String getPrefix(){\n        return OPTION_LOADER.getOption(MyPluginOptions.PREFIX);   \n    }\n    \n    public static boolean isCacheEnabled(){\n        return OPTION_LOADER.getOption(MyPluginOptions.CLEAR_CACHE);\n    }\n    \n    public static boolean isManager(OfflinePlayer player){\n        return OPTION_LOADER.getOption(MyPluginOptions.MANAGERS).contains(player);\n    }\n    \n}\n````\n\nYou can also create your own implementations of **OptionType** if you can't find an **OptionType** for the class you\nwant to use. If the class you want to use isn't a custom class in your plugin, you can\n[open an issue](https://github.com/efekos/PopularConfigurations/issues) to add it to builtin option types.\n\n# License\n\nThis project is licensed with the [MIT License](./LICENSE.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefekos%2Fpopularconfigurations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefekos%2Fpopularconfigurations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefekos%2Fpopularconfigurations/lists"}