From 031625e24157cd608292df20c7aaefc87c26530a Mon Sep 17 00:00:00 2001 From: CMPSCjg <52573645+CMPSCjg@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:58:13 -0400 Subject: [PATCH 01/86] Add TokensPlus Placeholder --- wiki/Placeholders.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index e3e7aa8..7907a5f 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -294,6 +294,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[TokenEnchant](#tokenenchant)** - **[TokenManager](#tokenmanager)** - **[Tokens](#tokens)** +- **[TokensPlus](#tokensplus)** - **[Towny](#towny)** - **[TownyChat](#townychat)** - **[TransmuteIt](#transmuteit)** @@ -4404,6 +4405,13 @@ Replace `XXX` with the enchantment. ``` ---- +- ### **[TokensPlus](https://www.spigotmc.org/resources/tokensplus.90507/)** +> NO DOWNLOAD COMMAND +``` +%tokensplus_tokens% +``` +---- + - ### **[Towny](https://github.com/TownyAdvanced/Towny)** > NO DOWNLOAD COMMAND From 33ff83d102583eeb82b0a17ce8f2cc36b1112b32 Mon Sep 17 00:00:00 2001 From: CMPSCjg <52573645+CMPSCjg@users.noreply.github.com> Date: Wed, 24 Mar 2021 16:16:04 -0400 Subject: [PATCH 02/86] Update wiki/Placeholders.md My bad, thought I updated the URL to reflect this format. Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> --- wiki/Placeholders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 7907a5f..89b76b0 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4405,7 +4405,7 @@ Replace `XXX` with the enchantment. ``` ---- -- ### **[TokensPlus](https://www.spigotmc.org/resources/tokensplus.90507/)** +- ### **[TokensPlus](https://www.spigotmc.org/resources/90507/)** > NO DOWNLOAD COMMAND ``` %tokensplus_tokens% From 72239801d8a140c200e70ad04d86f75d02545ad1 Mon Sep 17 00:00:00 2001 From: CMPSCjg <52573645+CMPSCjg@users.noreply.github.com> Date: Wed, 24 Mar 2021 16:19:33 -0400 Subject: [PATCH 03/86] Update Placeholders.md --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 89b76b0..f12d2e6 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4407,6 +4407,7 @@ Replace `XXX` with the enchantment. - ### **[TokensPlus](https://www.spigotmc.org/resources/90507/)** > NO DOWNLOAD COMMAND + ``` %tokensplus_tokens% ``` From b207cbf03ec1dadb2507dff4d133fbd2e88676fb Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Wed, 24 Mar 2021 21:37:06 +0100 Subject: [PATCH 04/86] Add plugin to Plugins using PlaceholderAPI page --- wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 0447951..2421658 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -900,6 +900,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[Tokens](https://www.spigotmc.org/resources/71941/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#tokens]]**] +- **[TokensPlus](https://www.spigotmc.org/resources/90507/)** + - [ ] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#tokensplus]]**] - **[Towny](https://github.com/TownyAdvanced/Towny)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#towny]]**] From 2fc28777b7816346aee5ff83ee5dfb7cfdc608bc Mon Sep 17 00:00:00 2001 From: vk2gpz Date: Thu, 25 Mar 2021 12:56:26 +1100 Subject: [PATCH 05/86] added %vkautopickup_autosmelt% and %vkautopickup_autoblock% to VKAutoPickup. --- wiki/Placeholders.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index f12d2e6..800b376 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4614,6 +4614,8 @@ Replace `XXX` with the enchantment. %vkautopickup_pickup% %vkautopickup_autosell% %vkautopickup_autoplanting% +%vkautopickup_autosmelt% +%vkautopickup_autoblock% ``` ---- From fb8572313edce6a24c066674cde3de1676caa86a Mon Sep 17 00:00:00 2001 From: Alpha018 Date: Thu, 25 Mar 2021 03:07:49 -0300 Subject: [PATCH 06/86] modify: Change wiki to use new placeholder --- wiki/Placeholders.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 800b376..fb40843 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3889,6 +3889,7 @@ The following placeholders are the same as above but instead of specifying the s > NO DOWNLOAD COMMAND ``` +Deprecated in old versions %skywarsreloaded_score% %skywarsreloaded_wins% %skywarsreloaded_kills% @@ -3902,6 +3903,17 @@ The following placeholders are the same as above but instead of specifying the s %skywarsreloaded_time_vote% %skywarsreloaded_opvote% %skywarsreloaded_op_vote% + +Tested on version (5.4.2) +%swr_wins% +%swr_losses% +%swr_kills% +%swr_deaths% +%swr_xp% +%swr_level% +%swr_games_played% +%swr_kill_death% +%swr_win_loss% ``` ---- From 8757217fb68a48705d7747c538466e88bf87daa3 Mon Sep 17 00:00:00 2001 From: LOOHP Date: Fri, 26 Mar 2021 21:53:43 +0800 Subject: [PATCH 07/86] Add %interactivechat_invdisplaylayout% placeholder --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index fb40843..8c6edeb 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -2378,6 +2378,7 @@ You can find an up-to-date list of the placeholders in [their wiki](https://fact ``` %interactivechat_mentiontoggle% +%interactivechat_invdisplaylayout% ``` ---- From b55261a62fd792146af69b6b67c263d7b9e36a66 Mon Sep 17 00:00:00 2001 From: matahombres Date: Sat, 27 Mar 2021 17:06:25 +0100 Subject: [PATCH 08/86] Update advancements placeholder --- wiki/Placeholders.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 8c6edeb..9886a10 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -337,13 +337,20 @@ More info about this expansion can be found on the [GitHub-Repository](https://g ``` %Advancements_% %Advancements_player_;% +%Advancements_list% +%Advancements_list_% %Advancements_playerList_% %Advancements_playerList_,% +%Advancements_listFormat% %Advancements_playerListFormat_% -%Advancements_completedAmount_% -%Advancements_completedAmount_,% -%Advancements_remainingAmount_% -%Advancements_remainingAmount_,% +%Advancements_completedAmount% +%Advancements_completedAmount_% +%Advancements_playerCompletedAmount_% +%Advancements_playerCompletedAmount_,% +%Advancements_remainingAmount% +%Advancements_remainingAmount_% +%Advancements_playerRemainingAmount_% +%Advancements_playerRemainingAmount_,% ``` ---- From e9e4caf98906e6b91fdaa008b29dec32422a9cb3 Mon Sep 17 00:00:00 2001 From: Paul Baird Date: Wed, 31 Mar 2021 15:24:25 +0100 Subject: [PATCH 09/86] Add TeamsExpansion placeholder expansion --- wiki/Placeholders.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 9886a10..8bd6881 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4768,3 +4768,14 @@ Replace `XXX` with the enchantment. %xlt_{tournamentId}_position% %xlt_{tournamentId}_type% ``` +---- + +- ### **[TeamsExpansion](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/)** +> NO DOWNLOAD COMMAND + +``` +%team_color% +%team_prefix% +%team_suffix% +%team_name% +``` From 79ec3c8f959a973ddc6bfb014ad6401989e32a76 Mon Sep 17 00:00:00 2001 From: Paul Baird Date: Wed, 31 Mar 2021 15:29:46 +0100 Subject: [PATCH 10/86] Added TeamExpansion in correct place --- wiki/Placeholders.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 8bd6881..db20775 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1064,6 +1064,17 @@ Other statistics ``` ---- +- ### **[TeamsExpansion](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/)** +> Download from [here](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/) + +``` +%team_color% +%team_prefix% +%team_suffix% +%team_name% +``` +---- + - ### **World** > /papi ecloud download world @@ -4768,14 +4779,3 @@ Replace `XXX` with the enchantment. %xlt_{tournamentId}_position% %xlt_{tournamentId}_type% ``` ----- - -- ### **[TeamsExpansion](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/)** -> NO DOWNLOAD COMMAND - -``` -%team_color% -%team_prefix% -%team_suffix% -%team_name% -``` From c3bdc90168449019f67aa2fe66a9d5f3a3e815d8 Mon Sep 17 00:00:00 2001 From: Paul Baird Date: Wed, 31 Mar 2021 15:59:44 +0100 Subject: [PATCH 11/86] Corrected entry and added ecloud command --- wiki/Placeholders.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index db20775..f70cb2a 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1064,8 +1064,8 @@ Other statistics ``` ---- -- ### **[TeamsExpansion](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/)** -> Download from [here](https://www.spigotmc.org/resources/teams-placeholder-expansion.90773/) +- ### **[TeamsExpansion](https://www.spigotmc.org/resources/90773/)** +> /papi ecloud download TeamsExpansion ``` %team_color% From e4a6faa22a51c4f3c63899a35430eb09b6e483b6 Mon Sep 17 00:00:00 2001 From: Paul Baird Date: Wed, 31 Mar 2021 16:09:15 +0100 Subject: [PATCH 12/86] Corrected ecloud link for name change --- wiki/Placeholders.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index f70cb2a..c8641bc 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1064,8 +1064,8 @@ Other statistics ``` ---- -- ### **[TeamsExpansion](https://www.spigotmc.org/resources/90773/)** -> /papi ecloud download TeamsExpansion +- ### **[Teams](https://www.spigotmc.org/resources/90773/)** +> /papi ecloud download Teams ``` %team_color% From 501d1bbbdd3ab9dbbc2481e0829f0222dfa2e208 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Wed, 31 Mar 2021 17:28:14 +0200 Subject: [PATCH 13/86] Add minor corrections --- wiki/Placeholders.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index c8641bc..a78bffe 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -45,6 +45,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[SpeedPerSec](#speedpersec)** - **[Statistic](#statistic)** - **[Team](#team)** +- **[Teams](#teams)** - **[World](#world)** ---- @@ -1056,7 +1057,9 @@ Other statistics --- - ### **[Team](https://www.spigotmc.org/resources/74959/)** -> Download from [here](https://www.spigotmc.org/resources/74959/) +> NO DOWNLOAD COMMAND + +Download from [here](https://www.spigotmc.org/resources/74959/) ``` %team_color% @@ -1065,7 +1068,7 @@ Other statistics ---- - ### **[Teams](https://www.spigotmc.org/resources/90773/)** -> /papi ecloud download Teams +> /papi ecloud download teams ``` %team_color% From 04968cb4374fa48ffda5b3f3dae9b93bc8f169dc Mon Sep 17 00:00:00 2001 From: Lorenzo <69311874+Lorenzo0111@users.noreply.github.com> Date: Fri, 2 Apr 2021 17:01:52 +0200 Subject: [PATCH 14/86] Update Plugins-using-PlaceholderAPI.md --- wiki/Plugins-using-PlaceholderAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 2421658..6d7e506 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -730,7 +730,7 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - [x] Supports placeholders. - [ ] Provides own placeholders. [Link] - **[RocketPlaceholders](https://www.spigotmc.org/resources/82678/)** - - [ ] Supports placeholders. + - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#rocketplaceholders]]**] - **[RogueParkour](https://www.spigotmc.org/resources/26563/)** - [ ] Supports placeholders. From f711500d8090971949d328636b9fc50f66b9cfd0 Mon Sep 17 00:00:00 2001 From: RobinDeBaets Date: Sat, 10 Apr 2021 17:01:54 +0200 Subject: [PATCH 15/86] Add %statistic_mob_kills% --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index a78bffe..c5477ce 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -986,6 +986,7 @@ For specific blocks, items, entities, ... Other statistics ``` +%statistic_mob_kills% %statistic_mine_block% %statistic_use_item% %statistic_break_item% From 001fa6bcf2bf30e3f0ba01be09c156175a7da4aa Mon Sep 17 00:00:00 2001 From: CMPSCjg <52573645+CMPSCjg@users.noreply.github.com> Date: Mon, 12 Apr 2021 11:49:16 -0400 Subject: [PATCH 16/86] Add 2 New TokensPlus Placeholders --- wiki/Placeholders.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index c5477ce..f93f814 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4445,6 +4445,8 @@ Replace `XXX` with the enchantment. ``` %tokensplus_tokens% +%tokensplus_tokens_commas% +%tokensplus_tokens_formatted% ``` ---- From 8b5ead7a13b92007f48453d0b6092053ab9d8ac7 Mon Sep 17 00:00:00 2001 From: thienbao860 <35884937+thienbao860@users.noreply.github.com> Date: Tue, 13 Apr 2021 23:18:39 +0700 Subject: [PATCH 17/86] Update placeholders, clear Spectator expansion --- wiki/Placeholders.md | 47 +++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index f93f814..2ea09cb 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -41,7 +41,6 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Server](#server)** - **[Shortcut](#shortcut)** - **[Sound](#sound)** -- **[Spectators](#spectators)** - **[SpeedPerSec](#speedpersec)** - **[Statistic](#statistic)** - **[Team](#team)** @@ -949,23 +948,15 @@ This placeholder is for all players on the server. - ### **SpeedPerSec** > /papi ecloud download SpeedPerSec +Note: Clicking is supported in left click only ``` -%speedpersec_blockBreak% -%speedpersec_blockPlace% +%speedpersec_blockbreak% +%speedpersec_blockplace% %speedpersec_speed% -%speedpersec_expCollected% +%speedpersec_expcollected% %speedpersec_damaging% %speedpersec_hurting% -``` ----- - -- ### **Spectators** -> /papi ecloud download Spectators - -``` -%spectator_isSpectating% -%spectator_lookFrom% -%spectator_infoFrom_health% +%speedpersec_clicking% ``` ---- @@ -1082,26 +1073,28 @@ Download from [here](https://www.spigotmc.org/resources/74959/) - ### **World** > /papi ecloud download world -For the totalBalance placeholder, you must have a service provider plugin (eg. EssentialsX) +For the totalbalance placeholder, you must have a service provider plugin (eg. EssentialsX) to work ``` -%world_animalAllowed_% %world_biome% -%world_canPvP_% -%world_difficulty_% -%world_isgamerule__% -%world_monsterAllowed_% -%world_name_% %world_nearbyEntities_% -%world_playerexist_% +%world_total% +%world_name_% +%world_seed_% +%world_sealevel_% +%world_time_% +%world_timein12_% +%world_canpvp_% +%world_thunder_% +%world_animalallowed_% +%world_monsterallowed_% +%world_difficulty_% %world_players_% %world_players__% +%world_haspermission__% +%world_playerexist__% +%world_isgamerule__% %world_recentjoin_% %world_recentquit_% -%world_sealevel_% -%world_seed_% -%world_thunder_% -%world_time_% -%world_total% %world_totalbalance_% ``` ---- From 5595bc144f731fe0a330c9fcaced30023e760932 Mon Sep 17 00:00:00 2001 From: Kyle <39589930+MysteriousKyle@users.noreply.github.com> Date: Wed, 14 Apr 2021 10:56:27 -0500 Subject: [PATCH 18/86] Addition of a plugin using PalaceholderAPI --- wiki/Placeholders.md | 14 ++++++++++++++ wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 2 files changed, 17 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 2ea09cb..a088de5 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -305,6 +305,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th ## **U** - **[USkyBlock](#uskyblock)** - **[UltimateChat](#ultimatechat)** +- **[UltimateClaims](#ultimateclaims)** - **[UltimateVotes](#ultimatevotes)** - **[UnityGen](#unitygen)** @@ -4576,6 +4577,19 @@ Replace `XXX` with the enchantment. ---- +- ### **[UltimateClaims](https://songoda.com/marketplace/product/65)** +> NO DOWNLOAD COMMAND + +``` +%ultimateclaims_claims% +%ultimateclaims_owner% +%ultimateclaims_bans% +%ultimateclaims_totalpower% +%ultimateclaims_remainingpower% +%ultimateclaims_totalchunks% +``` +---- + - ### **[UltimateVotes](https://www.spigotmc.org/resources/516)** > /papi ecloud download UltimateVotes diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 6d7e506..0bf5638 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -936,6 +936,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[UltimateBossBar](https://www.spigotmc.org/resources/19303/)** - [x] Supports placeholders. - [ ] Provides own placeholders. +- **[UltimateClaims](https://songoda.com/marketplace/product/65)** + - [ ] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#ultimateclaims]]**] - **[UltimateSigns](https://www.spigotmc.org/resources/72462/)** - [x] Supports placeholders. - [ ] Provides own placeholders. From 9843d84ac3fc10e0af68d5731d800972e04538b2 Mon Sep 17 00:00:00 2001 From: Hempfest <64885225+Hempfest@users.noreply.github.com> Date: Sat, 17 Apr 2021 02:43:19 -0700 Subject: [PATCH 19/86] Updated Clans Pro Listing. New placeholders. --- wiki/Placeholders.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index a088de5..7dac807 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1683,8 +1683,17 @@ Note: You have to download the jar from the linked Spigot page. %clanspro_clan_pvp_mode% %clanspro_clan_balance% %clanspro_clan_power% +%clanspro_clan_top_slot_#% +%clanspro_clan_top_slot_#_power% +%clanspro_clan_top_slot_#_color% +%clanspro_clan_war_active% +%clanspro_clan_war_score% +%clanspro_clan_war_hours% +%clanspro_clan_war_minutes% +%clanspro_clan_war_seconds% %clanspro_clan_members_online% %clanspro_member_rank% +%clanspro_member_rank_short% %clanspro_member_bio% %clanspro_raidshield_status% ``` From b747720f36de44421f080f4ef4c650bd7a7c8202 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sun, 18 Apr 2021 02:33:40 +0200 Subject: [PATCH 20/86] Update towny placeholders --- wiki/Placeholders.md | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 7dac807..ad003d1 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4456,28 +4456,8 @@ Replace `XXX` with the enchantment. - ### **[Towny](https://github.com/TownyAdvanced/Towny)** > NO DOWNLOAD COMMAND -``` -%townyadvanced_town% -%townyadvanced_town_formatted% -%townyadvanced_nation% -%townyadvanced_nation_formatted% -%townyadvanced_town_balance% -%townyadvanced_nation_balance% -%townyadvanced_town_tag% -%townyadvanced_town_tag_override% -%townyadvanced_nation_tag% -%townyadvanced_nation_tag_override% -%townyadvanced_towny_tag% -%townyadvanced_towny_tag_override% -%townyadvanced_towny_tag_formatted% -%townyadvanced_title% -%townyadvanced_surname% -%townyadvanced_towny_name_prefix% -%townyadvanced_towny_name_postfix% -%townyadvanced_towny_prefix% -%townyadvanced_towny_postfix% -%townyadvanced_towny_colour% -``` +You can find an up-to-date list of the placeholders on the [Towny wiki](https://github.com/TownyAdvanced/Towny/wiki/Placeholders) + ---- - ### **[TownyChat](https://github.com/TownyAdvanced/TownyChat)** From 0b1bd1c265759b8d2dc9d5c6412f2e82e21ddcee Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sun, 18 Apr 2021 02:40:30 +0200 Subject: [PATCH 21/86] Forgot the dot. --- wiki/Placeholders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index ad003d1..b403d0e 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4456,7 +4456,7 @@ Replace `XXX` with the enchantment. - ### **[Towny](https://github.com/TownyAdvanced/Towny)** > NO DOWNLOAD COMMAND -You can find an up-to-date list of the placeholders on the [Towny wiki](https://github.com/TownyAdvanced/Towny/wiki/Placeholders) +You can find an up-to-date list of the placeholders on the [Towny wiki](https://github.com/TownyAdvanced/Towny/wiki/Placeholders). ---- From a8e996fa26295d3e784868b83d1b95e93ba83481 Mon Sep 17 00:00:00 2001 From: Andre601 <11576465+Andre601@users.noreply.github.com> Date: Tue, 20 Apr 2021 23:21:24 +0200 Subject: [PATCH 22/86] Redesign Placeholders page and other pages --- wiki/Home.md | 65 +- wiki/Placeholders.md | 8853 ++++++++++++++++++++++-------------------- wiki/README.md | 59 +- wiki/_Sidebar.md | 68 +- 4 files changed, 4675 insertions(+), 4370 deletions(-) diff --git a/wiki/Home.md b/wiki/Home.md index 1c5588b..9ecce12 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -18,40 +18,8 @@ It also has a list with all available placeholders (Work in progress). **[[Expansion cloud]]** **[[FAQ]]** **[[Plugins using PlaceholderAPI]]** -**[[Placeholders]]** -- [[PAPI-placeholders|Placeholders#papi-placeholders-1]] - - [[Advancements|Placeholders#advancements]] - - [[Animations|Placeholders#animations]] - - [[Armor|Placeholders#armor]] - - [[ASCII|Placeholders#ASCII]] - - [[BungeeCord|Placeholders#bungeecord]] - - [[CheckItem|Placeholders#checkitem]] - - [[CooldownBar|Placeholders#cooldownbar]] - - [[Formatter|Placeholders#formatter]] - - [[Javascript|Placeholders#javascript]] - - [[ListPlayers|Placeholders#listplayer]] - - [[LocalTime|Placeholders#localtime]] - - [[Math|Placeholders#math]] - - [[MVdW placeholders|Placeholders#mvdw-placeholders]] - - [[OtherPlayer|Placeholders#otherplayer]] - - [[ParseNear|Placeholders#parsenear]] - - [[ParseOther|Placeholders#parseother]] - - [[Pinger|Placeholders#pinger]] - - [[Player|Placeholders#player]] - - [[PlayerList|Placeholders#playerlist]] - - [[Plugin|Placeholders#plugin]] - - [[Progress|Placeholders#progress]] - - [[RainbowColor|Placeholders#rainbowcolor]] - - [[RandomColor|Placeholders#randomcolor]] - - [[RedisBungee|Placeholders#redisbungee]] - - [[RelCon|Placeholders#relcon]] - - [[ScoreboardObjectives|Placeholders#scoreboardobjectives]] - - [[Server|Placeholders#server]] - - [[Sound|Placeholders#sound]] - - [[Spectators|Placeholders#spectators]] - - [[Statistic|Placeholders#statistic]] - -- [[Plugin-placeholders|Placeholders#plugin-placeholders-1]] +**[[Placeholders]]** +- [[Standalone|Placeholders#standalone]] - [[A|Placeholders#a]] - [[B|Placeholders#b]] - [[C|Placeholders#c]] @@ -75,4 +43,33 @@ It also has a list with all available placeholders (Work in progress). - [[U|Placeholders#u]] - [[V|Placeholders#v]] - [[W|Placeholders#w]] + - [[X|Placeholders#x]] + - [[Y|Placeholders#y]] - [[Z|Placeholders#z]] +- [[Plugin-placeholders|Placeholders#plugin-placeholders-1]] + - [[A|Placeholders#a-1]] + - [[B|Placeholders#b-1]] + - [[C|Placeholders#c-1]] + - [[D|Placeholders#d-1]] + - [[E|Placeholders#e-1]] + - [[F|Placeholders#f-1]] + - [[G|Placeholders#g-1]] + - [[H|Placeholders#h-1]] + - [[I|Placeholders#i-1]] + - [[J|Placeholders#j-1]] + - [[K|Placeholders#k-1]] + - [[L|Placeholders#l-1]] + - [[M|Placeholders#m-1]] + - [[N|Placeholders#n-1]] + - [[O|Placeholders#o-1]] + - [[P|Placeholders#p-1]] + - [[Q|Placeholders#q-1]] + - [[R|Placeholders#r-1]] + - [[S|Placeholders#s-1]] + - [[T|Placeholders#t-1]] + - [[U|Placeholders#u-1]] + - [[V|Placeholders#v-1]] + - [[W|Placeholders#w-1]] + - [[X|Placeholders#x-1]] + - [[Y|Placeholders#y-1]] + - [[Z|Placeholders#z-1]] diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index b403d0e..0f00626 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1,3 +1,8 @@ +[SimpleDateFormat]: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html +[TimeZoneIDs]: https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/ + +[list]: https://github.com/PlaceholderAPI/PlaceholderAPI/discussions/510 + This is a list of all available placeholders. A download-command for the extension can be found at the area of the placeholder. If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, then it means, that the plugin actually has the placeholders hard-coded into them and doesn't require a manual download of any expansion. @@ -9,4775 +14,5081 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th > > You can find a comprehensive guide on how to do this on the [Wiki's README file](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/docs/wiki/wiki/README.md). -## [PAPI-placeholders](#papi-placeholders-1) +- [Standalone](#standalone) + - ### **A** + - **[Advancements](#advancements)** + - **[Animations](#animations)** + - **[Armor](#armor)** + - **[ASCII](#ascii)** + + - ### **B** + - **[BungeeCord](#bungeecord)** + + - ### **C** + - **[CheckItem](#checkitem)** + - **[CooldownBar](#cooldownbar)** + + - ### **D** + - *No Expansions* + + - ### **E** + - *No Expansions* + + - ### **F** + - **[Formatter](#formatter)** -- **[Advancements](#advancements)** -- **[Animations](#animations)** -- **[Armor](#armor)** -- **[ASCII](#ascii)** -- **[BungeeCord](#bungeecord)** -- **[CheckItem](#checkitem)** -- **[CooldownBar](#cooldownbar)** -- **[Formatter](#formatter)** -- **[Javascript](#javascript)** -- **[ListPlayers](#listplayers)** -- **[LocalTime](#localtime)** -- **[Math](#math)** -- **[MVdW placeholders](#mvdw-placeholders)** -- **[OtherPlayer](#otherplayer)** -- **[ParseNear](#parsenear)** -- **[ParseOther](#parseother)** -- **[Pinger](#pinger)** -- **[Player](#player)** -- **[PlayerList](#playerlist)** -- **[Plugin](#plugin)** -- **[Progress](#progress)** -- **[RainbowColor](#rainbowcolor)** -- **[RandomColor](#randomcolor)** -- **[RedisBungee](#redisbungee)** -- **[RelCon](#relcon)** -- **[RNG](#rng)** -- **[ScoreboardObjectives](#scoreboardobjectives)** -- **[Server](#server)** -- **[Shortcut](#shortcut)** -- **[Sound](#sound)** -- **[SpeedPerSec](#speedpersec)** -- **[Statistic](#statistic)** -- **[Team](#team)** -- **[Teams](#teams)** -- **[World](#world)** ----- + - ### **G** + - *No Expansions* -## [Plugin-placeholders](#plugin-placeholders-1) + - ### **H** + - *No Expansions* -## **A** -- **[AAC - AdvancedAntiCheat](#aac)** -- **[AbstractMenus](#abstractmenus)** -- **[AcidIsland](#acidisland)** -- **[Advanced Abilities](#advanced-abilities)** -- **[AdvancedAFK](#advancedafk)** -- **[AdvancedCustomMenu+](#advancedcustommenu)** -- **[AdvancedLottery](#advancedlottery)** -- **[AdvancedModReq](#advancedmodreq)** -- **[ajLeaderboards](#ajleaderboards)** -- **[ajParkour](#ajparkour)** -- **[AlonsoLevels](#alonsolevels)** -- **[Animated Menu](#animated-menu)** -- **[AParkour](#aparkour)** -- **[ASkyBlock](#askyblock)** -- **[AsyncKeepAlive](#asynckeepalive)** -- **[AutoRank](#autorank)** -- **[AutoSell](#autosell)** + - ### **I** + - *No Expansions* + + - ### **J** + - **[Javascript](#javascript)** -## **B** -- **[BankSystem](#banksystem)** -- **[BattleLevels](#battlelevels)** -- **[BeautyQuests](#beautyquests)** -- **[BedWars1058](#bedwars1058)** -- **[BentoBox](#bentobox)** -- **[BetonQuest](#betonquest)** -- **[BlockParty](#blockparty)** -- **[BlockQuest](#blockquest)** -- **[Boxing](#boxing)** -- **[BuildBattlePro](#buildbattlepro)** -- **[BungeePerms](#bungeeperms)** -- **[BuyCraft](#buycraft)** + - ### **K** + - *No Expansions* + + - ### **L** + - **[ListPlayers](#listplayers)** + - **[LocalTime](#localtime)** + + - ### **M** + - **[Math](#math)** + - **[MVdW placeholders](#mvdw-placeholders)** + - **[MySQL](#mysql)** + - **[MySQLTokens](#mysqltokens)** -## **C** -- **[CarlTheCreeper](#carlthecreeper)** -- **[ChatColor+](#chatcolor)** -- **[ChatColor+ Premium](#chatcolor-premium)** -- **[ChatReaction](#chatreaction)** -- **[CheckNameHistory](#checknamehistory)** -- **[Clans](#clans)** -- **[ClansFree](#clansfree)** -- **[Clans-API for Spigot/Clan tag in chat](#clans-api-for-spigotclan-tag-in-chat)** -- **[ClansPro](#clanspro)** -- **[ClanSystem](#clansystem)** -- **[CombatLogX](#combatlogx)** -- **[Compassance](#compassance)** -- **[Country on Join](#country-on-join)** -- **[CraftConomy](#craftconomy)** -- **[CraftingStore.net](#craftingstorenet)** -- **[CursedVIP](#cursedvip)** -- **[Custom Items](#custom-items)** + - ### **N** + - *No Expansions* + + - ### **O** + - **[OtherPlayer](#otherplayer)** + + - ### **P** + - **[ParseNear](#parsenear)** + - **[ParseOther](#parseother)** + - **[Pinger](#pinger)** + - **[Player](#player)** + - **[PlayerList](#playerlist)** + - **[Plugin](#plugin)** + - **[Progress](#progress)** -## **D** -- **[Daily Rewards](#daily-rewards)** -- **[DeliveryMan](#deliveryman)** -- **[DeluxeChat](#deluxechat)** -- **[DeluxeCombat](#deluxecombat)** -- **[DeluxeMenus](#deluxemenus)** -- **[DeluxePM](#deluxepm)** -- **[DeluxeTags](#deluxetags)** -- **[Denizen](#denizen)** -- **[DiscordSRV](#discordsrv)** -- **[Disease](#disease)** -- **[DonateParty](#donateparty)** -- **[Donations Holograms](#donations-holograms)** -- **[DragonSlayer](#dragonslayer)** -- **[DungeonsXL](#dungeonsxl)** + - ### **Q** + - *No Expansions* + + - ### **R** + - **[RainbowColor](#rainbowcolor)** + - **[RandomColor](#randomcolor)** + - **[RedisBungee](#redisbungee)** + - **[RelCon](#relcon)** + - **[RNG](#rng)** + + - ### **S** + - **[ScoreboardObjectives](#scoreboardobjectives)** + - **[Server](#server)** + - **[Shortcut](#shortcut)** + - **[Sound](#sound)** + - **[SpeedPerSec](#speedpersec)** + - **[Statistic](#statistic)** + + - ### **T** + - **[Team](#team)** + - **[Teams](#teams)** -## **E** -- **[Economy Bank](#economy-bank)** -- **[Enjin & DonationCraft 2.x](#enjin--donationcraft-2x)** -- **[Envoys](#envoys)** -- **[EpicFriends](#epicfriends)** -- **[EpicLevels](#epiclevels)** -- **[essCore](#esscore)** -- **[Essentials](#essentials)** -- **[EZBlocks](#ezblocks)** -- **[EZPrestige](#ezprestige)** -- **[EZRanksPro](#ezrankspro)** + - ### **U** + - *No Expansions* -## **F** -- **[Factions MCore](#factions-mcore)** -- **[FactionsUUID](#factionsuuid)** -- **[Factions relation placeholders](#factions-relation-placeholders)** -- **[FunnyGuilds](#funnyguilds)** + - ### **V** + - *No Expansions* + + - ### **W** + - **[World](#world)** -## **G** -- **[GAListener](#galistener)** -- **[GangsPlus](#gangsplus)** -- **[GemsEconomy](#gemseconomy)** -- **[GriefDefender](#griefdefender)** -- **[GriefPrevention](#griefprevention)** -- **[Guilds](#guilds)** -- **[GuiRedeemMCMMO](#guiredeemmcmmo)** + - ### **X** + - *No Expansions* -## **H** -- **[Head Database](#head-database)** -- **[Heroes](#heroes)** -- **[HoloBlock](#holoblock)** -- **[HPWizard](#hpwizard)** -- **[Hugs](#hugs)** + - ### **Y** + - *No Expansions* -## **I** -- **[InteractionVisualizer](#interactionvisualizer)** -- **[InteractiveChat](#interactivechat)** -- **[Island Border (ASkyblock / BentoBox / uSkyBlock / AcidIsland)](#island-border-askyblock--bentobox--uskyblock--acidisland)** -- **[IslandRate (ASkyBlock Addon)](#islandrate-askyblock-addon)** -- **[IslandRate (AcidIsland Addon)](#islandrate-acidisland-addon)** -- **[IslandWorld](#islandworld)** - -## **J** -- **[Jobs Reborn](#jobs-reborn)** - -## **K** -- **[Karma](#karma)** -- **[KillStats](#killstats)** -- **[KitPvP](#kitpvp)** -- **[Kingdoms+](#kingdoms)** -- **[KP-PVP](#kp-pvp)** - -## **L** -- **[LastLoginAPI](#lastloginapi)** -- **[LeaderHeads](#leaderheads)** -- **[LegendQuest](#legendquest)** -- **[LemonMobCoins](#lemonmobcoins)** -- **[LuckPerms](#luckperms)** -- **[LWC](#lwc)** - -## **M** -- **[Marcely's Bedwars](#marcelys-bedwars)** -- **[Marriage](#marriage)** -- **[Marriage (Reloaded)](#marriage-reloaded)** -- **[MarriageMaster](#marriagemaster)** -- **[McInfected](#mcinfected)** -- **[McJobs](#mcjobs)** -- **[McMMO](#mcmmo)** -- **[MineChess](#minechess)** -- **[MineCord](#minecord)** -- **[MineCrates](#minecrates)** -- **[MobHunting](#mobhunting)** -- **[Multiverse-Core](#multiverse-core)** -- **[MyCommand](#mycommand)** -- **[MyPet](#mypet)** -- **[MyPrefixSystem](#myprefixsystem)** -- **[MySQL](#mysql)** -- **[MySQLTokens](#mysqltokens)** - -## **N** -- **[Nameless Plugin](#nameless-plugin)** -- **[NameMC-API-ServersMC Plugin](#namemc-api-serversmc)** -- **[Nicknamer](#nicknamer)** -- **[NickReloaded](#nickreloaded)** -- **[Nicky](#nicky)** - -## **O** -- **[OnePlayerSleep](#oneplayersleep)** -- **[OnTime](#ontime)** -- **[OreAnnouncer](#oreannouncer)** -- **[Outpost](#outpost)** - -## **P** -- **[Paintball Battle](#paintball-battle)** -- **[Parkour](#parkour)** -- **[Parties](#parties)** -- **[Party and Friends](#party-and-friends)** -- **[PermissionTimer](#permissiontimer)** -- **[PixelVip](#pixelvip)** -- **[Plan](#plan)** -- **[PlayTime](#playtime)** -- **[PlayerPoints](#playerpoints)** -- **[PlotSquared](#plotsquared)** -- **[PointsAPI](#pointsapi)** -- **[PowerRanks](#powerranks)** -- **[PremiumVanish](#premiumvanish)** -- **[Prison](#prison)** -- **[PrisonMines](#prisonmines)** -- **[PrisonRanksX](#prisonranksx)** -- **[ProCosmetics](#procosmetics)** -- **[ProfessionalBans](#professionalbans)** -- **[ProQuest](#proquest)** -- **[ProtectionStones](#protectionstones)** -- **[PVPLevels](#pvplevels)** -- **[PVP Stats](#pvp-stats)** -- **[PvPStats Plugin](#pvpstats-plugin)** - -## **Q** -- **[Quests](#quests)** -- **[QuestCreator](#questcreator)** -- **[QuickSell](#quicksell)** - -## **R** -- **[RabbitsVSPenguins](#rabbitsvspenguins)** -- **[RageMode](#ragemode)** -- **[Rankup](#rankup)** -- **[RealisticWorldGenerator](#realisticworldgenerator)** -- **[RedProtect](#redprotect)** -- **[ReferralSystem](#referralsystem)** -- **[RestrictedDimensions](#restricteddimensions)** -- **[RocketPlaceholders](#rocketplaceholders)** -- **[RogueParkour](#rogueparkour)** -- **[RoyalCommands](#royalcommands)** -- **[RPGInventory](#rpginventory)** - -## **S** -- **[Seasons](#seasons)** -- **[SellAll](#sellall)** -- **[SignLink](#signlink)** -- **[SimpleClans](#simpleclans)** -- **[SimpleCoins](#simplecoins)** -- **[SimpleCoinsAPI](#simplecoinsapi)** -- **[SimpleKillTracker](#simplekilltracker)** -- **[SimplePrefix](#simpleprefix)** -- **[Simple Suffix](#simple-suffix)** -- **[SkillAPI](#skillapi)** -- **[SkinsRestorer](#skinsrestorer)** -- **[Skript](#skript)** -- **[Skywars](#skywars)** -- **[Skywars X](#skywars-x)** -- **[SkywarsReloaded](#skywarsreloaded)** -- **[Spark](#spark)** -- **[SQLPerms](#sqlperms)** -- **[SQLTokens](#sqltokens)** -- **[Staff Facilities](#staff-facilities)** -- **[Statz](#statz)** -- **[Streaming Drops](#streaming-drops)** -- **[StrikePractice 2](#strikepractice-2)** -- **[stTitles](#sttitles)** -- **[SubServers](#subservers)** -- **[SuperbVote](#superbvote)** -- **[SuperCredits](#supercredits)** -- **[SuperVanish](#supervanish)** - -## **T** -- **[The Time](#the-time)** -- **[ThemePark](#themepark)** -- **[Thirst](#thirst)** -- **[TicketGUI](#ticketgui)** -- **[Timed Rewards](#timed-rewards)** -- **[TimeManager](#timemanager)** -- **[Time Tokens](#time-tokens)** -- **[TNTRun_Reloaded](#tntrun_reloaded)** -- **[TokenEnchant](#tokenenchant)** -- **[TokenManager](#tokenmanager)** -- **[Tokens](#tokens)** -- **[TokensPlus](#tokensplus)** -- **[Towny](#towny)** -- **[TownyChat](#townychat)** -- **[TransmuteIt](#transmuteit)** -- **[Treasures](#treasures)** -- **[Trey's Double Jump](#treys-double-jump)** -- **[TrickOrTreat](#trickortreat)** - -## **U** -- **[USkyBlock](#uskyblock)** -- **[UltimateChat](#ultimatechat)** -- **[UltimateClaims](#ultimateclaims)** -- **[UltimateVotes](#ultimatevotes)** -- **[UnityGen](#unitygen)** - -## **V** -- **[Vault](#vault)** - - [Economy](#economy) - - [Permissions](#permissions) -- **[ViaVersion](#viaversion)** -- **[VKAutoPickup](#vkautopickup)** -- **[VoteParty](#voteparty)** -- **[VoteRoulette](#voteroulette)** -- **[VotingPlugin](#votingplugin)** - -## **W** -- **[WickedSkyWars](#wickedskywars)** -- **[WorldBorder](#worldborder)** -- **[WorldGuard](#worldguard)** - -## **X** -- **[XLTournaments](#xltournaments)** + - ### **Z** + - *No Expansions* ---- -## PAPI-placeholders -These placeholders are from PlaceholderAPI and don't require any additional plugin to function (unless mentioned). + +- [Plugin-placeholders](#plugin-placeholders) + - ### **A** + - **[AAC - AdvancedAntiCheat](#aac)** + - **[AbstractMenus](#abstractmenus)** + - **[AcidIsland](#acidisland)** + - **[AcidIslandRate](#acidislandrate)** + - **[Advanced Abilities](#advanced-abilities)** + - **[AdvancedAFK](#advancedafk)** + - **[AdvancedCustomMenu+](#advancedcustommenu)** + - **[AdvancedLottery](#advancedlottery)** + - **[AdvancedModReq](#advancedmodreq)** + - **[ajLeaderboards](#ajleaderboards)** + - **[ajParkour](#ajparkour)** + - **[AlonsoLevels](#alonsolevels)** + - **[Animated Menu](#animated-menu)** + - **[AParkour](#aparkour)** + - **[ASkyBlock](#askyblock)** + - **[AsyncKeepAlive](#asynckeepalive)** + - **[AutoRank](#autorank)** + - **[AutoSell](#autosell)** + + - ### **B** + - **[BankSystem](#banksystem)** + - **[BattleLevels](#battlelevels)** + - **[BeautyQuests](#beautyquests)** + - **[BedWars1058](#bedwars1058)** + - **[BentoBox](#bentobox)** + - **[BetonQuest](#betonquest)** + - **[BlockParty](#blockparty)** + - **[BlockQuest](#blockquest)** + - **[Boxing](#boxing)** + - **[BuildBattlePro](#buildbattlepro)** + - **[BungeePerms](#bungeeperms)** + - **[BuyCraft](#buycraft)** + + - ### **C** + - **[CarlTheCreeper](#carlthecreeper)** + - **[ChatColor+](#chatcolor)** + - **[ChatColor+ Premium](#chatcolor-premium)** + - **[ChatReaction](#chatreaction)** + - **[CheckNameHistory](#checknamehistory)** + - **[Clans](#clans)** + - **[ClansFree](#clansfree)** + - **[Clans-API for Spigot/Clan tag in chat](#clans-api-for-spigotclan-tag-in-chat)** + - **[ClansPro](#clanspro)** + - **[ClanSystem](#clansystem)** + - **[CombatLogX](#combatlogx)** + - **[Compassance](#compassance)** + - **[Country on Join](#country-on-join)** + - **[CraftConomy](#craftconomy)** + - **[CraftingStore.net](#craftingstorenet)** + - **[CursedVIP](#cursedvip)** + - **[Custom Items](#custom-items)** + + - ### **D** + - **[Daily Rewards](#daily-rewards)** + - **[DeliveryMan](#deliveryman)** + - **[DeluxeChat](#deluxechat)** + - **[DeluxeCombat](#deluxecombat)** + - **[DeluxeMenus](#deluxemenus)** + - **[DeluxePM](#deluxepm)** + - **[DeluxeTags](#deluxetags)** + - **[Denizen](#denizen)** + - **[DiscordSRV](#discordsrv)** + - **[Disease](#disease)** + - **[DonateParty](#donateparty)** + - **[Donations Holograms](#donations-holograms)** + - **[DragonSlayer](#dragonslayer)** + - **[DungeonsXL](#dungeonsxl)** + + - ### **E** + - **[Economy Bank](#economy-bank)** + - **[Enjin & DonationCraft 2.x](#enjin--donationcraft-2x)** + - **[Envoys](#envoys)** + - **[EpicFriends](#epicfriends)** + - **[EpicLevels](#epiclevels)** + - **[essCore](#esscore)** + - **[Essentials](#essentials)** + - **[EZBlocks](#ezblocks)** + - **[EZPrestige](#ezprestige)** + - **[EZRanksPro](#ezrankspro)** + + - ### **F** + - **[Factions MCore](#factions-mcore)** + - **[FactionsUUID](#factionsuuid)** + - **[Factions relation placeholders](#factions-relation-placeholders)** + - **[FunnyGuilds](#funnyguilds)** + + - ### **G** + - **[GAListener](#galistener)** + - **[GangsPlus](#gangsplus)** + - **[GemsEconomy](#gemseconomy)** + - **[GriefDefender](#griefdefender)** + - **[GriefPrevention](#griefprevention)** + - **[Guilds](#guilds)** + - **[GuiRedeemMCMMO](#guiredeemmcmmo)** + + - ### **H** + - **[Head Database](#head-database)** + - **[Heroes](#heroes)** + - **[HoloBlock](#holoblock)** + - **[HPWizard](#hpwizard)** + - **[Hugs](#hugs)** + + - ### **I** + - **[InteractionVisualizer](#interactionvisualizer)** + - **[InteractiveChat](#interactivechat)** + - **[Island Border (ASkyblock / BentoBox / uSkyBlock / AcidIsland)](#island-border-askyblock--bentobox--uskyblock--acidisland)** + - **[IslandRate (ASkyBlock Addon)](#islandrate)** + - **[IslandRate (AcidIsland Addon)](#islandrate)** + - **[IslandWorld](#islandworld)** + + - ### **J** + - **[Jobs Reborn](#jobs-reborn)** + + - ### **K** + - **[Karma](#karma)** + - **[KillStats](#killstats)** + - **[KitPvP](#kitpvp)** + - **[Kingdoms+](#kingdoms)** + - **[KP-PVP](#kp-pvp)** + + - ### **L** + - **[LastLoginAPI](#lastloginapi)** + - **[LeaderHeads](#leaderheads)** + - **[LegendQuest](#legendquest)** + - **[LemonMobCoins](#lemonmobcoins)** + - **[LuckPerms](#luckperms)** + - **[LWC](#lwc)** + + - ### **M** + - **[Marcely's Bedwars](#marcelys-bedwars)** + - **[Marriage](#marriage)** + - **[Marriage (Reloaded)](#marriage-reloaded)** + - **[MarriageMaster](#marriagemaster)** + - **[McInfected](#mcinfected)** + - **[McJobs](#mcjobs)** + - **[McMMO](#mcmmo)** + - **[MineChess](#minechess)** + - **[MineCord](#minecord)** + - **[MineCrates](#minecrates)** + - **[MobHunting](#mobhunting)** + - **[Multiverse-Core](#multiverse-core)** + - **[MyCommand](#mycommand)** + - **[MyPet](#mypet)** + - **[MyPrefixSystem](#myprefixsystem)** + + - ### **N** + - **[Nameless Plugin](#nameless-plugin)** + - **[NameMC-API-ServersMC Plugin](#namemc-api-serversmc)** + - **[Nicknamer](#nicknamer)** + - **[NickReloaded](#nickreloaded)** + - **[Nicky](#nicky)** + + - ### **O** + - **[OnePlayerSleep](#oneplayersleep)** + - **[OnTime](#ontime)** + - **[OreAnnouncer](#oreannouncer)** + - **[Outpost](#outpost)** + + - ### **P** + - **[Paintball Battle](#paintball-battle)** + - **[Parkour](#parkour)** + - **[Parties](#parties)** + - **[Party and Friends](#party-and-friends)** + - **[PermissionTimer](#permissiontimer)** + - **[PixelVip](#pixelvip)** + - **[Plan](#plan)** + - **[PlayTime](#playtime)** + - **[PlayerPoints](#playerpoints)** + - **[PlotSquared](#plotsquared)** + - **[PointsAPI](#pointsapi)** + - **[PowerRanks](#powerranks)** + - **[PremiumVanish](#premiumvanish)** + - **[Prison](#prison)** + - **[PrisonMines](#prisonmines)** + - **[PrisonRanksX](#prisonranksx)** + - **[ProCosmetics](#procosmetics)** + - **[ProfessionalBans](#professionalbans)** + - **[ProQuest](#proquest)** + - **[ProtectionStones](#protectionstones)** + - **[PVPLevels](#pvplevels)** + - **[PVP Stats](#pvp-stats)** + - **[PvPStats Plugin](#pvpstats-plugin)** + + - ### **Q** + - **[Quests](#quests)** + - **[QuestCreator](#questcreator)** + - **[QuickSell](#quicksell)** + + - ### **R** + - **[RabbitsVSPenguins](#rabbitsvspenguins)** + - **[RageMode](#ragemode)** + - **[Rankup](#rankup)** + - **[RealisticWorldGenerator](#realisticworldgenerator)** + - **[RedProtect](#redprotect)** + - **[ReferralSystem](#referralsystem)** + - **[RestrictedDimensions](#restricteddimensions)** + - **[RocketPlaceholders](#rocketplaceholders)** + - **[RogueParkour](#rogueparkour)** + - **[RoyalCommands](#royalcommands)** + - **[RPGInventory](#rpginventory)** + + - ### **S** + - **[Seasons](#seasons)** + - **[SellAll](#sellall)** + - **[SignLink](#signlink)** + - **[SimpleClans](#simpleclans)** + - **[SimpleCoins](#simplecoins)** + - **[SimpleCoinsAPI](#simplecoinsapi)** + - **[SimpleKillTracker](#simplekilltracker)** + - **[SimplePrefix](#simpleprefix)** + - **[Simple Suffix](#simple-suffix)** + - **[SkillAPI](#skillapi)** + - **[SkinsRestorer](#skinsrestorer)** + - **[Skript](#skript)** + - **[Skywars](#skywars)** + - **[Skywars X](#skywars-x)** + - **[SkywarsReloaded](#skywarsreloaded)** + - **[Spark](#spark)** + - **[SQLPerms](#sqlperms)** + - **[SQLTokens](#sqltokens)** + - **[Staff Facilities](#staff-facilities)** + - **[Statz](#statz)** + - **[Streaming Drops](#streaming-drops)** + - **[StrikePractice 2](#strikepractice-2)** + - **[stTitles](#sttitles)** + - **[SubServers](#subservers)** + - **[SuperbVote](#superbvote)** + - **[SuperCredits](#supercredits)** + - **[SuperVanish](#supervanish)** + + - ### **T** + - **[The Time](#the-time)** + - **[ThemePark](#themepark)** + - **[Thirst](#thirst)** + - **[TicketGUI](#ticketgui)** + - **[Timed Rewards](#timed-rewards)** + - **[TimeManager](#timemanager)** + - **[Time Tokens](#time-tokens)** + - **[TNTRun_Reloaded](#tntrun_reloaded)** + - **[TokenEnchant](#tokenenchant)** + - **[TokenManager](#tokenmanager)** + - **[Tokens](#tokens)** + - **[TokensPlus](#tokensplus)** + - **[Towny](#towny)** + - **[TownyChat](#townychat)** + - **[TransmuteIt](#transmuteit)** + - **[Treasures](#treasures)** + - **[Trey's Double Jump](#treys-double-jump)** + - **[TrickOrTreat](#trickortreat)** + + - ### **U** + - **[USkyBlock](#uskyblock)** + - **[UltimateChat](#ultimatechat)** + - **[UltimateClaims](#ultimateclaims)** + - **[UltimateVotes](#ultimatevotes)** + - **[UnityGen](#unitygen)** + + - ### **V** + - **[Vault](#vault)** + - [Economy](#economy) + - [Permissions](#permissions) + - **[ViaVersion](#viaversion)** + - **[VKAutoPickup](#vkautopickup)** + - **[VoteParty](#voteparty)** + - **[VoteRoulette](#voteroulette)** + - **[VotingPlugin](#votingplugin)** + + - ### **W** + - **[WickedSkyWars](#wickedskywars)** + - **[WorldBorder](#worldborder)** + - **[WorldGuard](#worldguard)** + + - ### **X** + - **[XLTournaments](#xltournaments)** + + - ### **Y** + - *No Expansions* + + - ### **Z** + - *No Expansions* + +---- +## Standalone +Expansions listed here don't need any plugin or extra library to function properly, unless mentioned otherwise. +A majority of these Expansions are maintained by the PlaceholderAPI team and can be considered *official*. - ### **Advancements** -> /papi ecloud download Advancements + > /papi ecloud download Advancements + + More info about this expansion can be found on the [GitHub-Repository](https://github.com/matahombres/Advancements). + + ``` + %Advancements_% + %Advancements_player_;% + %Advancements_list% + %Advancements_list_% + %Advancements_playerList_% + %Advancements_playerList_,% + %Advancements_listFormat% + %Advancements_playerListFormat_% + %Advancements_completedAmount% + %Advancements_completedAmount_% + %Advancements_playerCompletedAmount_% + %Advancements_playerCompletedAmount_,% + %Advancements_remainingAmount% + %Advancements_remainingAmount_% + %Advancements_playerRemainingAmount_% + %Advancements_playerRemainingAmount_,% + ``` -More info about this expansion can be found on the [GitHub-Repository](https://github.com/matahombres/Advancements). -``` -%Advancements_% -%Advancements_player_;% -%Advancements_list% -%Advancements_list_% -%Advancements_playerList_% -%Advancements_playerList_,% -%Advancements_listFormat% -%Advancements_playerListFormat_% -%Advancements_completedAmount% -%Advancements_completedAmount_% -%Advancements_playerCompletedAmount_% -%Advancements_playerCompletedAmount_,% -%Advancements_remainingAmount% -%Advancements_remainingAmount_% -%Advancements_playerRemainingAmount_% -%Advancements_playerRemainingAmount_,% -``` ---- - ### **Animations** -> /papi ecloud download Animations - -```html -%animations_Text% -%animations_Text% -%animations_Text% -``` - -Please note: When using placeholders within the animation text, you must use the bracket variant. -Use `{player_name}` instead of `%player_name%` within the tags. - -Please visit the [dedicated wiki](https://github.com/Niall7459/KiteBoard-Documentation/wiki/Animations-and-Modifiers) for all available tags. + > /papi ecloud download Animations + + ```html + %animations_Text% + %animations_Text% + %animations_Text% + ``` + + Please note: When using placeholders within the animation text, you must use the bracket variant. + Use `{player_name}` instead of `%player_name%` within the ` ` tags. + + Please visit the [dedicated wiki](https://github.com/Niall7459/KiteBoard-Documentation/wiki/Animations-and-Modifiers) for all available tags. ---- - ### **Armor** -> /papi ecloud download Armor + > /papi ecloud download Armor + + Gives you info about your armor + + ``` + Chose one value that's inside () and replace SLOT with one of the following: helmet, chestplate, leggings, boots. + + %armor_amount_SLOT% + %armor_color_(red/green/blue/hex)_SLOT% + %armor_durability_(left/max)_SLOT% + %armor_has_SLOT% + %armor_material_SLOT% + %armor_maxamount_SLOT% + ``` -Gives you info about your armor - -``` -Chose one value that's inside () and replace SLOT with one of the following: helmet, chestplate, leggings, boots. - -%armor_amount_SLOT% -%armor_color_(red/green/blue/hex)_SLOT% -%armor_durability_(left/max)_SLOT% -%armor_has_SLOT% -%armor_material_SLOT% -%armor_maxamount_SLOT% -``` ---- - ### **ASCII** -> /papi ecloud download ascii - -Returns the [ASCII Value](http://www.asciitable.com/) based on input - -``` -%ascii_% -``` - -Ex: `%ascii_37%` returns `%` + > /papi ecloud download ASCII + + Returns the [ASCII Value](http://www.asciitable.com/) based on input + + ``` + %ascii_% + ``` + + Ex: `%ascii_37%` returns `%` ---- - ### **BungeeCord** -> /papi ecloud download Bungee + > /papi ecloud download Bungee + + Allows you to show, how many players are online on the entire network, or just on a specific server. + + ``` + %bungee_total% + %bungee_% + ``` -Allows you to show, how many players are online on the entire network, or just on a specific server. - -``` -%bungee_total% -%bungee_% -``` ---- - ### **CheckItem** -> /papi ecloud download CheckItem - -Allows you to check the inventory of a player for a certain item. - -``` -- `%checkitem_,,<...>%` - Returns if user has the item -- `%checkitem_amount_,,<...>%` - Returns amount of items the user has -- `%checkitem_remove_,,<...>%` - Removes the items from the players inventory - Can be used with amount, it just has to be after. (Ex. `%checkitem_amount_remove_<...>%`) Please be careful as it does REMOVE ITEMS FOR GOOD -- `%checkitem_give_,,<...>%` - Gives the player items. Returns true if successful, returns the number of items NOT given if unsuccessful. (When unsuccessful items can still be given, it just might not be all of them) -``` - -**Modifiers** -You can combine different modifiers to check for different values. -Available modifiers are: -- `namecontains:` - Checks if the item's display name contains ``* \*\* -- `namestartswith:` - Checks if the item's display name starts with ``* \*\* -- `nameequals:` - Checks if the item's display name equals ``* \*\* ^ -- `mat:` - Checks if the item is `` (For example: `STONE`) ^ -- `amt:` - Checks if the player has `` of items ^ -- `data:` - Checks if the item has data `` (Example: Red wool has `14` as data (`WOOL:14`)). -This is only for 1.12 and older! ^ -- `custommodeldata:` - Checks if the item has CustomModelData `` This is only for 1.14 and newer! ^ -- `lorecontains:` - Checks if the item's lore contains ``* -- `loreequals:` - Checks if the item's lore equals `` Lines are separated by `|` ^ -- `matcontains:` - Checks if the item's material contains ``* -- `enchantments:;` (`=lvl` is optional) (Uses vanilla minecraft enchantment names) ^ -- `enchanted` - Checks if the item is enchanted (with anything) -- `potiontype:` - Checks if the item has the potiontype ([Click here for potion types](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html)) ^ -- `potionextended:` - Checks if a potion is extended ^ -- `potionupgraded:` - Checks if a potion is upgraded ^ -- `strict` - Requires `mat:` modifier. Strictly checks the name and lore for an item. (If a Stone named `Test` is in your inventory, and you're using `%checkitem_mat:stone,strict%`, it will return false) -- `inhand` - Check if the item is in the player's hand (Also checks off-hand) - -*Case-sensitive - -**Only one can be used - -^Supported by the `give` placeholder - -To use Commas in strings you must escape them using `\` (Ex: `loreequals:Milk\, Eggs\, Bread`) - -**Placeholders are supported, but they need to be in brackets! (Ex: `%player_name%` would be `{player_name}`** + > /papi ecloud download CheckItem + + Allows you to check the inventory of a player for a certain item. + + ``` + %checkitem_,,<...>% - Returns if user has the item + %checkitem_amount_,,<...>% - Returns amount of items the user has + %checkitem_remove_,,<...>% - Removes the items from the players inventory - Can be used with amount, it just has to be after. (Ex. `%checkitem_amount_remove_<...>%`) Please be careful as it does REMOVE ITEMS FOR GOOD + %checkitem_give_,,<...>% - Gives the player items. Returns true if successful, returns the number of items NOT given if unsuccessful. (When unsuccessful items can still be given, it just might not be all of them) + ``` + + **Modifiers** + You can combine different modifiers to check for different values. + Available modifiers are: + - `namecontains:` + Checks if the item's display name contains ``* \*\* + - `namestartswith:` + Checks if the item's display name starts with ``* \*\* + - `nameequals:` + Checks if the item's display name equals ``* \*\* ^ + - `mat:` + Checks if the item is `` (For example: `STONE`) ^ + - `amt:` + Checks if the player has `` of items ^ + - `data:` + Checks if the item has data `` (Example: Red wool has `14` as data (`WOOL:14`)). + This is only for 1.12 and older! ^ + - `custommodeldata:` + Checks if the item has CustomModelData `` + This is only for 1.14 and newer! ^ + - `lorecontains:` + Checks if the item's lore contains ``* + - `loreequals:` + Checks if the item's lore equals `` Lines are separated by `|` ^ + - `matcontains:` + Checks if the item's material contains ``* + - `enchantments:;` + Checks if the item's enchantments contains `` with an optional `=level` + Uses vanilla minecraft enchantment names ^ + - `enchanted` + Checks if the item is enchanted (with anything) + - `potiontype:` + Checks if the item has the potiontype ([Click here for potion types](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html)) ^ + - `potionextended:` + Checks if a potion is extended ^ + - `potionupgraded:` + Checks if a potion is upgraded ^ + - `strict` + Requires `mat:` modifier. Strictly checks the name and lore for an item. (If a Stone named `Test` is in your inventory, and you're using `%checkitem_mat:stone,strict%`, it will return false) + - `inhand` + Check if the item is in the player's hand (Also checks off-hand) + + **Notes:** + - * means case-sensitive + - ** means only one can be used + - ^ means that the modifier supports the `give` placeholder + - To use Commas in strings you must escape them using `\` (Ex: `loreequals:Milk\, Eggs\, Bread`) + - **Placeholders are supported, but they need to be in brackets! (Ex: `%player_name%` would be `{player_name}`** ---- - ### **CooldownBar** -> /papi ecloud download CooldownBar + > /papi ecloud download CooldownBar + + More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/CooldownBar-Expansion). + + ``` + %cooldownbar_{placeholder}% + %cooldownbar_{placeholder}_p:% + %cooldownbar_{placeholder}_i:% + %cooldownbar_{placeholder}_r:% + %cooldownbar_{placeholder}_l:% + %cooldownbar_{placeholder}_c:% + %cooldownbar_{placeholder}_rdy:% + %cooldownbar_{essentials_kit_time_until_available_tools}_p:&a■_i:&e■_r:&7■_l:5_c:100_rdy:&aReadytoclaim!% + %cooldownbar_percentage_{placeholder}% + %cooldownbar_percentage_{placeholder}_c:% + %cooldownbar_percentage_{placeholder}_d:% + %cooldownbar_percentage_{essentials_kit_time_until_available_tools}_c:120_d:0% + ``` -More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/CooldownBar-Expansion). - -``` -%cooldownbar_{placeholder}% -%cooldownbar_{placeholder}_p:% -%cooldownbar_{placeholder}_i:% -%cooldownbar_{placeholder}_r:% -%cooldownbar_{placeholder}_l:% -%cooldownbar_{placeholder}_c:% -%cooldownbar_{placeholder}_rdy:% -%cooldownbar_{essentials_kit_time_until_available_tools}_p:&a■_i:&e■_r:&7■_l:5_c:100_rdy:&aReadytoclaim!% -%cooldownbar_percentage_{placeholder}% -%cooldownbar_percentage_{placeholder}_c:% -%cooldownbar_percentage_{placeholder}_d:% -%cooldownbar_percentage_{essentials_kit_time_until_available_tools}_c:120_d:0% -``` ---- - ### **Formatter** -> /papi ecloud download Formatter - -More info about this expansion can be found on the [GitHub-Repository](https://github.com/Andre601/Formatter-Expansion). - -``` -%formatter_number_format_% -%formatter_number_format_[locale]:[format]_% - -%formatter_number_time_% -%formatter_number_time_seconds_% # Handles number as seconds -%formatter_number_time_secs_% # Handles number as seconds -%formatter_number_time_minutes_% # Handles number as minutes -%formatter_number_time_mins_% # Handles number as minutes -%formatter_number_time_hours_% # Handles number as hours -%formatter_number_time_hrs_% # Handles number as hours - -%formatter_replace___% -%formatter_text_substring__% -%formatter_text_uppercase_% -%formatter_text_lowercase_% -``` + > /papi ecloud download Formatter + + More info about this expansion can be found on the [GitHub-Repository](https://github.com/Andre601/Formatter-Expansion). + + ``` + %formatter_number_format_% + %formatter_number_format_[locale]:[format]_% + + %formatter_number_time_% + %formatter_number_time_seconds_% # Handles number as seconds + %formatter_number_time_secs_% # Handles number as seconds + %formatter_number_time_minutes_% # Handles number as minutes + %formatter_number_time_mins_% # Handles number as minutes + %formatter_number_time_hours_% # Handles number as hours + %formatter_number_time_hrs_% # Handles number as hours + + %formatter_replace___% + %formatter_text_substring__% + %formatter_text_uppercase_% + %formatter_text_lowercase_% + ``` ---- - ### **Javascript** -> /papi ecloud download Javascript + > /papi ecloud download Javascript + + Gives you a way, to use javascript, to give a different output, depending on conditions. + + ``` + %javascript_% + ``` -Gives you a way, to use javascript, to give a different output, depending on conditions. - -``` -%javascript_% -``` ---- - ### **ListPlayers** -> /papi ecloud download ListPlayers + > /papi ecloud download ListPlayers + + Lists players with a certain permission or in a certain world... 'nuf said. + + ``` + %listplayers_with_perm_% + %listplayers_in_world_% + ``` -Lists players with a certain permission or in a certain world... 'nuf said. - -``` -%listplayers_with_perm_% -%listplayers_in_world_% -``` ---- - ### **LocalTime** -> /papi ecloud download LocalTime - -``` -%localtime_time% -%localtime_time_% -%localtime_timezone_% -%localtime_timezone_,% -``` - -- [Simple Date Format](http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) -- [TimeZone ID](https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/) + > /papi ecloud download LocalTime + + ``` + %localtime_time% + %localtime_time_% + %localtime_timezone_% + %localtime_timezone_,% + ``` + + Please read the [SimpleDateFormat] Javadoc page about possible formats and [this post][TimeZoneIDs] about available time zone IDs for ``. ---- - ### **Math** -> /papi ecloud download Math + > /papi ecloud download Math + + Lets you make simple or advanced calculations. + Any placeholder that returns a number is supported (Use `{placeholder}` instead of `%placeholder%`) + + Supports all calculations you can do with [EvalEx](https://github.com/uklimaschewski/EvalEx). + Note that the `%` can't be used within the placeholder and that you have to use `[prc]` instead. + + ``` + %math_% + %math_[precision]:[rounding]_% + ``` -Lets you make simple or advanced calculations. -Placeholders are supported (You have to use `{}` instead of `%`). - -Supports all calculations you can do with [EvalEx](https://github.com/uklimaschewski/EvalEx). -Note that the `%` can't be used within the placeholder and that you have to to use `[prc]` instead. - -``` -%math_% -%math_[precision]:[rounding]_% -``` ---- - ### **MVdW Placeholders** -> /papi ecloud download MVdW + > /papi ecloud download MVdW + + Lets you use placeholders from [MVdWPlaceholderAPI](https://www.spigotmc.org/resources/11182/). + MVdWPlaceholderAPI and one of **[Maxims plugins](https://www.spigotmc.org/resources/2691/)**, that use it, are required! + A list of his placeholders can be found [here](https://www.spigotmc.org/wiki/mvdw-placeholders/) + + ``` + %mvdw_% + ``` -Lets you use placeholders from [MVdWPlaceholderAPI](https://www.spigotmc.org/resources/11182/). -MVdWPlaceholderAPI and one of **[Maxims plugins](https://www.spigotmc.org/resources/2691/)**, that use it, are required! -A list of his placeholders can be found [here](https://www.spigotmc.org/wiki/mvdw-placeholders/) - -``` -%mvdw_% -``` ----- - -- ### **OtherPlayer** -> /papi ecloud download OtherPlayer - -Lets you get placeholders for other players. (Not the one that triggers the action) - -``` -%otherplayer_displayname_% -%otherplayer_gamemode_% -%otherplayer_hasperm__perm_% -%otherplayer_haspotioneffect__effect_% -%otherplayer_health_% -%otherplayer_hunger_% -%otherplayer_iteminhand_% -%otherplayer_ip_% -%otherplayer_level_% -%otherplayer_locx_% -%otherplayer_locy_% -%otherplayer_locz_% -%otherplayer_oxygen_% -%otherplayer_spells_% -%otherplayer_uuid_% -%otherplayer_world_% -``` ----- - ----- -- ### **ParseNear** -> /papi ecloud download ParseNear - -Lets you parse any placeholder for the closest player. Will return blank if no player is found. - -``` -%parsenear_% # Parses placeholder for closest player -%parsenear__% # Parses placeholder for closest player in a radius -``` ----- - -- ### **ParseOther** -> /papi ecloud download ParseOther - -Lets you parse any placeholder for another player. -You can use placeholders in place of `username`. -Make sure to include the `{}` brackets, as it won't work without them. - -``` -%parseother_{username}_{placeholder_without_percent_signs}% -``` ----- - -- ### **Pinger** -> /papi ecloud download Pinger - -Lets you ping a server through an IP or domain (with port), to check the online-status and to receive some information. -The placeholders have a "warmup" time of around one or two minutes after installing the expansion. - -**Note**: These placeholders have a separate update-delay in the config.yml of PlaceholderAPI - -Replace `testplugins.com:25565` with your own server/IP. -``` -%pinger_gameversion_testplugins.com:25565% -%pinger_version_testplugins.com:25565% -%pinger_online_testplugins.com:25565% -%pinger_isonline_testplugins.com:25565% -%pinger_max_testplugins.com:25565% -%pinger_players_testplugins.com:25565% -%pinger_motd_testplugins.com:25565% -%pinger_pingversion_testplugins.com:25565% -``` -`%pinger_online_testplugins.com:25565%` and `%pinger_isonline_testplugins.com:25565%` do the exact same thing. - ----- - -- ### **Player** -> /papi ecloud download Player - -Gives you various placeholders for the player, that triggers the action. - -``` -%player_allow_flight% -%player_bed_x% -%player_bed_y% -%player_bed_z% -%player_bed_world% -%player_biome% -%player_can_pickup_items% -%player_colored_ping% -%player_compass_world% -%player_compass_x% -%player_compass_y% -%player_compass_z% -%player_custom_name% -%player_direction% -%player_displayname% -%player_exp% -%player_exp_to_level% -%player_first_join_date% -%player_fly_speed% -%player_food_level% -%player_gamemode% -%player_has_empty_slot% -%player_empty_slots% -%player_has_permission_% -%player_health% -%player_health_rounded% -%player_health_scale% -%player_ip% -%player_online% -%player_is_op% -%player_item_in_hand% -%player_item_in_hand_name% -%player_item_in_hand_data% -%player_item_in_hand_level_% -%player_item_in_offhand% -%player_item_in_offhand_name% -%player_item_in_offhand_data% -%player_item_in_offhand_level_% -%player_last_damage% -%player_level% -%player_max_air% -%player_max_health% -%player_max_health_rounded% -%player_max_no_damage_ticks% -%player_minutes_lived% -%player_name% -%player_no_damage_ticks% -%player_ping% -%player_ping_% -%player_remaining_air% -%player_saturation% -%player_seconds_lived% -%player_sleep_ticks% -%player_ticks_lived% -%player_time% -%player_time_offset% -%player_total_exp% -%player_uuid% -%player_walk_speed% -%player_world% -%player_world_time_12% -%player_world_time_24% -%player_x% -%player_y% -%player_z% -``` - ----- - -- ### **PlayerList** -> /papi ecloud download PlayerList - -### List Players - -Returns the player list matching the specified syntax - -``` -%playerlist_,,,,% -``` - -**Type:** -- `all` - Matches all players -- `online` - Matches online players -- `offline` - Matches offline players - -**Subtypes:** -- `normal` - Matches all players. Requires no `` -- `perm` - Matches all players that match the permission defined by ``. Supports multiple permissions separated by `+` (`perm.1+perm.2`) -- `world` - Matches all players in the world defined by ``. Supports multiple worlds separated by `+` (`world+world_nether`) -- `nearby` - Matches all players in a certain radius defined by `` - -**Include:** -- `yes` - Include the player -- `no` - Exclude the player - -**Output:** -- `list` - Returns a list of players separated by `, `. You can also change the separator with `list-`.* -- `amount` - Returns amount of players matched -- `` - Returns the player at the specified index - - -**Examples:** -``` -%playerlist_all,normal,yes,list% # Tanguygab, cj89898, funnycube, clip, Frcsty, GabyTM, ItsMeGlare -%playerlist_online,perm,yes,amount,staff.admin% # 2 -%playerlist_online,world,yes,2,buildingworld+spawnworld%` # cj89898, funnycube -%playerlist_online,nearby,yes,list,5% # Tanguygab, cj89898, clip -%playerlist_online,nearby,no,list,5% # Tanguygab, clip -%playerlist_online,nearby,no,list--,20% # Tanguygab-clip-Terfs -``` - -*You can also use `[placeholder]` for papi placeholders in addition to the javascript `{placeholder}`* - -*Note: `Offline` and `All` only support the `Normal` subtype.* -**Since `,` is used to separate the different parts of the placeholder, use `\.` instead if you want to display a `,`.** - ----- - -- ### **Plugin** -> /papi ecloud download Plugin - -Returns information about the specified plugin. - -``` -%plugin_isenabled_% -%plugin_isdisabled_% -%plugin_exists_% -``` ----- - -- ### **Progress** -> /papi ecloud download progress - -More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/Progress-Expansion). - -``` -%progress_bar_{placeholder}% -%progress_bar_{placeholder}_c:% -%progress_bar_{placeholder}_p:% -%progress_bar_{placeholder}_r:% -%progress_bar_{placeholder}_l:% -%progress_bar_{placeholder}_m:% -%progress_bar_{placeholder}_fullbar:% - -%progress_bar_{placeholder}_c:&a■_p:&e■_r:&7■_l:10_m:100_fullbar:&aCompleted!% -``` ----- - -- ### **RainbowColor** -> /papi ecloud download RainbowColor - -More info about the expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/RainbowColor-Expansion). - -``` -%RainbowColor_% -%RainbowColor_custom_,,_% - -e.g. %RainbowColor_custom_a,f,e,b_This is an example% -``` ----- - -- ### **RandomColor** -> /papi ecloud download RandomColor - -More info about the expansion can be found on the [GitHub-Repository](https://github.com/Andre601/RandomColor). - -``` -%randomcolor_all% -%randomcolor_color% -%randomcolor_combined% -%randomcolor_format% -%randomcolor_selected_% -``` ----- - -- ### **RedisBungee** -> /papi ecloud download RedisBungee - -Same like the BungeeCord-placeholders, but for RedisBungee - -``` -%redisbungee_total% -%redisbungee_% -``` ----- - -- ### **RelCon** -> /papi ecloud download RelCon - -More info about the expansion can be found on the [GitHub-Repository](https://github.com/PlaceholderAPI/RelCon-Expansion). - -``` -%rel_relcon_player___[text2]% -%rel_relcon_player__% -%rel_relcon_viewer___[text2]% -%rel_relcon_viewer__% -``` ----- - -- ### **RNG** -> /papi ecloud download RNG - -More info about the expansion can be found on the [GitHub-Repository](https://github.com/Kqliber/Expansion-RNG). - -``` -%rng_random% -%rng_,% -``` ----- - -- ### **ScoreboardObjectives** -> /papi ecloud download ScoreboardObjectives - -Get info from a scoreboard objective. - -``` -%objective_score_% -%objective_score__[otherEntry]% -``` -**Note**: `[otherEntry]` can be another player name, Offline Player name, or non-player Entry - ----- - -- ### **Server** -> /papi ecloud download Server - -Lets you get information about the server. - -``` -%server_name% -%server_online% -%server_version% -%server_max_players% -%server_unique_joins% -%server_uptime% -%server_ram_used% -%server_ram_free% -%server_ram_total% -%server_ram_max% -%server_tps% -%server_tps_1% -%server_tps_5% -%server_tps_15% -%server_tps_1_colored% -%server_tps_5_colored% -%server_tps_15_colored% -%server_online_% -%server_has_whitelist% -%server_total_chunks% -%server_total_living_entities% -%server_total_entities% -%server_time_% -%server_countdown__
If your expansion is hardcoded into the plugin or the jar is downloaded on a different place can you put `NO DOWNLOAD COMMAND` there. | +| `:description` | Optional. A brief description about the Expansion. You can also link to any page explaining the placeholders in more detail. | +| `:placeholders` | List of placeholders provided by the expansion. The placeholders should be in alphabetical order and you can use `<>` and `[]` to indicate required and optional parameters respectively. | -- If your entry has another one below it will you need to add an empty line, followed by for hypthons (`----`) at the bottom of your entry to separate it. -- You are allowed to add a description between the `> :command` and the placeholder list. Keep in mind to keep an empty line after the command line to prevent wrong formatting. A description is only useful/required if your expansion/plugin offers specific placeholder values and/or features. -- Always add your entry's name to the list at the top of the page in the format `- [:name](#:name)`. Note that if your entry shares the same name as another one on the page and you added it below it, that you will need to append a `-1`, `-2`, ... to the name in the brackets, depending on how many entries with the same name there are. +### Special Notes +- When linking to a resource page of Spigot will you need to use the following URL format, where you replace `:id` with the resource ID: + https://spigotmc.org/resources/:id +- On the Placeholders page, if your Entry has other Entries before or after it will you need to add four hyphens (`----`) surrounded by an empty line before and after it, depending on whether there is another entry before/after yours. +- You need to add your Entry in the list at the top of the Placeholders page. + The format is `- **[:name](#:header)**` where `:name` is the same as in the entry and `:header` is the lowercase version of it. + When there are more than one Expansion with the same name will you need to add yours **below** the existing one and add `-1` to the header. ---- ## Other Wiki pages diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index 0df7de5..20c0ec5 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -18,43 +18,8 @@ **[[Expansion cloud]]** **[[FAQ]]** **[[Plugins using PlaceholderAPI]]** -**[[Placeholders]]** -- [[PAPI-placeholders|Placeholders#papi-placeholders-1]] - - [[Advancements|Placeholders#advancements]] - - [[Animations|Placeholders#animations]] - - [[Armor|Placeholders#armor]] - - [[ASCII|Placeholders#ASCII]] - - [[BungeeCord|Placeholders#bungeecord]] - - [[CheckItem|Placeholders#checkitem]] - - [[CooldownBar|Placeholders#cooldownbar]] - - [[Formatter|Placeholders#formatter]] - - [[Javascript|Placeholders#javascript]] - - [[ListPlayers|Placeholders#listplayer]] - - [[LocalTime|Placeholders#localtime]] - - [[Math|Placeholders#math]] - - [[MVdW placeholders|Placeholders#mvdw-placeholders]] - - [[OtherPlayer|Placeholders#otherplayer]] - - [[ParseNear|Placeholders#parsenear]] - - [[ParseOther|Placeholders#parseother]] - - [[Pinger|Placeholders#pinger]] - - [[Player|Placeholders#player]] - - [[PlayerList|Placeholders#playerlist]] - - [[Plugin|Placeholders#plugin]] - - [[Progress|Placeholders#progress]] - - [[RainbowColor|Placeholders#rainbowcolor]] - - [[RandomColor|Placeholders#randomcolor]] - - [[RedisBungee|Placeholders#redisbungee]] - - [[RelCon|Placeholders#relcon]] - - [[ScoreboardObjectives|Placeholders#scoreboardobjectives]] - - [[Server|Placeholders#server]] - - [[Sound|Placeholders#sound]] - - [[Spectators|Placeholders#spectators]] - - [[SpeedPerSec|Placeholders#speedpersec]] - - [[Statistic|Placeholders#statistic]] - - [[Team|Placeholders#team]] - - [[World|Placeholders#world]] - -- [[Plugin-placeholders|Placeholders#plugin-placeholders-1]] +**[[Placeholders]]** +- [[Standalone|Placeholders#standalone]] - [[A|Placeholders#a]] - [[B|Placeholders#b]] - [[C|Placeholders#c]] @@ -78,4 +43,33 @@ - [[U|Placeholders#u]] - [[V|Placeholders#v]] - [[W|Placeholders#w]] + - [[X|Placeholders#x]] + - [[Y|Placeholders#y]] - [[Z|Placeholders#z]] +- [[Plugin-placeholders|Placeholders#plugin-placeholders-1]] + - [[A|Placeholders#a-1]] + - [[B|Placeholders#b-1]] + - [[C|Placeholders#c-1]] + - [[D|Placeholders#d-1]] + - [[E|Placeholders#e-1]] + - [[F|Placeholders#f-1]] + - [[G|Placeholders#g-1]] + - [[H|Placeholders#h-1]] + - [[I|Placeholders#i-1]] + - [[J|Placeholders#j-1]] + - [[K|Placeholders#k-1]] + - [[L|Placeholders#l-1]] + - [[M|Placeholders#m-1]] + - [[N|Placeholders#n-1]] + - [[O|Placeholders#o-1]] + - [[P|Placeholders#p-1]] + - [[Q|Placeholders#q-1]] + - [[R|Placeholders#r-1]] + - [[S|Placeholders#s-1]] + - [[T|Placeholders#t-1]] + - [[U|Placeholders#u-1]] + - [[V|Placeholders#v-1]] + - [[W|Placeholders#w-1]] + - [[X|Placeholders#x-1]] + - [[Y|Placeholders#y-1]] + - [[Z|Placeholders#z-1]] From 30b5abda1988576d0e83ea97ac70afa23f80e023 Mon Sep 17 00:00:00 2001 From: Andre601 <11576465+Andre601@users.noreply.github.com> Date: Tue, 20 Apr 2021 23:30:43 +0200 Subject: [PATCH 23/86] Fix wrong links --- wiki/Placeholders.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 0f00626..e29b400 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -226,9 +226,8 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **I** - **[InteractionVisualizer](#interactionvisualizer)** - **[InteractiveChat](#interactivechat)** - - **[Island Border (ASkyblock / BentoBox / uSkyBlock / AcidIsland)](#island-border-askyblock--bentobox--uskyblock--acidisland)** + - **[Island Border (ASkyblock / BentoBox / uSkyBlock / AcidIsland)](#island-border)** - **[IslandRate (ASkyBlock Addon)](#islandrate)** - - **[IslandRate (AcidIsland Addon)](#islandrate)** - **[IslandWorld](#islandworld)** - ### **J** From 230e36c55e9a6aca14ccf50d61520c5de9a30907 Mon Sep 17 00:00:00 2001 From: Andre601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 23 Apr 2021 00:08:00 +0200 Subject: [PATCH 24/86] [Wiki] Add Lands --- wiki/Placeholders.md | 56 ++++++++++++++++++++++++++++ wiki/Plugins-using-PlaceholderAPI.md | 3 ++ 2 files changed, 59 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index e29b400..2b9a9a7 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -241,6 +241,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[KP-PVP](#kp-pvp)** - ### **L** + - **[Lands](#lands)** - **[LastLoginAPI](#lastloginapi)** - **[LeaderHeads](#leaderheads)** - **[LegendQuest](#legendquest)** @@ -2782,6 +2783,61 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- +- ### **[Lands](https://www.spigotmc.org/resources/53313/)** + > NO DOWNLOAD COMMAND + + A Description of the placeholders can be found on the [Lands Wiki](https://github.com/Angeschossen/Lands/wiki/PlaceholderAPI-Placeholders#placeholders). + + ``` + # General + %lands_next_tax% + %lands_next_upkeep% + %lands_affiliation% + + # Land + %lands_land_name% + %lands_land_owner% + %lands_land_role% + %lands_land_members% + %lands_land_balance% + %lands_land_chunks% + %lands_land_chunks_max% + %lands_land_chunks_remaining% + %lands_land_tax% + %lands_land_upkeep% + %lands_land_balance% + %lands_land_chunk_cost_next% + + # Nation + %lands_nation_name% + + # War + %lands_war_enemy% + %lands_war_time% + %lands_war_state% + + # Top Lands + %lands_top_balance_NUMBER_name% + %lands_top_balance_NUMBER_owner% + %lands_top_balance_NUMBER_balance% + %lands_top_balance_NUMBER_size% + %lands_top_balance_NUMBER_members% + + %lands_top_chunks_NUMBER_name% + %lands_top_chunks_NUMBER_owner% + %lands_top_chunks_NUMBER_balance% + %lands_top_chunks_NUMBER_size% + %lands_top_chunks_NUMBER_members% + + %lands_top_members_NUMBER_name% + %lands_top_members_NUMBER_owner% + %lands_top_members_NUMBER_balance% + %lands_top_members_NUMBER_size% + %lands_top_members_NUMBER_members% + ``` + +---- + - ### **[LastLoginAPI](https://www.spigotmc.org/resources/66348/)** > NO DOWNLOAD COMMAND diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 0bf5638..2a300e0 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -461,6 +461,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl ---- ## L +- **[Lands](https://www.spigotmc.org/resources/53313/)** + - [ ] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#lands]]**] - **[LastLoginAPI](https://www.spigotmc.org/resources/66348/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#lastloginapi]]**] From edd3153acd8c59a90906a43177f08ed46f902b42 Mon Sep 17 00:00:00 2001 From: Lorenzo <69311874+Lorenzo0111@users.noreply.github.com> Date: Tue, 4 May 2021 16:24:18 +0200 Subject: [PATCH 25/86] Update documentation url --- wiki/Placeholders.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 2b9a9a7..8766832 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3998,7 +3998,7 @@ Please see [this discussion][list] for a list of all expansions officially maint ``` `` is the name you configured in the config.yml of this plugin. - [Read More](https://lorenzo0111.gitbook.io/rocekt-plugins/rocketplaceholders/configure) + [Read More](https://docs.rocketplugins.space/rocketplaceholders/configure) ---- @@ -5146,4 +5146,4 @@ Please see [this discussion][list] for a list of all expansions officially maint %xlt_{tournamentId}_score% %xlt_{tournamentId}_position% %xlt_{tournamentId}_type% - ``` \ No newline at end of file + ``` From c3922de323a312df34af7193209d53744bd439ff Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 7 May 2021 23:45:29 +0200 Subject: [PATCH 26/86] Update Commands.md --- wiki/Commands.md | 352 +++++++++++++++++++++++------------------------ 1 file changed, 171 insertions(+), 181 deletions(-) diff --git a/wiki/Commands.md b/wiki/Commands.md index c1970bd..0484d55 100644 --- a/wiki/Commands.md +++ b/wiki/Commands.md @@ -30,210 +30,200 @@ This page shows all commands, including with a detailed description of what ever - [`/papi reload`](#papi-reload) ---- + ### Parse Commands These commands are used to parse placeholders into their respective values. Useful for debugging. -#### `/papi bcparse` -**Description**: -Parses placeholders of a String and broadcasts the result to all players. +- #### `/papi bcparse` + **Description**: + Parses placeholders of a String and broadcasts the result to all players. + + **Arguments**: + * `` - The Player to parse values of the placeholder (Use `me` for yourself). + * `` - The text to parse. + + **Example**: + ``` + /papi bcparse funnycube My name is %player_name%! + ``` -**Arguments**: -* `` - The Player to parse values of the placeholder (Use `me` for yourself). -* `` - The text to parse. +- #### `/papi cmdparse` + **Description**: + Parses placeholders of a String and executes it as a command. -**Example**: -``` -/papi bcparse funnycube My name is %player_name%! -``` + **Arguments**: + - `` - The player to parse placeholders against. Use `me` for yourself. + - `` - The Text to parse and execute as command. Please leave away the `/` of the command. + + **Example**: + ``` + /papi cmdparse funnycube say My name is %player_name%! + ``` + +- #### `/papi parse` + **Description**: + Parses the placeholders in a given text and shows the result. + + **Arguments**: + * `` - The Player to parse values of the placeholder (Use `me` for yourself). + * `` - The text to parse. + + **Example**: + ``` + /papi parse funnycube My group is %vault_group% + ``` + +- #### `/papi parserel` + **Description**: + Parses a relational placeholder. + + **Arguments**: + * `` - The first player. + * `` - the second player to compare with. + * `` - The actual placeholder to parse. + + **Example**: + ``` + /papi parserel funnycube extended_clip %placeholder% + ``` ---- -#### `/papi cmdparse` -**Description**: -Parses placeholders of a String and executes it as a command. -**Arguments**: -- `` - The player to parse placeholders against. Use `me` for yourself. -- `` - The Text to parse and execute as command. Please leave away the `/` of the command. - -**Example**: -``` -/papi cmdparse funnycube say My name is %player_name%! -``` - ----- -#### `/papi parse` -**Description**: -Parses the placeholders in a given text and shows the result. - -**Arguments**: -* `` - The Player to parse values of the placeholder (Use `me` for yourself). -* `` - The text to parse. - -**Example**: -``` -/papi parse funnycube My group is %vault_group% -``` - ----- -#### `/papi parserel` -**Description**: -Parses a relational placeholder. - -**Arguments**: -* `` - The first player. -* `` - the second player to compare with. -* `` - The actual placeholder to parse. - -**Example**: -``` -/papi parserel funnycube extended_clip %placeholder% -``` - ----- ### eCloud Commands These commands all start with `/papi ecloud` and are used for things related about the [[Expansion Cloud]]. -#### `/papi ecloud clear` -**Description**: -Clears the cache for the eCloud. +- #### `/papi ecloud clear` + **Description**: + Clears the cache for the eCloud. + +- #### `/papi ecloud disable` + **Description**: + Disables the connection to the eCloud. + +- #### `/papi ecloud download` + **Description**: + Allows you to download an expansion from the eCloud + + **Arguments**: + - `` - The expansion to download. + - `[version]` - The specific version of the expansion to download (Optional) + + **Example**: + ``` + /papi ecloud download Vault + /papi ecloud download Vault 1.5.2 + ``` + +- #### `/papi ecloud enable` + **Description**: + Enables the connection to the eCloud + +- #### `/papi ecloud info` + **Description**: + Gives information about a specific Expansion. + + **Arguments**: + - `` - The Expansion to retrieve information from. + - `[version]` - The Expansion's version to get information from. + + **Example**: + ``` + /papi ecloud info Vault + ``` + +- #### `/papi ecloud list` + **Description**: + Lists either all Expansions on the eCloud, only those by a specific author or only those that you have [installed](#papi-ecloud-download). + Installed Expansions show as green in the list and Expansions that are installed and have an update available show as gold. + + **Arguments**: + - `|installed>` - List all Expansions, Expansions of a specific author or all Expnansions you have installed. + + **Example**: + ``` + /papi ecloud list all + /papi ecloud list clip + /papi ecloud list installed + ``` + +- #### `/papi ecloud placeholders` + **Description**: + List all placeholders of an Expansion. + + **Arguments**: + - `` - The Expansion to list placeholders of. + + **Example**: + ``` + /papi ecloud placeholders Vault + ``` + +- #### `/papi ecloud refresh` + **Description**: + Refresh the cached data from the eCloud. + +- #### `/papi ecloud status` + **Description**: + Displays the actual Status of the eCloud. ---- -#### `/papi ecloud disable` -**Description**: -Disables the connection to the eCloud. ----- -#### `/papi ecloud download` -**Description**: -Allows you to download an expansion from the eCloud - -**Arguments**: -- `` - The expansion to download. -- `[version]` - The specific version of the expansion to download (Optional) - -**Example**: -``` -/papi ecloud download Vault -/papi ecloud download Vault 1.5.2 -``` - ----- -#### `/papi ecloud enable` -**Description**: -Enables the connection to the eCloud - ----- -#### `/papi ecloud info` -**Description**: -Gives information about a specific Expansion. - -**Arguments**: -- `` - The Expansion to retrieve information from. -- `[version]` - The Expansion's version to get information from. - -**Example**: -``` -/papi ecloud info Vault -``` - ----- -#### `/papi ecloud list` -**Description**: -Lists either all Expansions on the eCloud, only those by a specific author or only those that you have [installed](#papi-ecloud-download). -Installed Expansions show as green in the list and Expansions that are installed and have an update available show as gold. - -**Arguments**: -- `|installed>` - List all Expansions, Expansions of a specific author or all Expnansions you have installed. - -**Example**: -``` -/papi ecloud list all -/papi ecloud list clip -/papi ecloud list installed -``` - ----- -#### `/papi ecloud placeholders` -**Description**: -List all placeholders of an Expansion. - -**Arguments**: -- `` - The Expansion to list placeholders of. - -**Example**: -``` -/papi ecloud placeholders Vault -``` - ----- -#### `/papi ecloud refresh` -**Description**: -Refresh the cached data from the eCloud. - ----- -#### `/papi ecloud status` -**Description**: -Displays the actual Status of the eCloud. - ----- ### Expansion Commands These commands can be used to manage the expansions that you have currently installed. -#### `/papi info` -**Description**: -Gives you information about the specified Expansion. +- #### `/papi info` + **Description**: + Gives you information about the specified Expansion. -**Argument(s)**: -- `` - The Expansion to get info from (Needs to be registered and active). + **Argument(s)**: + - `` - The Expansion to get info from (Needs to be registered and active). + + **Example**: + ``` + /papi info Vault + ``` -**Example**: -``` -/papi info Vault -``` +- #### `/papi list` + **Description**: + Lists all active/registered expansions. + This is different to [/papi ecloud list installed](#papi-ecloud-list) in the fact, that it also includes expansions that were installed through a plugin (That aren't a separate jar-file) and it also doesn't show which one have updates available. + +- #### `/papi register` + **Description**: + Registers an expansion from a specified filename. + This is useful in cases, where you downloaded the expansion manually and don't want to restart the server. + The file needs to be inside `/plugins/PlaceholderAPI/expansions`. + + **Arguments**: + - `` - The file to register (including the file-extension). + + **Example**: + ``` + /papi register MyExpansion.jar + ``` + +- #### `/papi unregister` + **Description**: + Unregisters the specified expansion. + + **Arguments**: + - `` - The expansion to unregister. + + **Example**: + ``` + /papi unregister MyExpansion.jar + ``` ---- -#### `/papi list` -**Description**: -Lists all active/registered expansions. -This is different to [/papi ecloud list installed](#papi-ecloud-list) in the fact, that it also includes expansions that were installed through a plugin (That aren't a separate jar-file) and it also doesn't show which one have updates available. ----- -#### `/papi register` -**Description**: -Registers an expansion from a specified filename. -This is useful in cases, where you downloaded the expansion manually and don't want to restart the server. -The file needs to be inside `/plugins/PlaceholderAPI/expansions`. - -**Arguments**: -- `` - The file to register (including the file-extension). - -**Example**: -``` -/papi register MyExpansion.jar -``` - ----- -#### `/papi unregister` -**Description**: -Unregisters the specified expansion. - -**Arguments**: -- `` - The expansion to unregister. - -**Example**: -``` -/papi unregister MyExpansion.jar -``` - ----- ### Other Commands These are other commands of PlaceholderAPI that don't fit any of the above categories. -#### `/papi dump` -**Description**: -Pastes useful information from PlaceholderAPI such as plugin version, server version and installed expansions to https://paste.helpch.at for simple sharing and support. +- #### `/papi dump` + **Description**: + Pastes useful information from PlaceholderAPI such as plugin version, server version and installed expansions to https://paste.helpch.at for simple sharing and support. -#### `/papi reload` -**Description**: -Reloads the config settings. -You need to use this command after [downloading Expansions](#papi-ecloud-download) from the eCloud or they won't be properly registered. \ No newline at end of file +- #### `/papi reload` + **Description**: + Reloads the config settings. + You need to use this command after [downloading Expansions](#papi-ecloud-download) from the eCloud or they won't be properly registered. From 5dbd58076ab24da171561939995023abc3ff52f9 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Sat, 8 May 2021 14:17:19 +0200 Subject: [PATCH 27/86] Add %rng_online_player% --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 8766832..9cab43e 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -976,6 +976,7 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can More info about the expansion can be found on the [GitHub-Repository](https://github.com/Kqliber/Expansion-RNG). ``` + %rng_online_player% %rng_random% %rng_,% ``` From 0df265881aaeb05bf82ab06c5a9ebc964b80e1a4 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Wed, 12 May 2021 00:03:34 +0200 Subject: [PATCH 28/86] Add CalculateNumbers --- wiki/Placeholders.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 9cab43e..e89fcf5 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -25,6 +25,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[BungeeCord](#bungeecord)** - ### **C** + - **[CalculateNumbers](#calculatenumbers)** - **[CheckItem](#checkitem)** - **[CooldownBar](#cooldownbar)** @@ -492,6 +493,20 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can ---- +- ### **CalculateNumbers** + > NO DOWNLOAD COMMAND + + Download the jar from [broken1arrow/CalculateNumbers/releases](https://github.com/broken1arrow/CalculateNumbers/releases) + + ``` + %number_numbervalue,tool:{a placeholder from your ranking plugin}% + %number_numbervalue,decimal,tool:{a placeholder from your ranking plugin}% + %number_numbervalue,armor:{a placeholder from your ranking plugin}% + %number_numbervalue,decimal,armor:{a placeholder from your ranking plugin}% + ``` + +---- + - ### **CheckItem** > /papi ecloud download CheckItem From a4d8009ce4699b1df9eb06b42832ab534cf9a45b Mon Sep 17 00:00:00 2001 From: broken1arrow Date: Wed, 12 May 2021 17:19:05 +0200 Subject: [PATCH 29/86] Has change and add descriptions Try other way and see if this work better to pull uppdates. --- wiki/Placeholders.md | 858 ++++++++++++++++++++++--------------------- 1 file changed, 433 insertions(+), 425 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index e89fcf5..fc73221 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -20,21 +20,21 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Animations](#animations)** - **[Armor](#armor)** - **[ASCII](#ascii)** - + - ### **B** - **[BungeeCord](#bungeecord)** - + - ### **C** - **[CalculateNumbers](#calculatenumbers)** - **[CheckItem](#checkitem)** - **[CooldownBar](#cooldownbar)** - + - ### **D** - *No Expansions* - + - ### **E** - *No Expansions* - + - ### **F** - **[Formatter](#formatter)** @@ -46,17 +46,17 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **I** - *No Expansions* - + - ### **J** - **[Javascript](#javascript)** - ### **K** - *No Expansions* - + - ### **L** - **[ListPlayers](#listplayers)** - **[LocalTime](#localtime)** - + - ### **M** - **[Math](#math)** - **[MVdW placeholders](#mvdw-placeholders)** @@ -65,10 +65,10 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **N** - *No Expansions* - + - ### **O** - **[OtherPlayer](#otherplayer)** - + - ### **P** - **[ParseNear](#parsenear)** - **[ParseOther](#parseother)** @@ -80,14 +80,14 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **Q** - *No Expansions* - + - ### **R** - **[RainbowColor](#rainbowcolor)** - **[RandomColor](#randomcolor)** - **[RedisBungee](#redisbungee)** - **[RelCon](#relcon)** - **[RNG](#rng)** - + - ### **S** - **[ScoreboardObjectives](#scoreboardobjectives)** - **[Server](#server)** @@ -95,7 +95,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Sound](#sound)** - **[SpeedPerSec](#speedpersec)** - **[Statistic](#statistic)** - + - ### **T** - **[Team](#team)** - **[Teams](#teams)** @@ -105,7 +105,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **V** - *No Expansions* - + - ### **W** - **[World](#world)** @@ -410,9 +410,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Advancements** > /papi ecloud download Advancements - + More info about this expansion can be found on the [GitHub-Repository](https://github.com/matahombres/Advancements). - + ``` %Advancements_% %Advancements_player_;% @@ -436,28 +436,28 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Animations** > /papi ecloud download Animations - + ```html %animations_Text% %animations_Text% %animations_Text% ``` - + Please note: When using placeholders within the animation text, you must use the bracket variant. Use `{player_name}` instead of `%player_name%` within the ` ` tags. - + Please visit the [dedicated wiki](https://github.com/Niall7459/KiteBoard-Documentation/wiki/Animations-and-Modifiers) for all available tags. ---- - ### **Armor** > /papi ecloud download Armor - + Gives you info about your armor - + ``` Chose one value that's inside () and replace SLOT with one of the following: helmet, chestplate, leggings, boots. - + %armor_amount_SLOT% %armor_color_(red/green/blue/hex)_SLOT% %armor_durability_(left/max)_SLOT% @@ -470,22 +470,22 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **ASCII** > /papi ecloud download ASCII - + Returns the [ASCII Value](http://www.asciitable.com/) based on input - + ``` %ascii_% ``` - + Ex: `%ascii_37%` returns `%` ---- - ### **BungeeCord** > /papi ecloud download Bungee - + Allows you to show, how many players are online on the entire network, or just on a specific server. - + ``` %bungee_total% %bungee_% @@ -495,9 +495,17 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **CalculateNumbers** > NO DOWNLOAD COMMAND - + (Will fix download command) + Download the jar from [broken1arrow/CalculateNumbers/releases](https://github.com/broken1arrow/CalculateNumbers/releases) - + + The idea with this expansion is that you should be able to charge dynamically, + for example in the deluxe menu. For tools, weapons and armor when players need to + repair their belongings. Has also added optional so you can also combine it with + rank plugin if you have one. + + Use decimal,to get two decimal digits. + ``` %number_numbervalue,tool:{a placeholder from your ranking plugin}% %number_numbervalue,decimal,tool:{a placeholder from your ranking plugin}% @@ -509,16 +517,16 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **CheckItem** > /papi ecloud download CheckItem - + Allows you to check the inventory of a player for a certain item. - + ``` %checkitem_,,<...>% - Returns if user has the item %checkitem_amount_,,<...>% - Returns amount of items the user has %checkitem_remove_,,<...>% - Removes the items from the players inventory - Can be used with amount, it just has to be after. (Ex. `%checkitem_amount_remove_<...>%`) Please be careful as it does REMOVE ITEMS FOR GOOD %checkitem_give_,,<...>% - Gives the player items. Returns true if successful, returns the number of items NOT given if unsuccessful. (When unsuccessful items can still be given, it just might not be all of them) ``` - + **Modifiers** You can combine different modifiers to check for different values. Available modifiers are: @@ -559,7 +567,7 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can Requires `mat:` modifier. Strictly checks the name and lore for an item. (If a Stone named `Test` is in your inventory, and you're using `%checkitem_mat:stone,strict%`, it will return false) - `inhand` Check if the item is in the player's hand (Also checks off-hand) - + **Notes:** - * means case-sensitive - ** means only one can be used @@ -571,9 +579,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **CooldownBar** > /papi ecloud download CooldownBar - + More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/CooldownBar-Expansion). - + ``` %cooldownbar_{placeholder}% %cooldownbar_{placeholder}_p:% @@ -593,13 +601,13 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Formatter** > /papi ecloud download Formatter - + More info about this expansion can be found on the [GitHub-Repository](https://github.com/Andre601/Formatter-Expansion). - + ``` %formatter_number_format_% %formatter_number_format_[locale]:[format]_% - + %formatter_number_time_% %formatter_number_time_seconds_% # Handles number as seconds %formatter_number_time_secs_% # Handles number as seconds @@ -607,7 +615,7 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can %formatter_number_time_mins_% # Handles number as minutes %formatter_number_time_hours_% # Handles number as hours %formatter_number_time_hrs_% # Handles number as hours - + %formatter_replace___% %formatter_text_substring__% %formatter_text_uppercase_% @@ -618,9 +626,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Javascript** > /papi ecloud download Javascript - + Gives you a way, to use javascript, to give a different output, depending on conditions. - + ``` %javascript_% ``` @@ -629,9 +637,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **ListPlayers** > /papi ecloud download ListPlayers - + Lists players with a certain permission or in a certain world... 'nuf said. - + ``` %listplayers_with_perm_% %listplayers_in_world_% @@ -641,27 +649,27 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **LocalTime** > /papi ecloud download LocalTime - + ``` %localtime_time% %localtime_time_% %localtime_timezone_% %localtime_timezone_,% ``` - + Please read the [SimpleDateFormat] Javadoc page about possible formats and [this post][TimeZoneIDs] about available time zone IDs for ``. ---- - ### **Math** > /papi ecloud download Math - + Lets you make simple or advanced calculations. Any placeholder that returns a number is supported (Use `{placeholder}` instead of `%placeholder%`) - + Supports all calculations you can do with [EvalEx](https://github.com/uklimaschewski/EvalEx). Note that the `%` can't be used within the placeholder and that you have to use `[prc]` instead. - + ``` %math_% %math_[precision]:[rounding]_% @@ -671,11 +679,11 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **MVdW Placeholders** > /papi ecloud download MVdW - + Lets you use placeholders from [MVdWPlaceholderAPI](https://www.spigotmc.org/resources/11182/). MVdWPlaceholderAPI and one of **[Maxims plugins](https://www.spigotmc.org/resources/2691/)**, that use it, are required! A list of his placeholders can be found [here](https://www.spigotmc.org/wiki/mvdw-placeholders/) - + ``` %mvdw_% ``` @@ -704,9 +712,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **OtherPlayer** > /papi ecloud download OtherPlayer - + Lets you get placeholders for other players. (Not the one that triggers the action) - + ``` %otherplayer_displayname_% %otherplayer_gamemode_% @@ -730,9 +738,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **ParseNear** > /papi ecloud download ParseNear - + Lets you parse any placeholder for the closest player. Will return blank if no player is found. - + ``` %parsenear_% # Parses placeholder for closest player %parsenear__% # Parses placeholder for closest player in a radius @@ -742,11 +750,11 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **ParseOther** > /papi ecloud download ParseOther - + Lets you parse any placeholder for another player. You can use placeholders in place of `username`. Make sure to include the `{}` brackets, as it won't work without them. - + ``` %parseother_{username}_{placeholder_without_percent_signs}% ``` @@ -755,12 +763,12 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Pinger** > /papi ecloud download Pinger - + Lets you ping a server through an IP or domain (with port), to check the online-status and to receive some information. The placeholders have a "warmup" time of around one or two minutes after installing the expansion. - + **Note**: These placeholders have a separate update-delay in the config.yml of PlaceholderAPI - + Replace `testplugins.com:25565` with your own server/IP. ``` %pinger_gameversion_testplugins.com:25565% @@ -778,9 +786,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Player** > /papi ecloud download Player - + Gives you various placeholders for the player, that triggers the action. - + ``` %player_allow_flight% %player_bed_x% @@ -853,33 +861,33 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### PlayerList > /papi ecloud download playerlist - + Returns the player list matching the specified syntax - + ``` %playerlist_,,,,% ``` - + **Type:** - `all` - Matches all players - `online` - Matches online players - `offline` - Matches offline players - + **Subtypes:** - `normal` - Matches all players. Requires no `` - `perm` - Matches all players that match the permission defined by ``. Supports multiple permissions separated by `+` (`perm.1+perm.2`) - `world` - Matches all players in the world defined by ``. Supports multiple worlds separated by `+` (`world+world_nether`) - `nearby` - Matches all players in a certain radius defined by `` - + **Include:** - `yes` - Include the player - `no` - Exclude the player - + **Output:** - `list` - Returns a list of players separated by `, `. You can also change the separator with `list-`.* - `amount` - Returns amount of players matched - `` - Returns the player at the specified index - + **Examples:** ``` %playerlist_all,normal,yes,list% # Tanguygab, cj89898, funnycube, clip, Frcsty, GabyTM, ItsMeGlare @@ -889,9 +897,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can %playerlist_online,nearby,no,list,5% # Tanguygab, clip %playerlist_online,nearby,no,list--,20% # Tanguygab-clip-Terfs ``` - + *You can also use `[placeholder]` for papi placeholders in addition to the javascript `{placeholder}`* - + *Note: `Offline` and `All` only support the `Normal` subtype.* **Since `,` is used to separate the different parts of the placeholder, use `\.` instead if you want to display a `,`.** @@ -899,9 +907,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Plugin** > /papi ecloud download Plugin - + Returns information about the specified plugin. - + ``` %plugin_isenabled_% %plugin_isdisabled_% @@ -912,9 +920,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **Progress** > /papi ecloud download progress - + More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/Progress-Expansion). - + ``` %progress_bar_{placeholder}% %progress_bar_{placeholder}_c:% @@ -923,7 +931,7 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can %progress_bar_{placeholder}_l:% %progress_bar_{placeholder}_m:% %progress_bar_{placeholder}_fullbar:% - + # Example %progress_bar_{placeholder}_c:&a■_p:&e■_r:&7■_l:10_m:100_fullbar:&aCompleted!% ``` @@ -932,13 +940,13 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **RainbowColor** > /papi ecloud download RainbowColor - + More info about the expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/RainbowColor-Expansion). - + ``` %RainbowColor_% %RainbowColor_custom_,,_% - + e.g. %RainbowColor_custom_a,f,e,b_This is an example% ``` @@ -946,9 +954,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **RandomColor** > /papi ecloud download RandomColor - + More info about the expansion can be found on the [GitHub-Repository](https://github.com/Andre601/RandomColor). - + ``` %randomcolor_all% %randomcolor_color% @@ -961,9 +969,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **RedisBungee** > /papi ecloud download RedisBungee - + Same like the [BungeeCord-placeholders](#bungeecord), but for RedisBungee - + ``` %redisbungee_total% %redisbungee_% @@ -973,9 +981,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **RelCon** > /papi ecloud download RelCon - + More info about the expansion can be found on the [GitHub-Repository](https://github.com/PlaceholderAPI/RelCon-Expansion). - + ``` %rel_relcon_player___[text2]% %rel_relcon_player__% @@ -987,9 +995,9 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **RNG** > /papi ecloud download RNG - + More info about the expansion can be found on the [GitHub-Repository](https://github.com/Kqliber/Expansion-RNG). - + ``` %rng_online_player% %rng_random% @@ -1000,23 +1008,23 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can - ### **ScoreboardObjectives** > /papi ecloud download ScoreboardObjectives - + Get info from a scoreboard objective. - + ``` %objective_score_% %objective_score__[otherEntry]% ``` - + **Note**: `[otherEntry]` can be another player name, Offline Player name, or non-player Entry ---- - ### **Server** > /papi ecloud download Server - + Lets you get information about the server. - + ``` %server_name% %server_online% @@ -1044,35 +1052,35 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can %server_countdown__
- *
If you create such a class inside your own plugin, you have to - * register it manually in your plugins {@code onEnable()} by using - * {@code new YourExpansionClass().register();} - */ public class SomeExpansion extends PlaceholderExpansion { - /** - * This method should always return true unless we - * have a dependency we need to make sure is on the server - * for our placeholders to work! - * - * @return always true since we do not have any dependencies. - */ - @Override - public boolean canRegister(){ - return true; - } - - /** - * The name of the person who created this expansion should go here. - * - * @return The name of the author as a String. - */ @Override public String getAuthor(){ return "someauthor"; } - - /** - * The placeholder identifier should go here. - *
This is what tells PlaceholderAPI to call our onRequest - * method to obtain a value if a placeholder starts with our - * identifier. - *
The identifier has to be lowercase and can't contain _ or % - * - * @return The identifier in {@code %_%} as String. - */ + @Override public String getIdentifier(){ return "example"; } - /** - * This is the version of this expansion. - *
You don't have to use numbers, since it is set as a String. - * - * @return The version as a String. - */ @Override public String getVersion(){ return "1.0.0"; } - - /** - * This is the method called when a placeholder with our identifier - * is found and needs a value. - *
We specify the value identifier in this method. - *
Since version 2.9.1 can you use OfflinePlayers in your requests. - * - * @param player - * A {@link org.bukkit.OfflinePlayer OfflinePlayer}. - * @param identifier - * A String containing the identifier/value. - * - * @return Possibly-null String of the requested identifier. - */ - @Override - public String onRequest(OfflinePlayer player, String identifier){ - - // %example_placeholder1% - if(identifier.equals("placeholder1")){ - return "placeholder1 works"; - } - - // %example_placeholder2% - if(identifier.equals("placeholder2")){ - return "placeholder2 works"; - } - - // We return null if an invalid placeholder (f.e. %example_placeholder3%) - // was provided - return null; - } } ``` +Let's quickly break down the different methods you have to implement. + +- #### getAuthor + This method allows you to set the name of the expansion's author. +- #### getIdentifier + The name that should be used to identify the placeholders for this expansion. + The identifier is the string after the starting `%` and before the first `_` (`%identifier_values%`) and, therefore, cannot contain any `_`s. + + If you want to use `_` in your expansion's name, you can override the optional `getName()` method. +- #### getVersion + This is a string, which means it can contain more than just a number. This is used to determine if a new update is available or not when the expansion is shared on the eCloud. + For expansions that are part of a plugin, this does not really matter. + +Those are all the neccessary parts for your PlaceholderExpansion. +Any other methods that are part of the [`PlaceholderExpansion`][placeholderexpansion] class are optional and will usually not be used, or will default to a specific value. Please read the Javadoc comments of those methods for more information. + +You must choose between one of these two methods for handling the actual parsing of placeholders: + +- #### onRequest(OfflinePlayer, String) + If not explicitly set, this will automatically call [`onPlaceholderRequest(Player, String)`](#onplaceholderrequestplayer-string). + This method is recommended as it allows the usage of `null` and can therefore be used in placeholders that don't require a valid player to be used. +- #### onPlaceholderRequest(Player, String) + If not set, this method will return `null` which PlaceholderAPI sees as an invalid placeholder. + ---- +## Without a Plugin +An expansion does not always need a plugin to rely on. If the placeholders it provides can return values from just the server itself or some other source (i.e. Java itself), then it can work independently. -### With external plugin -Those examples here applies to people who want to provide information from their own plugin through placeholders from PlaceholderAPI. -There exists a repository showcasing an [example-expansion](/PlaceholderAPI/Example-Expansion) with what you can/should do. +Common examples of such Expansions are: -In our examples do we have the plugin `SomePlugin` and want to show certain placeholders with it. +- [Player Expansion][playerexpansion] +- [Server Expansion][serverexpansion] +- [Math Expansion][mathexpansion] -There are two ways to actually get information from your plugin and they only are different in if you have the expansion as a separate jar-file or as an internal class. +These kinds of expansions don't require any additional plugins to function. +When creating such an expansion is it recommended to use [`onRequest(OfflinePlayer, String)`](#onrequestofflineplayer-string). -#### Separate jar -In our separate jar do we have to make some checks, to be sure, that the required plugin is installed and running. -The below code shows how the class can look like in case the plugin doesn't have a public and easy to access API. +#### Full Example +Please see the [Common parts](#common-parts) section for info on the other methods. ```java package at.helpch.placeholderapi.example.expansions; import org.bukkit.OfflinePlayer; import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import at.helpch.placeholderapi.example.SomePlugin; -/** - * This class will automatically register as a placeholder expansion - * when a jar including this class is added to the directory - * {@code /plugins/PlaceholderAPI/expansions} on your server. - *
- *
If you create such a class inside your own plugin, you have to - * register it manually in your plugins {@code onEnable()} by using - * {@code new YourExpansionClass().register();} - */ public class SomeExpansion extends PlaceholderExpansion { - // We get an instance of the plugin later. - private SomePlugin plugin; - - /** - * Since this expansion requires api access to the plugin "SomePlugin" - * we must check if said plugin is on the server or not. - * - * @return true or false depending on if the required plugin is installed. - */ - @Override - public boolean canRegister(){ - return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; - } - - /** - * The name of the person who created this expansion should go here. - * - * @return The name of the author as a String. - */ @Override public String getAuthor(){ return "someauthor"; } - - /** - * The placeholder identifier should go here. - *
This is what tells PlaceholderAPI to call our onRequest - * method to obtain a value if a placeholder starts with our - * identifier. - *
The identifier has to be lowercase and can't contain _ or % - * - * @return The identifier in {@code %_%} as String. - */ + @Override public String getIdentifier(){ - return "someplugin"; - } - - /** - * if the expansion requires another plugin as a dependency, the - * proper name of the dependency should go here. - *
Set this to {@code null} if your placeholders do not require - * another plugin to be installed on the server for them to work. - *
- *
This is extremely important to set your plugin here, since if - * you don't do it, your expansion will throw errors. - * - * @return The name of our dependency. - */ - @Override - public String getRequiredPlugin(){ - return "SomePlugin"; + return "example"; } - /** - * This is the version of this expansion. - *
You don't have to use numbers, since it is set as a String. - * - * @return The version as a String. - */ @Override public String getVersion(){ return "1.0.0"; } - - /** - * This is the method called when a placeholder with our identifier - * is found and needs a value. - *
We specify the value identifier in this method. - *
Since version 2.9.1 can you use OfflinePlayers in your requests. - * - * @param player - * A {@link org.bukkit.Player Player}. - * @param identifier - * A String containing the identifier/value. - * - * @return possibly-null String of the requested identifier. - */ + @Override - public String onPlaceholderRequest(Player player, String identifier){ - - if(p == null){ - return ""; - } - - // %someplugin_placeholder1% - if(identifier.equals("placeholder1")){ - return plugin.getConfig().getString("placeholder1", "value doesnt exist"); - } - - // %someplugin_placeholder2% - if(identifier.equals("placeholder2")){ - return plugin.getConfig().getString("placeholder2", "value doesnt exist"); - } - - // We return null if an invalid placeholder (f.e. %someplugin_placeholder3%) - // was provided - return null; + public String onRequest(OfflinePlayer player, String params){ + if(params.equalsIgnoreCase("name")){ + return player == null ? null : player.getName(); // "name" requires the player to be valid + + if(params.equalsIgnoreCase("placeholder1")){ + return "Placeholder Text 1"; + + if(params.equalsIgnoreCase("placeholder2")){ + return "Placeholder Text 2"; + + return null; // Placeholder is unknown by the Expansion } } ``` ---- -#### Internal class -You can have the class inside your plugin. -This has some advantages but can also have some disadvantages. -If you include a PlaceholderExpansion class in your plugin, you MUST add an override the persist() method to return true -otherwise, if PlaceholderAPI is reloaded, your expansion will be unregistered and lost forever. +## With a Plugin (External Jar) +If your expansion relies on a plugin to provide its placeholder values, you will need to override a few more methods to make sure everything will work correctly. + +Your expansion will need to override the `getRequiredPlugin()` method to return the name of the plugin your expansion depends on. +PlaceholderAPI automatically checks if this method will either return null, or if the name defined results in a non-null plugin. + +It is worth noting that it is a bit more difficult to make a separate jar file that depends on a plugin, as it will require the plugin to have some sort of accessible API in order to get the required values. +One way to bypass this is to override the `canRegister()` method with the following code: + +```java +SomePlugin plugin; // This would be the plugin your expansion depends on + +@Override +public boolean canregister(){ + // This sets plugin to the SomePlugin instance you get through the PluginManager + return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; +} +``` +Using this code-snippet, you can get a direct instance of the plugin and access things such as config values. +With that said, it is recommended instead to use an API if one is available, as this kind of plugin access is a relatively poor approach. + +#### Full Example +Please see the [Common parts](#common-parts) section for info on the other methods. + +```java +package at.helpch.placeholderapi.example.expansions; + +import at.helpch.placeholderapi.example.SomePlugin; +import org.bukkit.OfflinePlayer; +import me.clip.placeholderapi.expansion.PlaceholderExpansion; + +public class SomeExpansion extends PlaceholderExpansion { + + SomePlugin plugin; // This instance is assigned in canRegister() + + @Override + public String getAuthor(){ + return "someauthor"; + } + + @Override + public String getIdentifier(){ + return "example"; + } + + @Override + public String getVersion(){ + return "1.0.0"; + } + + @Override + public String getRequiredPlugin(){ + return "SomePlugin"; + } + + @Override + public boolean canRegister(){ + return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; + } + + @Override + public String onRequest(OfflinePlayer player, String params){ + if(params.equalsIgnoreCase("placeholder1")){ + return plugin.getConfig().getString("placeholders.placeholder1", "default1"); + + if(params.equalsIgnoreCase("placeholder2")){ + return plugin.getConfig().getString("placeholders.placeholder2", "default2"); + + return null; // Placeholder is unknown by the expansion + } +} +``` + +---- +## With a Plugin (Internal Class) +The way expansions are handled when they are part of the plugin itself is fairly similar to when you [make an expansion without a plugin dependency](#without-a-plugin). + +In fact, you don't even have to override the `getRequiredPlugin()` and `canRegister()` methods as it is always guaranteed that the plugin is available. +Something worth noting, however, is that you need to override the `persist()` method and make it return true. This ensures that the expansion won't be unregistered by PlaceholderAPI whenever it is reloaded. + +Finally, you can also use dependency injection as an easier way to access a plugin's methods. +Here is a small code example of how dependency injection may look: + +```java +public class SomeExpansion extends PlaceholderExpansion { + final SomePlugin plugin; // The instance is created in the constructor and won't be modified, so it can be final + + public SomeExpansion(SomePlugin plugin){ + this.plugin = plugin; + } +} +``` + +#### Full Example +Please see the [Common parts](#common-parts) section for info on the other methods. ```java package at.helpch.placeholderapi.example.expansions; +import at.helpch.placeholderapi.example.SomePlugin; import org.bukkit.OfflinePlayer; import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import at.helpch.placeholderapi.example.SomePlugin; -/** - * This class will be registered through the register-method in the - * plugins onEnable-method. - */ public class SomeExpansion extends PlaceholderExpansion { - private SomePlugin plugin; - - /** - * Since we register the expansion inside our own plugin, we - * can simply use this method here to get an instance of our - * plugin. - * - * @param plugin - * The instance of our plugin. - */ +private SomePlugin plugin; + public SomeExpansion(SomePlugin plugin){ this.plugin = plugin; } - - /** - * Because this is an internal class, - * you must override this method to let PlaceholderAPI know to not unregister your expansion class when - * PlaceholderAPI is reloaded - * - * @return true to persist through reloads - */ - @Override - public boolean persist(){ - return true; - } - - /** - * Because this is a internal class, this check is not needed - * and we can simply return {@code true} - * - * @return Always true since it's an internal class. - */ - @Override - public boolean canRegister(){ - return true; - } - - /** - * The name of the person who created this expansion should go here. - *
For convienience do we return the author from the plugin.yml - * - * @return The name of the author as a String. - */ + @Override public String getAuthor(){ - return plugin.getDescription().getAuthors().toString(); + return "someauthor"; } - - /** - * The placeholder identifier should go here. - *
This is what tells PlaceholderAPI to call our onRequest - * method to obtain a value if a placeholder starts with our - * identifier. - *
The identifier has to be lowercase and can't contain _ or % - * - * @return The identifier in {@code %_%} as String. - */ + @Override public String getIdentifier(){ - return "someplugin"; + return "example"; } - /** - * This is the version of the expansion. - *
You don't have to use numbers, since it is set as a String. - * - * For convienience do we return the version from the plugin.yml - * - * @return The version as a String. - */ @Override public String getVersion(){ - return plugin.getDescription().getVersion(); + return "1.0.0"; } - - /** - * This is the method called when a placeholder with our identifier - * is found and needs a value. - *
We specify the value identifier in this method. - *
Since version 2.9.1 can you use OfflinePlayers in your requests. - * - * @param player - * A {@link org.bukkit.Player Player}. - * @param identifier - * A String containing the identifier/value. - * - * @return possibly-null String of the requested identifier. - */ + @Override - public String onPlaceholderRequest(Player player, String identifier){ - - if(player == null){ - return ""; - } - - // %someplugin_placeholder1% - if(identifier.equals("placeholder1")){ - return plugin.getConfig().getString("placeholder1", "value doesnt exist"); - } - - // %someplugin_placeholder2% - if(identifier.equals("placeholder2")){ - return plugin.getConfig().getString("placeholder2", "value doesnt exist"); - } - - // We return null if an invalid placeholder (f.e. %someplugin_placeholder3%) - // was provided - return null; + public boolean persist(){ + return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload + } + + @Override + public String onRequest(OfflinePlayer player, String params){ + if(params.equalsIgnoreCase("placeholder1")){ + return plugin.getConfig().getString("placeholders.placeholder1", "default1"); + + if(params.equalsIgnoreCase("placeholder2")){ + return plugin.getConfig().getString("placeholders.placeholder2", "default2"); + + return null; // Placeholder is unknown by the Expansion } } ``` -As you can see is this method pretty similar to the one without any external plugins, since we can get an instance of our plugin much easier and also have a 100% guarantee that the plugin is installed and running. +### Register the Expansion +To register the expansion, you will need to call the `register()` method yourself. +This should be done in your plugin's `onEnable()` method after you make sure that PlaceholderAPI is installed and enabled. -Our final step now is to register the class and its placeholders. The plugin doesn't do this on its own. -To achieve this, add the following to your `onEnable()` section (Use your expansion name of course): ```java package at.helpch.placeholderapi.example @@ -409,3 +302,73 @@ public class SomePlugin extends JavaPlugin{ } } ``` + +---- +## Relational Placeholders +Relational Placeholders are a bit more specific compared to the previous examples. +While they do use the same [common parts](#common-parts) that the other examples do, they have a different method to return placeholders. + +In order to use the relational placeholders feature, you will need to implement the [`Relational`][relational] interface, which in return adds the `onPlaceholderRequest(Player, Player, String)` method to use. + +#### Full Example +Please see the [Common parts](#common-parts) section for info on the other methods. + +In this example, we use the [Internal class setup](#with-a-plugin-internal-jar) and `SomePlugin` has an `areFriends(Player, Player)` method that returns true or false based on if the given players are friends. + +```java +package at.helpch.placeholderapi.example.expansions; + +import at.helpch.placeholderapi.example.SomePlugin; +import org.bukkit.ChatColor; +import org.bukkit.Player; +import me.clip.placeholderapi.expansion.PlaceholderExpansion; +import me.clip.placeholderapi.expansion.Relational; + +public class SomeExpansion extends PlaceholderExpansion implements Relational { + + SomePlugin plugin; + + public SomeExpansion(SomePlugin plugin){ + this.plugin = plugin; + } + + @Override + public String getAuthor(){ + return "someauthor"; + } + + @Override + public String getIdentifier(){ + return "example"; + } + + @Override + public String getVersion(){ + return "1.0.0"; + } + + @Override + public boolean persist(){ + return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload + } + + @Override + public String onPlaceholderRequest(Player one, Player two, String identifier){ + if(one == null || two == null) + return null; // We require both Players to be online + + if(params.equalsIgnoreCase("friend")){ + if(plugin.areFriends(one, two)) + return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are friends!"; + else + return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are not friends!"; + } + + return null; // Placeholder is unknown by the Expansion + } +} +``` + +### Notes about Relational Placeholders +Relational placeholders will always start with `%rel_` to properly identify them. +So in the above example, the full placeholder will look like `%rel_example_friend%`. From e16287405bf5424c919f14fea99baddf52a101e6 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 22 Jul 2021 01:36:43 +0200 Subject: [PATCH 47/86] Update nav entries (#674) * Update nav entries * Update Home.md --- wiki/Home.md | 10 ++++++---- wiki/_Sidebar.md | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/wiki/Home.md b/wiki/Home.md index 9ecce12..655ebda 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -7,10 +7,12 @@ It also has a list with all available placeholders (Work in progress). ### Setup **[[Hook into PlaceholderAPI]]** - [[First steps|Hook-into-PlaceholderAPI#first-steps]] -- [[Adding placeholders to PlaceholderAPI|Hook-into-PlaceholderAPI#adding-placeholders-to-placeholderapi]] - - [[PlaceholderExpansion]] - - [[Without an external plugin|PlaceholderExpansion#without-an-external-plugin]] - - [[With external plugin|PlaceholderExpansion#with-external-plugin]] +- [[Adding placeholders to PlaceholderAPI|PlaceholderExpansion]] + - [[Common Parts|PlaceholderExpansion#common-parts]] + - [[Without an external plugin|PlaceholderExpansion#without-a-plugin]] + - [[With an external Plugin (Separate Jar)|PlaceholderExpansion#with-a-plugin-external-jar]] + - [[With an external Plugin (Internal class)|PlaceholderExpansion#with-a-plugin-internal-class]] + - [[Relational Placeholders|PlaceholderExpansion#relational-placeholders]] - [[Setting placeholders in your plugin|Hook-into-PlaceholderAPI#setting-placeholders-in-your-plugin]] ### Other diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md index 20c0ec5..f744ed0 100644 --- a/wiki/_Sidebar.md +++ b/wiki/_Sidebar.md @@ -7,10 +7,12 @@ ### Setup **[[Hook into PlaceholderAPI]]** - [[First steps|Hook-into-PlaceholderAPI#first-steps]] -- [[Adding placeholders to PlaceholderAPI|Hook-into-PlaceholderAPI#adding-placeholders-to-placeholderapi]] - - [[PlaceholderExpansion]] - - [[Without an external plugin|PlaceholderExpansion#without-an-external-plugin]] - - [[With external plugin|PlaceholderExpansion#with-external-plugin]] +- [[Adding placeholders to PlaceholderAPI|PlaceholderExpansion]] + - [[Common Parts|PlaceholderExpansion#common-parts]] + - [[Without an external plugin|PlaceholderExpansion#without-a-plugin]] + - [[With an external Plugin (Separate Jar)|PlaceholderExpansion#with-a-plugin-external-jar]] + - [[With an external Plugin (Internal class)|PlaceholderExpansion#with-a-plugin-internal-class]] + - [[Relational Placeholders|PlaceholderExpansion#relational-placeholders]] - [[Setting placeholders in your plugin|Hook-into-PlaceholderAPI#setting-placeholders-in-your-plugin]] ### Other From fa717c34effa18fe7279db30c9e934747694be28 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 22 Jul 2021 12:56:56 +0200 Subject: [PATCH 48/86] fix code examples --- wiki/PlaceholderExpansion.md | 90 ++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/wiki/PlaceholderExpansion.md b/wiki/PlaceholderExpansion.md index 8b96c23..fd2b50c 100644 --- a/wiki/PlaceholderExpansion.md +++ b/wiki/PlaceholderExpansion.md @@ -41,17 +41,17 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion; public class SomeExpansion extends PlaceholderExpansion { @Override - public String getAuthor(){ + public String getAuthor() { return "someauthor"; } @Override - public String getIdentifier(){ + public String getIdentifier() { return "example"; } @Override - public String getVersion(){ + public String getVersion() { return "1.0.0"; } } @@ -105,30 +105,33 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion; public class SomeExpansion extends PlaceholderExpansion { @Override - public String getAuthor(){ + public String getAuthor() { return "someauthor"; } @Override - public String getIdentifier(){ + public String getIdentifier() { return "example"; } @Override - public String getVersion(){ + public String getVersion() { return "1.0.0"; } @Override - public String onRequest(OfflinePlayer player, String params){ - if(params.equalsIgnoreCase("name")){ + public String onRequest(OfflinePlayer player, String params) { + if(params.equalsIgnoreCase("name")) { return player == null ? null : player.getName(); // "name" requires the player to be valid - - if(params.equalsIgnoreCase("placeholder1")){ + } + + if(params.equalsIgnoreCase("placeholder1")) { return "Placeholder Text 1"; - - if(params.equalsIgnoreCase("placeholder2")){ + } + + if(params.equalsIgnoreCase("placeholder2")) { return "Placeholder Text 2"; + } return null; // Placeholder is unknown by the Expansion } @@ -149,7 +152,7 @@ One way to bypass this is to override the `canRegister()` method with the follow SomePlugin plugin; // This would be the plugin your expansion depends on @Override -public boolean canregister(){ +public boolean canregister() { // This sets plugin to the SomePlugin instance you get through the PluginManager return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; } @@ -172,37 +175,39 @@ public class SomeExpansion extends PlaceholderExpansion { SomePlugin plugin; // This instance is assigned in canRegister() @Override - public String getAuthor(){ + public String getAuthor() { return "someauthor"; } @Override - public String getIdentifier(){ + public String getIdentifier() { return "example"; } @Override - public String getVersion(){ + public String getVersion() { return "1.0.0"; } @Override - public String getRequiredPlugin(){ + public String getRequiredPlugin() { return "SomePlugin"; } @Override - public boolean canRegister(){ + public boolean canRegister() { return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; } @Override - public String onRequest(OfflinePlayer player, String params){ + public String onRequest(OfflinePlayer player, String params) { if(params.equalsIgnoreCase("placeholder1")){ return plugin.getConfig().getString("placeholders.placeholder1", "default1"); - + } + if(params.equalsIgnoreCase("placeholder2")){ return plugin.getConfig().getString("placeholders.placeholder2", "default2"); + } return null; // Placeholder is unknown by the expansion } @@ -223,7 +228,7 @@ Here is a small code example of how dependency injection may look: public class SomeExpansion extends PlaceholderExpansion { final SomePlugin plugin; // The instance is created in the constructor and won't be modified, so it can be final - public SomeExpansion(SomePlugin plugin){ + public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; } } @@ -244,37 +249,39 @@ public class SomeExpansion extends PlaceholderExpansion { private SomePlugin plugin; - public SomeExpansion(SomePlugin plugin){ + public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; } @Override - public String getAuthor(){ + public String getAuthor() { return "someauthor"; } @Override - public String getIdentifier(){ + public String getIdentifier() { return "example"; } @Override - public String getVersion(){ + public String getVersion() { return "1.0.0"; } @Override - public boolean persist(){ + public boolean persist() { return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload } @Override - public String onRequest(OfflinePlayer player, String params){ + public String onRequest(OfflinePlayer player, String params) { if(params.equalsIgnoreCase("placeholder1")){ return plugin.getConfig().getString("placeholders.placeholder1", "default1"); - - if(params.equalsIgnoreCase("placeholder2")){ + } + + if(params.equalsIgnoreCase("placeholder2")) { return plugin.getConfig().getString("placeholders.placeholder2", "default2"); + } return null; // Placeholder is unknown by the Expansion } @@ -291,12 +298,12 @@ package at.helpch.placeholderapi.example import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; -public class SomePlugin extends JavaPlugin{ +public class SomePlugin extends JavaPlugin { @Override - public void onEnable(){ + public void onEnable() { // Small check to make sure that PlaceholderAPI is installed - if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null){ + if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { new SomeExpansion(this).register(); } } @@ -328,40 +335,41 @@ public class SomeExpansion extends PlaceholderExpansion implements Relational { SomePlugin plugin; - public SomeExpansion(SomePlugin plugin){ + public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; } @Override - public String getAuthor(){ + public String getAuthor() { return "someauthor"; } @Override - public String getIdentifier(){ + public String getIdentifier() { return "example"; } @Override - public String getVersion(){ + public String getVersion() { return "1.0.0"; } @Override - public boolean persist(){ + public boolean persist() { return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload } @Override - public String onPlaceholderRequest(Player one, Player two, String identifier){ + public String onPlaceholderRequest(Player one, Player two, String identifier) { if(one == null || two == null) return null; // We require both Players to be online - if(params.equalsIgnoreCase("friend")){ - if(plugin.areFriends(one, two)) + if(params.equalsIgnoreCase("friend")) { + if(plugin.areFriends(one, two)) { return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are friends!"; - else + } else { return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are not friends!"; + } } return null; // Placeholder is unknown by the Expansion From 059047905f5e9683c3bf9cd3d4b355e6ab869960 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 22 Jul 2021 17:28:06 +0200 Subject: [PATCH 49/86] Update formatter placeholders --- wiki/Placeholders.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 0826891..c618c74 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -610,20 +610,24 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can More info about this expansion can be found on the [GitHub-Repository](https://github.com/Andre601/Formatter-Expansion). + `[]` is optional and `<>` is required. + ``` %formatter_number_format_% %formatter_number_format_[locale]:[format]_% - %formatter_number_time_% - %formatter_number_time_seconds_% # Handles number as seconds - %formatter_number_time_secs_% # Handles number as seconds - %formatter_number_time_minutes_% # Handles number as minutes - %formatter_number_time_mins_% # Handles number as minutes - %formatter_number_time_hours_% # Handles number as hours - %formatter_number_time_hrs_% # Handles number as hours + %formatter_number_from:_to:_% # Converts from one time unit to another - %formatter_replace___% - %formatter_text_substring__% + %formatter_number_time_% + %formatter_number_time_fromSeconds_% # Handles number as seconds + %formatter_number_time_fromSecs_% # Handles number as seconds + %formatter_number_time_fromMinutes_% # Handles number as minutes + %formatter_number_time_fromMins_% # Handles number as minutes + %formatter_number_time_fromHours_% # Handles number as hours + %formatter_number_time_fromHrs_% # Handles number as hours + + %formatter_text_replace___% + %formatter_text_substring_[start]:[end]_% %formatter_text_uppercase_% %formatter_text_lowercase_% ``` From a494add04ccbeb35104c4f4d0642868bc02ba916 Mon Sep 17 00:00:00 2001 From: M0dii <53468997+M0diis@users.noreply.github.com> Date: Thu, 22 Jul 2021 21:48:38 +0300 Subject: [PATCH 50/86] Update Placeholders.md --- wiki/Placeholders.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index c618c74..9563ec2 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -386,6 +386,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Vault](#vault)** - [Economy](#economy) - [Permissions](#permissions) + - **[VenturaCalendar](#venturacalendar)** - **[ViaVersion](#viaversion)** - **[VKAutoPickup](#vkautopickup)** - **[VoteParty](#voteparty)** @@ -5098,6 +5099,27 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa ---- +- ### **[VenturaCalendar](https://www.spigotmc.org/resources/venturacalendar-your-own-custom-calendar.94096/)** + > NO DOWNLOAD COMMAND + + ``` + %venturacalendar_date_tick% + %venturacalendar_date_second% + %venturacalendar_date_minute% + %venturacalendar_date_hour% + %venturacalendar_date_day% + %venturacalendar_date_day_name% + %venturacalendar_date_dayofweek% + %venturacalendar_date_week% + %venturacalendar_date_month% + %venturacalendar_date_month_name% + %venturacalendar_date_year% + %venturacalendar_date_era% + %venturacalendar_date_era_name% + ``` + +---- + - ### **[ViaVersion](https://www.spigotmc.org/resources/19254/)** > /papi ecloud download ViaVersion From c01acfba77cc0807d369b3903d6eb48d2d7db691 Mon Sep 17 00:00:00 2001 From: M0dii <53468997+M0diis@users.noreply.github.com> Date: Thu, 22 Jul 2021 21:54:44 +0300 Subject: [PATCH 51/86] Update Placeholders.md Change resource ID. --- wiki/Placeholders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 9563ec2..de9acf7 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -5099,7 +5099,7 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa ---- -- ### **[VenturaCalendar](https://www.spigotmc.org/resources/venturacalendar-your-own-custom-calendar.94096/)** +- ### **[VenturaCalendar](https://www.spigotmc.org/resources/94096/)** > NO DOWNLOAD COMMAND ``` From d2192e3195a36105160c3b40d827af001a83a7e4 Mon Sep 17 00:00:00 2001 From: M0dii <53468997+M0diis@users.noreply.github.com> Date: Thu, 22 Jul 2021 23:11:09 +0300 Subject: [PATCH 52/86] Update Plugins-using-PlaceholderAPI.md Added VenturaCalendar. --- wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 4c34984..63021f7 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -990,6 +990,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[VentureChat](https://www.spigotmc.org/resources/771/)** - [x] Supports placeholders. - [ ] Provides own placeholders. [Link] +- **[VenturahCalendar](https://www.spigotmc.org/resources/94096/)** + - [x] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#venturacalendar]]**] - **[ViaVersion](https://www.spigotmc.org/resources/19254/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#viaversion]]**] From 8d30c4c99de6a78e551cde76c9a858943abfc2ca Mon Sep 17 00:00:00 2001 From: vk2gpz Date: Sat, 24 Jul 2021 17:12:03 +1000 Subject: [PATCH 53/86] added RandomNumber and LevelUp entries. --- wiki/Placeholders.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index de9acf7..a43ce86 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -84,6 +84,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **R** - **[RainbowColor](#rainbowcolor)** - **[RandomColor](#randomcolor)** + - **[RandomNumber](#randomnumber)** - **[RedisBungee](#redisbungee)** - **[RelCon](#relcon)** - **[RNG](#rng)** @@ -248,6 +249,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[LegendQuest](#legendquest)** - **[LemonMobCoins](#lemonmobcoins)** - **[LevelledMobs](#levelledmobs)** + - **[LevelUp](#levelup)** - **[LuckPerms](#luckperms)** - **[LWC](#lwc)** @@ -1016,6 +1018,20 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can ---- +- ### **RandomNumber** + > /papi ecloud download RandomNumber + + It returns a auto-scaled random number. If you did not specify the scale, the scale will be automatically computed. If both min and max are integer number, the returned random number will also be an integer. + + ``` + %randomnumber_number% + %randomnumber_number_scale% + %randomnumber_number_min_max% + %randomnumber_number_min_max_scale% + ``` + +---- + - ### **RedisBungee** > /papi ecloud download RedisBungee @@ -3001,6 +3017,35 @@ Please see [this discussion][list] for a list of all expansions officially maint ``` ---- +- ### **[LevelUp](https://polymart.org/resource/levelup.457/)** + > /papi ecloud download LevelUp + ``` + %levelup_item_level% + %levelup_player_level% + %levelup_pickaxe_level% + %levelup_pickaxe_level_percentage% + %levelup_pickaxe_level_meter% + %levelup_pickaxe_xp% + %levelup_pickaxe_xp_percentage% + %levelup_pickaxe_xp_meter% + %levelup_pickaxe_xp_to_next% + %levelup_sword_level% + %levelup_sword_level_percentage% + %levelup_sword_level_meter% + %levelup_sword_xp% + %levelup_sword_xp_percentage% + %levelup_sword_xp_meter% + %levelup_sword_xp_to_next% + %levelup_bow_level% + %levelup_bow_level_percentage% + %levelup_bow_level_meter% + %levelup_bow_xp% + %levelup_bow_xp_percentage% + %levelup_bow_xp_meter% + %levelup_bow_xp_to_next% + ``` +---- + - ### **[LuckPerms](https://www.spigotmc.org/resources/28140/)** > /papi ecloud download LuckPerms From c393392b856fbc354ff912438d58ed85e328f5c8 Mon Sep 17 00:00:00 2001 From: Funnycube <6916389+Funny-cube@users.noreply.github.com> Date: Sat, 24 Jul 2021 17:39:38 +1000 Subject: [PATCH 54/86] Update Placeholders.md --- wiki/Placeholders.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index a43ce86..1e86b82 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3017,7 +3017,7 @@ Please see [this discussion][list] for a list of all expansions officially maint ``` ---- -- ### **[LevelUp](https://polymart.org/resource/levelup.457/)** +- ### **[LevelUp](https://polymart.org/resource/457/)** > /papi ecloud download LevelUp ``` %levelup_item_level% @@ -3044,6 +3044,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %levelup_bow_xp_meter% %levelup_bow_xp_to_next% ``` + ---- - ### **[LuckPerms](https://www.spigotmc.org/resources/28140/)** From 62c3261a00964dce811e418ca20da51da95825b9 Mon Sep 17 00:00:00 2001 From: BlitzOffline <52609756+BlitzOffline@users.noreply.github.com> Date: Sat, 24 Jul 2021 14:00:42 +0300 Subject: [PATCH 55/86] added changeoutput expansion placeholders --- wiki/Placeholders.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 1e86b82..976d71e 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -26,6 +26,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **C** - **[CalculateNumbers](#calculatenumbers)** + - **[ChangeOutput](#changeoutput)** - **[CheckItem](#checkitem)** - **[CooldownBar](#cooldownbar)** @@ -522,6 +523,33 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can ---- +- ### **ChangeOutput** + > /papi ecloud download changeitem + + Alows you to change the output based on what other placeholders return + + ``` + %changeoutput_____% + ``` + + * \ + * equals - match the input exactly + * ignorecase - match the input while ignoring cases + * ignorecolor - match the input while ignoring colour codes + * contains - check if the match contains input + * \>= - check if the input is larger than or equal to the matcher + * \> - check if the input is larger than the matcher + * <= - check if the input is less than or equal to the matcher + * < - check if the input is less than the matcher + * \ - this is your text that you wish to replace + * \ - this is the text we will be looking for to meet the conditions + * \ - if the input meets the condition, this text will be displayed + * \ - if the input does not meet the condition, this text will be displayed instead + + *All arguments can be replaced with other placeholders, wrapped in* `{}` + +---- + - ### **CheckItem** > /papi ecloud download CheckItem From 33c309ee8e91e1efd8c6e93d133fb755cb2c20d5 Mon Sep 17 00:00:00 2001 From: BlitzOffline <52609756+BlitzOffline@users.noreply.github.com> Date: Sat, 24 Jul 2021 14:17:14 +0300 Subject: [PATCH 56/86] used inline code instead --- wiki/Placeholders.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 976d71e..60b481b 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -532,7 +532,7 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can %changeoutput_____% ``` - * \ + * `` * equals - match the input exactly * ignorecase - match the input while ignoring cases * ignorecolor - match the input while ignoring colour codes @@ -541,10 +541,10 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can * \> - check if the input is larger than the matcher * <= - check if the input is less than or equal to the matcher * < - check if the input is less than the matcher - * \ - this is your text that you wish to replace - * \ - this is the text we will be looking for to meet the conditions - * \ - if the input meets the condition, this text will be displayed - * \ - if the input does not meet the condition, this text will be displayed instead + * `` - this is your text that you wish to replace + * `` - this is the text we will be looking for to meet the conditions + * `` - if the input meets the condition, this text will be displayed + * `` - if the input does not meet the condition, this text will be displayed instead *All arguments can be replaced with other placeholders, wrapped in* `{}` From d6748933122a5708c37bbe677e3a825d714dccb2 Mon Sep 17 00:00:00 2001 From: vk2gpz Date: Thu, 29 Jul 2021 07:27:27 +1000 Subject: [PATCH 57/86] Update Placeholders.md added %levelup_pickaxe_block_count%, %levelup_bow_kill_count%, %levelup_sword_kill_count% --- wiki/Placeholders.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 60b481b..7bce402 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3050,6 +3050,7 @@ Please see [this discussion][list] for a list of all expansions officially maint ``` %levelup_item_level% %levelup_player_level% + %levelup_pickaxe_block_count% %levelup_pickaxe_level% %levelup_pickaxe_level_percentage% %levelup_pickaxe_level_meter% @@ -3057,6 +3058,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %levelup_pickaxe_xp_percentage% %levelup_pickaxe_xp_meter% %levelup_pickaxe_xp_to_next% + %levelup_sword_kill_count% %levelup_sword_level% %levelup_sword_level_percentage% %levelup_sword_level_meter% @@ -3064,6 +3066,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %levelup_sword_xp_percentage% %levelup_sword_xp_meter% %levelup_sword_xp_to_next% + %levelup_bow_kill_count% %levelup_bow_level% %levelup_bow_level_percentage% %levelup_bow_level_meter% From 54ddc9fd4dfdb8f3b5e51cf444ca7c7a43db3ade Mon Sep 17 00:00:00 2001 From: AfkF24 <12214250+AfkF24@users.noreply.github.com> Date: Sat, 31 Jul 2021 16:23:25 +0200 Subject: [PATCH 58/86] Update Placeholders.md Swap Kingdoms+ for KingdomsX and add link to wiki --- wiki/Placeholders.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 7bce402..fc266ab 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -240,7 +240,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Karma](#karma)** - **[KillStats](#killstats)** - **[KitPvP](#kitpvp)** - - **[Kingdoms+](#kingdoms)** + - **[KingdomsX](#kingdoms)** - **[KP-PVP](#kp-pvp)** - ### **L** @@ -2876,19 +2876,10 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- -- ### **[Kingdoms+](https://www.spigotmc.org/resources/11833/)** +- ### **[KingdomsX](https://www.spigotmc.org/resources/77670/)** > NO DOWNLOAD COMMAND - ``` - %kingdoms_kingdom% - %kingdoms_haskingdom% - %kingdoms_rp% - %kingdoms_land% - %kingdoms_onlinemembers% - %kingdoms_members% - %kingdoms_king% - %kingdoms_rank% - ``` +You can find an up-to-date list of placeholders on the [KingdomsX wiki](https://github.com/CryptoMorin/KingdomsX/wiki/Placeholders). ---- From 905c9e83eed129f38205caf1f11f391f7c7339c4 Mon Sep 17 00:00:00 2001 From: AfkF24 <12214250+AfkF24@users.noreply.github.com> Date: Sat, 31 Jul 2021 16:44:46 +0200 Subject: [PATCH 59/86] Apply suggestions from code review Woop, thanks Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> --- wiki/Placeholders.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index fc266ab..21ea260 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -240,7 +240,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Karma](#karma)** - **[KillStats](#killstats)** - **[KitPvP](#kitpvp)** - - **[KingdomsX](#kingdoms)** + - **[KingdomsX](#kingdomsx)** - **[KP-PVP](#kp-pvp)** - ### **L** @@ -2879,7 +2879,7 @@ Please see [this discussion][list] for a list of all expansions officially maint - ### **[KingdomsX](https://www.spigotmc.org/resources/77670/)** > NO DOWNLOAD COMMAND -You can find an up-to-date list of placeholders on the [KingdomsX wiki](https://github.com/CryptoMorin/KingdomsX/wiki/Placeholders). + You can find an up-to-date list of placeholders on the [KingdomsX wiki](https://github.com/CryptoMorin/KingdomsX/wiki/Placeholders). ---- From e687a06d6e01f7c35894c28d3494bef6baf75ae6 Mon Sep 17 00:00:00 2001 From: vk2gpz Date: Mon, 9 Aug 2021 07:19:25 +1000 Subject: [PATCH 60/86] added missing baltop related placeholders --- wiki/Placeholders.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 21ea260..b15fed9 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4934,13 +4934,17 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa %tokenenchant__version% %tokenenchant__fullrefund% %tokenenchant__fullrefund_long% - %tokenenthcnat__refund_Y% - %tokenenthcnat__refund_Y_long% + %tokenenchnat__refund_Y% + %tokenenchnat__refund_Y_long% + %tokenenchant_tokenmultiplier% + %tokenenchant__occurrencemultiplier% %tokenenchant_repair_cost% %tokenenchant_repair_cost_long% %tokenenchant_repair_cost_num% %tokenenchant_repair_cost_num_long% %tokenenchant_enchantments% + %tokenenchant_baltop__name% : The name of X-th baltop player + %tokenenchant_baltop__balance% : The balance of X-th baltop player ``` ---- From a65426219651a2b20d4f6539586c2ba8ccec5bc0 Mon Sep 17 00:00:00 2001 From: BlitzOffline <52609756+BlitzOffline@users.noreply.github.com> Date: Sun, 15 Aug 2021 00:04:17 +0300 Subject: [PATCH 61/86] Added placeholders frmo the String expansion --- wiki/Placeholders.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index b15fed9..a1e4b8c 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -97,6 +97,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Sound](#sound)** - **[SpeedPerSec](#speedpersec)** - **[Statistic](#statistic)** + - **[String](#string)** - ### **T** - **[Team](#team)** @@ -1285,6 +1286,32 @@ A majority of these Expansions are maintained by the PlaceholderAPI team and can ---- +- ### **String** + > /papi ecloud download String + + More info about the expansion can be found on the [GitHub-Repository](https://github.com/BlitzOffline/StringExpansion). + + ``` + %string_equals__% + %string_equalsIgnoreCase__% + %string_contains__% + %string_containsIgnoreCase__% + %string_indexOf__% + %string_lastIndexOf__% + %string_substring__% + %string_substring_,_% + %string_charAt__% + %string_shuffle_% + %string_uppercase_% + %string_lowercase_% + %string_length_% + %string_random____% + ``` + + Supports placeholders using brackets: `{placeholder}` + +---- +L - ### **[Team](https://www.spigotmc.org/resources/74959/)** > NO DOWNLOAD COMMAND From 2eda4b1335b8c90e763ba5dc99fc1a6968cd4180 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Sun, 15 Aug 2021 15:44:27 +0200 Subject: [PATCH 62/86] Add missing commands to wiki --- wiki/Commands.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wiki/Commands.md b/wiki/Commands.md index 0484d55..071ea40 100644 --- a/wiki/Commands.md +++ b/wiki/Commands.md @@ -27,7 +27,9 @@ This page shows all commands, including with a detailed description of what ever - **[Other Commands](#other-commands)** - [`/papi dump`](#papi-dump) + - [`/papi help`](#papi-help) - [`/papi reload`](#papi-reload) + - [`/papi version`](#papi-version) ---- @@ -223,7 +225,15 @@ These are other commands of PlaceholderAPI that don't fit any of the above categ **Description**: Pastes useful information from PlaceholderAPI such as plugin version, server version and installed expansions to https://paste.helpch.at for simple sharing and support. +- #### `/papi help` + **Description**: + Displays all the commands PlaceholderAPI currently offers. + - #### `/papi reload` **Description**: Reloads the config settings. You need to use this command after [downloading Expansions](#papi-ecloud-download) from the eCloud or they won't be properly registered. + +- #### `/papi version` + **Description**: + Shows the current version and authors of PlaceholderAPI. From c1d2effe7e797ed2160404423006217382c503aa Mon Sep 17 00:00:00 2001 From: vk2gpz Date: Sun, 22 Aug 2021 09:42:02 +1000 Subject: [PATCH 63/86] added new placeholders for TokenEnchant renamed rawcost to fullcost. added costmax ```%tokenenchant__costmax% : cost to increment the enchantmnt level to its maax one from the current level %tokenenchant__fullcostmax% : cost to enchant the max level from 0 level %tokenenchant__fullcost_% : cost to enchant the level from 0 level ``` --- wiki/Placeholders.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index b15fed9..9c7bf1b 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4920,6 +4920,8 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa - ### **[TokenEnchant](https://www.spigotmc.org/resources/2287/)** > /papi ecloud download TokenEnchant + + If you add ```_long``` to the cost related placeholder, it will returne a number without comma/decimal point. ``` %tokenenchant_token% @@ -4927,8 +4929,11 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa %tokenenchant_token_num% %tokenenchant_token_num_long% %tokenenchant__level% - %tokenenchant__cost% - %tokenenchant__cost_long% + %tokenenchant__cost% : cost to increment the enchantmnt level by one from the current level + %tokenenchant__costmax% : cost to increment the enchantmnt level to its maax one from the current level + %tokenenchant__cost_% : cost to increment the enchantmnt level by from the current level + %tokenenchant__fullcostmax% : cost to enchant the max level from 0 level + %tokenenchant__fullcost_% : cost to enchant the level from 0 level %tokenenchant__max% %tokenenchant__description% %tokenenchant__version% From 8105beeee01b056728053eeb4ed3ca7a2bd99f10 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Mon, 23 Aug 2021 01:52:10 +0200 Subject: [PATCH 64/86] Improve grammar of PlaceholderExpansion.md --- wiki/PlaceholderExpansion.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wiki/PlaceholderExpansion.md b/wiki/PlaceholderExpansion.md index fd2b50c..60ff3ce 100644 --- a/wiki/PlaceholderExpansion.md +++ b/wiki/PlaceholderExpansion.md @@ -29,7 +29,6 @@ For starters, you need to decide what type of [`PlaceholderExpansion`][placehold ### Common Parts All shown examples will share the same common parts that belong to the [`PlaceholderExpansion`][placeholderexpansion] class. In order to not repeat the same basic info for each method throughout this page, and to greatly reduce its overall length, we will cover the most basic/necessary ones here. -`` #### Basic PlaceholderExpansion Structure ```java @@ -62,9 +61,9 @@ Let's quickly break down the different methods you have to implement. This method allows you to set the name of the expansion's author. - #### getIdentifier The name that should be used to identify the placeholders for this expansion. - The identifier is the string after the starting `%` and before the first `_` (`%identifier_values%`) and, therefore, cannot contain any `_`s. + The identifier is the string after the starting `%` and before the first `_` (`%identifier_values%`) and, therefore, cannot contain `_`, `%` or spaces. - If you want to use `_` in your expansion's name, you can override the optional `getName()` method. + If you still want to use the previously mentioned symbols can you override the `getName()` method to change the Expansion's displayname. - #### getVersion This is a string, which means it can contain more than just a number. This is used to determine if a new update is available or not when the expansion is shared on the eCloud. For expansions that are part of a plugin, this does not really matter. From 1f53daf41606d0d07f53eac581350f0ff9ca10a0 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Mon, 23 Aug 2021 01:58:15 +0200 Subject: [PATCH 65/86] Some more corrections --- wiki/PlaceholderExpansion.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wiki/PlaceholderExpansion.md b/wiki/PlaceholderExpansion.md index 60ff3ce..984b071 100644 --- a/wiki/PlaceholderExpansion.md +++ b/wiki/PlaceholderExpansion.md @@ -148,7 +148,7 @@ It is worth noting that it is a bit more difficult to make a separate jar file t One way to bypass this is to override the `canRegister()` method with the following code: ```java -SomePlugin plugin; // This would be the plugin your expansion depends on +private SomePlugin plugin = null; // This would be the plugin your expansion depends on @Override public boolean canregister() { @@ -171,7 +171,7 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion; public class SomeExpansion extends PlaceholderExpansion { - SomePlugin plugin; // This instance is assigned in canRegister() + private SomePlugin plugin; // This instance is assigned in canRegister() @Override public String getAuthor() { @@ -225,7 +225,7 @@ Here is a small code example of how dependency injection may look: ```java public class SomeExpansion extends PlaceholderExpansion { - final SomePlugin plugin; // The instance is created in the constructor and won't be modified, so it can be final + private final SomePlugin plugin; // The instance is created in the constructor and won't be modified, so it can be final public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; @@ -246,7 +246,7 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion; public class SomeExpansion extends PlaceholderExpansion { -private SomePlugin plugin; + private final SomePlugin plugin; public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; @@ -332,7 +332,7 @@ import me.clip.placeholderapi.expansion.Relational; public class SomeExpansion extends PlaceholderExpansion implements Relational { - SomePlugin plugin; + private final SomePlugin plugin; public SomeExpansion(SomePlugin plugin) { this.plugin = plugin; From c401adee865ad1d3b80c0eb5b71fd0bac1867b50 Mon Sep 17 00:00:00 2001 From: Liel Date: Fri, 27 Aug 2021 16:24:51 +0300 Subject: [PATCH 66/86] Added Two Factor Authentication to PlaceholderAPI's wiki --- wiki/Placeholders.md | 13 +++++++++++++ wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 2 files changed, 16 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 075dc94..5f70638 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -378,6 +378,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[Treasures](#treasures)** - **[Trey's Double Jump](#treys-double-jump)** - **[TrickOrTreat](#trickortreat)** + - **[Two Factor Authentication](#twofactorauthentication)** - ### **U** - **[USkyBlock](#uskyblock)** @@ -5107,6 +5108,18 @@ All placeholders are listed here: https://wiki.staffplusplus.org/integrations/pa ---- +- ### **[Two Factor Authentication](https://www.spigotmc.org/resources/85594/)** + > NO DOWNLOAD COMMAND + + ``` + %2fa_is_enabled% + %2fa_time_since_enabled% + %2fa_key% + %2fa_is_required% + ``` + +---- + - ### **[USkyBlock](https://www.spigotmc.org/resources/2280/)** > /papi ecloud download uSkyBlock diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 63021f7..054753b 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -936,6 +936,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[TrickOrTreat](https://www.spigotmc.org/resources/61370/)** - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#trickortreat]]**] +- **[Two Factor Authentication](https://www.spigotmc.org/resources/85594/)** + - [x] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#twofactorauthentication]]**] ---- ## U From 3da8f0066425fe10f633db04d68bfc7dc04b09ec Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Mon, 30 Aug 2021 11:18:11 +0100 Subject: [PATCH 67/86] Update Advanced Achievements links --- wiki/Plugins-using-PlaceholderAPI.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 054753b..d0341bb 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -41,9 +41,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[Advanced Abilities](https://www.spigotmc.org/resources/21983/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#advanced-abilities]]**] -- **[Advanced Achievements](https://www.spigotmc.org/resources/6239/)** - - [x] Supports placeholders. - - [ ] Provides own placeholders. [Link] +- **[Advanced Achievements](https://www.spigotmc.org/resources/advanced-achievements.83466/)** + - [ ] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#advanced-achievements]]**] - **[AdvancedAFK](https://www.spigotmc.org/resources/60761/)** - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#advancedafk]]**] From 663f149d742db4a71fd4498989ded1984ba265f9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Mon, 30 Aug 2021 11:43:26 +0100 Subject: [PATCH 68/86] Add Advanced Achievements placeholders --- wiki/Placeholders.md | 126 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 5f70638..ad25ecc 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -130,6 +130,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[AcidIsland](#acidisland)** - **[AcidIslandRate](#acidislandrate)** - **[Advanced Abilities](#advanced-abilities)** + - **[Advanced Achievements](#advanced-achievements)** - **[AdvancedAFK](#advancedafk)** - **[AdvancedCustomMenu+](#advancedcustommenu)** - **[AdvancedLottery](#advancedlottery)** @@ -1463,6 +1464,131 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- +- ### **[Advanced Achievements](https://www.spigotmc.org/resources/advanced-achievements.83466/)** + > NO DOWNLOAD COMMAND + + Global achievement placeholders: + ``` + %aach_achievements% - Return the total unlocked achievements (number) + %aach_achievements_percentage% - Return the total unlocked achievements (%) + %aach_total_achievements% - Return the total achievements (number) + ``` + Normal achievement placeholders for individual player statistics: + ``` + %aach_connections% + %aach_deaths% + %aach_arrows% + %aach_snowballs% + %aach_eggs% + %aach_fish% + %aach_treasures% + %aach_itembreaks% + %aach_eatenitems% + %aach_shear% + %aach_milk% + %aach_lavabuckets% + %aach_waterbuckets% + %aach_trades% + %aach_anvilsused% + %aach_enchantments% + %aach_beds% + %aach_maxlevel% + %aach_consumedpotions% + %aach_playedtime% + %aach_itemdrops% + %aach_itempickups% + %aach_hoeplowings% + %aach_fertilising% + %aach_taming% + %aach_brewing% + %aach_fireworks% + %aach_musicdiscs% + %aach_enderpearls% + %aach_smelting% + %aach_petmastergive% + %aach_petmasterreceive% + %aach_distancefoot% + %aach_distancepig% + %aach_distancehorse% + %aach_distanceminecart% + %aach_distanceboat% + %aach_distancegliding% + %aach_distancellama% + %aach_distancesneaking% + %aach_raidswon% + %aach_riptides% + %aach_advancementscompleted% + ``` + Multiple Achievement Placeholders for individual player statistics: + ``` + %aach_places_[blockname]% - example: %aach_places_dirt% + %aach_breaks_[blockname]% - example: %aach_breaks_stone% + %aach_kills_[entityname]% - example: %aach_kills_zombie% + %aach_targetsshot_[targetname]% - example: %aach_targetsshot_zombie% + %aach_crafts_[itemname]% - example: %aach_crafts_bread% + %aach_breeding_[entityname]% - example: %aach_breeding_pig% + %aach_playercommands_[command]% - example: %aach_playercommands_aach list% + %aach_custom_[customname]% - example: %aach_custom_votes% + %aach_jobsreborn_[job]% - example: %aach_jobsreborn_hunter% + ``` + Placeholders for total category achievements: + ``` + %aach_total_connections% + %aach_total_deaths% + %aach_total_arrows% + %aach_total_snowballs% + %aach_total_eggs% + %aach_total_fish% + %aach_total_treasures% + %aach_total_itembreaks% + %aach_total_eatenitems% + %aach_total_shear% + %aach_total_milk% + %aach_total_lavabuckets% + %aach_total_waterbuckets% + %aach_total_trades% + %aach_total_anvilsused% + %aach_total_enchantments% + %aach_total_beds% + %aach_total_maxlevel% + %aach_total_consumedpotions% + %aach_total_playedtime% + %aach_total_itemdrops% + %aach_total_itempickups% + %aach_total_hoeplowings% + %aach_total_fertilising% + %aach_total_taming% + %aach_total_brewing% + %aach_total_fireworks% + %aach_total_musicdiscs% + %aach_total_enderpearls% + %aach_total_smelting% + %aach_total_petmastergive% + %aach_total_petmasterreceive% + %aach_total_distancefoot% + %aach_total_distancepig% + %aach_total_distancehorse% + %aach_total_distanceminecart% + %aach_total_distanceboat% + %aach_total_distancegliding% + %aach_total_distancellama% + %aach_total_distancesneaking% + %aach_total_raidswon% + %aach_total_riptides% + %aach_total_advancementscompleted% + %aach_total_places% + %aach_total_breaks% + %aach_total_kills% + %aach_total_targetsshot% + %aach_total_crafts% + %aach_total_breeding% + %aach_total_playercommands% + %aach_total_custom% + %aach_total_jobsreborn% + ``` + +---- + - ### **[AdvancedAFK](https://www.spigotmc.org/resources/60761/)** > NO DOWNLOAD COMMAND From 1b0a3bc09d27b266da29833770e90142b59d1a0d Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Mon, 30 Aug 2021 12:05:04 +0100 Subject: [PATCH 69/86] Simplify link format Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> --- wiki/Placeholders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index ad25ecc..477839d 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1464,7 +1464,7 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- -- ### **[Advanced Achievements](https://www.spigotmc.org/resources/advanced-achievements.83466/)** +- ### **[Advanced Achievements](https://www.spigotmc.org/resources/83466/)** > NO DOWNLOAD COMMAND Global achievement placeholders: From b35035390e61eca3f30a41f9f764b64e800c934b Mon Sep 17 00:00:00 2001 From: Pierre-Yves B Date: Mon, 30 Aug 2021 12:05:14 +0100 Subject: [PATCH 70/86] Simplify link format Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> --- wiki/Plugins-using-PlaceholderAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index d0341bb..e36770a 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -41,7 +41,7 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[Advanced Abilities](https://www.spigotmc.org/resources/21983/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#advanced-abilities]]**] -- **[Advanced Achievements](https://www.spigotmc.org/resources/advanced-achievements.83466/)** +- **[Advanced Achievements](https://www.spigotmc.org/resources/83466/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#advanced-achievements]]**] - **[AdvancedAFK](https://www.spigotmc.org/resources/60761/)** From a383a73b2411b13a384c1ee97b495ffb495853d2 Mon Sep 17 00:00:00 2001 From: Leaf26 Date: Tue, 31 Aug 2021 21:41:32 -0400 Subject: [PATCH 71/86] add RTP placeholders --- wiki/Placeholders.md | 13 +++++++++++++ wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 2 files changed, 16 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 477839d..f0250ea 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -329,6 +329,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[RogueParkour](#rogueparkour)** - **[RoyalCommands](#royalcommands)** - **[RPGInventory](#rpginventory)** + - **[RTP](#rtp)** - ### **S** - **[Seasons](#seasons)** @@ -4363,6 +4364,18 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- +- ### **[RTP](https://www.spigotmc.org/resources/rtp.94812/)** + > NO DOWNLOAD COMMAND + +``` +%rtp_player_status% +%rtp_total_queue_length% +%rtp_public_queue_length% +%rtp_personal_queue_length% +``` + +---- + - ### **[Seasons](https://www.spigotmc.org/resources/39298/)** > NO DOWNLOAD COMMAND diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index e36770a..d2ef06a 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -756,6 +756,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[RPGInventory](https://www.spigotmc.org/resources/12498/)** - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#rpginventory]]**] +- **[RTP](https://www.spigotmc.org/resources/rtp.94812/)** + - [x] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#rtp]]**] ---- ## S From cd429bd7d74cb667c86b110ef8899171e61e0aa0 Mon Sep 17 00:00:00 2001 From: Leaf26 Date: Tue, 31 Aug 2021 22:38:03 -0400 Subject: [PATCH 72/86] adding a few more --- wiki/Placeholders.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index f0250ea..e08e349 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -4372,6 +4372,10 @@ Please see [this discussion][list] for a list of all expansions officially maint %rtp_total_queue_length% %rtp_public_queue_length% %rtp_personal_queue_length% +%rtp_teleport_world% +%rtp_teleport_x% +%rtp_teleport_y% +%rtp_teleport_z% ``` ---- From 5a24387f3dbdc8f29d2b3ee19919465666c400d7 Mon Sep 17 00:00:00 2001 From: Leaf26 Date: Tue, 31 Aug 2021 22:39:02 -0400 Subject: [PATCH 73/86] fix spacing --- wiki/Placeholders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index e08e349..800a8b4 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -329,7 +329,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - **[RogueParkour](#rogueparkour)** - **[RoyalCommands](#royalcommands)** - **[RPGInventory](#rpginventory)** - - **[RTP](#rtp)** + - **[RTP](#rtp)** - ### **S** - **[Seasons](#seasons)** From 39c68e8f87e5609ab40aaf4a906b3ac39c3cbe36 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Wed, 1 Sep 2021 13:37:19 +0200 Subject: [PATCH 74/86] fix url and padding --- wiki/Placeholders.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 800a8b4..db5ba44 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1,4 +1,4 @@ -[SimpleDateFormat]: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html +[SimpleDateFormat]: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html [TimeZoneIDs]: https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/ [list]: https://github.com/PlaceholderAPI/PlaceholderAPI/discussions/510 @@ -4364,19 +4364,19 @@ Please see [this discussion][list] for a list of all expansions officially maint ---- -- ### **[RTP](https://www.spigotmc.org/resources/rtp.94812/)** +- ### **[RTP](https://www.spigotmc.org/resources/94812/)** > NO DOWNLOAD COMMAND - -``` -%rtp_player_status% -%rtp_total_queue_length% -%rtp_public_queue_length% -%rtp_personal_queue_length% -%rtp_teleport_world% -%rtp_teleport_x% -%rtp_teleport_y% -%rtp_teleport_z% -``` + + ``` + %rtp_player_status% + %rtp_total_queue_length% + %rtp_public_queue_length% + %rtp_personal_queue_length% + %rtp_teleport_world% + %rtp_teleport_x% + %rtp_teleport_y% + %rtp_teleport_z% + ``` ---- From b82948c87a7f098c214257ab8f5088fea1416cfd Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Wed, 1 Sep 2021 13:38:15 +0200 Subject: [PATCH 75/86] fix link --- wiki/Plugins-using-PlaceholderAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index d2ef06a..857debf 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -756,7 +756,7 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[RPGInventory](https://www.spigotmc.org/resources/12498/)** - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#rpginventory]]**] -- **[RTP](https://www.spigotmc.org/resources/rtp.94812/)** +- **[RTP](https://www.spigotmc.org/resources/94812/)** - [x] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#rtp]]**] From af2f6252247db12f6a6a6e932add926a24064ee2 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 3 Sep 2021 00:05:42 +0200 Subject: [PATCH 76/86] Update PlotSquared placeholders --- wiki/Placeholders.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index db5ba44..099bb67 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3814,9 +3814,13 @@ Please see [this discussion][list] for a list of all expansions officially maint %plotsquared_currentplot_owner% %plotsquared_currentplot_members% %plotsquared_currentplot_members_added% + %plotsquared_currentplot_members_added_list% %plotsquared_currentplot_members_trusted% + %plotsquared_currentplot_members_trusted_list% %plotsquared_currentplot_members_denied% - %plotsquared_world_name% + %plotsquared_currentplot_members_denied_list% + %plotsquared_currentplot_world_name% + %plotsquared_currentplot_can_build% %plotsquared_has_plot_% %plotsquared_currentplot_x% %plotsquared_currentplot_y% @@ -3830,6 +3834,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %plotsquared_allowed_plot_count% %plotsquared_currentplot_localflag_% %plotsquared_currentplot_flag_% + %plotsquared_currentplot_creationdate% ``` ---- From 4300bf7d1e519fc7ef348bc538422795991510a5 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 9 Sep 2021 18:31:29 +0200 Subject: [PATCH 77/86] Pull latest changes from master into docs/wiki (#712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Javadoc documentation * More comments... a lot more! * Remove Gson * Implemented working version for 1.8.8 - 1.16.3 * Improve ExpansionsLoadedEvent's docs * 2021 🥳 * Add contributing and expansion section * Fix invalid link tag * Start using new Issue template system * Create bug_report.yml * Rename feature_request.md to feature_request_old.md * Create feature_request.yml * should it use setBracketPlaceholders?? * fix unique name * Update feature_request_old.md * Add Checkboxes * Add checkboxes * disable default issue body * Delete bug_report_old.md * Delete feature_request_old.md * Rename bug_report_new.yml to bug_report.yml * Check if deleting this fixed the PR... * Use description in favour of about * improve feature_request.md * Update bug_report.yml * Assign "Type: Issue (Unconfirmed)" label * Use lists and not comma-separated string * Update feature_request.yml * Use id option for error and dump fields * Add field for logs * Update Copyright ~ Fixed a typo and updated missed files from #543 * Re-add removed code That should actually NOT be here... * Undo renaming of boolean * Remove deprecated issue_body type * Update feature_request.yml * Improve description of bug_report.yml * Build jars on PR (Compile and build validation) * Initial 1.17 Changes * Extracted URLClassLoader out of try-with-resources block * Close URLClassLoader if Expansion class was not found * Build against Java 8, 11 and 16 * adoPt I always make that mistake... * add render * Cleanup build.gradle (cherry picked from commit 7750ba7033dc9fdf40d55fcd9ecc20a94819a7c1) * Remove the @NotNull's because they are overridden by expansion devs anyways, and it turns out people can make them null anyways. This adds a hashcode check and pretty error for it. (cherry picked from commit f5386d4ca55c23b54f3c5f952f08040b0967f4a3) * Fix version checker to compare the individual semver numbers instead of combining it together. (cherry picked from commit ef5cd9d37680cc6cc1321ef2e04af09b44a2c681) * Update src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> (cherry picked from commit ccf4f5934386b005831757d298e2da9d8f46cb1a) * Re-add NotNull's (cherry picked from commit 2bfd8e7e5efb25f648b8a6de934b1eff675481b1) * Removed nullcheck from hashcode, and moved it up the chain. * POJO to help with checking that expansions have all required methods implemented. * Add method implementation checking and nullchecking for fields. * Appease the Pigman * Revert build.gradle dependencies change * Fixed duplicate files * Sync Dev with master (#659) * Add contributing and expansion section * Start using new Issue template system * Create bug_report.yml * Rename feature_request.md to feature_request_old.md * Create feature_request.yml * fix unique name * Update feature_request_old.md * Add Checkboxes * Add checkboxes * disable default issue body * Delete bug_report_old.md * Delete feature_request_old.md * Rename bug_report_new.yml to bug_report.yml * Check if deleting this fixed the PR... * Use description in favour of about * improve feature_request.md * Update bug_report.yml * Assign "Type: Issue (Unconfirmed)" label * Use lists and not comma-separated string * Update feature_request.yml * Use id option for error and dump fields * Add field for logs * Remove deprecated issue_body type * Update feature_request.yml * Improve description of bug_report.yml * Initial 1.17 Changes * add render * Revert build.gradle dependencies change * Fixed duplicate files Co-authored-by: PiggyPiglet Co-authored-by: darbyjack * Initial test on adventure * started moving to pure adventure * finished kyori impl * added 1.17 to nmsversion (what does this even do) * removed dev for release * added dev back * Switch to differen wiki action Co-authored-by: darbyjack Co-authored-by: ElijahRus250 <64851720+ElijahRus250@users.noreply.github.com> Co-authored-by: PiggyPiglet Co-authored-by: Huynh Tien Co-authored-by: Vaishnav Anil Co-authored-by: Starmism Co-authored-by: PiggyPiglet --- .github/ISSUE_TEMPLATE/bug_report.md | 43 - .github/ISSUE_TEMPLATE/bug_report.yml | 101 ++ .github/ISSUE_TEMPLATE/feature_request.md | 31 - .github/ISSUE_TEMPLATE/feature_request.yml | 62 + .github/workflows/pr_build_jars.yml | 31 + .github/workflows/wiki.yml | 28 +- README.md | 10 +- build.gradle | 41 +- config/headers/jsonmessage.txt | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 58910 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 5 +- gradlew | 2 +- gradlew.bat | 21 +- .../clip/placeholderapi/PlaceholderAPI.java | 40 +- .../placeholderapi/PlaceholderAPIPlugin.java | 33 +- .../clip/placeholderapi/PlaceholderHook.java | 4 +- .../commands/PlaceholderCommand.java | 4 +- .../commands/PlaceholderCommandRouter.java | 4 +- .../commands/impl/cloud/CommandECloud.java | 4 +- .../impl/cloud/CommandECloudClear.java | 4 +- .../impl/cloud/CommandECloudDownload.java | 4 +- .../cloud/CommandECloudExpansionInfo.java | 4 +- .../cloud/CommandECloudExpansionList.java | 118 +- .../CommandECloudExpansionPlaceholders.java | 4 +- .../impl/cloud/CommandECloudRefresh.java | 4 +- .../impl/cloud/CommandECloudStatus.java | 4 +- .../impl/cloud/CommandECloudToggle.java | 4 +- .../impl/cloud/CommandECloudUpdate.java | 4 +- .../commands/impl/local/CommandDump.java | 32 +- .../impl/local/CommandExpansionRegister.java | 4 +- .../local/CommandExpansionUnregister.java | 4 +- .../commands/impl/local/CommandHelp.java | 4 +- .../commands/impl/local/CommandInfo.java | 4 +- .../commands/impl/local/CommandList.java | 4 +- .../commands/impl/local/CommandParse.java | 4 +- .../commands/impl/local/CommandReload.java | 4 +- .../commands/impl/local/CommandVersion.java | 4 +- .../configuration/ExpansionSort.java | 4 +- .../configuration/PlaceholderAPIConfig.java | 4 +- .../events/ExpansionRegisterEvent.java | 15 +- .../events/ExpansionUnregisterEvent.java | 15 +- .../events/ExpansionsLoadedEvent.java | 9 +- .../events/PlaceholderHookUnloadEvent.java | 4 +- .../exceptions/NoDefaultCommandException.java | 4 +- .../placeholderapi/expansion/Cacheable.java | 4 +- .../placeholderapi/expansion/Cleanable.java | 4 +- .../expansion/Configurable.java | 6 +- .../placeholderapi/expansion/NMSVersion.java | 7 +- .../expansion/PlaceholderExpansion.java | 129 +- .../placeholderapi/expansion/Relational.java | 4 +- .../placeholderapi/expansion/Taskable.java | 4 +- .../placeholderapi/expansion/Version.java | 4 +- .../expansion/VersionSpecific.java | 4 +- .../expansion/cloud/CloudExpansion.java | 4 +- .../manager/CloudExpansionManager.java | 4 +- .../manager/LocalExpansionManager.java | 50 +- .../expansion/manager/MethodSignature.java | 37 + .../clip/placeholderapi/libs/JSONMessage.java | 1120 ----------------- .../listeners/ServerLoadEventListener.java | 4 +- .../replacer/CharsReplacer.java | 6 +- .../replacer/RegexReplacer.java | 4 +- .../placeholderapi/replacer/Replacer.java | 4 +- .../updatechecker/UpdateChecker.java | 26 +- .../me/clip/placeholderapi/util/FileUtil.java | 17 +- .../me/clip/placeholderapi/util/Format.java | 4 +- .../me/clip/placeholderapi/util/Futures.java | 4 +- .../java/me/clip/placeholderapi/util/Msg.java | 4 +- .../clip/placeholderapi/util/TimeFormat.java | 4 +- .../me/clip/placeholderapi/util/TimeUtil.java | 4 +- .../java/me/clip/placeholderapi/Values.java | 2 +- .../replacer/ReplacerBenchmarks.java | 2 +- .../replacer/ReplacerUnitTester.java | 2 +- 72 files changed, 709 insertions(+), 1494 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/workflows/pr_build_jars.yml mode change 100644 => 100755 gradlew create mode 100644 src/main/java/me/clip/placeholderapi/expansion/manager/MethodSignature.java delete mode 100644 src/main/java/me/clip/placeholderapi/libs/JSONMessage.java diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c4ab045..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: Bug Report -about: Report bugs of PlaceholderAPI with this template - ---- - - -## Bug Report - -### Issue - - - -### Expected behaviour - - - -### Actual behaviour - - - -### How to reproduce - - -1. - -### `/papi dump` output - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..bb353aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,101 @@ +name: Bug Report +description: Found a Bug about PlaceholderAPI? Use this template to report it! +labels: +- "Type: Issue (Unconfirmed)" +body: +- type: markdown + attributes: + value: |- + Thank you for taking your time and opening a Bug Report. + In order for us to process this Bug Report as fast and efficient as possible do we ask you to read the form carefully and provide any requested information. + Required fields are marked with an asterisk symbol (`*`) + + Also, always make sure to use the latest Release from [Spigot](https://www.spigotmc.org/resources/6245/) or the latest Development Build from our [Jenkins Server](http://ci.extendedclip.com/job/PlaceholderAPI/) to make sure that your issue isn't already fixed. + + **DO NOT REPORT ISSUES WITH EXPANSIONS AND/OR PLACEHOLDERS. USE THE APPROPRIATE ISSUE TRACKER FOR THOSE!** +- type: checkboxes + attributes: + label: Confirmation + description: Please make sure to have followed the following checks. + options: + - label: My issue isn't already found on the Issue tracker. + required: true + - label: My issue is about **PlaceholderAPI** and not any expansion or external plugin + required: true + - label: The issue isn't already fixed in a Spigot Release or Development Build. + required: true +- type: dropdown + attributes: + label: "Type" + description: |- + What kind of Bug do you encounter? + + - `Plugin Bug`: PlaceholderAPI doesn't startup properly. + - `API Bug`: A method you use didn't work or has an unexpected result. + - `Plugin/Server Incompatability`: PlaceholderAPI either doesn't support a specific Server Type/Version or has conflicts with another plugin. + multiple: false + options: + - "Plugin Bug" + - "API Bug" + - "Plugin/Server Incompatability" + validations: + required: true +- type: textarea + attributes: + label: "What happens?" + description: "What bug are you encountering? Try to explain it as detailed as possible." + placeholder: "PlaceholderAPI does this when I do that..." + validations: + required: true +- type: textarea + attributes: + label: "Expected Behaviour" + description: "What behaviour did you expect from PlaceholderAPI?" + placeholder: "PlaceholderAPI should actually do..." + validations: + required: true +- type: textarea + attributes: + label: "How to Reproduce" + description: |- + List the steps on how to reproduce this Bug. + Post any Code-examples in the `Additional Information` field below when you selected `API Bug`. + placeholder: |- + 1. Do this + 2. ... + 3. Profit! + validations: + required: true +- type: input + id: "dump" + attributes: + label: "`/papi dump` Output" + description: |- + Please execute the `/papi dump` command and provide the generated URL from it. + If you can't execute the command (i.e. PlaceholderAPI doesn't start up) can you put N/A here and mention the issue in the `Additional Information` field. + placeholder: "https://paste.helpch.at/dump.log" + validations: + required: true +- type: input + id: "console" + attributes: + label: "Console Log" + description: |- + Get the latest content of your `latest.log` file an upload it to https://paste.helpch.at + Take the generated URL and paste it into this field. + placeholder: "https://paste.helpch.at/latest.log" +- type: input + id: "error" + attributes: + label: "Errors" + description: |- + Upload any errors you find to https://paste.helpch.at and post the link in the field below. + placeholder: "https://paste.helpch.at/error.log" +- type: textarea + attributes: + label: "Additional Info" + description: |- + Add any extra info you think is nessesary for this Bug report. + - If you selected `API Bug` will you need to include code-examples here to reproduce the issue. + - If you selected `Plugin/Server Incompatability` should you include extra Server info such as a Timings or Spark-Report or info about the plugin in question. + placeholder: "Put any extra info you like into this field..." diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c66b3e4..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Feature Request -about: Request a update/change of the PlaceholderAPI-code - ---- - - - -## Feature Request - -### Type - - - -- [ ] New function for PlaceholderAPI. -A new function that developers could use. -- [ ] Change to code (Internal). -Changes to code that won't affect the end-user. -- [ ] Change to code (External). -Changes to code that will affect the end-user (breaks stuff). -- [ ] Other: __________ - -### Description - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..d6f6087 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,62 @@ +name: Feature Request +description: Suggest a new Feature for PlaceholderAPI +labels: +- "Type: Enhancement" +body: +- type: markdown + attributes: + value: |- + Thank you for taking the time in creating this Feature Request. + In order to process your feature request as fast and efficiently as possible do we ask you to fill out any required fields (Indicated with a red asterisk (`*`)) with the requested information. + + If you have any further questions should you either [join our Discord Server](https://helpch.at/discord) or [ask in our Discussions](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions). +- type: checkboxes + attributes: + label: Confirmation + description: Please make sure to have followed the following checks. + options: + - label: I checked the Issues and Pull request tab for any existing issues or PRs. + required: true + - label: My Feature Request is for **PlaceholderAPI** and not any expansion or other plugin. + required: true +- type: dropdown + attributes: + label: "Type" + description: "What type is your Suggestion? Select all that match." + multiple: true + options: + - "New API feature" + - "New config option" + - "Minor Code improvement (Won't affect Servers)" + - "Major Code improvement (Will affect Servers)" + validations: + required: true +- type: textarea + attributes: + label: "Description" + description: |- + Give a detailed explanation about your Feature request and why it would be beneficial for PlaceholderAPI. + Just saying "It's cool!" or "I need it" don't count as valid reasons. It needs to have a clear benefit for **other** players too. + validations: + required: true +- type: textarea + attributes: + label: "Code Example" + description: |- + Do you have any Code Snippets that you want to share with us? Paste it here! + Note that the input will automatically be rendered as Java code, so you won't need to put it into a code block yourself. + render: java +- type: input + attributes: + label: "Jar file" + description: |- + If you already have a PlaceholderAPI Jar with the requested changes would we love to get a download link for it. + If you don't have a download link can you leave this field empty or provide "N/A" as a response. + placeholder: "https://cdn.discordapp.com/..." +- type: textarea + attributes: + label: "Additional Information" + description: |- + Add any extra info you think is nessesary for this Feature request. + - When you selected `Major Code improvement (Will affect Servers)` should you mention what will break when people update. + placeholder: "Put any extra info you like into this field..." diff --git a/.github/workflows/pr_build_jars.yml b/.github/workflows/pr_build_jars.yml new file mode 100644 index 0000000..ba543f6 --- /dev/null +++ b/.github/workflows/pr_build_jars.yml @@ -0,0 +1,31 @@ +name: "Test compiling against Java 8, 11 and 16" + +on: + pull_request: + branches: + - development + paths: + - "src/**" + - "build.gradle" + +jobs: + testBuilds: + name: "Test-compile against Java 8, 11 and 16" + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 4 + matrix: + java-version: [8, 11, 16] + steps: + - name: "Checkout Code" + uses: actions/checkout@v2 + - name: "Prepare Java ${{ matrix.java-version }}" + uses: actions/setup-java@v2 + with: + distribution: "adopt" + java-version: "${{ matrix.java-version }}" + - name: "Make build.gradle executable" + run: "chmod +x gradlew" + - name: "Build jar with Java ${{ matrix.java-version }}" + run: "./gradlew shadowJar" diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 02864b8..63abe4c 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -27,26 +27,10 @@ jobs: - name: 'Checkout Code' uses: actions/Checkout@v2 - name: 'Update Wiki' - uses: docker://decathlon/wiki-page-creator-action:latest + uses: Andrew-Chen-Wang/github-wiki-action@v2 env: - # - # We can use the E-Mail and Name of the GitHub Actions account - # for our convenience. - # - ACTION_MAIL: 'actions@github.com' - ACTION_NAME: 'github-actions[bot]' - # - # We (sadly) have to use a PAT (Personal Access Token) for this action. - # - GH_PAT: '${{ secrets.WORKFLOWPAT }}' - OWNER: 'PlaceholderAPI' - REPO_NAME: 'PlaceholderAPI' - # - # We only want to target files in the wiki folder - # - MD_FOLDER: 'wiki' - WIKI_PUSH_MESSAGE: '${{ github.event.commits[0].message }}' - # - # We skip/ignore the README.md file in the Wiki folder - # - SKIP_MD: README.md + WIKI_DIR: wiki/ + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_EMAIL: 'actions@github.com' + GH_NAME: 'github-actions[bot]' + EXCLUDED_FILES: 'README.md' diff --git a/README.md b/README.md index a6c7930..2ea8404 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ [APIversionImg]: https://img.shields.io/nexus/placeholderapi/me.clip/placeholderapi?server=https%3A%2F%2Frepo.extendedclip.com&label=API%20Version [logo]: https://i.imgur.com/Ea4PURv.png + +[contributing]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/.github/CONTRIBUTING.md +[placeholderexpansion]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion [![logo]][spigot] @@ -29,8 +32,11 @@ Support for specific plugins are provided either by the plugin itself or through PlaceholderAPI has been downloaded over 500,000 times and has been used concurrently on over 20,000 servers, which makes it a must-have for a server of any type or scale. - - +## Contribute +If you would like to contribute towards PlaceholderAPI should you take a look at our [Contributing file][contributing] for the ins and outs on how you can do that and what you need to keep in mind. + +## Create an Expansion +If you would like to create your own Placeholder Expansion for PlaceholderAPI, take a look at our [Wiki][placeholderexpansion] which contains a detailed tutorial on how you can achieve this. ## Support - [Issue Tracker][issues] diff --git a/build.gradle b/build.gradle index 41ba3ca..5df263f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,10 @@ +import org.apache.tools.ant.filters.ReplaceTokens + plugins { id "java" id "maven-publish" - id "net.minecrell.licenser" version "0.4.1" - id "com.github.johnrengelman.shadow" version "6.0.0" + id "org.cadixdev.licenser" version "0.6.0" + id "com.github.johnrengelman.shadow" version "7.0.0" } group "me.clip" @@ -11,30 +13,32 @@ version "2.10.10-DEV-${System.getProperty("BUILD_NUMBER")}" description "An awesome placeholder provider!" repositories { + maven({ url = "https://oss.sonatype.org/content/repositories/snapshots/" }) + mavenCentral() + mavenLocal() maven({ url = "https://repo.codemc.org/repository/maven-public" }) maven({ url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }) } dependencies { - implementation "com.google.code.gson:gson:2.8.6" - implementation "org.bstats:bstats-bukkit:1.5" + implementation "org.bstats:bstats-bukkit:2.2.1" - compileOnly "org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT" + implementation "net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT" + + compileOnly "org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT" compileOnly "org.jetbrains:annotations:19.0.0" testImplementation "org.openjdk.jmh:jmh-core:1.23" testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.23" - testCompile "org.junit.jupiter:junit-jupiter-engine:5.6.2" - testRuntime "org.junit.jupiter:junit-jupiter-engine:5.6.2" + testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.2" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.2" } processResources { - from(sourceSets.main.resources.srcDirs) { - filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description] - } + filter ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description] } java { @@ -60,7 +64,7 @@ shadowJar { archiveClassifier.set("") relocate "org.bstats", "me.clip.placeholderapi.metrics" - relocate "com.google.gson", "me.clip.placeholderapi.libs.gson" + relocate "net.kyori", "me.clip.placeholderapi.libs.kyori" } license { @@ -70,12 +74,8 @@ license { header = file('config/headers/main.txt') } - matching('**/JSONMessage.java') { - header = file('config/headers/jsonmessage.txt') - } - ext { - year = 2020 + year = 2021 } } @@ -83,15 +83,16 @@ test { useJUnitPlatform() } -sourceSets { - test.compileClasspath += configurations.compileOnly - test.runtimeClasspath += configurations.compileOnly +configurations { + testImplementation { + extendsFrom(compileOnly) + } } publishing { repositories { maven { - if (version.contains("-DEV-")) { + if (version.contains("-DEV")) { url = uri("https://repo.extendedclip.com/content/repositories/dev/") } else { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") diff --git a/config/headers/jsonmessage.txt b/config/headers/jsonmessage.txt index ec15330..9fddec6 100644 --- a/config/headers/jsonmessage.txt +++ b/config/headers/jsonmessage.txt @@ -1,4 +1,4 @@ -Copyright (c) 2018-2020 Peter Blood +Copyright (c) 2018-2021 Peter Blood Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c053550b91381bbd28b1afc82d634bf73a8a..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f 100644 GIT binary patch delta 6656 zcmY+Ibx_pN*Z*PZ4(U#j1qtbvrOTyO8fghZ8kYJfEe%U|$dV!@ASKczEZq$fg48M@ z;LnHO_j#Uq?%bL4dY^md%$$4Y+&@nKC|1uHR&59YNhubGh72|a#ylPdh9V+akp|I; zPk^W-a00GrFMkz_NSADdv2G2-i6rb=cB_@WnG(**4ZO$=96R=t|NZ@|0_z&q3GwO^ ziUFcuj$a9QaZ3j?xt`5#q`sT-ufrtBP0nt3IA&dr*+VCsBzBVW?vZ6eZr0oD%t33z zm~-5IVsjy(F>;S~Pm@bxX85>Z*@(QL6i3JQc?1ryQFcC@X^2^mZWhFv|v? z49>l|nA&XNQ6#OvccUTyBMB*WO#NA;FW5|eE_K6dtVYP2G?uUZ09!`Iq1IF2gA(aS zLu@G^cQJmh=x?-YsYa@E6QnE5+1@ds&0f#OQRDl^GnIT_m84G5XY%W z;Ck6bk^Oeu*Ma-XmxI5GjqzWNbJMsQF4)WfMZEA{oxW0E32e)*JfG}3otPishIQBw zkBe6N#4pKPN>q1R6G1@5&(u#5yPEToMBB6_oEK|q z@(i5j!?;NNCv~=HvW%zF&1yWBq(nJa_#``G&SRmQvE|jePUPs{J!$TacM|e}Fsceb zx+76|mDp6@w>)^DIl{8?)6XYNRU|2plG8Jy&7(^9SdOWNKKJK&>0!z6XiN4J*Jkao z=E1y5x-XDC==Ub+8fLb#OW&{2ww{h^xlJFYAMOUd)}Xg@j?ak{7Kno6?9S~F?|6Df zHo|ijXX~`Sp;Vf!nR;m%vUhq>zvlRXsL0u*Tt?F#yR}3tF0#of{(UjitqST|!{aBA zicWh+URU}Jnc*sg9iMkf0pggpd?3TI*C-q$2QOdCC7rV+CHBmjS3O%a3VeZ$ZSs5ubJuJp%e%$LHgrj0niYjX;4kt z&2~j%@q3MO)-QGCA{>o%eZu){ou^MgC6~Z8Y=tc!qF=|TOlG3wJXbaLYr-;$Ch=2J z_UcE59Xzq&h0LsjLrcZrQSa}#=0~Lk|4?e4M z6d;v->NCC1oMti)RRc`Ys0?JXQjsZ@VdCy%Z)TptCrI>0Tte$pR!@yJesoU2dtyuW z7iFsE8)CkbiJP+OP28;(%?!9WddQZcAid@R@`*e%3W65$g9ee`zvwb(VPO+uVBq6p z{QDR%CR(2z@?&9Obm3xPi2lzvfip`7q`_7UDD|lRS}4=bsl3xQIOi0@GSvMuDQX}* z4B^(DI<${qUhcLqO`itJU;e<%%iS+R3I^_xIV1O%sp*x~;-dn` zt$8>RnSUh#rU3{-47067W^WNwTdq-t$-U>Hj%r!GD!gLa;kV zW5g6pCqV+!q8LgrI49(}fIc5K_`FLV4_E#XZ6{<>w8wzc%V9k!!Byg5-0WY+J?1*z%9~Aj4WQr1Jsn2(G!U8fFpi(wsy@JLg^d+IB0kl89 z0@Ssqf!L9JjYKK$J=978+NO*5^C)GPH2a%4hm$HROjM|N3g9ch9kDLh*nlwqy{mVM z`P(l#>3NnK%#O8tSb(VmZrG+`dRD#=Cc1P%(y5S?*Hj5E{vg&Eiw!YV>S#7_WRDVoFxT5m=gFi4)}y5V%KT8!xbsH_rmR& zsmM?%J}K$1l8d?2+m(}2c}-G`x>CY%Y&QBJRC$sKM}zN<9{IlF@yJEG<^0={$+`Hc zDodJ)gCADJ_bD#am(c2ojXKb|j+ENJ#58PAA&pZXufrFzBwnuuo+khfMgd!DMlU#v z9|JelQO~E2;d^w!RZJbt%IANIudpKSP)cssoWhq)>({nvcfCr0=9=FAIMuZm8Eo=} z|DND}8_PB5HqG(QwDvaM@orYBZ9kCkHV*rxKTy>q7n~0emErUwLbhq;VN<2nKT&*a2Ajz z;lKBzU2i8KLV`d)Y&ae)!HcGk$dO}Or%8KF@kE@jU1h@zwpw{6p4ME|uC$Za-ERR2 ztQvL&uOZLe(k{w_+J^ng+l}~N8MP>F1Z$fLu}D-WWaeu#XduP@#8JpmH(X>rIL)k3 zyXNyTIB1(IH%S&pQ{rWaTVfB$~-;RnlY z^(y7mR>@=brI>!TrA)BQsQ={b*6$=1Eqbuu6IdhJ&$YD$08AwtNr9*J?%-WT<;O1< zPl1<@yeqfZ>@s4azqTf<=I4(kU^+^Qkstm%WM-0_VLm({jFc8`5Df2Q1Y9zMZu0^! zsO_yh2Sz9K>Jq6fkYbBZocEJ6C!SdEzYDkiEtNJs{?!tA#e|oiN+VaaAobwKef_kUup&4scD?1+}Q8)DaekkMYn-FOS{J%NY za^mmJ^n`t*1p@hF*gl#L+5wr40*(ub4J#L|@oCl~@|4UvCjHBYDQv&S zhyGMAkRO^tF_dyi&XM)4mQ;k>kj?RgRo@-?==oD+ns*>bf@&fPXF|4U0&ib2 zo~1ZdmCPWf!W9#sGP@9X$;Rc`tjbz^&JY}z{}j9bl?;VC{x)TfQH$D^WowKL&4Zx@ zdSn+QV7H(e0xRfN6aBfH)Q=@weoD?dvu6^ZS)zqb>GwMmIuS8zJfaMUQx9>%k~w34 z3}_B2Jj~u=SnJ~vZPj*)UoDi_FtT=UAb#J^b4B%R6z3H%cj-1OCjU5F$ky>By1zsg z>2A0ccp29(Y<;my|J_g-r{1I@+*O$>!R3`_sFNP4e}LD1e1mM&SA`;;TR0I`_hESV zh4U*9ecK$0=lYk`{SR_cm$}iS*?yQR(}T-5ub?Wn^#RTe*^1~ya%`!xWq-F*WH@%nnZTNREA z3eUX2uM9b_w!Zo$nVTotEtzuL(88N)H~v_G=89|(@IFz~Wq6ME);z(!2^PkR2B&kE zxR)xV8PE|Hszyjp#jNf=ZIQ7JR~4Ls#Vd@mPF(7R5VO$akUq8JM+sn>ZVg(lJZ)5qjqdw(*7tuwjY#0tx+|!sTz9yV~%HOdrb#!5w9>*0LrCS z%wF$Yc6~hqVQZzoC^D<(-h0aOtk}kn<<*xF61HQr<5}efY{zXXA+PaJG7vT&{Oz(@Uu!V#Fp9%Ht!~@;6AcD z$lvlPu&yd(YnAHfpN51*)JN0aYw9gGk{NE7!Oqu4rBp}F30669;{zcH-a7w9KSpDQPIE_f9T zit? zJSjTKWbe{f{9BmSDAFO1(K0oqB4578tU0(oRBE^28X>xDA!1C&VJEiYak4_ZTM*7M`hv_ zw3;2ndv3X$zT!wa7TrId{gNE`Vxf}j5wsyX+;Kn<^$EJT`NzznjyYx=pYMkZjizEU zb;Gg8Pl_pqxg)9P)C)Hxh_-mQ;u-I_Ol>d^>q08zFF!>Z3j1-HmuME_TGZ*Ev;O0O z%e(edJfV<6t3&FKwtInnj9EeQhq9;o5oLJoiKwWF5bP2~Feh#P4oN()JT0pdq!9x* ze3D-1%AV#{G=Op$6q?*Z>s{qFn}cl@9#m@DK_Bs@fdwSN`Qe18_WnveRB583mdMG- z?<3pJC!YljOnO8=M=|Cg)jw;4>4sna`uI>Kh&F20jNOk9HX&}Ry|mHJ+?emHnbYLJ zwfkx@slh31+3nq-9G5FVDQBHWWY}&hJ-fpDf!lQdmw8dlTt#=)20X74S>c&kR(?PT zBg)Y%)q&|hW1K;`nJPAGF*c3{3`FvrhD9=Ld{3M*K&5$jRhXNsq$0CLXINax1AmXX ziF39vkNtcK6i^+G^AEY!WalGazOQ$_#tx?BQ{YY$&V&42sICVl8@AI6yv;sGnT;@f zL=}rZcJqNwrEEA=GDdEe8Z=f9>^?($oS8xGdFf1eUWTYtZF<3tu2V%noPBnd=thZ+ zO&xoc?jvXG7Xt!RTw#5VN50UjgqSntw9Y35*~pxz=8OzkXg{@S2J%+{l3Q>B_qbnl z20Deb7JM&ZSp`%X>xWpb>FF8q7Nq&4#a1}A-(-!aMDmVbz05D!NpUzVe{~72h%cOh zwQFNai2a$K|hFgDk(oPF_tuf{BV!=m0*xqSzGAJ(~XUh8rk#{YOg0ReK>4eJl z;-~u5v$}DM)#vER>F)-}y(X6rGkp<{AkiPM7rFgAV^)FUX8XmCKKaWlS4;MSEagj$ z#pvH`vLX1q{&eOm>htnk4hmv=_)ao!MCp}9ql5yfre&Py!~hBAGNBa}PH&J8K=~<% z&?!J-QaH|0bq_uo6rt*r-M>d7jm1cbW^T>s)S?L{n8v`^?VIPA+qi^6e@cM|5boqEO!p1e|_{7U3Yl6K?0xMN1bbjf0@$TE-T))w> zFe?E?g$PUT-)AJ(PS^By^D^Ed!K5iv$*_eW~VA(I3~UMy*ZcgVu0$XZC*_0PgDmUL)qTCn927LD~p$yXR_GCJ&iQ; z4*`%l-dC5pALH!y*nmhdHRh02QjW1vZL4ySucz*w3f|#`=u@@YvMV1?i!&DIa2+S< z8z!gvN3FV4I;%fl;ruFeV{jKjI~?GlgkmGBuJ<7vY|l3xMOc?S@Q#C(zo*m&JLrjT2rU9PYOniB8O~yO5<1CCcQz# z17B2m1Z{R!Y)UO#CU-Y&mOlv4*Gz%rC_YkRcO)jTUEWHDvv!GWmEihE>OKPx1J?Av z8J{-#7NsT>>R#*7**=QL)1@IR77G9JGZZiVt!=jD+i(oRV;I`JkiTSZkAXuHm-VG1 z+2-LD!!2dNEk@1@Rp|C$MD9mH^)H*G*wI(i*Rc6Vvdik+BDycYQ*=0JA3dxxha|Zg zCIW1Ye-DdpMGTEwbA^6hVC<(@0FL4dkDOYcxxC5c%MJQ^)zpA%>>~Q|Y=@)XW!px; z_Fx+xOo7>sz4QX|Ef~igE+uFnzFWP<-#||*V0`0p7E*+n5+awuOWmvR{-M*chIXgo zYiZvQMond#{F8+4Zh_;>MsaZUuhp=onH@P!7W>sq|CWv|u}Wg0vo&f4UtmLzhCwwu zJaR=IO;sQxS}h(K>9VZjnED+>9rGgB3ks+AwTy_EYH{oc)mo`451n&YH%A1@WC{;1 z=fB6n zIYp46_&u`COM&Di?$P}pPAlAF*Ss<)2Xc?=@_2|EMO?(A1u!Vc=-%bDAP#zDiYQvJ z0}+}3GaLxsMIlh6?f=iRs0K=RyvMOcWl*xqe-IBLv?K{S^hP)@K|$I+h_)pdD9r~! zxhw2u66+F(E`&6hY}B_qe>wil|#*0R0B;<@E?L zVrhXKfwRg0l8r>LuNs1QqW&39ME0sOXe8zycivGVqUOjEWpU)h|9fwp@d(8=M-WxY zeazSz6x5e`k821fgylLIbdqx~Kdh^Oj`Q!4vc*Km)^Tr-qRxPHozdvvU^#xNsKVr6aw8={70&S4y*5xeoF@Q^y596*09`XF56-N z1=Rm5?-An178o?$ix}y7gizQ9gEmGHF5AW+92DYaOcwEHnjAr~!vI>CK%h`E_tO8L Yte!%o?r4GTrVtxD61Ym!|5fq-1K$0e!T1w z1SC8j)_dObefzK9b=~*c&wBRW>;B{VGKiBofK!FMN5oJBE0V;;!kWUz!jc1W?5KdY zyZ3mCBHprpchz-9{ASiJJh&&h1|4rdw6wxD2+9= z#6#}Uq8&^1F3wgvGFoNDo?bIeEQXpcuAR0-+w$JWoK-@yUal1M&~W_O)r+Rx;{@hWH5n^oQWR36GMYBDDZyPK4L@WVjRrF+XlSzi4X4!_!U%Uujl6LHQ#|l(sUU%{ zefYd8jnVYP91K}Qn-OmmSLYFK1h~_}RPS~>+Xdz%dpvpJ{ll!IKX=JN99qowqslbO zV3DmqPZ}6>KB!9>jEObpi$u5oGPfO3O5!o3N2Mn`ozpje<}1I1H)m2rJDcB7AwXc6 z6j)tnPiql7#)r+b+p9?MVahp&=qJ^$oG+a^C*);FoJ!+V*^W+|2Olx5{*&$bXth)U zejc7mU6cBp?^Rj|dd{GL-0eHRTBi6_yJ&GLP5kIncv^z{?=0AVy^5{S8_n=rtua!J zFGY=A(yV^ZhB}1J_y(F`3QTu+zkHlw;1GiFeP&pw0N1k%NShHlO(4W+(!wy5phcg4 zA-|}(lE_1@@e6y`veg;v7m;q%(PFG&K3#}eRhJioXUU0jg_8{kn$;KVwf;zpL2X_( zC*_R#5*PaBaY73(x*oZ}oE#HPLJQRQ7brNK=v!lsu==lSG1(&q>F)`adBT~d*lMS| z%!%7(p~<7kWNmpZ5-N31*e=8`kih|g5lVrI%2wnLF-2D+G4k6@FrYsJ_80AJ}KMRi>) z-kIeHp{maorNWkF81v0FKgB==_6blyaF$5GaW)B!i4v*jNk6r)vU6?G$0pV8(Y+UK z5lgRVt%;N_gWp)^osv=h+^07UY6+$4^#t=M3>0i0`{`aEkFLL#a)93uXhYO+aKTtu zckg2T9S&GKNtZmdAS^8PzvDva-%-K&g9eqPXQ4$dM^inr@6Zl z{!Cq&C_+V;g*{>!0cZP}?ogDb$#ZS=n@NHE{>k@84lOkl&$Bt2NF)W%GClViJq14_ zQIfa^q+0aq){}CO8j%g%R9|;G0uJuND*HO$2i&U_uW_a5xJ33~(Vy?;%6_(2_Cuq1 zLhThN@xH7-BaNtkKTn^taQHrs$<<)euc6z(dhps>SM;^Wx=7;O&IfNVJq3wk4<1VS z-`*7W4DR_i^W4=dRh>AXi~J$K>`UqP>CKVVH&+T(ODhRJZO7DScU$F7D)di-%^8?O z6)Ux`zdrVOe1GNkPo0FgrrxSu1AGQkJe@pqu}8LkBDm+V!N_1l}`tjLW8${rgDLv3m@E*#zappt-Mm zSC<$o+6UO~w0C=(0$&*y**@nKe_Q{|eAuD!(0YL0_a{z%+sdfSyP={Nyd$re6Rzbp zvsgTY7~VflX0^Vf7qqomYZ_$ryrFVV2$sFyzw2r%Q8*uYDA+)iQdfKms_5(>!s#!( z!P5S(N0i9CKQKaqg(U%Gk#V3*?)lO6dLv`8KB~F<-%VhbtL8Rl>mEz+PN=qx&t*|= zQHV=qG)YKlPk4iCyWIUGjC?kpeA>hIBK*A?B0)rB=RqAal#D%1C9yVQwBcz${#Jb5 zR{TRmMrOrJsLc&6x9qDo@FJ^=do_Y?3oU0G^nV5_EU&+DS+VA7Tp{^TAF>yZbyM3c zf*1CqHY9T|aL_lyY7c)i!_MtGPA!sdy3|mrsKVj1mi&>dms@-ozSa}OZ?2I*tAndg z@S7er$t^d^-;!wLQbG60nWd@1pQVD7tw-G_B#OscoYyremiZ_hj8*sXqQdchuD^!R zpXGuSj5psk+jR>3rWu3^`17>j&*^9^rWbszP=Mf@5KIEj%b=z98v=Ymp%$FYt>%Ld zm8})EDbNOJu9n)gwhz_RS``#Ag)fr)3<*?(!9O~mTQWeh;8c;0@o=iBLQNqx3d_2#W7S9#FXzr6VXfs>4 z;QXw}-STvK9_-7H=uqgal2{GkbjVLN+=D5ddd)4^WvX;(NYA*X*(JxTdiUzqVJopd zQg#~psX4o<)cF>r=rxP`(Xsf<+HG-pf&7aFPL8z|-&B*P?Vmsu5d>Nlg^2$WRY!S@#`g2{81;(1w#o5HsvN}5pFZi});>|VK^kL{Zkx~wgn ztlZp;HW`H8(GdRfIwc~?#N6}o#h158ohI*GIsK%56I_9sf2k_K@4vD!l{(dX9E7PJ;w>$|Y;-VBJSO4@){07bo-89^LZ9g<<%;dOl zyIq{s8`8Ltp*GDwu(l_Z$6sA2nam$BM$Q~6TpZg)w2TtW?G5whV(lRwaf$6EU86is zBP9Rs&vS_~sk?Nn_b}^HkM8LiO@>J}=g(T4hLmvH@5Jj#2aHa~K)lD9VB0k>$V2BP zgh;(=y9Op(KQ=H5vj+%qs>?s4tYN~-Q|fyQePA)s?HrF~;l!+@t8VMzqUpqMLudFT z)=o~s!MM4XkgbetIsODwtQ=FF$IcIp&!pjh6Q6{tL+l*7GQ%8Wsg(tC#qU3oW$~n) zL=>XIxI}Hi7HS0F_mmi+(c%1HDuKiWm>|6Xa}nW7ei55ggru9)xjBvC#JcEIN*#cp zv*ACvr=HTC?dX9NNo9Yhulu_gX5Z~}QQ2&QZ&C77{(>Y3_ z6j5Z1Uc5FtPEpS_31HsgmSLHZijGb_p$WlRJ1p^_1!ZLP8kr6OtCEK7Qh267o$H>e zf<4cNGQRk{g5h$XfvTFQ@`qm@iju83-~}ebAYpZryARHVR$AEt3229U{y@Fp4 z-8FBBtGG&(hTyUdx5ZOfiz`c=<0F%+w|Fl=rWk{K7>70k04SN?RU(^mrKSeKDqA!K^Hsv8C?#ioj4@WUL zC*?{hTai6q0%_oBTqDHygp_Kl;({sAScYQIwMDM1U>{x0ww zve?_}E;DG?+|zsUrsph5X_G7l#Y~vqkq3@NNDabbw7|`eJBmn`Qrlr%?`va=mm$Mc{+FBbQbogAZ6{MuzT|P%QZZotd21eb1hfj|;GYAX&>bx#D5EB+=XMj2XJkpnyMUykaVo) zj3ZLqEl1&)Rturc8m@+uUuD^vaNaSxGwP4dq0-OSb~62lPv8E_K4usLvG{Qg zdR%z8dd2H!{JaT|X_bfm{##*W$YM;_J8Y8&Z)*ImOAf4+| zEyi)qK%Ld1bHuqD+}-WiCnjszDeC-%8g+8JRpG1bOc!xUGB?@?6f~FTrI%U#5R~YF z%t5(S2Q>?0`(XNHa8xKdTEZ~Z4SJOheit#ldfdg63}#W6j8kO;SjQD`vftxS+#x1B zYu|5szEvkyz|}|B3x|DNlyi$;+n+cW$Hu+?)=X1!sa%{H-^;oBO9XACZJ}wkQ!sTa zQ#J3h|HX{{&WwIG3h7d6aWktuJaO)ie6&=KJBoX@w(rBWfin`*a6OmCC5M0HzL(gv zY<*e4hmW>SWVhxk-`UGOAbD%Hk+uu<^7zJ_ytVXamfqCd0$g+W08>?QAB}Cv{b}eM z@X}ILg+uT%>-6`A25p@uhS3%;u>ccSq}8|H_^o&`nBT5S0y z;2H0I^(4MO*S+(4l$gULc4KSeKvidto5Nl0P|%9CqQ*ikY!w_GUlo}sb9HYB=L^oFpJ zfTQskXW!LFVnUo4(OHPDaZSf3zB|3{RGu1>ueE$(+dr?tT zp!SGlqDU8vu{5xLWSvj+j$arHglg54#Lx&TvuO3LIIU>hF9Uoj&=-b*Q?uYr`#V?xz?2 zhirZrv^eA{k%{hFh%9LYVXEYWd5#PuUd1QqaqB*J!CMXEM>fEB$@#1>mtB`Bfil}t zhhTIObqh5HRvT+4q_Do$Q*Jika?qV=Np-DtPkU z(KoXyWLfPwr@UY1)hBAvR3nCBZgd|CevTG?H~HqDF}dzy%2sd2`f{^CBbTk*^K~RO zN~O0+2EjAJlywF%SjgYz810l&G5AqzI<=Ber{912^PpSPRJl3dm8W@dKHL}7_@k3)Y!SXYkyxQy>Q4I2o zr`ev7fLF$1t96h|sH<-#*YzGD-b^3$_!#wsh(Yw;)b@udLz9mm`mFYh z1Zz24KIQJ(*_-E0(3&1InqG;U?wF)GYd>DFo(em`#|UaaYmkA9;GTX7b?0@C@QkTVpGD#mf$dQoRNV=n{^Zi_W*ps;3?^$s`0;ER7;==~OmQ~9 zS5P=FjxE5%|;xq6h4@!_h?@|aK&FYI2IT(OHXv2%1 zWEo-v!L7x^YT(xLVHlpJttcwaF@1Y;-S*q3CRa!g7xdzl|Jan>2#dI0`LKl!T1GMk zRKe4|bQO&ET}Z^Aiym*HII>cSxIzl|F~JEUGxz;+DB=8fxXhnBI4R12q6ews$lA`Jfi}r@A@-)6TOAUMNYFYJ zZ-Zd?lxFTyjN3mXnL!%#>Z%$0gJ4*9g;e;@zSmQ{eGGDaRRNM3s@6!;hYuVc=c+3B z=qzNNS~n^EsJU4aOGE|mdy={C^lPKEfPL-IJAsTpQsDgZ@~s+eHZYmp9yb=YW_4r?lqQaYZQ`nau){W`LY#P)>i zq^wHEuOYs#FlPZeMuT@Etb@~A6feCebq`miJE3w+gAL%bVF_s*5e*@)?xmKSo%I3? zLELHVdWia$}~s6 zr!^LfxSSB4Td&9iTXrzQpl5ZDo#SdmNr;23QsPHQ!x!UT9xtb!Ycz^JF8x)%cFOXK z^EXw%dRz_VD}7?RU^4{)1+xFO=z!EI8IUa3U*rag=1BpHX$Xi<__kSbS{y_xa*MJv z_`thq0Z^sPzjAk48ssDQj}!$N8Q$XC84(bU$t_Bm69Jf+C!h_}ep zwzpQj9sRA94<{x3{~z&ix-DwX;RAzka)4-#6ZHJqKh|SVuO|>Yrv+m30+!|sK<-|E z=)5E->#y<_1V|T1f%Af!ZYqXg}`O zI$qKOWdnclF`%_Z`WGOe{`A`l-#a?s=Q1a#@BOWmExH2;Wl`OB!B-%lq3nO{4=WO& z#k_x|N&(qzm*6S{G*|GCegF2N2ulC+(58z2DG~yUs}i8zvRf&$CJCaexJ6Xu!`qz( z)*v8*kAE#D0KCo*s{8^Rbg=`*E2MzeIt0|x55%n-gO&yX#$l=3W7-_~&(G8j1E(XB hw}tl`5K!1C(72%nnjQrp<7@!WCh47rWB+@R{{wClNUHz< diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c78a2b9..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Jul 14 23:27:02 AWST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index fbd7c51..4f906e0 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java index e162d09..beb93ce 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -140,13 +140,29 @@ public final class PlaceholderAPI { return text.stream().map(line -> setBracketPlaceholders(player, line)) .collect(Collectors.toList()); } - + + /** + * Translates all placeholders into their corresponding values. + *
The pattern of a valid placeholder is {@literal {_}}. + * + * @param player Player to parse the placeholders against + * @param text Text to set the placeholder values in + * @return String containing all translated placeholders + */ public static String setBracketPlaceholders(Player player, String text) { return setBracketPlaceholders((OfflinePlayer) player, text); } - + + /** + * Translates all placeholders into their corresponding values. + *
The pattern of a valid placeholder is {@literal {_}}. + * + * @param player Player to parse the placeholders against + * @param text List of Strings to set the placeholder values in + * @return String containing all translated placeholders + */ public static List setBracketPlaceholders(Player player, List text) { - return setPlaceholders((OfflinePlayer) player, text); + return setBracketPlaceholders((OfflinePlayer) player, text); } /** @@ -216,7 +232,7 @@ public final class PlaceholderAPI { /** * Get all registered placeholder identifiers * - * @return All registered placeholder identifiers + * @return A Set of type String containing the identifiers of all registered expansions. */ @NotNull public static Set getRegisteredIdentifiers() { @@ -226,8 +242,8 @@ public final class PlaceholderAPI { /** * Get the normal placeholder pattern. - * - * @return The default Placeholder Pattern + * + * @return Regex Pattern of {@literal [%]([^%]+)[%]} */ public static Pattern getPlaceholderPattern() { return PLACEHOLDER_PATTERN; @@ -235,8 +251,8 @@ public final class PlaceholderAPI { /** * Get the bracket placeholder pattern. - * - * @return the Bracket Placeholder Pattern + * + * @return Regex Pattern of {@literal [{]([^{}]+)[}]} */ public static Pattern getBracketPlaceholderPattern() { return BRACKET_PLACEHOLDER_PATTERN; @@ -244,8 +260,8 @@ public final class PlaceholderAPI { /** * Get the relational placeholder pattern. - * - * @return The Relational Placeholder Pattern + * + * @return Regex Pattern of {@literal [%](rel_)([^%]+)[%]} */ public static Pattern getRelationalPlaceholderPattern() { return RELATIONAL_PLACEHOLDER_PATTERN; diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java index fe07931..b121bd3 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -32,7 +32,11 @@ import me.clip.placeholderapi.expansion.manager.CloudExpansionManager; import me.clip.placeholderapi.expansion.manager.LocalExpansionManager; import me.clip.placeholderapi.listeners.ServerLoadEventListener; import me.clip.placeholderapi.updatechecker.UpdateChecker; +import net.kyori.adventure.platform.bukkit.BukkitAudiences; +import net.kyori.adventure.text.serializer.craftbukkit.MinecraftComponentSerializer; import org.bstats.bukkit.Metrics; +import org.bstats.charts.AdvancedPie; +import org.bstats.charts.SimplePie; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -73,6 +77,8 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { @NotNull private final CloudExpansionManager cloudExpansionManager = new CloudExpansionManager(this); + private BukkitAudiences adventure; + /** * Gets the static instance of the main class for PlaceholderAPI. This class is not the actual API * class, this is the main class that extends JavaPlugin. For most API methods, use static methods @@ -138,6 +144,8 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { setupMetrics(); setupExpansions(); + adventure = BukkitAudiences.create(this); + if (config.isCloudEnabled()) { getCloudExpansionManager().load(); } @@ -156,6 +164,9 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { Bukkit.getScheduler().cancelTasks(this); + adventure.close(); + adventure = null; + instance = null; } @@ -183,6 +194,15 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { return cloudExpansionManager; } + @NotNull + public BukkitAudiences getAdventure() { + if(adventure == null) { + throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!"); + } + + return adventure; + } + /** * Obtain the configuration class for PlaceholderAPI. * @@ -205,14 +225,13 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { } private void setupMetrics() { - final Metrics metrics = new Metrics(this); - metrics.addCustomChart(new Metrics.SimplePie("using_expansion_cloud", + final Metrics metrics = new Metrics(this, 438); + metrics.addCustomChart(new SimplePie("using_expansion_cloud", () -> getPlaceholderAPIConfig().isCloudEnabled() ? "yes" : "no")); - metrics.addCustomChart( - new Metrics.SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no")); + metrics.addCustomChart(new SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no")); - metrics.addCustomChart(new Metrics.AdvancedPie("expansions_used", () -> { + metrics.addCustomChart(new AdvancedPie("expansions_used", () -> { final Map values = new HashMap<>(); for (final PlaceholderExpansion expansion : getLocalExpansionManager().getExpansions()) { diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java index 0087590..91c3263 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommand.java b/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommand.java index 016a37c..2d6b78a 100644 --- a/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommand.java +++ b/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommand.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommandRouter.java b/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommandRouter.java index 3c32314..2a81e85 100644 --- a/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommandRouter.java +++ b/src/main/java/me/clip/placeholderapi/commands/PlaceholderCommandRouter.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java index 7a89a34..0cfbc16 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloud.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudClear.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudClear.java index 251ae43..3296657 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudClear.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudClear.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java index 7bbb872..ee9e6ca 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudDownload.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java index 569c0ce..267505e 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionInfo.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java index e4cb193..cb4d38c 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionList.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -26,14 +26,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.common.primitives.Ints; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; @@ -43,15 +36,22 @@ import me.clip.placeholderapi.commands.PlaceholderCommand; import me.clip.placeholderapi.configuration.ExpansionSort; import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.cloud.CloudExpansion; -import me.clip.placeholderapi.libs.JSONMessage; import me.clip.placeholderapi.util.Format; import me.clip.placeholderapi.util.Msg; -import org.bukkit.ChatColor; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.TextComponent; +import net.kyori.adventure.text.event.ClickEvent; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.format.TextDecoration; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Unmodifiable; +import static net.kyori.adventure.text.Component.*; +import static net.kyori.adventure.text.format.NamedTextColor.*; + public final class CommandECloudExpansionList extends PlaceholderCommand { private static final int PAGE_SIZE = 10; @@ -132,77 +132,81 @@ public final class CommandECloudExpansionList extends PlaceholderCommand { builder.append(" &bPage&7: &a") .append(page) - .append("&r") - .append('\n'); + .append("&r"); } - @NotNull - private static JSONMessage getMessage(@NotNull final List expansions, + private static Component getMessage(@NotNull final List expansions, final int page, final int limit, @NotNull final String target) { final SimpleDateFormat format = PlaceholderAPIPlugin.getDateFormat(); - final StringBuilder tooltip = new StringBuilder(); - final JSONMessage message = JSONMessage.create(); + final TextComponent.Builder message = text(); for (int index = 0; index < expansions.size(); index++) { final CloudExpansion expansion = expansions.get(index); + final TextComponent.Builder line = text(); - tooltip.append("&bClick to download this expansion!") - .append('\n') - .append('\n') - .append("&bAuthor: &f") - .append(expansion.getAuthor()) - .append('\n') - .append("&bVerified: ") - .append(expansion.isVerified() ? "&a&l✔&r" : "&c&l❌&r") - .append('\n') - .append("&bLatest Version: &f") - .append(expansion.getLatestVersion()) - .append('\n') - .append("&bReleased: &f") - .append(format.format(expansion.getLastUpdate())); + final int expansionNumber = index + ((page - 1) * PAGE_SIZE) + 1; + line.append(text(expansionNumber + ". ", DARK_GRAY)); - final String description = expansion.getDescription(); - if (description != null && !description.isEmpty()) { - tooltip.append('\n') - .append('\n') - .append("&f") - .append(description.replace("\r", "").trim()); + final NamedTextColor expansionColour; + + if (expansion.shouldUpdate()) { + expansionColour = GOLD; + } else { + if (expansion.hasExpansion()) { + expansionColour = GREEN; + } else { + expansionColour = GRAY; + } } - message.then(Msg.color( - "&8" + (index + ((page - 1) * PAGE_SIZE) + 1) + ".&r " + (expansion.shouldUpdate() ? "&6" - : expansion.hasExpansion() ? "&a" : "&7") + expansion.getName())); + line.append(text(expansion.getName(), expansionColour)); - message.tooltip(Msg.color(tooltip.toString())); - message.suggestCommand("/papi ecloud download " + expansion.getName()); + line.clickEvent(ClickEvent.suggestCommand("/papi ecloud download " + expansion.getName())); - if (index < expansions.size() - 1) { - message.newline(); + final TextComponent.Builder hoverText = text("Click to download this expansion!", AQUA) + .append(newline()).append(newline()) + .append(text("Author: ", AQUA)).append(text(expansion.getAuthor(), WHITE)) + .append(newline()) + .append(text("Verified: ", AQUA)).append(text(expansion.isVerified() ? "✔" : "❌", expansion.isVerified() ? GREEN : RED, TextDecoration.BOLD)) + .append(newline()) + .append(text("Released: ", AQUA)).append(text(format.format(expansion.getLastUpdate()), WHITE)) + .toBuilder(); + + Optional.ofNullable(expansion.getDescription()) + .filter(description -> !description.isEmpty()) + .ifPresent(description -> hoverText.append(newline()).append(newline()) + .append(text(description.replace("\r", "").trim(), WHITE)) + ); + + line.hoverEvent(HoverEvent.showText(hoverText.build())); + + if (index != expansions.size() - 1) { + line.append(newline()); } - tooltip.setLength(0); + message.append(line.build()); } if (limit > 1) { - message.newline(); + message.append(newline()); + + final TextComponent.Builder left = text("◀", page > 1 ? GRAY : DARK_GRAY).toBuilder(); - message.then("◀") - .color(page > 1 ? ChatColor.GRAY : ChatColor.DARK_GRAY); if (page > 1) { - message.runCommand("/papi ecloud list " + target + " " + (page - 1)); + left.clickEvent(ClickEvent.runCommand("/papi ecloud list " + target + " " + (page - 1))); } - message.then(" " + page + " ").color(ChatColor.GREEN); + final TextComponent.Builder right = text("▶", page < limit ? GRAY : DARK_GRAY).toBuilder(); - message.then("▶") - .color(page < limit ? ChatColor.GRAY : ChatColor.DARK_GRAY); if (page < limit) { - message.runCommand("/papi ecloud list " + target + " " + (page + 1)); + right.clickEvent(ClickEvent.runCommand("/papi ecloud list " + target + " " + (page + 1))); } + + message.append(left, text(" " + page + " ", GREEN), right); } - return message; + return message.build(); } private static void addExpansionTable(@NotNull final List expansions, @@ -321,8 +325,8 @@ public final class CommandECloudExpansionList extends PlaceholderCommand { final int limit = (int) Math.ceil((double) expansions.size() / PAGE_SIZE); - final JSONMessage message = getMessage(values, page, limit, params.get(0)); - message.send(((Player) sender)); + final Component message = getMessage(values, page, limit, params.get(0)); + plugin.getAdventure().player((Player) sender).sendMessage(message); } @Override diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java index 9d51966..46eda28 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudExpansionPlaceholders.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudRefresh.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudRefresh.java index 2185d88..77f023e 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudRefresh.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudRefresh.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudStatus.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudStatus.java index 47aafa6..f1e6333 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudStatus.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudStatus.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudToggle.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudToggle.java index 5cbd754..57539d5 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudToggle.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudToggle.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudUpdate.java b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudUpdate.java index 6b4d21a..0cb4a10 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudUpdate.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/cloud/CommandECloudUpdate.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java index d3c3637..d30699d 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandDump.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -21,7 +21,17 @@ package me.clip.placeholderapi.commands.impl.local; import com.google.common.io.CharStreams; -import com.google.gson.JsonParser; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import me.clip.placeholderapi.PlaceholderAPIPlugin; +import me.clip.placeholderapi.commands.PlaceholderCommand; +import me.clip.placeholderapi.expansion.PlaceholderExpansion; +import me.clip.placeholderapi.util.Msg; +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Unmodifiable; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -41,20 +51,15 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.logging.Level; import java.util.stream.Collectors; -import me.clip.placeholderapi.PlaceholderAPIPlugin; -import me.clip.placeholderapi.commands.PlaceholderCommand; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import me.clip.placeholderapi.util.Msg; -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.Plugin; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; public final class CommandDump extends PlaceholderCommand { @NotNull private static final String URL = "https://paste.helpch.at/"; + @NotNull + private static final Gson gson = new Gson(); + @NotNull private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter .ofLocalizedDateTime(FormatStyle.LONG) @@ -102,9 +107,8 @@ public final class CommandDump extends PlaceholderCommand { try (final InputStream stream = connection.getInputStream()) { //noinspection UnstableApiUsage - final String json = CharStreams - .toString(new InputStreamReader(stream, StandardCharsets.UTF_8)); - return JsonParser.parseString(json).getAsJsonObject().get("key").getAsString(); + final String json = CharStreams.toString(new InputStreamReader(stream, StandardCharsets.UTF_8)); + return gson.fromJson(json, JsonObject.class).get("key").getAsString(); } } catch (final IOException ex) { throw new CompletionException(ex); diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java index 84cf1bf..9f0bcbd 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionRegister.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionUnregister.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionUnregister.java index 4b59fac..3d03283 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionUnregister.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandExpansionUnregister.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java index d43e2fe..aeb53e7 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandHelp.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandInfo.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandInfo.java index ca0903a..d4dc03a 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandInfo.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandInfo.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java index f401e7f..5a5b28a 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandList.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java index 3bd8bc2..60c4ff8 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandParse.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandReload.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandReload.java index 5bb6d97..77ac57a 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandReload.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandReload.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandVersion.java b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandVersion.java index 6804f1c..4ad73dd 100644 --- a/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandVersion.java +++ b/src/main/java/me/clip/placeholderapi/commands/impl/local/CommandVersion.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/configuration/ExpansionSort.java b/src/main/java/me/clip/placeholderapi/configuration/ExpansionSort.java index c663f47..79b1f2a 100644 --- a/src/main/java/me/clip/placeholderapi/configuration/ExpansionSort.java +++ b/src/main/java/me/clip/placeholderapi/configuration/ExpansionSort.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java index 78b728e..9d9a057 100644 --- a/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java +++ b/src/main/java/me/clip/placeholderapi/configuration/PlaceholderAPIConfig.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java index e1e556f..6f812dc 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -26,6 +26,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; +/** + * Indicates that a {@link PlaceholderExpansion} has been registered by + * PlaceholderAPI. + */ public final class ExpansionRegisterEvent extends Event implements Cancellable { @NotNull @@ -42,7 +46,12 @@ public final class ExpansionRegisterEvent extends Event implements Cancellable { public static HandlerList getHandlerList() { return HANDLERS; } - + + /** + * The {@link PlaceholderExpansion expansion} that was registered. + * + * @return The {@link PlaceholderExpansion} instance. + */ @NotNull public PlaceholderExpansion getExpansion() { return expansion; diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java index b9bebac..4c0beb1 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionUnregisterEvent.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -25,6 +25,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; +/** + * Indicates that a {@link PlaceholderExpansion} had been unregistered by + * PlaceholderAPI. + */ public final class ExpansionUnregisterEvent extends Event { @NotNull @@ -42,7 +46,12 @@ public final class ExpansionUnregisterEvent extends Event { public static HandlerList getHandlerList() { return HANDLERS; } - + + /** + * The {@link PlaceholderExpansion expansion} that was unregistered. + * + * @return The {@link PlaceholderExpansion} instance. + */ @NotNull public PlaceholderExpansion getExpansion() { return expansion; diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionsLoadedEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionsLoadedEvent.java index 157b0a0..b173007 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionsLoadedEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionsLoadedEvent.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -26,7 +26,10 @@ import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; /** - * This event is called when all expansions are loaded (when reloading config, on plugin start and on server load). + * Indicates that all {@link me.clip.placeholderapi.expansion.PlaceholderExpansion PlayceholderExpansions} + * have been loaded. + *
This event is fired on Server load and when reloading the + * confiuration. */ public class ExpansionsLoadedEvent extends Event { diff --git a/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java b/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java index 0452d29..24a8a0b 100644 --- a/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/PlaceholderHookUnloadEvent.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/exceptions/NoDefaultCommandException.java b/src/main/java/me/clip/placeholderapi/exceptions/NoDefaultCommandException.java index 8ba6a9f..d4ceebd 100644 --- a/src/main/java/me/clip/placeholderapi/exceptions/NoDefaultCommandException.java +++ b/src/main/java/me/clip/placeholderapi/exceptions/NoDefaultCommandException.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/Cacheable.java b/src/main/java/me/clip/placeholderapi/expansion/Cacheable.java index e002c44..aa105f8 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Cacheable.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Cacheable.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/Cleanable.java b/src/main/java/me/clip/placeholderapi/expansion/Cleanable.java index e08f0d6..b408acf 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Cleanable.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Cleanable.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/Configurable.java b/src/main/java/me/clip/placeholderapi/expansion/Configurable.java index 5660f64..a20b73b 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Configurable.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Configurable.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -24,7 +24,7 @@ import java.util.Map; /** * Any {@link PlaceholderExpansion} class which implements configurable will have any options listed - * in the getDefaults map automatically added to the PlaceholderAPI config.yml file + * in the {@link #getDefaults()} map automatically added to the PlaceholderAPI config.yml file * * @author Ryan McCarthy */ diff --git a/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java b/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java index acd7e0d..541a004 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java +++ b/src/main/java/me/clip/placeholderapi/expansion/NMSVersion.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -41,7 +41,8 @@ public enum NMSVersion { SPIGOT_1_15_R1("v1_15_R1"), SPIGOT_1_16_R1("v1_16_R1"), SPIGOT_1_16_R2("v1_16_R2"), - SPIGOT_1_16_R3("v1_16_R3"); + SPIGOT_1_16_R3("v1_16_R3"), + SPIGOT_1_17_R1("v1_17_R1"); private final String version; diff --git a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java index 84e50e3..1e71a45 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java +++ b/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -22,7 +22,6 @@ package me.clip.placeholderapi.expansion; import java.util.Collections; import java.util.List; -import java.util.Objects; import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.PlaceholderHook; import org.bukkit.Bukkit; @@ -32,10 +31,17 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/** + * Any class extending this will be able to get registered as a PlaceholderExpansion. + *
The registration either happens automatically when the jar file containing a + * class extending this one is located under the {@code PlaceholderAPI/expansions} + * directory or when the {@link #register()} method is called by said class. + */ public abstract class PlaceholderExpansion extends PlaceholderHook { /** - * The placeholder identifier of this expansion + * The placeholder identifier of this expansion. May not contain {@literal %}, + * {@literal {}} or _ * * @return placeholder identifier that is associated with this expansion */ @@ -153,64 +159,153 @@ public abstract class PlaceholderExpansion extends PlaceholderHook { } // === Configuration === - + + /** + * Gets the ConfigurationSection of the expansion located in the config.yml of PlaceholderAPI or + * null when not specified. + *
You may use the {@link Configurable} interface to define default values set + * + * @return ConfigurationSection that this epxpansion has. + */ @Nullable public final ConfigurationSection getConfigSection() { return getPlaceholderAPI().getConfig().getConfigurationSection("expansions." + getIdentifier()); } - + + /** + * Gets the ConfigurationSection relative to the {@link #getConfigSection() default one} set + * by the expansion or null when the default ConfigurationSection is null + * + * @param path The path to get the ConfigurationSection from. This is relative to the default section + * @return ConfigurationSection relative to the default section + */ @Nullable public final ConfigurationSection getConfigSection(@NotNull final String path) { final ConfigurationSection section = getConfigSection(); return section == null ? null : section.getConfigurationSection(path); } - + + /** + * Gets the Object relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the provided Default Object, when the default ConfigurationSection is null + * + * @param path The path to get the Object from. This is relative to the default section + * @param def The default Object to return when the ConfigurationSection returns null + * @return Object from the provided path or the default one provided + */ @Nullable @Contract("_, !null -> !null") public final Object get(@NotNull final String path, final Object def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.get(path, def); } - + + /** + * Gets the int relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the provided Default int, when the default ConfigurationSection is null + * + * @param path The path to get the int from. This is relative to the default section + * @param def The default int to return when the ConfigurationSection returns null + * @return int from the provided path or the default one provided + */ public final int getInt(@NotNull final String path, final int def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.getInt(path, def); } - + + /** + * Gets the long relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the provided Default long, when the default ConfigurationSection is null + * + * @param path The path to get the long from. This is relative to the default section + * @param def The default long to return when the ConfigurationSection returns null + * @return long from the provided path or the default one provided + */ public final long getLong(@NotNull final String path, final long def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.getLong(path, def); } - + + /** + * Gets the double relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the provided Default double, when the default ConfigurationSection is null + * + * @param path The path to get the double from. This is relative to the default section + * @param def The default double to return when the ConfigurationSection returns null + * @return double from the provided path or the default one provided + */ public final double getDouble(@NotNull final String path, final double def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.getDouble(path, def); } - + + /** + * Gets the String relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the provided Default String, when the default ConfigurationSection is null + * + * @param path The path to get the String from. This is relative to the default section + * @param def The default String to return when the ConfigurationSection returns null. Can be null + * @return String from the provided path or the default one provided + */ @Nullable @Contract("_, !null -> !null") public final String getString(@NotNull final String path, @Nullable final String def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.getString(path, def); } - + + /** + * Gets a String List relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or an empty List, when the default ConfigurationSection is null + * + * @param path The path to get the String list from. This is relative to the default section + * @return String list from the provided path or an empty list + */ @NotNull public final List getStringList(@NotNull final String path) { final ConfigurationSection section = getConfigSection(); return section == null ? Collections.emptyList() : section.getStringList(path); } + /** + * Gets the boolean relative to the {@link #getConfigSection() default ConfigurationSection} set + * by the expansion or the default boolean, when the default ConfigurationSection is null + * + * @param path The path to get the boolean from. This is relative to the default section + * @param def The default boolean to return when the ConfigurationSection is null + * @return boolean from the provided path or the default one provided + */ @NotNull public final boolean getBoolean(@NotNull final String path, final boolean def) { final ConfigurationSection section = getConfigSection(); return section == null ? def : section.getBoolean(path, def); } + /** + * Whether the {@link #getConfigSection() default ConfigurationSection} contains the provided path + * or not. This will return {@code false} when either the default section is null, or doesn't + * contain the provided path + * + * @param path The path to check + * @return true when the default ConfigurationSection is not null and contains the path, false otherwise + */ public final boolean configurationContains(@NotNull final String path) { final ConfigurationSection section = getConfigSection(); return section != null && section.contains(path); } - + + /** + * Whether the provided Object is an instance of this PlaceholderExpansion. + *
This method will perform the following checks in order: + *
    + *
  • Checks if Object equals the class. Returns true when equal and continues otherwise
  • + *
  • Checks if the Object is an instance of a PlaceholderExpansion. Returns false if not
  • + *
  • Checks if the Object's Identifier, Author and version equal the one of this class
  • + *
+ * + * @param o The Object to check + * @return true or false depending on the above mentioned checks + */ @Override public final boolean equals(final Object o) { if (this == o) { @@ -226,7 +321,12 @@ public abstract class PlaceholderExpansion extends PlaceholderHook { getAuthor().equals(expansion.getAuthor()) && getVersion().equals(expansion.getVersion()); } - + + /** + * Returns a String containing the Expansion's name, author and version + * + * @return String containing name, author and version of the expansion + */ @Override public final String toString() { return String.format("PlaceholderExpansion[name: '%s', author: '%s', version: '%s']", getName(), @@ -267,5 +367,4 @@ public abstract class PlaceholderExpansion extends PlaceholderHook { public String getLink() { return null; } - } diff --git a/src/main/java/me/clip/placeholderapi/expansion/Relational.java b/src/main/java/me/clip/placeholderapi/expansion/Relational.java index ca80f6e..6d05e94 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Relational.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Relational.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/Taskable.java b/src/main/java/me/clip/placeholderapi/expansion/Taskable.java index f32a6a9..fa0ac21 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Taskable.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Taskable.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/Version.java b/src/main/java/me/clip/placeholderapi/expansion/Version.java index e789243..0ba9029 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/Version.java +++ b/src/main/java/me/clip/placeholderapi/expansion/Version.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/VersionSpecific.java b/src/main/java/me/clip/placeholderapi/expansion/VersionSpecific.java index 84d28ba..7c91500 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/VersionSpecific.java +++ b/src/main/java/me/clip/placeholderapi/expansion/VersionSpecific.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/cloud/CloudExpansion.java b/src/main/java/me/clip/placeholderapi/expansion/cloud/CloudExpansion.java index b6516b9..b9e9566 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/cloud/CloudExpansion.java +++ b/src/main/java/me/clip/placeholderapi/expansion/cloud/CloudExpansion.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/CloudExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/CloudExpansionManager.java index 36603e9..c79ee11 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/CloudExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/CloudExpansionManager.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index 2557ae2..872215c 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -46,18 +46,25 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Unmodifiable; import java.io.File; +import java.lang.reflect.Modifier; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; +import java.util.stream.Collectors; public final class LocalExpansionManager implements Listener { @NotNull private static final String EXPANSIONS_FOLDER_NAME = "expansions"; + @NotNull + private static final Set ABSTRACT_EXPANSION_METHODS = Arrays.stream(PlaceholderExpansion.class.getDeclaredMethods()) + .filter(method -> Modifier.isAbstract(method.getModifiers())) + .map(method -> new MethodSignature(method.getName(), method.getParameterTypes())) + .collect(Collectors.toSet()); @NotNull private final File folder; @@ -153,20 +160,33 @@ public final class LocalExpansionManager implements Listener { @NotNull final Class clazz) { try { final PlaceholderExpansion expansion = createExpansionInstance(clazz); - if (expansion == null || !expansion.register()) { + + Objects.requireNonNull(expansion.getAuthor(), "The expansion author is null!"); + Objects.requireNonNull(expansion.getIdentifier(), "The expansion identifier is null!"); + Objects.requireNonNull(expansion.getVersion(), "The expansion version is null!"); + + if (!expansion.register()) { return Optional.empty(); } return Optional.of(expansion); - } catch (final LinkageError ex) { - plugin.getLogger().severe("Failed to load Expansion class " + clazz.getSimpleName() + - " (Is a dependency missing?)"); - plugin.getLogger().severe("Cause: " + ex.getClass().getSimpleName() + " " + ex.getMessage()); + } catch (LinkageError | NullPointerException ex) { + final String reason; + + if (ex instanceof LinkageError) { + reason = " (Is a dependency missing?)"; + } else { + reason = " - One of its properties is null which is not allowed!"; + } + + plugin.getLogger().severe("Failed to load expansion class " + clazz.getSimpleName() + + reason); + plugin.getLogger().log(Level.SEVERE, "", ex); } return Optional.empty(); } - + @ApiStatus.Internal public boolean register(@NotNull final PlaceholderExpansion expansion) { final String identifier = expansion.getIdentifier().toLowerCase(); @@ -341,6 +361,16 @@ public final class LocalExpansionManager implements Listener { if (expansionClass == null) { plugin.getLogger().severe("Failed to load Expansion: " + file.getName() + ", as it does not have" + " a class which extends PlaceholderExpansion."); + return null; + } + + Set expansionMethods = Arrays.stream(expansionClass.getDeclaredMethods()) + .map(method -> new MethodSignature(method.getName(), method.getParameterTypes())) + .collect(Collectors.toSet()); + if (!expansionMethods.containsAll(ABSTRACT_EXPANSION_METHODS)) { + plugin.getLogger().severe("Failed to load Expansion: " + file.getName() + ", as it does not have the" + + " required methods declared for a PlaceholderExpansion."); + return null; } return expansionClass; @@ -365,8 +395,8 @@ public final class LocalExpansionManager implements Listener { if (ex.getCause() instanceof LinkageError) { throw ((LinkageError) ex.getCause()); } - - plugin.getLogger().warning("There was an issue with loading an expansion"); + + plugin.getLogger().warning("There was an issue with loading an expansion."); return null; } diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/MethodSignature.java b/src/main/java/me/clip/placeholderapi/expansion/manager/MethodSignature.java new file mode 100644 index 0000000..8a7d735 --- /dev/null +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/MethodSignature.java @@ -0,0 +1,37 @@ +package me.clip.placeholderapi.expansion.manager; + +import java.util.Arrays; +import java.util.Objects; + +public final class MethodSignature { + private final String name; + private final Class[] params; + + protected MethodSignature(String name, Class[] params) { + this.name = name; + this.params = params; + } + + public String getName() { + return name; + } + + public Class[] getParams() { + return params; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MethodSignature that = (MethodSignature) o; + return Objects.equals(name, that.name) && Arrays.equals(params, that.params); + } + + @Override + public int hashCode() { + int result = Objects.hash(name); + result = 31 * result + Arrays.hashCode(params); + return result; + } +} diff --git a/src/main/java/me/clip/placeholderapi/libs/JSONMessage.java b/src/main/java/me/clip/placeholderapi/libs/JSONMessage.java deleted file mode 100644 index b07a31c..0000000 --- a/src/main/java/me/clip/placeholderapi/libs/JSONMessage.java +++ /dev/null @@ -1,1120 +0,0 @@ -/* - * Copyright (c) 2018-2020 Peter Blood - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package me.clip.placeholderapi.libs; - -import com.google.common.base.Strings; -import com.google.common.collect.BiMap; -import com.google.common.collect.ImmutableBiMap; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.UUID; -import java.util.Vector; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; - -/** - * This is a complete JSON message builder class. To create a new JSONMessage do {@link - * #create(String)} - * - * @author Rayzr - */ -@SuppressWarnings({"WeakerAccess", "unused"}) -public class JSONMessage { - - private static final BiMap stylesToNames; - - static { - ImmutableBiMap.Builder builder = ImmutableBiMap.builder(); - for (final ChatColor style : ChatColor.values()) { - if (!style.isFormat()) { - continue; - } - - String styleName; - switch (style) { - case MAGIC: - styleName = "obfuscated"; - break; - case UNDERLINE: - styleName = "underlined"; - break; - default: - styleName = style.name().toLowerCase(); - break; - } - - builder.put(style, styleName); - } - stylesToNames = builder.build(); - } - - - private final List parts = new ArrayList<>(); - private int centeringStartIndex = -1; - - /** - * Creates a new {@link JSONMessage} object - * - * @param text The text to start with - */ - private JSONMessage(String text) { - parts.add(new MessagePart(text)); - } - - /** - * Creates a new {@link JSONMessage} object - * - * @param text The text to start with - * @return A new {@link JSONMessage} object - */ - public static JSONMessage create(String text) { - return new JSONMessage(text); - } - - /** - * Creates a new {@link JSONMessage} object - * - * @return A new {@link JSONMessage} object - */ - public static JSONMessage create() { - return create(""); - } - - /** - * Sends an action bar message - * - * @param message The message to send - * @param players The players you want to send it to - */ - public static void actionbar(String message, Player... players) { - ReflectionHelper.sendPacket(ReflectionHelper - .createActionbarPacket(ChatColor.translateAlternateColorCodes('&', message)), players); - } - - /** - * @return The latest {@link MessagePart} - * @throws ArrayIndexOutOfBoundsException If {@code parts.size() <= 0}. - */ - public MessagePart last() { - if (parts.size() <= 0) { - throw new ArrayIndexOutOfBoundsException("No MessageParts exist!"); - } - return parts.get(parts.size() - 1); - } - - /** - * Converts this {@link JSONMessage} instance to actual JSON - * - * @return The JSON representation of this {@link JSONMessage} - */ - public JsonObject toJSON() { - JsonObject obj = new JsonObject(); - - obj.addProperty("text", ""); - - JsonArray array = new JsonArray(); - - parts.stream() - .map(MessagePart::toJSON) - .forEach(array::add); - - obj.add("extra", array); - - return obj; - } - - /** - * Converts this {@link JSONMessage} object to a String representation of the JSON. This is an - * alias of {@code toJSON().toString()}. - */ - @Override - public String toString() { - return toJSON().toString(); - } - - /** - * Converts this {@link JSONMessage} object to the legacy formatting system, which uses formatting - * codes (like &6, &l, &4, etc.) - * - * @return This {@link JSONMessage} instance {@link JSONMessage} in legacy format - */ - public String toLegacy() { - StringBuilder output = new StringBuilder(); - - parts.stream() - .map(MessagePart::toLegacy) - .forEach(output::append); - - return output.toString(); - } - - /** - * Sends this {@link JSONMessage} to all the players specified - * - * @param players The players you want to send this to - */ - public void send(Player... players) { - if (ReflectionHelper.MAJOR_VER >= 16) { -// ReflectionHelper.sendTextPacket(toString(), players); -// return; - } - - ReflectionHelper.sendPacket(ReflectionHelper.createTextPacket(toString()), players); - } - - /** - * Sends this as a title to all the players specified - * - * @param fadeIn How many ticks to fade in - * @param stay How many ticks to stay - * @param fadeOut How many ticks to fade out - * @param players The players to send this to - */ - public void title(int fadeIn, int stay, int fadeOut, Player... players) { - ReflectionHelper - .sendPacket(ReflectionHelper.createTitleTimesPacket(fadeIn, stay, fadeOut), players); - ReflectionHelper.sendPacket(ReflectionHelper.createTitlePacket(toString()), players); - } - - /** - * Sends this as a subtitle to all the players specified. Must be used after sending a {@link - * #title(int, int, int, Player...) title}. - * - * @param players The players to send this to - */ - public void subtitle(Player... players) { - ReflectionHelper.sendPacket(ReflectionHelper.createSubtitlePacket(toString()), players); - } - - /** - * Sends an action bar message - * - * @param players The players you want to send this to - */ - public void actionbar(Player... players) { - actionbar(toLegacy(), players); - } - - /** - * Sets the color of the current message part. - * - * @param color The color to set - * @return This {@link JSONMessage} instance - */ - public JSONMessage color(ChatColor color) { - if (!color.isColor()) { - throw new IllegalArgumentException(color.name() + " is not a color."); - } - - last().setColor(color); - return this; - } - - /** - * Sets the color of the current message part. - *
If the provided color is a hex color ({@code #rrggbb}) but the major version of MC is older - * than 1.16 will this - * default to the color WHITE. - * - * @param color The color to set - * @return This {@link JSONMessage} instance - */ - public JSONMessage color(String color) { - return color(color, ChatColor.WHITE); - } - - /** - * Sets the color of the current message part. - *
If the provided color is a hex color ({@code #rrggbb}) but the major version of MC is older - * than 1.16 will the provided - * default ChatColor be used instead. - * - * @param color The color to set - * @param def The default ChatColor to use, when MC version is older than 1.16 - * @return This {@link JSONMessage} instance - */ - public JSONMessage color(String color, ChatColor def) { - if (color.startsWith("#") && ReflectionHelper.MAJOR_VER < 16) { - return color(def); - } - - last().setColor(color); - return this; - } - - /** - * Sets the font of the current message part. - *
When this is used on versions older than 1.16 will this do nothing. - * - * @param font The font to set - * @return This {@link JSONMessage} instance - */ - public JSONMessage font(String font) { - if (ReflectionHelper.MAJOR_VER < 16) { - return this; - } - - last().setFont(font); - return this; - } - - /** - * Adds a style to the current message part. - * - * @param style The style to add - * @return This {@link JSONMessage} instance - */ - public JSONMessage style(ChatColor style) { - last().addStyle(style); - return this; - } - - /** - * Makes the text run a command. - * - * @param command The command to run - * @return This {@link JSONMessage} instance - */ - public JSONMessage runCommand(String command) { - last().setOnClick(ClickEvent.runCommand(command)); - return this; - } - - /** - * Makes the text suggest a command. - * - * @param command The command to suggest - * @return This {@link JSONMessage} instance - */ - public JSONMessage suggestCommand(String command) { - last().setOnClick(ClickEvent.suggestCommand(command)); - return this; - } - - /** - * Opens a URL. - * - * @param url The url to open - * @return This {@link JSONMessage} instance - */ - public JSONMessage openURL(String url) { - last().setOnClick(ClickEvent.openURL(url)); - return this; - } - - /** - * Copies the provided text to the Clipboard of the player. - *
When this is used on versions older than 1.15 will this default to {@link - * #suggestCommand(String) suggestCommand(String)}. - * - * @param text The text to copy - * @return This {@link JSONMessage} instance - */ - public JSONMessage copyText(String text) { - last().setOnClick(ClickEvent.copyText(text)); - return this; - } - - /** - * Changes the page of a book. Using this in a non-book context is useless and will probably - * error. - * - * @param page The page to change to - * @return This {@link JSONMessage} instance - */ - public JSONMessage changePage(int page) { - last().setOnClick(ClickEvent.changePage(page)); - return this; - } - - /** - * Shows text when you hover over it - * - * @param text The text to show - * @return This {@link JSONMessage} instance - */ - public JSONMessage tooltip(String text) { - last().setOnHover(HoverEvent.showText(text)); - return this; - } - - /** - * Shows text when you hover over it - * - * @param message The text to show - * @return This {@link JSONMessage} instance - */ - public JSONMessage tooltip(JSONMessage message) { - last().setOnHover(HoverEvent.showText(message)); - return this; - } - - /** - * Shows an achievement when you hover over it - * - * @param id The id of the achievement - * @return This {@link JSONMessage} instance - */ - public JSONMessage achievement(String id) { - last().setOnHover(HoverEvent.showAchievement(id)); - return this; - } - - /** - * Adds another part to this {@link JSONMessage} - * - * @param text The text to start the next {@link MessagePart} with - * @return This {@link JSONMessage} instance - */ - public JSONMessage then(String text) { - return then(new MessagePart(text)); - } - - /** - * Adds another part to this {@link JSONMessage} - * - * @param nextPart The next {@link MessagePart} - * @return This {@link JSONMessage} instance - */ - public JSONMessage then(MessagePart nextPart) { - parts.add(nextPart); - return this; - } - - /** - * Adds a horizontal bar to the message of the given length - * - * @param length The length of the horizontal bar - * @return This {@link JSONMessage} instance - */ - public JSONMessage bar(int length) { - return then(Strings.repeat("-", length)).color(ChatColor.DARK_GRAY) - .style(ChatColor.STRIKETHROUGH); - } - - /** - * Adds a horizontal bar to the message that's 53 characters long. This is the default width of - * the player's chat window. - * - * @return This {@link JSONMessage} instance - */ - public JSONMessage bar() { - return bar(53); - } - - /** - * Adds a blank line to the message - * - * @return This {@link JSONMessage} instance - */ - public JSONMessage newline() { - return then("\n"); - } - - /** - * Sets the starting point to begin centering JSONMessages. - * - * @return This {@link JSONMessage} instance - */ - public JSONMessage beginCenter() { - // Start with the NEXT message part. - centeringStartIndex = parts.size(); - return this; - } - - /** - * Ends the centering of the JSONMessage text. - * - * @return This {@link JSONMessage} instance - */ - public JSONMessage endCenter() { - int current = centeringStartIndex; - - while (current < parts.size()) { - Vector currentLine = new Vector<>(); - int totalLineLength = 0; - - for (; ; current++) { - MessagePart part = current < parts.size() ? parts.get(current) : null; - String raw = part == null ? null : ChatColor.stripColor(part.toLegacy()); - int rawLength = raw == null ? 0 : raw.length(); - - if (current >= parts.size() || totalLineLength + rawLength >= 53) { - int padding = Math.max(0, (53 - totalLineLength) / 2); - currentLine.firstElement() - .setText(Strings.repeat(" ", padding) + currentLine.firstElement().getText()); - currentLine.lastElement().setText(currentLine.lastElement().getText() + "\n"); - currentLine.clear(); - break; - } - - totalLineLength += rawLength; - currentLine.add(part); - } - } - - MessagePart last = parts.get(parts.size() - 1); - last.setText(last.getText().substring(0, last.getText().length() - 1)); - - centeringStartIndex = -1; - - return this; - } - - /////////////////////////// - // BEGIN UTILITY CLASSES // - /////////////////////////// - - /** - * Represents the JSON format that all click/hover events in JSON messages must follow. - *
- *
- * Reference - * - * @author Rayzr - */ - public static class MessageEvent { - - private String action; - private Object value; - - public MessageEvent(String action, Object value) { - this.action = action; - this.value = value; - } - - /** - * @return A {@link JsonObject} representing the properties of this {@link MessageEvent} - */ - public JsonObject toJSON() { - JsonObject obj = new JsonObject(); - obj.addProperty("action", action); - /* - * MC 1.16 changed "value" to "contents", but only for Hover events... Don't ask why. - * Since this lib only has tooltip and achievement can we simply check if action starts with "show_" - */ - String valueType = - (ReflectionHelper.MAJOR_VER >= 16 && action.startsWith("show_")) ? "contents" : "value"; - - if (value instanceof JsonElement) { - obj.add(valueType, (JsonElement) value); - } else { - obj.addProperty(valueType, value.toString()); - } - return obj; - } - - /** - * @return The action - */ - public String getAction() { - return action; - } - - /** - * @param action The action to set - */ - public void setAction(String action) { - this.action = action; - } - - /** - * @return The value - */ - public Object getValue() { - return value; - } - - /** - * @param value The value to set - */ - public void setValue(Object value) { - this.value = value; - } - - } - - public static class ClickEvent { - - /** - * Runs a command. - * - * @param command The command to run - * @return The {@link MessageEvent} - */ - public static MessageEvent runCommand(String command) { - return new MessageEvent("run_command", command); - } - - /** - * Suggests a command by inserting it in chat. - * - * @param command The command to suggest - * @return The {@link MessageEvent} - */ - public static MessageEvent suggestCommand(String command) { - return new MessageEvent("suggest_command", command); - } - - /** - * Requires web links to be enabled on the client. - * - * @param url The url to open - * @return The {@link MessageEvent} - */ - public static MessageEvent openURL(String url) { - return new MessageEvent("open_url", url); - } - - /** - * Only used with written books. - * - * @param page The page to switch to - * @return The {@link MessageEvent} - */ - public static MessageEvent changePage(int page) { - return new MessageEvent("change_page", page); - } - - /** - * Copies the provided text to the clipboard of the player. - *
When used on versions older than 1.15 will this {@link #suggestCommand(String) suggest - * the text} instead. - * - * @param text The text to copy. - * @return The {@link MessageEvent} - */ - public static MessageEvent copyText(String text) { - if (ReflectionHelper.MAJOR_VER < 15) { - return suggestCommand(text); - } - - return new MessageEvent("copy_to_clipboard", text); - } - - } - - public static class HoverEvent { - - /** - * Shows text when you hover over it - * - * @param text The text to show - * @return The {@link MessageEvent} - */ - public static MessageEvent showText(String text) { - return new MessageEvent("show_text", text); - } - - /** - * Shows text when you hover over it - * - * @param message The {@link JSONMessage} to show - * @return The {@link MessageEvent} - */ - public static MessageEvent showText(JSONMessage message) { - JsonArray arr = new JsonArray(); - arr.add(new JsonPrimitive("")); - arr.add(message.toJSON()); - return new MessageEvent("show_text", arr); - } - - /** - * Shows an achievement when you hover over it - * - * @param id The id of the achievement - * @return The {@link MessageEvent} - */ - public static MessageEvent showAchievement(String id) { - return new MessageEvent("show_achievement", id); - } - - } - - private static class ReflectionHelper { - - private static final String version; - private static Constructor chatComponentText; - - private static Class packetPlayOutChat; - private static Field packetPlayOutChatComponent; - private static Field packetPlayOutChatMessageType; - private static Field packetPlayOutChatUuid; - private static Object enumChatMessageTypeMessage; - private static Object enumChatMessageTypeActionbar; - - private static Constructor titlePacketConstructor; - private static Constructor titleTimesPacketConstructor; - private static Object enumActionTitle; - private static Object enumActionSubtitle; - - private static Field connection; - private static MethodHandle GET_HANDLE; - private static MethodHandle SEND_PACKET; - private static MethodHandle STRING_TO_CHAT; - private static boolean SETUP; - private static int MAJOR_VER = -1; - - static { - String[] split = Bukkit.getServer().getClass().getPackage().getName().split("\\."); - version = split[split.length - 1]; - - try { - MAJOR_VER = Integer.parseInt(version.split("_")[1]); - - final Class craftPlayer = getClass("{obc}.entity.CraftPlayer"); - Method getHandle = craftPlayer.getMethod("getHandle"); - connection = getHandle.getReturnType().getField("playerConnection"); - Method sendPacket = connection.getType().getMethod("sendPacket", getClass("{nms}.Packet")); - - chatComponentText = getClass("{nms}.ChatComponentText").getConstructor(String.class); - - final Class iChatBaseComponent = getClass("{nms}.IChatBaseComponent"); - - Method stringToChat; - - if (MAJOR_VER < 8) { - stringToChat = getClass("{nms}.ChatSerializer").getMethod("a", String.class); - } else { - stringToChat = getClass("{nms}.IChatBaseComponent$ChatSerializer") - .getMethod("a", String.class); - } - - GET_HANDLE = MethodHandles.lookup().unreflect(getHandle); - SEND_PACKET = MethodHandles.lookup().unreflect(sendPacket); - STRING_TO_CHAT = MethodHandles.lookup().unreflect(stringToChat); - - packetPlayOutChat = getClass("{nms}.PacketPlayOutChat"); - packetPlayOutChatComponent = getField(packetPlayOutChat, "a"); - packetPlayOutChatMessageType = getField(packetPlayOutChat, "b"); - packetPlayOutChatUuid = MAJOR_VER >= 16 ? getField(packetPlayOutChat, "c") : null; - - Class packetPlayOutTitle = getClass("{nms}.PacketPlayOutTitle"); - Class titleAction = getClass("{nms}.PacketPlayOutTitle$EnumTitleAction"); - - titlePacketConstructor = packetPlayOutTitle.getConstructor(titleAction, iChatBaseComponent); - titleTimesPacketConstructor = packetPlayOutTitle - .getConstructor(int.class, int.class, int.class); - - enumActionTitle = titleAction.getField("TITLE").get(null); - enumActionSubtitle = titleAction.getField("SUBTITLE").get(null); - - if (MAJOR_VER >= 12) { - Method getChatMessageType = getClass("{nms}.ChatMessageType").getMethod("a", byte.class); - - enumChatMessageTypeMessage = getChatMessageType.invoke(null, (byte) 1); - enumChatMessageTypeActionbar = getChatMessageType.invoke(null, (byte) 2); - } - - SETUP = true; - } catch (Exception e) { - e.printStackTrace(); - SETUP = false; - } - } - - static void sendPacket(Object packet, Player... players) { - assertIsSetup(); - - if (packet == null) { - return; - } - - for (Player player : players) { - try { - SEND_PACKET.bindTo(connection.get(GET_HANDLE.bindTo(player).invoke())).invoke(packet); - } catch (Throwable e) { - System.err.println("Failed to send packet"); - e.printStackTrace(); - } - } - - } - - static Object createActionbarPacket(String message) { - assertIsSetup(); - - Object packet = createTextPacket(message); - setType(packet, (byte) 2); - return packet; - } - - static Object createTextPacket(String message) { - assertIsSetup(); - - try { - Object packet = packetPlayOutChat.newInstance(); - setFieldValue(packetPlayOutChatComponent, packet, fromJson(message)); - setFieldValue(packetPlayOutChatUuid, packet, UUID.randomUUID()); - setType(packet, (byte) 1); - return packet; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - static Object createTitlePacket(String message) { - assertIsSetup(); - - try { - return titlePacketConstructor.newInstance(enumActionTitle, fromJson(message)); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - static Object createTitleTimesPacket(int fadeIn, int stay, int fadeOut) { - assertIsSetup(); - - try { - return titleTimesPacketConstructor.newInstance(fadeIn, stay, fadeOut); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - static Object createSubtitlePacket(String message) { - assertIsSetup(); - - try { - return titlePacketConstructor.newInstance(enumActionSubtitle, fromJson(message)); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - private static void setType(Object chatPacket, byte type) { - assertIsSetup(); - - if (MAJOR_VER < 12) { - setFieldValue(packetPlayOutChatMessageType, chatPacket, type); - return; - } - - switch (type) { - case 1: - setFieldValue(packetPlayOutChatMessageType, chatPacket, enumChatMessageTypeMessage); - break; - case 2: - setFieldValue(packetPlayOutChatMessageType, chatPacket, enumChatMessageTypeActionbar); - break; - default: - throw new IllegalArgumentException("type must be 1 or 2"); - } - } - - /** - * Creates a ChatComponentText from plain text - * - * @param message The text to convert to a chat component - * @return The chat component - */ - static Object componentText(String message) { - assertIsSetup(); - - try { - return chatComponentText.newInstance(message); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - } - - /** - * Attempts to convert a String representing a JSON message into a usable object - * - * @param json The JSON to attempt to parse - * @return The object representing the text in JSON form, or null if something went - * wrong converting the String to JSON data - */ - static Object fromJson(String json) { - assertIsSetup(); - - if (!json.trim().startsWith("{")) { - return componentText(json); - } - - try { - return STRING_TO_CHAT.invoke(json); - } catch (Throwable e) { - e.printStackTrace(); - return null; - } - } - - private static void assertIsSetup() { - if (!SETUP) { - throw new IllegalStateException("JSONMessage.ReflectionHelper is not set up yet!"); - } - } - - private static Class getClass(String path) throws ClassNotFoundException { - return Class.forName(path.replace("{nms}", "net.minecraft.server." + version) - .replace("{obc}", "org.bukkit.craftbukkit." + version)); - } - - private static void setFieldValue(Field field, Object instance, Object value) { - if (field == null) { - // useful for fields that might not exist - return; - } - - try { - field.set(instance, value); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - private static Field getField(Class classObject, String fieldName) { - try { - Field field = classObject.getDeclaredField(fieldName); - field.setAccessible(true); - return field; - } catch (NoSuchFieldException e) { - e.printStackTrace(); - return null; - } - } - - private static int getVersion() { - return MAJOR_VER; - } - } - - /** - * Defines a section of the message, and represents the format that all JSON messages must follow - * in Minecraft. - *
- *
- * Reference - * - * @author Rayzr - */ - public static class MessagePart { - - private final List styles = new ArrayList<>(); - private MessageEvent onClick; - private MessageEvent onHover; - private String color; - private ChatColor legacyColor; - private String font; - private String text; - - public MessagePart(String text) { - this.text = text == null ? "null" : text; - } - - /** - * Converts this {@link MessagePart} into a {@link JsonObject} - * - * @return The Minecraft-compatible {@link JsonObject} - */ - public JsonObject toJSON() { - Objects.requireNonNull(text); - - JsonObject obj = new JsonObject(); - obj.addProperty("text", text); - - if (color != null && !color.isEmpty()) { - obj.addProperty("color", color.toLowerCase()); - } - - for (ChatColor style : styles) { - obj.addProperty(stylesToNames.get(style), true); - } - - if (onClick != null) { - obj.add("clickEvent", onClick.toJSON()); - } - - if (onHover != null) { - obj.add("hoverEvent", onHover.toJSON()); - } - - if (font != null) { - obj.addProperty("font", font); - } - - return obj; - - } - - /** - * @return This {@link MessagePart} in legacy-style color/formatting codes - */ - public String toLegacy() { - StringBuilder output = new StringBuilder(); - ChatColor legacyColor = getColor(); - - if (legacyColor != null) { - output.append(legacyColor); - } - - styles.stream() - .map(ChatColor::toString) - .forEach(output::append); - - return output.append(text).toString(); - } - - /** - * @return The click event bound - */ - public MessageEvent getOnClick() { - return onClick; - } - - /** - * @param onClick The new click event to bind - */ - public void setOnClick(MessageEvent onClick) { - this.onClick = onClick; - } - - /** - * @return The hover event bound - */ - public MessageEvent getOnHover() { - return onHover; - } - - /** - * @param onHover The new hover event to bind - */ - public void setOnHover(MessageEvent onHover) { - this.onHover = onHover; - } - - /** - * @return The color - */ - public String getColorValue() { - return color; - } - - /** - * @return The color - * @deprecated Use {@link #getColorValue()} instead - */ - @Deprecated - public ChatColor getColor() { - if (legacyColor != null) { - return legacyColor; - } - - if (this.color.startsWith("#") && ReflectionHelper.MAJOR_VER < 16) { - throw new IllegalStateException( - "Custom Hex colors can only be used in Minecraft 1.16 or newer!"); - } - - try { - return ChatColor.valueOf(this.color.toUpperCase()); - } catch (Exception ex) { - return null; - } - } - - /** - * @param color The color to set - * @deprecated Use {@link #setColor(String)} instead - */ - @Deprecated - public void setColor(ChatColor color) { - setColor(color == null ? null : color.name().toLowerCase()); - setLegacyColor(color); - } - - /** - * @param color The color to set - */ - public void setColor(String color) { - if (color != null && color.isEmpty()) { - throw new IllegalArgumentException("Color cannot be null!"); - } - this.color = color; - } - - /** - * @param color The legacy ChatColor to set - * @deprecated Use {@link #setColor(String)} instead - */ - @Deprecated - public void setLegacyColor(ChatColor color) { - legacyColor = color; - } - - /** - * @return The list of styles - */ - public List getStyles() { - return styles; - } - - /** - * @param style The new style to add - */ - public void addStyle(ChatColor style) { - if (style == null) { - throw new IllegalArgumentException("Style cannot be null!"); - } - if (!style.isFormat()) { - throw new IllegalArgumentException(style.name() + " is not a style!"); - } - styles.add(style); - } - - /** - * @return The font used - */ - public String getFont() { - return font; - } - - /** - * @param font The font to use - */ - public void setFont(String font) { - this.font = font; - } - - /** - * @return The raw text - */ - public String getText() { - return text; - } - - /** - * @param text The raw text to set - */ - public void setText(String text) { - this.text = text; - } - - } -} \ No newline at end of file diff --git a/src/main/java/me/clip/placeholderapi/listeners/ServerLoadEventListener.java b/src/main/java/me/clip/placeholderapi/listeners/ServerLoadEventListener.java index b76d2ef..f7141d8 100644 --- a/src/main/java/me/clip/placeholderapi/listeners/ServerLoadEventListener.java +++ b/src/main/java/me/clip/placeholderapi/listeners/ServerLoadEventListener.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java index 98ff409..0b3bb0c 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -49,7 +49,7 @@ public final class CharsReplacer implements Replacer { for (int i = 0; i < chars.length; i++) { final char l = chars[i]; - + if (l == '&' && ++i < chars.length) { final char c = Character.toLowerCase(chars[i]); diff --git a/src/main/java/me/clip/placeholderapi/replacer/RegexReplacer.java b/src/main/java/me/clip/placeholderapi/replacer/RegexReplacer.java index 3e3bee5..8eccfbe 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/RegexReplacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/RegexReplacer.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/replacer/Replacer.java b/src/main/java/me/clip/placeholderapi/replacer/Replacer.java index d25402e..339088f 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/Replacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/Replacer.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java b/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java index 206dcd1..2163be2 100644 --- a/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java +++ b/src/main/java/me/clip/placeholderapi/updatechecker/UpdateChecker.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -23,6 +23,7 @@ package me.clip.placeholderapi.updatechecker; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; +import java.util.Arrays; import javax.net.ssl.HttpsURLConnection; import me.clip.placeholderapi.PlaceholderAPIPlugin; import me.clip.placeholderapi.util.Msg; @@ -90,17 +91,24 @@ public class UpdateChecker implements Listener { return false; } - String plV = toReadable(pluginVersion); - String spV = toReadable(spigotVersion); - return plV.compareTo(spV) < 0; + int[] plV = toReadable(pluginVersion); + int[] spV = toReadable(spigotVersion); + + if (plV[0] < spV[0]) { + return true; + } else if ((plV[1] < spV[1])) { + return true; + } else { + return plV[2] < spV[2]; + } } - private String toReadable(String version) { - if (version.contains("-DEV-")) { - version = version.split("-DEV-")[0]; + private int[] toReadable(String version) { + if (version.contains("-DEV")) { + version = version.split("-DEV")[0]; } - return version.replaceAll("\\.", ""); + return Arrays.stream(version.split("\\.")).mapToInt(Integer::parseInt).toArray(); } @EventHandler(priority = EventPriority.MONITOR) diff --git a/src/main/java/me/clip/placeholderapi/util/FileUtil.java b/src/main/java/me/clip/placeholderapi/util/FileUtil.java index 7e20de1..825ff54 100644 --- a/src/main/java/me/clip/placeholderapi/util/FileUtil.java +++ b/src/main/java/me/clip/placeholderapi/util/FileUtil.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -42,13 +42,11 @@ public class FileUtil { } final URL jar = file.toURI().toURL(); - + final URLClassLoader loader = new URLClassLoader(new URL[]{jar}, clazz.getClassLoader()); final List matches = new ArrayList<>(); final List> classes = new ArrayList<>(); - try (final JarInputStream stream = new JarInputStream( - jar.openStream()); final URLClassLoader loader = new URLClassLoader(new URL[]{jar}, - clazz.getClassLoader())) { + try (final JarInputStream stream = new JarInputStream(jar.openStream())) { JarEntry entry; while ((entry = stream.getNextJarEntry()) != null) { final String name = entry.getName(); @@ -69,8 +67,11 @@ public class FileUtil { } } } - - return classes.isEmpty() ? null : classes.get(0); + if (classes.isEmpty()) { + loader.close(); + return null; + } + return classes.get(0); } } diff --git a/src/main/java/me/clip/placeholderapi/util/Format.java b/src/main/java/me/clip/placeholderapi/util/Format.java index 1d959c2..1167375 100644 --- a/src/main/java/me/clip/placeholderapi/util/Format.java +++ b/src/main/java/me/clip/placeholderapi/util/Format.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/util/Futures.java b/src/main/java/me/clip/placeholderapi/util/Futures.java index 01a3586..8f07e32 100644 --- a/src/main/java/me/clip/placeholderapi/util/Futures.java +++ b/src/main/java/me/clip/placeholderapi/util/Futures.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/util/Msg.java b/src/main/java/me/clip/placeholderapi/util/Msg.java index 702b251..31aa49f 100644 --- a/src/main/java/me/clip/placeholderapi/util/Msg.java +++ b/src/main/java/me/clip/placeholderapi/util/Msg.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/util/TimeFormat.java b/src/main/java/me/clip/placeholderapi/util/TimeFormat.java index e0b9717..9558daa 100644 --- a/src/main/java/me/clip/placeholderapi/util/TimeFormat.java +++ b/src/main/java/me/clip/placeholderapi/util/TimeFormat.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/main/java/me/clip/placeholderapi/util/TimeUtil.java b/src/main/java/me/clip/placeholderapi/util/TimeUtil.java index 33b14fc..85e07df 100644 --- a/src/main/java/me/clip/placeholderapi/util/TimeUtil.java +++ b/src/main/java/me/clip/placeholderapi/util/TimeUtil.java @@ -2,9 +2,9 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * - * PlaceholderAPI free software: you can redistribute it and/or modify + * PlaceholderAPI is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. diff --git a/src/test/java/me/clip/placeholderapi/Values.java b/src/test/java/me/clip/placeholderapi/Values.java index 73d26bc..da23a34 100644 --- a/src/test/java/me/clip/placeholderapi/Values.java +++ b/src/test/java/me/clip/placeholderapi/Values.java @@ -2,7 +2,7 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * * PlaceholderAPI free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test/java/me/clip/placeholderapi/replacer/ReplacerBenchmarks.java b/src/test/java/me/clip/placeholderapi/replacer/ReplacerBenchmarks.java index 2afc016..cec02bf 100644 --- a/src/test/java/me/clip/placeholderapi/replacer/ReplacerBenchmarks.java +++ b/src/test/java/me/clip/placeholderapi/replacer/ReplacerBenchmarks.java @@ -2,7 +2,7 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * * PlaceholderAPI free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java b/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java index 09524f3..7ff36bc 100644 --- a/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java +++ b/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java @@ -2,7 +2,7 @@ * This file is part of PlaceholderAPI * * PlaceholderAPI - * Copyright (c) 2015 - 2020 PlaceholderAPI Team + * Copyright (c) 2015 - 2021 PlaceholderAPI Team * * PlaceholderAPI free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From f7dc1848999be89d78addd70676a3e88f0693e22 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 9 Sep 2021 18:32:37 +0200 Subject: [PATCH 78/86] Update label-commenter-config.yml --- .github/label-commenter-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/label-commenter-config.yml b/.github/label-commenter-config.yml index 4b3c23b..03fe45e 100644 --- a/.github/label-commenter-config.yml +++ b/.github/label-commenter-config.yml @@ -86,7 +86,7 @@ labels: We would like to inform you, that you are now able to directly commit your changes to the wiki through a Pull request. When doing so, make sure you follow these steps: - - The Pull request targets the [`docs/wiki`](https://github.com/PlaceholderAPI/PlaceholderAPI/tree/docs/wiki) branch of the Repository. + - The Pull request is based on AND targets the [`docs/wiki`](https://github.com/PlaceholderAPI/PlaceholderAPI/tree/docs/wiki) branch of the Repository. - You only made changes to the files inside the [`wiki`](https://github.com/PlaceholderAPI/PlaceholderAPI/tree/docs/wiki/wiki) folder. - You followed the general Styling Guidelines mentioned in the wiki's [README](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/docs/wiki/wiki/README.md) file. From 7b5ceb520fed585c519f70e00b2bdd9dc8f759cd Mon Sep 17 00:00:00 2001 From: ThisKarolGajda <78842362+ThisKarolGajda@users.noreply.github.com> Date: Fri, 10 Sep 2021 01:55:13 +0200 Subject: [PATCH 79/86] Update Placeholders.md - OpEconomy (#713) * Update Placeholders.md * Add OpEconomy to "Plugins using PlaceholderAPI" Co-authored-by: Andre_601 <11576465+Andre601@users.noreply.github.com> --- wiki/Placeholders.md | 19 +++++++++++++++++++ wiki/Plugins-using-PlaceholderAPI.md | 3 +++ 2 files changed, 22 insertions(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 099bb67..7a8064f 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -283,6 +283,7 @@ If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, th - ### **O** - **[OnePlayerSleep](#oneplayersleep)** - **[OnTime](#ontime)** + - **[OpEconomy](#opeconomy)** - **[OreAnnouncer](#oreannouncer)** - **[OreMarket](#oremarket)** - **[Outpost](#outpost)** @@ -3622,6 +3623,24 @@ Please see [this discussion][list] for a list of all expansions officially maint %ontime_time_played_week% %ontime_referrals_week% %ontime_votes_week% + + ``` +---- +- ### **[OpEconomy](https://www.spigotmc.org/resources/95674)** + > NO DOWNLOAD COMMAND + + [Description and usage for placeholders](https://github.com/ThisKarolGajda/OpEconomy/wiki/PlaceholderAPI) + + ``` + %opeconomy_money_% - Gets custom player money + %opeconomy_money% - Gets money + %opeconomy_baltop_number_% - Gets player's name + %opeconomy_baltop_player_position_% - Gets player's position + %opeconomy_currency% - Shows active currency + %opeconomy_is_active_code_% - Boolean, if code is active + %opeconomy_max_uses_code_% - Shows max uses for code + %opeconomy_uses_code_% - Shows uses for code + %opeconomy_reward_code_% - Shows reward for entering code ``` ---- diff --git a/wiki/Plugins-using-PlaceholderAPI.md b/wiki/Plugins-using-PlaceholderAPI.md index 857debf..a13eb9f 100644 --- a/wiki/Plugins-using-PlaceholderAPI.md +++ b/wiki/Plugins-using-PlaceholderAPI.md @@ -587,6 +587,9 @@ If your plugin isn't shown here and you want it to be added, [open an issue](/Pl - **[OnTime](http://dev.bukkit.org/bukkit-plugins/ontime/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#ontime]]**] +- **[OpEconomy](https://www.spigotmc.org/resources/95674)** + - [x] Supports placeholders. + - [x] Provides own placeholders. [**[[Link|Placeholders#opeconomy]]**] - **[OreAnnouncer](https://www.spigotmc.org/resources/33464/)** - [ ] Supports placeholders. - [x] Provides own placeholders. [**[[Link|Placeholders#oreannouncer]]**] From 04f2c85722d6db8605a80240e94e8eb9453fa057 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 10 Sep 2021 01:58:46 +0200 Subject: [PATCH 80/86] fix e-mail env --- .github/workflows/wiki.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 63abe4c..0320ed7 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -31,6 +31,6 @@ jobs: env: WIKI_DIR: wiki/ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_EMAIL: 'actions@github.com' + GH_MAIL: 'actions@github.com' GH_NAME: 'github-actions[bot]' EXCLUDED_FILES: 'README.md' From 66025a6a1c9206476fff65968c5a90e2f9fa5c9b Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 10 Sep 2021 02:02:53 +0200 Subject: [PATCH 81/86] Update PlaceholderExpansion.md --- wiki/PlaceholderExpansion.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wiki/PlaceholderExpansion.md b/wiki/PlaceholderExpansion.md index 984b071..2957f8e 100644 --- a/wiki/PlaceholderExpansion.md +++ b/wiki/PlaceholderExpansion.md @@ -60,10 +60,10 @@ Let's quickly break down the different methods you have to implement. - #### getAuthor This method allows you to set the name of the expansion's author. - #### getIdentifier - The name that should be used to identify the placeholders for this expansion. - The identifier is the string after the starting `%` and before the first `_` (`%identifier_values%`) and, therefore, cannot contain `_`, `%` or spaces. + The identifier is the part in the placeholder that is between the first `%` (Or `{` if bracket placeholders are used) and the first `_`. + Because of that can you not use `%`, `{`, `}` or `_` in youd identifier. - If you still want to use the previously mentioned symbols can you override the `getName()` method to change the Expansion's displayname. + If you still want to use those symbols can you override the `getName()` method to display a different name. - #### getVersion This is a string, which means it can contain more than just a number. This is used to determine if a new update is available or not when the expansion is shared on the eCloud. For expansions that are part of a plugin, this does not really matter. From 1b7fabf238d4e74b11fc9891d8889306dfc4a448 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 10 Sep 2021 03:23:11 +0200 Subject: [PATCH 82/86] Update Wiki Readme... a lot --- wiki/README.md | 218 +++++++++++++++++++++++++++++++------------------ 1 file changed, 139 insertions(+), 79 deletions(-) diff --git a/wiki/README.md b/wiki/README.md index cf7585c..56112e0 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -1,107 +1,167 @@ -[Wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki -[Placeholders]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders -[Plugins using PlaceholderAPI]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Plugins-using-PlaceholderAPI +[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki + +[placeholders]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders +[using_papi]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Plugins-using-PlaceholderAPI + +[discord]: https://discord.gg/HelpChat +[discussion]: https://github.com/PlaceholderAPI/PlaceholderAPI/discussions + +[andre]: https://github.com/Andre601 +[andrew]: https://github.com/Andrew-Chen-Wang +[action]: https://github.com/Andrew-Chen-Wang/github-wiki-action + + +[branch-selector]: https://user-images.githubusercontent.com/11576465/132779328-8571458a-d63d-4c25-b920-96aa16ae0058.png +[upstream_up-to-date]: https://user-images.githubusercontent.com/11576465/132779917-96f19239-077d-44ed-98e7-6a76f305b33a.png +[upstream_needs_update]: https://user-images.githubusercontent.com/11576465/132779798-1fe3dc72-a6c2-41eb-a8bc-95793671f384.png +[create_branch]: https://user-images.githubusercontent.com/11576465/132780127-45599156-1400-40c9-b865-351574786873.png # Wiki -This is the wiki folder. It contains all pages that you can find in our [Wiki]. -It allows you to suggest changes through Pull request while keeping a simple way for us to maintain the wiki, without granting everyone push rights to it. +Welcome to the Wiki folder! -If you want to contribute towards the wiki would we highly recommend to follow the below contributing Guidelines, to keep the overal style of the wiki intact. +This folder contains all the files of the [PlaceholderAPI Wiki][wiki]. +It allows you to contribute towards the wiki and us to have more control about what changes are commited to it. -## Target branch -The wiki is handled on a separate branch called `docs/wiki`. -When making a Pull request, make sure to target this specific branch. Any PR not targeting this branch may either be closed or the target changed. +## Contrbuting to the wiki +If you want to contribute towards the wiki, will you need to follow the below instructions to not get your Pull request closed without a warning. -## Adding your resource(s) -When you either have a plugin, which adds and/or uses placeholders or an expansion and you want to add it to the wiki should you follow the below steps. +### Fork the Repository (Not wiki!) +> Already having a fork? Skip to the [next Step](#select-target-branch)! -- [Plugins using PlaceholderAPI](#plugins-using-placeholderapi) -- [Placeholders](#placeholders) +You need to make a fork of the PlaceholderAPI Repository to contribute towards the wiki. +To do this, click the "Fork" button on the top-right corner of the site and select the account you want your fork to be created on. This will also show you any already existing forks of this Repository that you may have. -### [Plugins using PlaceholderAPI] -This is only required for plugins. -If your plugin supports placeholders of other plugins and/or provides own placeholders through PlaceholderAPI should you always add it the the `Plugins using PlaceholderAPI` page. +The forking process should only take a few seconds and you should be redirected to your fork afterwards. -Each entry on this page follows a specific format that you need to follow: -```markdown -- **[:name](:url)** - - [?] Supports placeholders. - - [?] Provides own placeholders. [:link] -``` +### Select target branch +All main changes to the wiki are made on the dedicated `docs/wiki` branch. +Before you try to make any changes should you make sure that you have the `docs/wiki` branch selected. To do that, check the button next to the `X branches` text. If it says anything other than `docs/wiki` will you need to click it and select the right branch. -| Key | Description | -| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `:name` | The name of the Plugin. Plugins are ordered by alphabet and if your plugin shares the same name as another one will you need to add it **below** the other resource. | -| `:url` | This should be a URL to either the Spigot page of the plugin, to the GitHub Repository or similar. You can leave the URL away and only use `:name` if there isn't any link. | -| `?` | Should be replaced with either an `x` or a space, depending on if the option is supported. So the result is either `[x]` or `[ ]` | -| `:link` | Should be replaced with either `**[[Link\|Placeholders#:name]]**` or just `Link` depending on if your resource has own Placeholders listed in the [[Placeholders]] page. | | +![branch-selector] -### [Placeholders] -If you either have an Expansion that provides placeholders, or your plugin provides its own to use in other plugins, should you add it to this page. +### Fetch Changes from Upstream +This is only required when you already had a fork and didn't update it for some time. -Each entry in the page follows the same general syntax: +While you're on the `docs/wiki` branch, click the `Fetch upstream` text located right below the green `Code` button. +Depending on the status of your branch can the prompt show different outcomes: + +- `This branch is not behind the upstream PlaceholderAPI:docs/wiki` + Your fork's `docs/wiki` branch is up-to-date with the latest changes from Upstream (This Repository). You don't have to update anything. + ![upstream_up-to-date] +- `Fetch and merge upstream commits from PlaceholderAPI:docs/wiki` + This is shown when your fork's branch is outdated and upstream (This Repository) has changes. Click the `Fetch and merge` button to fetch the latest commits and update your fork's `docs/wiki` branch. + ![upstream_needs_update] + +### Commit changes +To commit changes will you need to choose, if you want to directly commit to your fork's `docs/wiki` branch, or make a dedicated branch for it. + +#### Make separate branch (Optional) +If you want to have a dedicated branch for it, will you need to click the button saying `docs/wiki`, type in the small text field the name of the branch you want to use and click the text saying `Create branch: from 'docs/wiki'` + +![create_branch] + +After that should you now have a separate branch that is based of the `docs/wiki` branch and you can finally commit changes to it. + +#### Formatting +The wiki uses normal Markdown formatting with some special design-rules you need to keep in mind. +These rules are as follows: + +- Unordered lists need to start with a `-` and not `*`. This is to not get it confused with *italic text* which uses single `*` characters. +- New lines in lists need to keep their indends. This means you need to add two spaces at the start to keep the text in the same line. + Example: + ```markdown + - Line 1 + Line 2 + ``` +- Use the `[[Page]]` and `[[Text|Page]]` format to link to other wiki pages. While those aren't rendered in the wiki folder will they render in the final wiki pages. +- External links should be set as Refernce Links, which means they are set as `[text]: link` at the top of the page and then used either through `[text]` or `[display text][text]` througout the page. + +#### Adding new Expansion +When you add a new expansion to the wiki's [Placeholder page][placeholders] will you need to follow the following format: ````markdown -- ### **[:name](:url)** +- ### [:name](:link) > :command - :description + :text ``` :placeholders ``` ```` -Please take note of the indent, which is 2 spaces. -This aligns the content with the list's indent to make it look better. +There are a few extra rules you need to also keep in mind: -| Key | Description | -| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `:name` | The name to show. This should either be the plugin's name, or the name used on the eCloud. | -| `:url` | This should be a URL to either the Spigot page of the plugin, to the GitHub Repository or similar. You can leave the URL away and only use `:name` if there isn't any link. | -| `:command` | The command to use for downloading the expansion.
If your expansion is hardcoded into the plugin or the jar is downloaded on a different place can you put `NO DOWNLOAD COMMAND` there. | -| `:description` | Optional. A brief description about the Expansion. You can also link to any page explaining the placeholders in more detail. | -| `:placeholders` | List of placeholders provided by the expansion. The placeholders should be in alphabetical order and you can use `<>` and `[]` to indicate required and optional parameters respectively. | +- `:name` would be the name of your Expansion, not the plugin (Unless it is integrated into your plugin). + - Only embed a link, if your Expansion requires a plugin to function. + - When linking to a Spigot page, make sure to sanitze the link. + This means that f.e. https://www.spigotmc.org/resources/placeholderapi.6245/ becomes https://www.spigotmc.org/resources/6245/ +- `:command` should be replaced with either the PlaceholderAPI command to download your expansion from the eCloud (`/papi ecloud download :name`) or with `NO DOWNLOAD COMMAND` if no separate download is available. +- `:text` is optional and should only be provided to link to additional documentation, your own placeholder list, or explain more complicated placeholders/features. +- `:placeholders` will be the list of placeholders your expansion provides. + Please avoid specific examples (i.e. `%placeholder_player_user123%`) and instead use `<>` and `[]` to mark required and optional options respecively (`%placeholder_player_%`) -### Special Notes -- When linking to a resource page of Spigot will you need to use the following URL format, where you replace `:id` with the resource ID: - https://spigotmc.org/resources/:id -- On the Placeholders page, if your Entry has other Entries before or after it will you need to add four hyphens (`----`) surrounded by an empty line before and after it, depending on whether there is another entry before/after yours. -- You need to add your Entry in the list at the top of the Placeholders page. - The format is `- **[:name](#:header)**` where `:name` is the same as in the entry and `:header` is the lowercase version of it. - When there are more than one Expansion with the same name will you need to add yours **below** the existing one and add `-1` to the header. +**Note:** +When your Expansion's entry is after and/or before other entries will you need to add `----` before or after it to separate it from other entries. + +Example: +````markdown +- ### SomeExpansion + > NO DOWNLOAD COMMAND + + ``` + %someexpansion_placeholder% + ``` ---- -## Other Wiki pages -Please follow these general guidelines when editing any other pages. -### Links -The wiki uses 3 types of links: - -- [Reference Links](#reference-links) -- [Wiki Links](#wiki-links) -- [Header Links](#header-links) - -#### Reference Links -Reference Links are in the format `[:text]: :url` where `:text` is the name to use as reference and `:url` is the url. -These types of links are usually put at the top of the page and allow us easier updating of these links, by just altering the URL without the need to replace them in the entire file. - -To use a reference link, either use `[:text]` or `[:displayed_text][:text]` to link with a differently shown text. - -For example: With `[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki` will `[wiki]` become [wiki] and `[to the wiki][wiki]` becomes [to the wiki][wiki]. - -Always use reference links for URLs that point outside of the Wiki. Only exceptions are Links in the [Placeholders] and [Plugins using PlaceholderAPI] page (See above for details). - -#### Wiki Links -Wiki links are used to link to other pages on the wiki. -These types of links are in the format `[[:pagename]]` or `[[:text|:pagename]]` to display a different text. `:pagename` is case-sensitive. - -If you want to link to a header in another wiki page can you use `[[:text|:pagename#:header]]`. - -#### Header Links -Header links are used to link to a section within the same wiki page. -The format is `[:text](#:header)`. The header name is case-insensitive but it's recommended to keep it lowercase. +- ### YourExpansion + > NO DOWNLOAD COMMAND + + ``` + %yourexpansion_placeholder% + ``` ---- -### Lists -Lists should always be started with a hyphen (`-`) to better distinguish it from other formatting characters like the asterisk (`*`) used for bold or italic text. +- ### AnotherExpansion + > NO DOWNLOAD COMMAND + + ``` + %anotherexpansion_placeholder% + ``` +```` + +After you added your expansion to this page will you also need to add an entry to the list at the top of the page. +You do so by adding `- **[:text](#:name)**` to the list, where `:text` is the text to display (Usually the name you set) and `:name` is the name you just set. If your expansion shares the exact same name as another entry on the page will you need to make sure that your expansion is listed **after** the other one AND that the list-entry has a `-1` appended to `#:name` (So f.e. `#expansion` becomes `#expansion-1`). + +Finally can you now commit your changes and move forward to the [Plugins using PlaceholderAPI][using_papi] page in the wiki folder. + +#### Adding new plugin +This step is only required if you either add a new plugin to the list, or you added an Expansion that is included in your own plugin. + +Similar to the [Placeholders page][placeholders] does this page follow a specific format which we will explain real quick. + +```markdown +- [:name](:link) + - [?] Supports placeholders. + - [?] Provides own placeholders. [:page] +``` + +Here are the following rules: + +- `:name` needs to be replaced with the Name of your plugin. +- `:link` needs to be the link of the plugin's resource page. + - If no resource page is available can a GitHub repository be linked (if available) or the link omited altogether) + - When linking to a Spigot page, make sure to sanitze the link. + This means that f.e. https://www.spigotmc.org/resources/placeholderapi.6245/ becomes https://www.spigotmc.org/resources/6245/ +- `[?]` needs to be replaced with either `[ ]` or `[x]` depending on whether the mentioned option is supported or not. +- `:page` needs to replace with the right value, depending on the conditions. + - If your plugin provides own Placeholders for other plugins to use can you set `**[[Link|Placeholders#:name]]**` where `:name` is the title you set in the placeholders page. + - If your plugin does not provide own placeholders will you need to set `Link`. + +### Questions? +If you have any questions, do not hesitate to ask in the [HelpChat Discord][discord] or [open a new discussion][discussion] in this repository. We will be happy to help you. + +### Credits +- The Wiki is maintained by [Andre601][andre]. +- We use the [GitHub Wiki Action][action] by [Andrew-Chen-Wang][andrew] to update the PlaceholderAPI wiki through GitHub Actions. From 327078d8dd0b3e7ea7a52b6539ead02ba443f6ce Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Fri, 10 Sep 2021 03:30:03 +0200 Subject: [PATCH 83/86] Update README.md --- wiki/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wiki/README.md b/wiki/README.md index 56112e0..cf47408 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -159,6 +159,20 @@ Here are the following rules: - If your plugin provides own Placeholders for other plugins to use can you set `**[[Link|Placeholders#:name]]**` where `:name` is the title you set in the placeholders page. - If your plugin does not provide own placeholders will you need to set `Link`. +### Make a Pull request +After you made your changes is it time to make a Pull request. + +When you go to the upstream repository, should GitHub already show you a notification that you have commits to PR. Click the `Compare & pull request` button to proceed. + +![image](https://user-images.githubusercontent.com/11576465/132784030-c2ffd5e0-fb95-44de-bd77-97a965cc6dbd.png) + +By default will GitHub select the `master` branch as the target, which is not what we want. To fix this, click the button saying `base:master` and select the `docs/wiki` branch. + +![image](https://user-images.githubusercontent.com/11576465/132784142-8f752697-7dd7-4afb-bbdc-dc66c570dc3c.png) + +Finally, fill out the Pull request template and submit the Pull request. +Congratulations! You've successfully made a Pull request for the wiki. + ### Questions? If you have any questions, do not hesitate to ask in the [HelpChat Discord][discord] or [open a new discussion][discussion] in this repository. We will be happy to help you. From 5e4d3f7135e8a11317f8ea7a109c5899e76f2025 Mon Sep 17 00:00:00 2001 From: ThisKarolGajda <78842362+ThisKarolGajda@users.noreply.github.com> Date: Fri, 10 Sep 2021 14:25:24 +0200 Subject: [PATCH 84/86] Update Placeholders.md (#714) --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 7a8064f..3805fe7 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -3636,6 +3636,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %opeconomy_money% - Gets money %opeconomy_baltop_number_% - Gets player's name %opeconomy_baltop_player_position_% - Gets player's position + %opeconomy_baltop_player_position% - Getting position of player %opeconomy_currency% - Shows active currency %opeconomy_is_active_code_% - Boolean, if code is active %opeconomy_max_uses_code_% - Shows max uses for code From 6f2f1f1cf17af46fa36784ee2a9104bdb7f39fd1 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Sun, 12 Sep 2021 02:17:58 +0200 Subject: [PATCH 85/86] Update README.md --- wiki/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/README.md b/wiki/README.md index cf47408..5a8f695 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -103,7 +103,7 @@ There are a few extra rules you need to also keep in mind: **Note:** When your Expansion's entry is after and/or before other entries will you need to add `----` before or after it to separate it from other entries. -Example: +##### Example: ````markdown - ### SomeExpansion > NO DOWNLOAD COMMAND From 0647f88de58b5ce70689638b2ee2d3508b15537a Mon Sep 17 00:00:00 2001 From: Kris Stancy <60243600+TheCashFire@users.noreply.github.com> Date: Sun, 19 Sep 2021 22:06:01 -0500 Subject: [PATCH 86/86] New Placeholder Added %aach_total_commands% new placeholder to the total achievement placeholders section. --- wiki/Placeholders.md | 1 + 1 file changed, 1 insertion(+) diff --git a/wiki/Placeholders.md b/wiki/Placeholders.md index 3805fe7..0190080 100644 --- a/wiki/Placeholders.md +++ b/wiki/Placeholders.md @@ -1586,6 +1586,7 @@ Please see [this discussion][list] for a list of all expansions officially maint %aach_total_breeding% %aach_total_playercommands% %aach_total_custom% + %aach_total_commands% %aach_total_jobsreborn% ```