Compare commits
686 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09d3c06698 | ||
|
|
5048328e82 | ||
|
|
2e75ec023f | ||
|
|
f43274c03e | ||
|
|
86c98df5d2 | ||
|
|
d62b6af129 | ||
|
|
4ee2840a0a | ||
|
|
c52d117f12 | ||
|
|
e307aba414 | ||
|
|
5ea5a18fe8 | ||
|
|
9c1db4b48a | ||
|
|
b233c92ca1 | ||
|
|
1b1d2e61b9 | ||
|
|
2dc5b93133 | ||
|
|
880ddc22b5 | ||
|
|
d378f782b4 | ||
|
|
1f2d969a69 | ||
|
|
cac79a26af | ||
|
|
8b078f9058 | ||
|
|
d3a5d01f55 | ||
|
|
9a677d46a1 | ||
|
|
8116cbb385 | ||
|
|
b9affd0879 | ||
|
|
ec8657015c | ||
|
|
38a86e6d2d | ||
|
|
35376e43ca | ||
|
|
1c233ec297 | ||
|
|
967dec09ff | ||
|
|
85aa6ae8ae | ||
|
|
83aad38b09 | ||
|
|
b0fb784079 | ||
|
|
84948101f4 | ||
|
|
5dea70532c | ||
|
|
403adeb217 | ||
|
|
a81ed63c0f | ||
|
|
38da700168 | ||
|
|
4a085682dc | ||
|
|
cfed3ce31b | ||
|
|
4c62318338 | ||
|
|
7247cbb9f7 | ||
|
|
9ed7a7ae56 | ||
|
|
9a356ceecf | ||
|
|
e0ac7b1c66 | ||
|
|
82230d8156 | ||
|
|
cda55f20aa | ||
|
|
0df7a01fd8 | ||
|
|
b49668ddee | ||
|
|
f14b081f0b | ||
|
|
b51fbf4e13 | ||
|
|
e48b6fe702 | ||
|
|
984f944daf | ||
|
|
0575c8cf41 | ||
|
|
c181d18f5e | ||
|
|
2e0d9eb846 | ||
|
|
33d1009d6a | ||
|
|
b16d62fb75 | ||
|
|
e019d6370c | ||
|
|
581b73dbc7 | ||
|
|
25f7eafe32 | ||
|
|
ef22d564f3 | ||
|
|
787a053d98 | ||
|
|
f31dd2bea9 | ||
|
|
5c8086150a | ||
|
|
b838d1c52a | ||
|
|
0a712e6530 | ||
|
|
272e2e7904 | ||
|
|
98082398fc | ||
|
|
c66806ecf8 | ||
|
|
c97f5aa5a6 | ||
|
|
c1487898a9 | ||
|
|
907ced6d7d | ||
|
|
ac771207c3 | ||
|
|
8b031576aa | ||
|
|
2d1a0ee157 | ||
|
|
b9e2bf9429 | ||
|
|
a35923a117 | ||
|
|
d5e96bd6a6 | ||
|
|
2523b6c094 | ||
|
|
7b230fc679 | ||
|
|
68f467ab29 | ||
|
|
068b5a31b2 | ||
|
|
882b7c5965 | ||
|
|
7a0be5edf8 | ||
|
|
e94328935d | ||
|
|
604fed36a4 | ||
|
|
403622d205 | ||
|
|
1cd4d93f7f | ||
|
|
a83ef75bf9 | ||
|
|
b96e535aaa | ||
|
|
2e67272aea | ||
|
|
2c7767e77d | ||
|
|
c4a046ff24 | ||
|
|
57fa68c896 | ||
|
|
b64f024eb2 | ||
|
|
c7a4900aa3 | ||
|
|
491abd6238 | ||
|
|
d3646a9874 | ||
|
|
af0b475330 | ||
|
|
d35a499e31 | ||
|
|
c0f824450e | ||
|
|
5b1a8ef4ba | ||
|
|
5623a00f9b | ||
|
|
4926907b47 | ||
|
|
32f3d14682 | ||
|
|
152105017d | ||
|
|
be956f52b0 | ||
|
|
195158b18b | ||
|
|
36fa9ac96d | ||
|
|
42cfe1dc80 | ||
|
|
92a7d54664 | ||
|
|
f91b4e3752 | ||
|
|
a497e05e55 | ||
|
|
74d8fec6bd | ||
|
|
28287c7fbd | ||
|
|
744cf6d8c0 | ||
|
|
ecd4c002c8 | ||
|
|
b4e60b7db5 | ||
|
|
e862abe0b4 | ||
|
|
2d946646f0 | ||
|
|
5ab61e0cd3 | ||
|
|
81ef464dad | ||
|
|
0ae0ddc9cb | ||
|
|
3d00d48106 | ||
|
|
7e902cae66 | ||
|
|
f4e4433b16 | ||
|
|
d5c371004c | ||
|
|
e246473782 | ||
|
|
4afad7f7b0 | ||
|
|
a0b177bdd8 | ||
|
|
40b1fe8d68 | ||
|
|
9ee4afa1e9 | ||
|
|
1cf66b130c | ||
|
|
c3cfc82eb3 | ||
|
|
3afb634e58 | ||
|
|
d888d9754b | ||
|
|
4c228ca4fb | ||
|
|
6cf987586e | ||
|
|
46d9a69534 | ||
|
|
af8cc09fca | ||
|
|
452c8ccd42 | ||
|
|
054c780fd1 | ||
|
|
83261eee49 | ||
|
|
3fca78626a | ||
|
|
a2456c582d | ||
|
|
b987916328 | ||
|
|
23ef4ecb62 | ||
|
|
8b7a217796 | ||
|
|
74ebb0bec0 | ||
|
|
794c8890e5 | ||
|
|
013e566a85 | ||
|
|
5a4a8c2e7e | ||
|
|
0b068470ac | ||
|
|
f3cb7635c2 | ||
|
|
8e21a76118 | ||
|
|
1dad2381e5 | ||
|
|
9767811cb9 | ||
|
|
e6fb6d5ec6 | ||
|
|
1acc621f2e | ||
|
|
d9bab03e3b | ||
|
|
9baf5f58ae | ||
|
|
077d64dc68 | ||
|
|
b8d5886cad | ||
|
|
52119682f3 | ||
|
|
651e14a797 | ||
|
|
0ac62d6b63 | ||
|
|
0be6b721cf | ||
|
|
0e0e36476a | ||
|
|
a56b3b62b9 | ||
|
|
883f1c1edf | ||
|
|
bfc30a8703 | ||
|
|
37c39ab734 | ||
|
|
35c47a8745 | ||
|
|
fadf14a316 | ||
|
|
1388a5278f | ||
|
|
3bc6ad0f06 | ||
|
|
bb149811d4 | ||
|
|
350a2be0ed | ||
|
|
b73d72cec7 | ||
|
|
7afb8ee36d | ||
|
|
1241c33ba0 | ||
|
|
631609af74 | ||
|
|
fe8d865657 | ||
|
|
50d4e14333 | ||
|
|
666ab468a1 | ||
|
|
151fb08db8 | ||
|
|
cd9074203c | ||
|
|
38d77ff4ca | ||
|
|
3ccbbe9c20 | ||
|
|
358a3bcab3 | ||
|
|
ca088227c3 | ||
|
|
69fd180c9b | ||
|
|
38e6e02e1b | ||
|
|
a71b8657f1 | ||
|
|
850633e792 | ||
|
|
348b075ac5 | ||
|
|
ce18d3b597 | ||
|
|
9d66d9d9a1 | ||
|
|
5fe9389dda | ||
|
|
e25a28b2a5 | ||
|
|
cfd289939e | ||
|
|
d168be94b1 | ||
|
|
511717a8d6 | ||
|
|
18fb194ce6 | ||
|
|
e11d551071 | ||
|
|
020f14d82c | ||
|
|
acb5728e65 | ||
|
|
cc235cfc01 | ||
|
|
894dcd0a2f | ||
|
|
41c9231664 | ||
|
|
31deef2a62 | ||
|
|
3ba29f1147 | ||
|
|
e969f37405 | ||
|
|
b9a5f4445f | ||
|
|
6f87955898 | ||
|
|
d68af58df5 | ||
|
|
6e1eb88585 | ||
|
|
0798d94449 | ||
|
|
aa68a481ee | ||
|
|
6f5853746d | ||
|
|
416fbc0e3e | ||
|
|
407714c13f | ||
|
|
aa13ddf17e | ||
|
|
d9da5a706c | ||
|
|
80446de15b | ||
|
|
0647f88de5 | ||
|
|
38099198d6 | ||
|
|
6f2f1f1cf1 | ||
|
|
5e4d3f7135 | ||
|
|
327078d8dd | ||
|
|
1b7fabf238 | ||
|
|
66025a6a1c | ||
|
|
04f2c85722 | ||
|
|
7b5ceb520f | ||
|
|
f7dc184899 | ||
|
|
4300bf7d1e | ||
|
|
5412b484f8 | ||
|
|
af2f625224 | ||
|
|
d2a4f038d0 | ||
|
|
7e28dc0a41 | ||
|
|
b82948c87a | ||
|
|
39c68e8f87 | ||
|
|
5a24387f3d | ||
|
|
cd429bd7d7 | ||
|
|
a383a73b24 | ||
|
|
7baaa5233d | ||
|
|
b35035390e | ||
|
|
1b0a3bc09d | ||
|
|
3817f52158 | ||
|
|
663f149d74 | ||
|
|
3da8f00664 | ||
|
|
c24c75c8c0 | ||
|
|
c401adee86 | ||
|
|
1dd3e1fc0d | ||
|
|
1f53daf416 | ||
|
|
8105beeee0 | ||
|
|
8c9a20c035 | ||
|
|
c1d2effe7e | ||
|
|
2eda4b1335 | ||
|
|
ff72450d3f | ||
|
|
a654262196 | ||
|
|
fa705e4572 | ||
|
|
e687a06d6e | ||
|
|
08c43d25e7 | ||
|
|
48da25659d | ||
|
|
905c9e83ee | ||
|
|
54ddc9fd4d | ||
|
|
fe0bb12d53 | ||
|
|
e6da5f291e | ||
|
|
d674893312 | ||
|
|
9da9e8c20f | ||
|
|
33c309ee8e | ||
|
|
62c3261a00 | ||
|
|
c393392b85 | ||
|
|
fbf91d6393 | ||
|
|
8d30c4c99d | ||
|
|
721904335d | ||
|
|
d79f9725bd | ||
|
|
eb2decb93d | ||
|
|
d2192e3195 | ||
|
|
c01acfba77 | ||
|
|
a494add04c | ||
|
|
059047905f | ||
|
|
fa717c34ef | ||
|
|
e16287405b | ||
|
|
afdf80bf00 | ||
|
|
ec7943fe0a | ||
|
|
6493963d8a | ||
|
|
c48e11bd70 | ||
|
|
b4f6831e54 | ||
|
|
6348c88c6f | ||
|
|
5fb45d13da | ||
|
|
5710972288 | ||
|
|
63955511a8 | ||
|
|
9a7790c808 | ||
|
|
3abc78ff64 | ||
|
|
c4789b7db0 | ||
|
|
d7a4acc2f5 | ||
|
|
dd7751332f | ||
|
|
7b50453294 | ||
|
|
fa7c30df80 | ||
|
|
89053354e9 | ||
|
|
ead63ca763 | ||
|
|
0fa592383f | ||
|
|
7df3a5c6e0 | ||
|
|
c4a2256fff | ||
|
|
9b6b558002 | ||
|
|
94bf5fea57 | ||
|
|
252802dcbe | ||
|
|
8932a92049 | ||
|
|
679ef90091 | ||
|
|
ac9b0c42b7 | ||
|
|
14d885392c | ||
|
|
0c102a1823 | ||
|
|
4c968f012d | ||
|
|
ba71486151 | ||
|
|
e1269d6c86 | ||
|
|
438a665b74 | ||
|
|
247a5cde8f | ||
|
|
aa9ac65d02 | ||
|
|
ba983f7fb3 | ||
|
|
af268c4941 | ||
|
|
4c4b1602d9 | ||
|
|
8c69a164b8 | ||
|
|
df8583df57 | ||
|
|
09e68e7510 | ||
|
|
2c223ffc87 | ||
|
|
5571ba5d70 | ||
|
|
b77b1b9649 | ||
|
|
bf9b34eb57 | ||
|
|
215fd7e3f0 | ||
|
|
aca624c2d3 | ||
|
|
5826390251 | ||
|
|
a91a5c85ba | ||
|
|
156243a549 | ||
|
|
eceb236121 | ||
|
|
71b5433326 | ||
|
|
2c8314200f | ||
|
|
0b70ea61aa | ||
|
|
ac31e107ad | ||
|
|
b9230ef9c5 | ||
|
|
06e6765870 | ||
|
|
5ac579e878 | ||
|
|
a4d8009ce4 | ||
|
|
0df265881a | ||
|
|
5dbd58076a | ||
|
|
c3922de323 | ||
|
|
0f118f12bc | ||
|
|
edd3153acd | ||
|
|
748b9f33f7 | ||
|
|
230e36c55e | ||
|
|
0f7294972e | ||
|
|
d14f319eb4 | ||
|
|
0927760d76 | ||
|
|
91af12f575 | ||
|
|
5dbbe01b95 | ||
|
|
30b5abda19 | ||
|
|
a8e996fa26 | ||
|
|
3f83312454 | ||
|
|
0b1bd1c265 | ||
|
|
b747720f36 | ||
|
|
be34f28fd3 | ||
|
|
9843d84ac3 | ||
|
|
37de42f4a7 | ||
|
|
5595bc144f | ||
|
|
9b2e7bb3ca | ||
|
|
8b5ead7a13 | ||
|
|
0c6dd5466c | ||
|
|
41275509b2 | ||
|
|
4e8b1b47d1 | ||
|
|
d0e62e6434 | ||
|
|
2086fcb299 | ||
|
|
b3ea920b41 | ||
|
|
001fa6bcf2 | ||
|
|
3a31c5cb78 | ||
|
|
20b2a69b5e | ||
|
|
682717660f | ||
|
|
7b7bfb7306 | ||
|
|
09043c6aaf | ||
|
|
f711500d80 | ||
|
|
8d6aa7c801 | ||
|
|
04968cb437 | ||
|
|
048c539fff | ||
|
|
501d1bbbdd | ||
|
|
e4a6faa22a | ||
|
|
c3bdc90168 | ||
|
|
79ec3c8f95 | ||
|
|
e9e4caf989 | ||
|
|
0b1a3ced9e | ||
|
|
b55261a62f | ||
|
|
8c633c8943 | ||
|
|
8757217fb6 | ||
|
|
8f796e3940 | ||
|
|
bf1527a40f | ||
|
|
a65de95b16 | ||
|
|
fb8572313e | ||
|
|
2fc28777b7 | ||
|
|
ffd493fea9 | ||
|
|
b207cbf03e | ||
|
|
72239801d8 | ||
|
|
33ff83d102 | ||
|
|
031625e241 | ||
|
|
ec127dbeb1 | ||
|
|
5d80119fcd | ||
|
|
f6c972c9a2 | ||
|
|
a0b256c17d | ||
|
|
a66cae9a6b | ||
|
|
7f6122f8b8 | ||
|
|
ee7257208a | ||
|
|
87ea46a4dd | ||
|
|
d221a3f38a | ||
|
|
f62980606a | ||
|
|
c2ab9f5b85 | ||
|
|
2c925983a8 | ||
|
|
375e743124 | ||
|
|
78f76c8343 | ||
|
|
33e4743e89 | ||
|
|
b9b7104f6b | ||
|
|
a45f420069 | ||
|
|
a7d92f569f | ||
|
|
73f55735b4 | ||
|
|
a15c6b4855 | ||
|
|
48f7ffe089 | ||
|
|
c607338003 | ||
|
|
66a7a6d199 | ||
|
|
1d7bf239ea | ||
|
|
43a5db7711 | ||
|
|
0e56ea9503 | ||
|
|
d640d801e6 | ||
|
|
b5c70dedcb | ||
|
|
a8bcf0e14d | ||
|
|
0c13004040 | ||
|
|
cc05a3508b | ||
|
|
458030c575 | ||
|
|
3b4641c26c | ||
|
|
9b03af17b6 | ||
|
|
72b2be4933 | ||
|
|
2f0f717d44 | ||
|
|
e3bef564f2 | ||
|
|
319be0e043 | ||
|
|
431483da89 | ||
|
|
d07376245c | ||
|
|
2aa6ac2b63 | ||
|
|
03a362817c | ||
|
|
2dc972423a | ||
|
|
4b43d35bcc | ||
|
|
350ec10186 | ||
|
|
0104e48b72 | ||
|
|
a88f7aab30 | ||
|
|
e91ed337cc | ||
|
|
32d5b7697d | ||
|
|
c23d35d219 | ||
|
|
6b04b6c39b | ||
|
|
021d5b1f47 | ||
|
|
b0f14c6e4e | ||
|
|
cd3a0f52d5 | ||
|
|
cc5835423f | ||
|
|
155fc0592a | ||
|
|
a163c72e93 | ||
|
|
562f6a852d | ||
|
|
bfb88781af | ||
|
|
ff4656bbe7 | ||
|
|
c44b08e2e9 | ||
|
|
4d14b583ff | ||
|
|
892f0727e8 | ||
|
|
3635ecb8b4 | ||
|
|
dd2981b13e | ||
|
|
ff60343089 | ||
|
|
fb77c42bba | ||
|
|
a65b9ad49e | ||
|
|
0ed32c7ddd | ||
|
|
f1350783fc | ||
|
|
5ac2efd9c6 | ||
|
|
a7247acbb3 | ||
|
|
0b3663ee87 | ||
|
|
ba9b38dd0e | ||
|
|
62bb68ee94 | ||
|
|
e96c6fb7ef | ||
|
|
c04c101de5 | ||
|
|
5ab2c05821 | ||
|
|
9b9e0e4b9e | ||
|
|
c3ee5bbdc0 | ||
|
|
fb70ba6403 | ||
|
|
f605db479b | ||
|
|
175308ecf5 | ||
|
|
2adf2845fd | ||
|
|
0438c67f7d | ||
|
|
47d6928b9f | ||
|
|
deee5a1c39 | ||
|
|
c9492564e0 | ||
|
|
0c826a288e | ||
|
|
093ba4d68c | ||
|
|
1478aabb5e | ||
|
|
07ac8e41c5 | ||
|
|
f0dccbd594 | ||
|
|
26fdedd989 | ||
|
|
d342c73f24 | ||
|
|
0a52ef7219 | ||
|
|
6a69ec833f | ||
|
|
b540127651 | ||
|
|
8fa0f73a46 | ||
|
|
077a221c3f | ||
|
|
301a1c9ac5 | ||
|
|
0db15f96ae | ||
|
|
9b2ea05875 | ||
|
|
27d8ae03e1 | ||
|
|
15e22ea115 | ||
|
|
f398854c68 | ||
|
|
29446c08b6 | ||
|
|
3d44f8ffdc | ||
|
|
61afb24d33 | ||
|
|
e8b5660eda | ||
|
|
d4744838ee | ||
|
|
32f3e21ab7 | ||
|
|
e6d57f81da | ||
|
|
818bf91c93 | ||
|
|
ac2c2b324e | ||
|
|
cf9d07a856 | ||
|
|
860239fa2b | ||
|
|
69f0ede0c6 | ||
|
|
480f13a3ce | ||
|
|
b99335e5b2 | ||
|
|
e83eba9226 | ||
|
|
278a5a4096 | ||
|
|
1cfa247f8c | ||
|
|
a3b2777d16 | ||
|
|
3c9f6ea520 | ||
|
|
15d2452b19 | ||
|
|
f582474fb1 | ||
|
|
b1662676f1 | ||
|
|
23943f41ad | ||
|
|
3cd665a159 | ||
|
|
4074192c0b | ||
|
|
59cd5982ad | ||
|
|
b3893c38db | ||
|
|
a3d6426084 | ||
|
|
30a194c75d | ||
|
|
6431bcdeca | ||
|
|
0d1978cece | ||
|
|
e7e9e81e85 | ||
|
|
ba22201311 | ||
|
|
f799835dd0 | ||
|
|
6f3dcf04fe | ||
|
|
6b03c38e40 | ||
|
|
f756fbb43b | ||
|
|
f84702e3b2 | ||
|
|
9c750f50a2 | ||
|
|
dcca454bad | ||
|
|
ffef826c94 | ||
|
|
15e0a293eb | ||
|
|
11ed822845 | ||
|
|
1e4af86172 | ||
|
|
5f9dffc3c7 | ||
|
|
93e83efb57 | ||
|
|
0d9485ddec | ||
|
|
1248010566 | ||
|
|
d68fe7067c | ||
|
|
e16497618c | ||
|
|
4cfd419565 | ||
|
|
f52bdbc458 | ||
|
|
433dd7020c | ||
|
|
4fef2dd82a | ||
|
|
1e6fb502a6 | ||
|
|
b56ab1408e | ||
|
|
5dae844181 | ||
|
|
329b46c042 | ||
|
|
e2dd16cf1c | ||
|
|
dc244849a1 | ||
|
|
736de5b633 | ||
|
|
b31767ba4a | ||
|
|
ae06fcd807 | ||
|
|
7108ffbb31 | ||
|
|
7a6b6d7ce4 | ||
|
|
549a30b502 | ||
|
|
c64946173b | ||
|
|
5bca9dc41f | ||
|
|
5c830d7102 | ||
|
|
400c0d5b5d | ||
|
|
c53d5b2abf | ||
|
|
a842095fff | ||
|
|
c6e36fec2c | ||
|
|
fa7eeb5852 | ||
|
|
b6bfe3f3ef | ||
|
|
d6cfc8beae | ||
|
|
83c35ced32 | ||
|
|
b9bdb3167a | ||
|
|
dfec6c4c8b | ||
|
|
35838aa229 | ||
|
|
ee0df86f84 | ||
|
|
0650de95d6 | ||
|
|
279f1d0c07 | ||
|
|
5a8738e711 | ||
|
|
00b95461b6 | ||
|
|
a74f78bd73 | ||
|
|
9d35f4c3e6 | ||
|
|
325cd2d284 | ||
|
|
d4f0eb91ef | ||
|
|
5ab228d1d8 | ||
|
|
64e0f7e500 | ||
|
|
7998d4d666 | ||
|
|
2a91d34a65 | ||
|
|
ac717c7600 | ||
|
|
e13b91cb22 | ||
|
|
fdfca9da42 | ||
|
|
1556e15a1a | ||
|
|
7691dd93ad | ||
|
|
2c13acfd30 | ||
|
|
40f1fcbce2 | ||
|
|
456958d647 | ||
|
|
7c404db56b | ||
|
|
18cfd438b8 | ||
|
|
d5e27252cf | ||
|
|
3fe0f0143c | ||
|
|
61a71b9e73 | ||
|
|
e542dabd52 | ||
|
|
9cde086436 | ||
|
|
fe02939466 | ||
|
|
f1c2315055 | ||
|
|
9681c518fc | ||
|
|
762bb409d3 | ||
|
|
0394ba284b | ||
|
|
3e9dcdb53c | ||
|
|
ddfaf4105d | ||
|
|
5b1df7c42a | ||
|
|
7555bb0f97 | ||
|
|
ab96120911 | ||
|
|
7371a576d6 | ||
|
|
5d5ceb5902 | ||
|
|
125d02fecd | ||
|
|
8c98a214f8 | ||
|
|
2a3e8dcec1 | ||
|
|
a996d9039e | ||
|
|
cfba92bf14 | ||
|
|
41f408226e | ||
|
|
58cfa92136 | ||
|
|
f3309b76d1 | ||
|
|
04bfa1e721 | ||
|
|
dc894c6212 | ||
|
|
7c7025fdbb | ||
|
|
97a4eca0a7 | ||
|
|
5e4110b1b3 | ||
|
|
d1e3047445 | ||
|
|
c72515912d | ||
|
|
eb5a93dce2 | ||
|
|
7cb3b3b7ec | ||
|
|
c648d6a541 | ||
|
|
2d72e274e3 | ||
|
|
b73d00e169 | ||
|
|
5065623ab0 | ||
|
|
8698449e5d | ||
|
|
722e987b93 | ||
|
|
a00cbf4be3 | ||
|
|
f235c60bef | ||
|
|
a1d69cd25f | ||
|
|
f7504b99ca | ||
|
|
02669e2435 | ||
|
|
3d2fca277f | ||
|
|
3e6d10e203 | ||
|
|
f828857ce3 | ||
|
|
eeb9c8d5db | ||
|
|
6d38f411ba | ||
|
|
542ffd6b7b | ||
|
|
2a559fd240 | ||
|
|
51844cd291 | ||
|
|
ec9d6295fb | ||
|
|
19a80c2d26 | ||
|
|
12a358fbd0 | ||
|
|
0982505574 | ||
|
|
e3d71843ac | ||
|
|
364635cd06 | ||
|
|
d3844711bc | ||
|
|
81038dab80 | ||
|
|
514e25454d | ||
|
|
203f02029c | ||
|
|
eb20a80b37 | ||
|
|
c2dc51c728 | ||
|
|
c38ecfc16c | ||
|
|
cc02c126b5 | ||
|
|
b4a914314a | ||
|
|
f6ba24e46f | ||
|
|
745f7926a6 | ||
|
|
62c93465f2 | ||
|
|
c76baeae1c | ||
|
|
d12c746630 | ||
|
|
fbdd789dbe | ||
|
|
b521fe4a1f | ||
|
|
b24b127ad5 |
9
.github/CODEOWNERS
vendored
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# Assigns extendedclip and PiggyPiglet for any PR unless a check below matches.
|
||||
#
|
||||
* @extendedclip @PiggyPiglet
|
||||
|
||||
#
|
||||
# Assigns Andre601 to any PR that targets the wiki folder.
|
||||
#
|
||||
/wiki/ @Andre601
|
||||
64
.github/CONTRIBUTING.md
vendored
@@ -1,64 +0,0 @@
|
||||
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
||||
[Discord]: https://helpch.at/discord
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via [issue] or through [Discord] with the owners of this repository before making a change.
|
||||
|
||||
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
1. Update the README.md with details of changes if it is affected by those changes.
|
||||
2. Try to prevent any breaking changes affecting the end-user (Developers using the API).
|
||||
Mention any breaking changes that could affect the end-user.
|
||||
3. Document any public methods that the end-user might use.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
### Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
### Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
### Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
### Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at our [Discord]. All
|
||||
complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
### Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
47
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,47 +0,0 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Report bugs of PlaceholderAPI with this template
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
### Please read ###
|
||||
This template is only for reporting bugs of PlaceholderAPI!
|
||||
If you want to request changes to the code of PlaceholderAPI, use the "Request change (PlaceholderAPI)" template.
|
||||
For changes to the wiki consider making a Pull request towards the "wiki" folder containing your changes.
|
||||
|
||||
Please also make sure that you use the latest Spigot release or the latest developement build and that your bug isn't already reported on the issues page.
|
||||
You may get Releases from following sources:
|
||||
|
||||
- Spigot: https://www.spigotmc.org/resources/6245/
|
||||
- Jenkins: http://ci.extendedclip.com/job/PlaceholderAPI/
|
||||
|
||||
NOTE:
|
||||
PLEASE REPORT ISSUES WITH EXPANSIONS AND/OR PLACEHOLDERS TO THEIR CORRESPONDING REPOSITORY/ISSUE TRACKER.
|
||||
THIS REPOSITORY IS NOT FOR SUCH ISSUES.
|
||||
-->
|
||||
## Bug Report
|
||||
|
||||
### Issue
|
||||
> What is the issue? Describe it like you would tell a friend.
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
|
||||
|
||||
### Expected behaviour
|
||||
> What should PlaceholderAPI do?
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
|
||||
|
||||
### Actual behaviour
|
||||
> What does PlaceholderAPI actually do?
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
|
||||
|
||||
### How to reproduce
|
||||
> What steps did you made, to get this bug?
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
1.
|
||||
|
||||
### Installed expansions
|
||||
> Please list all expansions that are displayed when running `/papi list`
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
14
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,14 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: HelpChat Discord
|
||||
url: https://discordapp.com/invite/0utOOIYX82aImw7h
|
||||
about: Please join our Discord for faster support.
|
||||
- name: Wiki
|
||||
url: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||
about: The Wiki of PlaceholderAPI.
|
||||
- name: Hastebin
|
||||
url: https://paste.helpch.at
|
||||
about: Use our Hastebin-site for sharing errors and configuration files.
|
||||
- name: Update Wiki
|
||||
url: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
||||
about: Please make a Pull request towards the "wiki" folder to update the wiki.
|
||||
33
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,33 +0,0 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Request a update/change of the PlaceholderAPI-code
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
### Please read ###
|
||||
Before suggesting any new features, make sure that it wasn't suggested before and that no open issue with it exists already.
|
||||
|
||||
If possible would we suggest to create a Pull request instead.
|
||||
When doing so, make sure to follow our Contributing Guidelines: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/.github/CONTRIBUTING.md
|
||||
-->
|
||||
|
||||
## Feature Request
|
||||
|
||||
### Type
|
||||
> What kind of request is this? (Multiple selections possible)
|
||||
<!--
|
||||
Please select the right options by replacing the [ ] with a [x]
|
||||
-->
|
||||
- [ ] 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: __________ <!-- Use this if none of the above matches your request -->
|
||||
|
||||
### Info
|
||||
> What is the change?
|
||||
> Please provide as much information (including links, images and code-snippeds) as possible.
|
||||
<!-- Please write below this line to prevent formatting issues -->
|
||||
25
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,25 +0,0 @@
|
||||
## Please read
|
||||
Please make sure you checked the following:
|
||||
- You checked the [Pull requests] page for any upcoming changes.
|
||||
- You documented any public code that the end-user might use.
|
||||
- You followed the [contributing file]
|
||||
|
||||
### Type
|
||||
<!--
|
||||
Please select the right one, by changing the [ ] to [x]
|
||||
-->
|
||||
- [ ] Internal change (Doesn't affect end-user).
|
||||
- [ ] External change (Does affect end-user).
|
||||
- [ ] Wiki (Changes towards the [Wiki]).
|
||||
- [ ] Other: __________ <!-- Use this if none of the above matches your request -->
|
||||
|
||||
### Description
|
||||
> Provide additional information if needed.
|
||||
<!-- Please type below this line -->
|
||||
|
||||
|
||||
<!-- DO NOT ALTER ANYTHING BELOW THIS LINE! -->
|
||||
|
||||
[Pull requests]: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
||||
[contributing file]: https://github.com/PlaceholderAPI/PlaceholderAPI/tree/master/.github/CONTRIBUTING.md
|
||||
[Wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||
52
.github/workflows/wiki.yml
vendored
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# This is a GitHub Action that allows us to auto-update the wiki
|
||||
# when a Pull request changes specific files in a folder.
|
||||
#
|
||||
name: Update Wiki
|
||||
|
||||
on:
|
||||
push:
|
||||
#
|
||||
# Only trigger when the push changes any files in the wiki-folder.
|
||||
#
|
||||
paths:
|
||||
- 'wiki/**'
|
||||
branches:
|
||||
- 'docs/wiki'
|
||||
#
|
||||
# Releases cause this action to also fire.
|
||||
# Using this prevents this problem.
|
||||
#
|
||||
tags-ignore:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Code'
|
||||
uses: actions/Checkout@v2
|
||||
- name: 'Update Wiki'
|
||||
uses: docker://decathlon/wiki-page-creator-action:latest
|
||||
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
|
||||
674
LICENSE
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
44
README.md
@@ -1,44 +0,0 @@
|
||||
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||
[licenseImg]: https://img.shields.io/github/license/PlaceholderAPI/PlaceholderAPI.svg
|
||||
[license]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/LICENSE
|
||||
|
||||
[releaseImg]: https://img.shields.io/github/release/PlaceholderAPI/PlaceholderAPI.svg?label=github%20release
|
||||
[release]: https://github.com/PlaceholderAPI/PlaceholderAPI/releases/latest
|
||||
|
||||
[discord]: https://helpch.at/discord
|
||||
[spigot]: https://www.spigotmc.org/resources/6245/
|
||||
[Expansions cloud]: https://api.extendedclip.com/home
|
||||
[placeholder list]: https://helpch.at/placeholders
|
||||
[statistics]: https://bstats.org/plugin/bukkit/PlaceholderAPI
|
||||
|
||||
[ci]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
||||
[ciImg]: http://ci.extendedclip.com/buildStatus/icon?job=PlaceholderAPI
|
||||
|
||||
[APIversionImg]: https://img.shields.io/nexus/r/http/repo.extendedclip.com/me.clip/placeholderapi.svg?label=API-Version
|
||||
[logo]: https://i.imgur.com/Ea4PURv.png
|
||||
<!-- The stuff above isn't visible in the readme -->
|
||||
|
||||
[![logo]][spigot]
|
||||
|
||||
[![ciImg]][ci] [![releaseImg]][release] ![APIversionImg] [![licenseImg]][license]
|
||||
|
||||
# Information
|
||||
[PlaceholderAPI][spigot] is a plugin for Spigot servers that allows server owners to display information from various plugins with a uniform format.
|
||||
|
||||
Support for specific plugins are provided either by the plugin itself or through expansions. The expansions may be downloaded in-game through the PAPI Expansion Cloud. There are currently over 150+ expansions that support a wide variety of plugins, such as Essentials, Factions, LuckPerms, and Vault.
|
||||
|
||||
PlaceholderAPI has been downloaded over 300,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.
|
||||
|
||||
<!-- TODO: Add contributing section -->
|
||||
<!-- TODO: Add expansion creation section (possibly add to a wiki?) -->
|
||||
|
||||
## Support
|
||||
- [Issue Tracker][issues]
|
||||
- [Discord Support][discord]
|
||||
|
||||
## Quick Links
|
||||
- [CI Server][ci]
|
||||
- [Expansions cloud]
|
||||
- [Placeholder List]
|
||||
- [Spigot Page][spigot]
|
||||
- [Plugin Statistics][statistics]
|
||||
109
build.gradle
@@ -1,109 +0,0 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "maven-publish"
|
||||
id "net.minecrell.licenser" version "0.4.1"
|
||||
id "com.github.johnrengelman.shadow" version "6.0.0"
|
||||
}
|
||||
|
||||
group "me.clip"
|
||||
version "2.10.8"
|
||||
|
||||
description "An awesome placeholder provider!"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
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"
|
||||
|
||||
compileOnly "org.spigotmc:spigot-api:1.16.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"
|
||||
}
|
||||
|
||||
processResources {
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description]
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
|
||||
relocate "org.bstats", "me.clip.placeholderapi.metrics"
|
||||
relocate "com.google.gson", "me.clip.placeholderapi.libs.gson"
|
||||
}
|
||||
|
||||
license {
|
||||
include '**/*.java'
|
||||
|
||||
matching('**/*.java') {
|
||||
header = file('config/headers/main.txt')
|
||||
}
|
||||
|
||||
matching('**/JSONMessage.java') {
|
||||
header = file('config/headers/jsonmessage.txt')
|
||||
}
|
||||
|
||||
ext {
|
||||
year = 2020
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test.compileClasspath += configurations.compileOnly
|
||||
test.runtimeClasspath += configurations.compileOnly
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
if (version.contains("-DEV-")) {
|
||||
url = uri("https://repo.extendedclip.com/content/repositories/dev/")
|
||||
} else {
|
||||
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
}
|
||||
|
||||
credentials {
|
||||
username = System.getenv("JENKINS_USER")
|
||||
password = System.getenv("JENKINS_PASS")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId = "placeholderapi"
|
||||
|
||||
from components.java
|
||||
|
||||
pom.withXml {
|
||||
asNode().appendNode("packaging", "jar")
|
||||
asNode().remove(asNode().get("dependencies"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publish.dependsOn clean, test, jar
|
||||
@@ -1,7 +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.
|
||||
@@ -1,17 +0,0 @@
|
||||
This file is part of PlaceholderAPI
|
||||
|
||||
PlaceholderAPI
|
||||
Copyright (c) 2015 - ${year} 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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
@@ -1,569 +0,0 @@
|
||||
<code_scheme name="DaddyStyle" version="173">
|
||||
<option name="OTHER_INDENT_OPTIONS">
|
||||
<value>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="RIGHT_MARGIN" value="100" />
|
||||
<AndroidXmlCodeStyleSettings>
|
||||
<option name="USE_CUSTOM_SETTINGS" value="true" />
|
||||
<option name="LAYOUT_SETTINGS">
|
||||
<value>
|
||||
<option name="INSERT_BLANK_LINE_BEFORE_TAG" value="false" />
|
||||
</value>
|
||||
</option>
|
||||
</AndroidXmlCodeStyleSettings>
|
||||
<JSCodeStyleSettings version="0">
|
||||
<option name="INDENT_CHAINED_CALLS" value="false" />
|
||||
</JSCodeStyleSettings>
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
|
||||
<value />
|
||||
</option>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
|
||||
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
|
||||
<option name="JD_P_AT_EMPTY_LINES" value="false" />
|
||||
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
|
||||
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
|
||||
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
|
||||
</JavaCodeStyleSettings>
|
||||
<Objective-C>
|
||||
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
|
||||
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
|
||||
<option name="INDENT_CLASS_MEMBERS" value="2" />
|
||||
<option name="INDENT_VISIBILITY_KEYWORDS" value="1" />
|
||||
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
|
||||
<option name="KEEP_STRUCTURES_IN_ONE_LINE" value="true" />
|
||||
<option name="FUNCTION_PARAMETERS_WRAP" value="5" />
|
||||
<option name="FUNCTION_CALL_ARGUMENTS_WRAP" value="5" />
|
||||
<option name="TEMPLATE_CALL_ARGUMENTS_WRAP" value="5" />
|
||||
<option name="TEMPLATE_CALL_ARGUMENTS_ALIGN_MULTILINE" value="true" />
|
||||
<option name="ALIGN_INIT_LIST_IN_COLUMNS" value="false" />
|
||||
<option name="SPACE_BEFORE_SUPERCLASS_COLON" value="false" />
|
||||
</Objective-C>
|
||||
<Objective-C-extensions>
|
||||
<option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
|
||||
<option name="RELEASE_STYLE" value="IVAR" />
|
||||
<option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cc" header="h" />
|
||||
<pair source="c" header="h" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
<Python>
|
||||
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
|
||||
</Python>
|
||||
<TypeScriptCodeStyleSettings version="0">
|
||||
<option name="INDENT_CHAINED_CALLS" value="false" />
|
||||
</TypeScriptCodeStyleSettings>
|
||||
<XML>
|
||||
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
|
||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||
</XML>
|
||||
<codeStyleSettings language="CSS">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="ECMA Script Level 4">
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="HTML">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
|
||||
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="WRAP_COMMENTS" value="true" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSON">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JavaScript">
|
||||
<option name="RIGHT_MARGIN" value="80" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="ObjectiveC">
|
||||
<option name="RIGHT_MARGIN" value="80" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
<option name="BLANK_LINES_BEFORE_IMPORTS" value="0" />
|
||||
<option name="BLANK_LINES_AFTER_IMPORTS" value="0" />
|
||||
<option name="BLANK_LINES_AROUND_CLASS" value="0" />
|
||||
<option name="BLANK_LINES_AROUND_METHOD" value="0" />
|
||||
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="false" />
|
||||
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="PROTO">
|
||||
<option name="RIGHT_MARGIN" value="80" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Python">
|
||||
<option name="RIGHT_MARGIN" value="80" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="SASS">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="SCSS">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="TypeScript">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:.*Style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_width</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_height</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_weight</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_margin</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginTop</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginBottom</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginStart</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginEnd</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginLeft</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_marginRight</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:layout_.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:padding</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingTop</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingBottom</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingStart</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingEnd</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingLeft</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:paddingRight</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res-auto</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>http://schemas.android.com/tools</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="protobuf">
|
||||
<option name="RIGHT_MARGIN" value="80" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
BIN
dark_mode/ABOUT.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
dark_mode/COMMANDS.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
dark_mode/CONFIG.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
dark_mode/GETTING_STARTED.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
dark_mode/HEADER.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
dark_mode/PERMISSIONS.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
dark_mode/Placeholders.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
dark_mode/Placeholders2.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
dark_mode/STEPS.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
dark_mode/eCloud.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
dark_mode/wiki.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
6
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +0,0 @@
|
||||
#Tue Jul 14 23:27:02 AWST 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
185
gradlew
vendored
@@ -1,185 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
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
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
104
gradlew.bat
vendored
@@ -1,104 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
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
|
||||
|
||||
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%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1 +0,0 @@
|
||||
rootProject.name = 'PlaceholderAPI'
|
||||
@@ -1,536 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Relational;
|
||||
import me.clip.placeholderapi.replacer.CharsReplacer;
|
||||
import me.clip.placeholderapi.replacer.Replacer;
|
||||
import me.clip.placeholderapi.replacer.Replacer.Closure;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class PlaceholderAPI {
|
||||
|
||||
private static final Replacer REPLACER_PERCENT = new CharsReplacer(Closure.PERCENT);
|
||||
private static final Replacer REPLACER_BRACKET = new CharsReplacer(Closure.BRACKET);
|
||||
|
||||
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
|
||||
private static final Pattern BRACKET_PLACEHOLDER_PATTERN = Pattern.compile("[{]([^{}]+)[}]");
|
||||
private static final Pattern RELATIONAL_PLACEHOLDER_PATTERN = Pattern
|
||||
.compile("[%](rel_)([^%]+)[%]");
|
||||
|
||||
|
||||
private PlaceholderAPI() {
|
||||
}
|
||||
|
||||
// === Current API ===
|
||||
|
||||
/**
|
||||
* Translates all placeholders into their corresponding values.
|
||||
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
||||
*
|
||||
* @param player Player to parse the placeholders against
|
||||
* @param text Text to set the placeholder values in
|
||||
* @return String containing all translated placeholders
|
||||
*/
|
||||
@NotNull
|
||||
public static String setPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final String text) {
|
||||
return REPLACER_PERCENT.apply(text, player,
|
||||
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates all placeholders into their corresponding values.
|
||||
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
@NotNull
|
||||
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final List<@NotNull String> text) {
|
||||
return text.stream().map(line -> setPlaceholders(player, line)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates all placeholders into their corresponding values.
|
||||
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
||||
*
|
||||
* @param player Player to parse the placeholders against
|
||||
* @param text Text to set the placeholder values in
|
||||
* @return String containing all translated placeholders
|
||||
*/
|
||||
@NotNull
|
||||
public static String setBracketPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final String text) {
|
||||
return REPLACER_BRACKET.apply(text, player,
|
||||
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates all placeholders into their corresponding values.
|
||||
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
@NotNull
|
||||
public static List<String> setBracketPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final List<@NotNull String> text) {
|
||||
return text.stream().map(line -> setBracketPlaceholders(player, line))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a specific placeholder identifier is currently registered
|
||||
*
|
||||
* @param identifier The identifier to check
|
||||
* @return true if identifier is already registered
|
||||
*/
|
||||
public static boolean isRegistered(@NotNull final String identifier) {
|
||||
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
||||
.findExpansionByIdentifier(identifier).isPresent();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all registered placeholder identifiers
|
||||
*
|
||||
* @return All registered placeholder identifiers
|
||||
*/
|
||||
@NotNull
|
||||
public static Set<String> getRegisteredIdentifiers() {
|
||||
return ImmutableSet
|
||||
.copyOf(PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getIdentifiers());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the normal placeholder pattern.
|
||||
*/
|
||||
public static Pattern getPlaceholderPattern() {
|
||||
return PLACEHOLDER_PATTERN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bracket placeholder pattern.
|
||||
*/
|
||||
public static Pattern getBracketPlaceholderPattern() {
|
||||
return BRACKET_PLACEHOLDER_PATTERN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the relational placeholder pattern.
|
||||
*/
|
||||
public static Pattern getRelationalPlaceholderPattern() {
|
||||
return RELATIONAL_PLACEHOLDER_PATTERN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a String contains any PlaceholderAPI placeholders ({@literal
|
||||
* %<identifier>_<params>%}).
|
||||
*
|
||||
* @param text String to check
|
||||
* @return true if String contains any matches to the normal placeholder pattern, false otherwise
|
||||
*/
|
||||
public static boolean containsPlaceholders(String text) {
|
||||
return text != null && PLACEHOLDER_PATTERN.matcher(text).find();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a String contains any PlaceholderAPI bracket placeholders ({@literal
|
||||
* {<identifier>_<params>}}).
|
||||
*
|
||||
* @param text String to check
|
||||
* @return true if String contains any matches to the bracket placeholder pattern, false otherwise
|
||||
*/
|
||||
public static boolean containsBracketPlaceholders(String text) {
|
||||
return text != null && BRACKET_PLACEHOLDER_PATTERN.matcher(text).find();
|
||||
}
|
||||
|
||||
// === Deprecated API ===
|
||||
|
||||
/**
|
||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||
* %<rel_(identifier)_(params)>% when set with this method
|
||||
*
|
||||
* @param one First player to compare
|
||||
* @param two Second player to compare
|
||||
* @param text Text to parse the placeholders in
|
||||
* @return The text containing the parsed relational placeholders
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static String setRelationalPlaceholders(Player one, Player two, String text) {
|
||||
return setRelationalPlaceholders(one, two, text, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate placeholders in the provided List based on the relation of the two provided players.
|
||||
* <br>The pattern of a valid placeholder is {@literal %rel_<identifier>_<param>%}.
|
||||
*
|
||||
* @param one Player to compare
|
||||
* @param two Player to compare
|
||||
* @param text text to parse the placeholder values to
|
||||
* @return The text containing the parsed relational placeholders
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text) {
|
||||
return setRelationalPlaceholders(one, two, text, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get map of registered placeholders
|
||||
*
|
||||
* @return Map of registered placeholders
|
||||
* @deprecated Use {@link me.clip.placeholderapi.PlaceholderAPIPlugin().getLocalExpansionManager()
|
||||
* .getExpansions()} instead.
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static Map<String, PlaceholderHook> getPlaceholders() {
|
||||
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
||||
.getExpansions().stream()
|
||||
.collect(Collectors.toMap(PlaceholderExpansion::getIdentifier, ex -> ex));
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate placeholders in the provided list based on the relation of the two provided players.
|
||||
* <br>The pattern of a valid placeholder is {@literal %rel_<identifier>_<params>%}.
|
||||
*
|
||||
* @param one First player to compare
|
||||
* @param two Second player to compare
|
||||
* @param text Text to parse the placeholders in
|
||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
||||
* @return The text containing the parsed relational placeholders
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text,
|
||||
boolean colorize) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return text.stream()
|
||||
.map(line -> setRelationalPlaceholders(one, two, line, colorize))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||
* %<rel_(identifier)_(params)>% when set with this method
|
||||
*
|
||||
* @param one Player to compare
|
||||
* @param two Player to compare
|
||||
* @param text Text to parse the placeholders in
|
||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
||||
* @return The text containing the parsed relational placeholders
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("DuplicatedCode")
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setRelationalPlaceholders(Player one, Player two, String text,
|
||||
boolean colorize) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansionsCount() == 0) {
|
||||
return colorize ? Msg.color(text) : text;
|
||||
}
|
||||
|
||||
final Matcher matcher = RELATIONAL_PLACEHOLDER_PATTERN.matcher(text);
|
||||
|
||||
while (matcher.find()) {
|
||||
final String format = matcher.group(2);
|
||||
final int index = format.indexOf("_");
|
||||
|
||||
if (index <= 0 || index >= format.length()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String identifier = format.substring(0, index).toLowerCase();
|
||||
String params = format.substring(index + 1);
|
||||
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
|
||||
.getLocalExpansionManager().getExpansion(identifier);
|
||||
|
||||
if (!(expansion instanceof Relational)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final String value = ((Relational) expansion).onPlaceholderRequest(one, two, params);
|
||||
|
||||
if (value != null) {
|
||||
text = text.replaceAll(Pattern.quote(matcher.group()), Matcher.quoteReplacement(value));
|
||||
}
|
||||
}
|
||||
|
||||
return colorize ? Msg.color(text) : text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||
* register placeholders instead
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"
|
||||
+ " Please reach out to " + plugin.getDescription().getAuthors().toString()
|
||||
+ " and let them know that they need to update ASAP!");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||
* register placeholders instead
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static boolean registerPlaceholderHook(String identifier,
|
||||
PlaceholderHook placeholderHook) {
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||
* unregister placeholders instead
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static boolean unregisterPlaceholderHook(Plugin plugin) {
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||
+ " is attempting to unregister placeholders via the PlaceholderAPI class which is no longer supported!"
|
||||
+ " Please reach out to " + plugin.getDescription().getAuthors().toString()
|
||||
+ " and let them know that they need to update ASAP!");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||
* unregister placeholders instead
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static boolean unregisterPlaceholderHook(String identifier) {
|
||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||
+ " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, String)} instead
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final String text, @NotNull final Pattern pattern, final boolean colorize) {
|
||||
return setPlaceholders(player, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, List)} instead
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player,
|
||||
@NotNull final List<String> text, @NotNull final Pattern pattern, final boolean colorize) {
|
||||
return setPlaceholders(player, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text,
|
||||
boolean colorize) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||
boolean colorize) {
|
||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||
Pattern pattern) {
|
||||
return setPlaceholders(player, text, pattern, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) {
|
||||
return setPlaceholders(player, text, pattern, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static Set<String> getRegisteredPlaceholderPlugins() {
|
||||
return getRegisteredIdentifiers();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static Set<String> getExternalPlaceholderPlugins() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setPlaceholders(Player player, String text) {
|
||||
return setPlaceholders(((OfflinePlayer) player), text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setPlaceholders(Player player, String text, boolean colorize) {
|
||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setPlaceholders(Player player, List<String> text) {
|
||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) {
|
||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setBracketPlaceholders(Player player, String text) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static String setBracketPlaceholders(Player player, String text, boolean colorize) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setBracketPlaceholders(Player player, List<String> text) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public static List<String> setBracketPlaceholders(Player player, List<String> text,
|
||||
boolean colorize) {
|
||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,239 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommandRouter;
|
||||
import me.clip.placeholderapi.configuration.PlaceholderAPIConfig;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Version;
|
||||
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 org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Yes I have a shit load of work to do...
|
||||
*
|
||||
* @author Ryan McCarthy
|
||||
*/
|
||||
public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
|
||||
@NotNull
|
||||
private static final Version VERSION;
|
||||
private static PlaceholderAPIPlugin instance;
|
||||
|
||||
static {
|
||||
final String version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
|
||||
|
||||
boolean isSpigot;
|
||||
try {
|
||||
Class.forName("org.spigotmc.SpigotConfig");
|
||||
isSpigot = true;
|
||||
} catch (final ExceptionInInitializerError | ClassNotFoundException ignored) {
|
||||
isSpigot = false;
|
||||
}
|
||||
|
||||
VERSION = new Version(version, isSpigot);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIConfig config = new PlaceholderAPIConfig(this);
|
||||
|
||||
@NotNull
|
||||
private final LocalExpansionManager localExpansionManager = new LocalExpansionManager(this);
|
||||
@NotNull
|
||||
private final CloudExpansionManager cloudExpansionManager = new CloudExpansionManager(this);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* available from the class: {@link PlaceholderAPI}
|
||||
*
|
||||
* @return PlaceholderAPIPlugin instance
|
||||
*/
|
||||
@NotNull
|
||||
public static PlaceholderAPIPlugin getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configurable {@linkplain String} value that should be returned when a boolean is true
|
||||
*
|
||||
* @return string value of true
|
||||
*/
|
||||
@NotNull
|
||||
public static String booleanTrue() {
|
||||
return getInstance().getPlaceholderAPIConfig().booleanTrue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configurable {@linkplain String} value that should be returned when a boolean is false
|
||||
*
|
||||
* @return string value of false
|
||||
*/
|
||||
@NotNull
|
||||
public static String booleanFalse() {
|
||||
return getInstance().getPlaceholderAPIConfig().booleanFalse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configurable {@linkplain SimpleDateFormat} object that is used to parse time for
|
||||
* generic time based placeholders
|
||||
*
|
||||
* @return date format
|
||||
*/
|
||||
@NotNull
|
||||
public static SimpleDateFormat getDateFormat() {
|
||||
try {
|
||||
return new SimpleDateFormat(getInstance().getPlaceholderAPIConfig().dateFormat());
|
||||
} catch (final IllegalArgumentException ex) {
|
||||
getInstance().getLogger().log(Level.WARNING, "configured date format is invalid", ex);
|
||||
return new SimpleDateFormat("MM/dd/yy HH:mm:ss");
|
||||
}
|
||||
}
|
||||
|
||||
public static Version getServerVersion() {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
instance = this;
|
||||
|
||||
saveDefaultConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
setupCommand();
|
||||
setupMetrics();
|
||||
setupExpansions();
|
||||
|
||||
if (config.isCloudEnabled()) {
|
||||
getCloudExpansionManager().load();
|
||||
}
|
||||
|
||||
if (config.checkUpdates()) {
|
||||
new UpdateChecker(this).fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
getCloudExpansionManager().kill();
|
||||
getLocalExpansionManager().kill();
|
||||
|
||||
HandlerList.unregisterAll(this);
|
||||
|
||||
Bukkit.getScheduler().cancelTasks(this);
|
||||
|
||||
instance = null;
|
||||
}
|
||||
|
||||
public void reloadConf(@NotNull final CommandSender sender) {
|
||||
getLocalExpansionManager().kill();
|
||||
|
||||
reloadConfig();
|
||||
|
||||
getLocalExpansionManager().load(sender);
|
||||
|
||||
if (config.isCloudEnabled()) {
|
||||
getCloudExpansionManager().load();
|
||||
} else {
|
||||
getCloudExpansionManager().kill();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public LocalExpansionManager getLocalExpansionManager() {
|
||||
return localExpansionManager;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CloudExpansionManager getCloudExpansionManager() {
|
||||
return cloudExpansionManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the configuration class for PlaceholderAPI.
|
||||
*
|
||||
* @return PlaceholderAPIConfig instance
|
||||
*/
|
||||
@NotNull
|
||||
public PlaceholderAPIConfig getPlaceholderAPIConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
private void setupCommand() {
|
||||
final PluginCommand pluginCommand = getCommand("placeholderapi");
|
||||
if (pluginCommand == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final PlaceholderCommandRouter router = new PlaceholderCommandRouter(this);
|
||||
pluginCommand.setExecutor(router);
|
||||
pluginCommand.setTabCompleter(router);
|
||||
}
|
||||
|
||||
private void setupMetrics() {
|
||||
final Metrics metrics = new Metrics(this);
|
||||
metrics.addCustomChart(new Metrics.SimplePie("using_expansion_cloud",
|
||||
() -> getPlaceholderAPIConfig().isCloudEnabled() ? "yes" : "no"));
|
||||
|
||||
metrics.addCustomChart(
|
||||
new Metrics.SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no"));
|
||||
|
||||
metrics.addCustomChart(new Metrics.AdvancedPie("expansions_used", () -> {
|
||||
final Map<String, Integer> values = new HashMap<>();
|
||||
|
||||
for (final PlaceholderExpansion expansion : getLocalExpansionManager().getExpansions()) {
|
||||
values.put(expansion.getRequiredPlugin() == null ? expansion.getIdentifier()
|
||||
: expansion.getRequiredPlugin(), 1);
|
||||
}
|
||||
|
||||
return values;
|
||||
}));
|
||||
}
|
||||
|
||||
private void setupExpansions() {
|
||||
Bukkit.getPluginManager().registerEvents(getLocalExpansionManager(), this);
|
||||
|
||||
try {
|
||||
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
||||
new ServerLoadEventListener(this);
|
||||
} catch (final ExceptionInInitializerError | ClassNotFoundException ignored) {
|
||||
Bukkit.getScheduler()
|
||||
.runTaskLater(this, () -> getLocalExpansionManager().load(Bukkit.getConsoleSender()), 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @deprecated This class will be completely removed in the next release, please use {@link
|
||||
* me.clip.placeholderapi.expansion.PlaceholderExpansion}
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.NonExtendable
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public abstract class PlaceholderHook {
|
||||
|
||||
@Nullable
|
||||
public String onRequest(@Nullable final OfflinePlayer player, @NotNull final String params) {
|
||||
if (player != null && player.isOnline()) {
|
||||
return onPlaceholderRequest((Player) player, params);
|
||||
}
|
||||
|
||||
return onPlaceholderRequest(null, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This method will be completely removed, please use {@link
|
||||
* me.clip.placeholderapi.expansion.PlaceholderExpansion#onRequest(OfflinePlayer, String)}
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated
|
||||
public String onPlaceholderRequest(@Nullable final Player player, @NotNull final String params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public abstract class PlaceholderCommand {
|
||||
|
||||
@NotNull
|
||||
private final String label;
|
||||
@NotNull
|
||||
private final Set<String> alias;
|
||||
|
||||
@Nullable
|
||||
private String permission;
|
||||
|
||||
|
||||
protected PlaceholderCommand(@NotNull final String label, @NotNull final String... alias) {
|
||||
this.label = label;
|
||||
this.alias = Sets.newHashSet(alias);
|
||||
|
||||
setPermission("placeholderapi." + label);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Stream<PlaceholderCommand> filterByPermission(@NotNull final CommandSender sender,
|
||||
@NotNull final Stream<PlaceholderCommand> commands) {
|
||||
return commands.filter(
|
||||
target -> target.getPermission() == null || sender.hasPermission(target.getPermission()));
|
||||
}
|
||||
|
||||
public static void suggestByParameter(@NotNull final Stream<String> possible,
|
||||
@NotNull final List<String> suggestions, @Nullable final String parameter) {
|
||||
if (parameter == null) {
|
||||
possible.forEach(suggestions::add);
|
||||
} else {
|
||||
possible.filter(suggestion -> suggestion.toLowerCase().startsWith(parameter.toLowerCase()))
|
||||
.forEach(suggestions::add);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public final String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public final Set<String> getAlias() {
|
||||
return ImmutableSet.copyOf(alias);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public final Set<String> getLabels() {
|
||||
return ImmutableSet.<String>builder().add(label).addAll(alias).build();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final String getPermission() {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public void setPermission(@NotNull final String permission) {
|
||||
this.permission = permission;
|
||||
}
|
||||
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
|
||||
}
|
||||
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.impl.cloud.CommandECloud;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandDump;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandExpansionRegister;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandExpansionUnregister;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandHelp;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandInfo;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandList;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandParse;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandReload;
|
||||
import me.clip.placeholderapi.commands.impl.local.CommandVersion;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class PlaceholderCommandRouter implements CommandExecutor, TabCompleter {
|
||||
|
||||
@Unmodifiable
|
||||
private static final List<PlaceholderCommand> COMMANDS = ImmutableList.of(new CommandHelp(),
|
||||
new CommandInfo(),
|
||||
new CommandList(),
|
||||
new CommandDump(),
|
||||
new CommandECloud(),
|
||||
new CommandParse(),
|
||||
new CommandReload(),
|
||||
new CommandVersion(),
|
||||
new CommandExpansionRegister(),
|
||||
new CommandExpansionUnregister());
|
||||
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
private final Map<String, PlaceholderCommand> commands;
|
||||
|
||||
|
||||
public PlaceholderCommandRouter(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
final ImmutableMap.Builder<String, PlaceholderCommand> commands = ImmutableMap.builder();
|
||||
|
||||
for (final PlaceholderCommand command : COMMANDS) {
|
||||
command.getLabels().forEach(label -> commands.put(label, command));
|
||||
}
|
||||
|
||||
this.commands = commands.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull final CommandSender sender, @NotNull final Command command,
|
||||
@NotNull final String alias, @NotNull final String[] args) {
|
||||
if (args.length == 0) {
|
||||
final PlaceholderCommand fallback = commands.get("version");
|
||||
if (fallback != null) {
|
||||
fallback.evaluate(plugin, sender, "", Collections.emptyList());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
final String search = args[0].toLowerCase();
|
||||
final PlaceholderCommand target = commands.get(search);
|
||||
|
||||
if (target == null) {
|
||||
Msg.msg(sender, "&cUnknown command &7" + search);
|
||||
return true;
|
||||
}
|
||||
|
||||
final String permission = target.getPermission();
|
||||
if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
||||
Msg.msg(sender, "&cYou do not have permission to do this!");
|
||||
return true;
|
||||
}
|
||||
|
||||
target
|
||||
.evaluate(plugin, sender, search, Arrays.asList(Arrays.copyOfRange(args, 1, args.length)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull final CommandSender sender,
|
||||
@NotNull final Command command, @NotNull final String alias, @NotNull final String[] args) {
|
||||
final List<String> suggestions = new ArrayList<>();
|
||||
|
||||
if (args.length > 1) {
|
||||
final PlaceholderCommand target = this.commands.get(args[0].toLowerCase());
|
||||
|
||||
if (target != null) {
|
||||
target.complete(plugin, sender, args[0].toLowerCase(),
|
||||
Arrays.asList(Arrays.copyOfRange(args, 1, args.length)), suggestions);
|
||||
}
|
||||
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
final Stream<String> targets = PlaceholderCommand
|
||||
.filterByPermission(sender, commands.values().stream()).map(PlaceholderCommand::getLabels)
|
||||
.flatMap(Collection::stream);
|
||||
PlaceholderCommand.suggestByParameter(targets, suggestions, args.length == 0 ? null : args[0]);
|
||||
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloud extends PlaceholderCommand {
|
||||
|
||||
@Unmodifiable
|
||||
private static final List<PlaceholderCommand> COMMANDS = ImmutableList
|
||||
.of(new CommandECloudClear(),
|
||||
new CommandECloudToggle(),
|
||||
new CommandECloudStatus(),
|
||||
new CommandECloudUpdate(),
|
||||
new CommandECloudRefresh(),
|
||||
new CommandECloudDownload(),
|
||||
new CommandECloudExpansionInfo(),
|
||||
new CommandECloudExpansionList(),
|
||||
new CommandECloudExpansionPlaceholders());
|
||||
|
||||
static {
|
||||
COMMANDS
|
||||
.forEach(command -> command.setPermission("placeholderapi.ecloud." + command.getLabel()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
private final Map<String, PlaceholderCommand> commands;
|
||||
|
||||
|
||||
public CommandECloud() {
|
||||
super("ecloud");
|
||||
|
||||
final ImmutableMap.Builder<String, PlaceholderCommand> commands = ImmutableMap.builder();
|
||||
|
||||
for (final PlaceholderCommand command : COMMANDS) {
|
||||
command.getLabels().forEach(label -> commands.put(label, command));
|
||||
}
|
||||
|
||||
this.commands = commands.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&b&lPlaceholderAPI &8- &7eCloud Help Menu &8- ",
|
||||
" ",
|
||||
"&b/papi &fenable/disable/toggle",
|
||||
" &7&oEnable or disable the eCloud",
|
||||
"&b/papi &fecloud status",
|
||||
" &7&oView status of the eCloud",
|
||||
"&b/papi &fecloud list <all/{author}/installed> {page}",
|
||||
" &7&oList all/author specific available expansions",
|
||||
"&b/papi &fecloud info <expansion name> {version}",
|
||||
" &7&oView information about a specific expansion available on the eCloud",
|
||||
"&b/papi &fecloud placeholders <expansion name>",
|
||||
" &7&oView placeholders for an expansion",
|
||||
"&b/papi &fecloud download <expansion name> {version}",
|
||||
" &7&oDownload an expansion from the eCloud",
|
||||
"&b/papi &fecloud update <expansion name/all>",
|
||||
" &7&oUpdate a specific/all installed expansions",
|
||||
"&b/papi &fecloud refresh",
|
||||
" &7&oFetch the most up to date list of expansions available.",
|
||||
"&b/papi &fecloud clear",
|
||||
" &7&oClear the expansion cloud cache.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
final String search = params.get(0).toLowerCase();
|
||||
final PlaceholderCommand target = commands.get(search);
|
||||
|
||||
if (target == null) {
|
||||
Msg.msg(sender, "&cUnknown command &7ecloud " + search);
|
||||
return;
|
||||
}
|
||||
|
||||
final String permission = target.getPermission();
|
||||
if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
||||
Msg.msg(sender, "&cYou do not have permission to do this!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(target instanceof CommandECloudToggle) && !plugin.getPlaceholderAPIConfig()
|
||||
.isCloudEnabled()) {
|
||||
Msg.msg(sender,
|
||||
"&cThe eCloud Manager is not enabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
target.evaluate(plugin, sender, search, params.subList(1, params.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() <= 1) {
|
||||
final Stream<String> targets = filterByPermission(sender, commands.values().stream())
|
||||
.map(PlaceholderCommand::getLabels).flatMap(Collection::stream);
|
||||
suggestByParameter(targets, suggestions, params.isEmpty() ? null : params.get(0));
|
||||
|
||||
return; // send sub commands
|
||||
}
|
||||
|
||||
final String search = params.get(0).toLowerCase();
|
||||
final PlaceholderCommand target = commands.get(search);
|
||||
|
||||
if (target == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
target.complete(plugin, sender, search, params.subList(1, params.size()), suggestions);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudClear extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudClear() {
|
||||
super("clear");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
plugin.getCloudExpansionManager().clean();
|
||||
Msg.msg(sender,
|
||||
"&aThe eCloud cache has been cleared!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudDownload extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudDownload() {
|
||||
super("download");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must supply the name of an expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
final CloudExpansion expansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(params.get(0)).orElse(null);
|
||||
if (expansion == null) {
|
||||
Msg.msg(sender,
|
||||
"&cFailed to find an expansion named: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final CloudExpansion.Version version;
|
||||
if (params.size() < 2) {
|
||||
version = expansion.getVersion(expansion.getLatestVersion());
|
||||
if (version == null) {
|
||||
Msg.msg(sender,
|
||||
"&cCould not find latest version for expansion.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
version = expansion.getVersion(params.get(1));
|
||||
if (version == null) {
|
||||
Msg.msg(sender,
|
||||
"&cCould not find specified version: &f" + params.get(1),
|
||||
"&7Available versions: &f" + expansion.getAvailableVersions());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getCloudExpansionManager().downloadExpansion(expansion, version)
|
||||
.whenComplete((file, exception) -> {
|
||||
if (exception != null) {
|
||||
Msg.msg(sender,
|
||||
"&cFailed to download expansion: &f" + exception.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aSuccessfully downloaded expansion &f" + expansion.getName() + " [" + version
|
||||
.getVersion() + "] &ato file: &f" + file.getName(),
|
||||
"&aMake sure to type &f/papi reload &ato enable your new expansion!");
|
||||
|
||||
plugin.getCloudExpansionManager().clean();
|
||||
plugin.getCloudExpansionManager()
|
||||
.fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.size() <= 1) {
|
||||
final Stream<String> names = plugin.getCloudExpansionManager().getCloudExpansions().values()
|
||||
.stream().map(CloudExpansion::getName).map(name -> name.replace(' ', '_'));
|
||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final Optional<CloudExpansion> expansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(params.get(0));
|
||||
if (!expansion.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(expansion.get().getAvailableVersions().stream(), suggestions, params.get(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudExpansionInfo extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudExpansionInfo() {
|
||||
super("info");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify the name of the expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
final CloudExpansion expansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(params.get(0)).orElse(null);
|
||||
if (expansion == null) {
|
||||
Msg.msg(sender,
|
||||
"&cThere is no expansion with the name: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("&bExpansion: &f")
|
||||
.append(expansion.shouldUpdate() ? "&e" : "&a")
|
||||
.append(expansion.getName())
|
||||
.append('\n')
|
||||
.append("&bAuthor: &f")
|
||||
.append(expansion.getAuthor())
|
||||
.append('\n')
|
||||
.append("&bVerified: ")
|
||||
.append(expansion.isVerified() ? "&a&l✔" : "&c&l❌")
|
||||
.append('\n');
|
||||
|
||||
if (params.size() < 2) {
|
||||
builder.append("&bLatest Version: &f")
|
||||
.append(expansion.getLatestVersion())
|
||||
.append('\n')
|
||||
.append("&bReleased: &f")
|
||||
.append(expansion.getTimeSinceLastUpdate())
|
||||
.append(" ago")
|
||||
.append('\n')
|
||||
.append("&bRelease Notes: &f")
|
||||
.append(expansion.getVersion().getReleaseNotes())
|
||||
.append('\n');
|
||||
} else {
|
||||
final CloudExpansion.Version version = expansion.getVersion(params.get(1));
|
||||
if (version == null) {
|
||||
Msg.msg(sender,
|
||||
"&cCould not find specified version: &f" + params.get(1),
|
||||
"&aVersions: &f" + expansion.getAvailableVersions());
|
||||
return;
|
||||
}
|
||||
|
||||
builder.append("&bVersion: &f")
|
||||
.append(version.getVersion())
|
||||
.append('\n')
|
||||
.append("&bRelease Notes: &f")
|
||||
.append(version.getReleaseNotes())
|
||||
.append('\n')
|
||||
.append("&bDownload URL: &f")
|
||||
.append(version.getUrl())
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.size() <= 1) {
|
||||
final Stream<String> names = plugin.getCloudExpansionManager().getCloudExpansions().values()
|
||||
.stream().map(CloudExpansion::getName).map(name -> name.replace(' ', '_'));
|
||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final Optional<CloudExpansion> expansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(params.get(0));
|
||||
if (!expansion.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(expansion.get().getAvailableVersions().stream(), suggestions, params.get(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,348 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
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.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
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 org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudExpansionList extends PlaceholderCommand {
|
||||
|
||||
private static final int PAGE_SIZE = 10;
|
||||
|
||||
@NotNull
|
||||
private static final Function<CloudExpansion, Object> EXPANSION_NAME =
|
||||
expansion -> (expansion.shouldUpdate() ? "&6" : expansion.hasExpansion() ? "&a" : "&7")
|
||||
+ expansion.getName();
|
||||
@NotNull
|
||||
private static final Function<CloudExpansion, Object> EXPANSION_AUTHOR =
|
||||
expansion -> "&f" + expansion.getAuthor();
|
||||
@NotNull
|
||||
private static final Function<CloudExpansion, Object> EXPANSION_VERIFIED =
|
||||
expansion -> expansion.isVerified() ? "&aY" : "&cN";
|
||||
@NotNull
|
||||
private static final Function<CloudExpansion, Object> EXPANSION_LATEST_VERSION =
|
||||
expansion -> "&f" + expansion.getLatestVersion();
|
||||
@NotNull
|
||||
private static final Function<CloudExpansion, Object> EXPANSION_CURRENT_VERSION =
|
||||
expansion -> "&f" + PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
||||
.findExpansionByName(expansion.getName()).map(PlaceholderExpansion::getVersion)
|
||||
.orElse("Unknown");
|
||||
|
||||
|
||||
@Unmodifiable
|
||||
private static final Set<String> OPTIONS = ImmutableSet.of("all", "installed");
|
||||
|
||||
|
||||
public CommandECloudExpansionList() {
|
||||
super("list");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Collection<CloudExpansion> getExpansions(@NotNull final String target,
|
||||
@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
switch (target.toLowerCase()) {
|
||||
case "all":
|
||||
return plugin.getCloudExpansionManager().getCloudExpansions().values();
|
||||
case "installed":
|
||||
return plugin.getCloudExpansionManager().getCloudExpansionsInstalled().values();
|
||||
default:
|
||||
return plugin.getCloudExpansionManager().getCloudExpansionsByAuthor(target).values();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<CloudExpansion> getPage(@NotNull final List<CloudExpansion> expansions,
|
||||
final int page) {
|
||||
final int head = (page * PAGE_SIZE);
|
||||
final int tail = Math.min(expansions.size(), head + PAGE_SIZE);
|
||||
|
||||
if (expansions.size() < head) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return expansions.subList(head, tail);
|
||||
}
|
||||
|
||||
public static void addExpansionTitle(@NotNull final StringBuilder builder,
|
||||
@NotNull final String target, final int page) {
|
||||
switch (target.toLowerCase()) {
|
||||
case "all":
|
||||
builder.append("&bAll Expansions");
|
||||
break;
|
||||
case "installed":
|
||||
builder.append("&bInstalled Expansions");
|
||||
break;
|
||||
default:
|
||||
builder.append("&bExpansions by &f")
|
||||
.append(target);
|
||||
break;
|
||||
}
|
||||
|
||||
if (page == -1) {
|
||||
builder.append('\n');
|
||||
return;
|
||||
}
|
||||
|
||||
builder.append(" &bPage&7: &a")
|
||||
.append(page)
|
||||
.append("&r")
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static JSONMessage getMessage(@NotNull final List<CloudExpansion> 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();
|
||||
|
||||
for (int index = 0; index < expansions.size(); index++) {
|
||||
final CloudExpansion expansion = expansions.get(index);
|
||||
|
||||
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 String description = expansion.getDescription();
|
||||
if (description != null && !description.isEmpty()) {
|
||||
tooltip.append('\n')
|
||||
.append('\n')
|
||||
.append("&f")
|
||||
.append(description.replace("\r", "").trim());
|
||||
}
|
||||
|
||||
message.then(Msg.color(
|
||||
"&8" + (index + ((page - 1) * PAGE_SIZE) + 1) + ".&r " + (expansion.shouldUpdate() ? "&6"
|
||||
: expansion.hasExpansion() ? "&a" : "&7") + expansion.getName()));
|
||||
|
||||
message.tooltip(Msg.color(tooltip.toString()));
|
||||
message.suggestCommand("/papi ecloud download " + expansion.getName());
|
||||
|
||||
if (index < expansions.size() - 1) {
|
||||
message.newline();
|
||||
}
|
||||
|
||||
tooltip.setLength(0);
|
||||
}
|
||||
|
||||
if (limit > 1) {
|
||||
message.newline();
|
||||
|
||||
message.then("◀")
|
||||
.color(page > 1 ? ChatColor.GRAY : ChatColor.DARK_GRAY);
|
||||
if (page > 1) {
|
||||
message.runCommand("/papi ecloud list " + target + " " + (page - 1));
|
||||
}
|
||||
|
||||
message.then(" " + page + " ").color(ChatColor.GREEN);
|
||||
|
||||
message.then("▶")
|
||||
.color(page < limit ? ChatColor.GRAY : ChatColor.DARK_GRAY);
|
||||
if (page < limit) {
|
||||
message.runCommand("/papi ecloud list " + target + " " + (page + 1));
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
private static void addExpansionTable(@NotNull final List<CloudExpansion> expansions,
|
||||
@NotNull final StringBuilder message, final int startIndex,
|
||||
@NotNull final String versionTitle,
|
||||
@NotNull final Function<CloudExpansion, Object> versionFunction) {
|
||||
final Map<String, Function<CloudExpansion, Object>> functions = new LinkedHashMap<>();
|
||||
|
||||
final AtomicInteger counter = new AtomicInteger(startIndex);
|
||||
functions.put("&f", expansion -> "&8" + counter.getAndIncrement() + ".");
|
||||
|
||||
functions.put("&9Name", EXPANSION_NAME);
|
||||
functions.put("&9Author", EXPANSION_AUTHOR);
|
||||
functions.put("&9Verified", EXPANSION_VERIFIED);
|
||||
functions.put(versionTitle, versionFunction);
|
||||
|
||||
final List<List<String>> rows = new ArrayList<>();
|
||||
|
||||
rows.add(0, new ArrayList<>(functions.keySet()));
|
||||
|
||||
for (final CloudExpansion expansion : expansions) {
|
||||
rows.add(functions.values().stream().map(function -> function.apply(expansion))
|
||||
.map(Objects::toString).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
final List<String> table = Format.tablify(Format.Align.LEFT, rows)
|
||||
.orElse(Collections.emptyList());
|
||||
if (table.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
table.add(1, "&8" + Strings.repeat("-", table.get(0).length() - (rows.get(0).size() * 2)));
|
||||
|
||||
message.append(String.join("\n", table));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify an option. [all, {author}, installed]");
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean installed = params.get(0).equalsIgnoreCase("installed");
|
||||
final List<CloudExpansion> expansions = Lists
|
||||
.newArrayList(getExpansions(params.get(0), plugin));
|
||||
|
||||
if (expansions.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cNo expansions available to list.");
|
||||
return;
|
||||
}
|
||||
|
||||
expansions
|
||||
.sort(plugin.getPlaceholderAPIConfig().getExpansionSort().orElse(ExpansionSort.LATEST));
|
||||
|
||||
if (!(sender instanceof Player) && params.size() < 2) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
addExpansionTitle(builder, params.get(0), -1);
|
||||
addExpansionTable(expansions,
|
||||
builder,
|
||||
1,
|
||||
installed ? "&9Version" : "&9Latest Version",
|
||||
installed ? EXPANSION_CURRENT_VERSION : EXPANSION_LATEST_VERSION);
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
final int page;
|
||||
|
||||
if (params.size() < 2) {
|
||||
page = 1;
|
||||
} else {
|
||||
//noinspection UnstableApiUsage
|
||||
final Integer parsed = Ints.tryParse(params.get(1));
|
||||
if (parsed == null) {
|
||||
Msg.msg(sender,
|
||||
"&cPage number must be an integer.");
|
||||
return;
|
||||
}
|
||||
|
||||
final int limit = (int) Math.ceil((double) expansions.size() / PAGE_SIZE);
|
||||
|
||||
if (parsed < 1 || parsed > limit) {
|
||||
Msg.msg(sender,
|
||||
"&cPage number must be in the range &8[&a1&7..&a" + limit + "&8]");
|
||||
return;
|
||||
}
|
||||
|
||||
page = parsed;
|
||||
}
|
||||
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
final List<CloudExpansion> values = getPage(expansions, page - 1);
|
||||
|
||||
addExpansionTitle(builder, params.get(0), page);
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
addExpansionTable(values,
|
||||
builder,
|
||||
((page - 1) * PAGE_SIZE) + 1,
|
||||
installed ? "&9Version" : "&9Latest Version",
|
||||
installed ? EXPANSION_CURRENT_VERSION : EXPANSION_LATEST_VERSION);
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.size() <= 1) {
|
||||
suggestByParameter(
|
||||
Sets.union(OPTIONS, plugin.getCloudExpansionManager().getCloudExpansionAuthors())
|
||||
.stream(), suggestions, params.isEmpty() ? null : params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(IntStream.rangeClosed(1,
|
||||
(int) Math.ceil((double) getExpansions(params.get(0), plugin).size() / PAGE_SIZE))
|
||||
.mapToObj(Objects::toString), suggestions, params.get(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudExpansionPlaceholders extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudExpansionPlaceholders() {
|
||||
super("placeholders");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify the name of the expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
final CloudExpansion expansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(params.get(0)).orElse(null);
|
||||
if (expansion == null) {
|
||||
Msg.msg(sender,
|
||||
"&cThere is no expansion with the name: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final List<String> placeholders = expansion.getPlaceholders();
|
||||
if (placeholders == null || placeholders.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cThe expansion specified does not have placeholders listed.");
|
||||
return;
|
||||
}
|
||||
|
||||
final List<List<String>> partitions = Lists
|
||||
.partition(placeholders.stream().sorted().collect(Collectors.toList()), 10);
|
||||
|
||||
Msg.msg(sender,
|
||||
"&6" + placeholders.size() + "&7 placeholders: &a",
|
||||
partitions.stream().map(partition -> String.join(", ", partition))
|
||||
.collect(Collectors.joining("\n")));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Stream<String> names = plugin.getCloudExpansionManager()
|
||||
.getCloudExpansions()
|
||||
.values()
|
||||
.stream()
|
||||
.map(CloudExpansion::getName)
|
||||
.map(name -> name.replace(' ', '_'));
|
||||
|
||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudRefresh extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudRefresh() {
|
||||
super("refresh");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
plugin.getCloudExpansionManager().clean();
|
||||
plugin.getCloudExpansionManager()
|
||||
.fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aThe eCloud manager has been refreshed!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.manager.CloudExpansionManager;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudStatus extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudStatus() {
|
||||
super("status");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
final CloudExpansionManager manager = plugin.getCloudExpansionManager();
|
||||
|
||||
final int updateCount = manager.getCloudUpdateCount();
|
||||
final int authorCount = manager.getCloudExpansionAuthorCount();
|
||||
final int expansionCount = manager.getCloudExpansions().size();
|
||||
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("&bThere are &a").append(expansionCount)
|
||||
.append("&b expansions available on the eCloud.").append('\n');
|
||||
builder.append("&7A total of &f").append(authorCount)
|
||||
.append("&7 authors have contributed to the eCloud.").append('\n');
|
||||
|
||||
if (updateCount > 0) {
|
||||
builder.append("&eYou have &f").append(updateCount)
|
||||
.append(updateCount > 1 ? "&e expansions" : "&e expansion").append("installed that ")
|
||||
.append(updateCount > 1 ? "have an" : "has an").append(" update available.");
|
||||
}
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandECloudToggle extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudToggle() {
|
||||
super("toggle", "enable", "disable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
final boolean desiredState;
|
||||
final boolean currentState = plugin.getPlaceholderAPIConfig().isCloudEnabled();
|
||||
|
||||
switch (alias.toLowerCase()) {
|
||||
case "enable":
|
||||
desiredState = true;
|
||||
break;
|
||||
case "disable":
|
||||
desiredState = false;
|
||||
break;
|
||||
default:
|
||||
desiredState = !currentState;
|
||||
break;
|
||||
}
|
||||
|
||||
if (desiredState == currentState) {
|
||||
Msg.msg(sender, "&7The eCloud Manager is already " + (desiredState ? "enabled" : "disabled"));
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getPlaceholderAPIConfig().setCloudEnabled(desiredState);
|
||||
|
||||
if (desiredState) {
|
||||
plugin.getCloudExpansionManager().load();
|
||||
} else {
|
||||
plugin.getCloudExpansionManager().kill();
|
||||
}
|
||||
|
||||
Msg.msg(sender, "&aThe eCloud Manager has been " + (desiredState ? "enabled" : "disabled"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.cloud;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
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.expansion.cloud.CloudExpansion;
|
||||
import me.clip.placeholderapi.util.Futures;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
/**
|
||||
* please don't flame me for this code, I will fix this shit later.
|
||||
*/
|
||||
public final class CommandECloudUpdate extends PlaceholderCommand {
|
||||
|
||||
public CommandECloudUpdate() {
|
||||
super("update");
|
||||
}
|
||||
|
||||
private static CompletableFuture<List<@Nullable Class<? extends PlaceholderExpansion>>> downloadAndDiscover(
|
||||
@NotNull final List<CloudExpansion> expansions, @NotNull final PlaceholderAPIPlugin plugin) {
|
||||
return expansions.stream()
|
||||
.map(expansion -> plugin.getCloudExpansionManager()
|
||||
.downloadExpansion(expansion, expansion.getVersion()))
|
||||
.map(future -> future.thenCompose(plugin.getLocalExpansionManager()::findExpansionInFile))
|
||||
.collect(Futures.collector());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must define 'all' or the name of an expansion to update.");
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean multiple = params.get(0).equalsIgnoreCase("all");
|
||||
final List<CloudExpansion> expansions = new ArrayList<>();
|
||||
|
||||
// gather target expansions
|
||||
if (multiple) {
|
||||
expansions.addAll(plugin.getCloudExpansionManager().getCloudExpansionsInstalled().values());
|
||||
} else {
|
||||
plugin.getCloudExpansionManager().findCloudExpansionByName(params.get(0))
|
||||
.ifPresent(expansions::add);
|
||||
}
|
||||
|
||||
// remove the ones that are the latest version
|
||||
expansions.removeIf(expansion -> !expansion.shouldUpdate());
|
||||
|
||||
if (expansions.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cNo updates available for " + (!multiple ? "this expansion."
|
||||
: "your active expansions."));
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aUpdating expansions: " + expansions.stream().map(CloudExpansion::getName)
|
||||
.collect(Collectors.joining("&7, &6", "&8[&6", "&8]&r")));
|
||||
|
||||
Futures.onMainThread(plugin, downloadAndDiscover(expansions, plugin), (classes, exception) -> {
|
||||
if (exception != null) {
|
||||
Msg.msg(sender,
|
||||
"&cFailed to update expansions: &e" + exception.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aSuccessfully downloaded updates, registering new versions.");
|
||||
|
||||
final String message = classes.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(plugin.getLocalExpansionManager()::register)
|
||||
.filter(Optional::isPresent)
|
||||
.map(Optional::get)
|
||||
.map(expansion -> " &a" + expansion.getName() + " &f" + expansion.getVersion())
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
Msg.msg(sender,
|
||||
"&7Registered expansions:", message);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<CloudExpansion> installed = Lists
|
||||
.newArrayList(plugin.getCloudExpansionManager().getCloudExpansionsInstalled().values());
|
||||
installed.removeIf(expansion -> !expansion.shouldUpdate());
|
||||
|
||||
if (!installed.isEmpty() && (params.isEmpty() || "all"
|
||||
.startsWith(params.get(0).toLowerCase()))) {
|
||||
suggestions.add("all");
|
||||
}
|
||||
|
||||
suggestByParameter(
|
||||
installed.stream().map(CloudExpansion::getName).map(name -> name.replace(" ", "_")),
|
||||
suggestions, params.isEmpty() ? null : params.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,205 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import com.google.common.io.CharStreams;
|
||||
import com.google.gson.JsonParser;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
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 DateTimeFormatter DATE_FORMAT = DateTimeFormatter
|
||||
.ofLocalizedDateTime(FormatStyle.LONG)
|
||||
.withLocale(Locale.US)
|
||||
.withZone(ZoneId.of("UTC"));
|
||||
|
||||
|
||||
public CommandDump() {
|
||||
super("dump");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
postDump(makeDump(plugin)).whenComplete((key, exception) -> {
|
||||
if (exception != null) {
|
||||
plugin.getLogger().log(Level.WARNING, "failed to post dump details", exception);
|
||||
|
||||
Msg.msg(sender,
|
||||
"&cFailed to post dump details, check console.");
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aSuccessfully posted dump: " + URL + key);
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private CompletableFuture<String> postDump(@NotNull final String dump) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
final HttpURLConnection connection = ((HttpURLConnection) new URL(URL + "documents")
|
||||
.openConnection());
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "text/plain; charset=utf-8");
|
||||
connection.setDoOutput(true);
|
||||
|
||||
connection.connect();
|
||||
|
||||
try (final OutputStream stream = connection.getOutputStream()) {
|
||||
stream.write(dump.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
} catch (final IOException ex) {
|
||||
throw new CompletionException(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String makeDump(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("Generated: ")
|
||||
.append(DATE_FORMAT.format(Instant.now()))
|
||||
.append("\n\n");
|
||||
|
||||
builder.append("PlaceholderAPI: ")
|
||||
.append(plugin.getDescription().getVersion())
|
||||
.append("\n\n");
|
||||
|
||||
builder.append("Expansions Registered:")
|
||||
.append('\n');
|
||||
|
||||
final List<PlaceholderExpansion> expansions = plugin.getLocalExpansionManager()
|
||||
.getExpansions()
|
||||
.stream()
|
||||
.sorted(Comparator.comparing(PlaceholderExpansion::getIdentifier))
|
||||
.sorted(Comparator.comparing(PlaceholderExpansion::getAuthor))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int size = 0;
|
||||
|
||||
for (final String name : expansions.stream().map(PlaceholderExpansion::getIdentifier)
|
||||
.collect(Collectors.toList())) {
|
||||
if (name.length() > size) {
|
||||
size = name.length();
|
||||
}
|
||||
}
|
||||
|
||||
for (final PlaceholderExpansion expansion : expansions) {
|
||||
builder.append(" ")
|
||||
.append(String.format("%-" + size + "s", expansion.getIdentifier()))
|
||||
.append(" [Author: ")
|
||||
.append(expansion.getAuthor())
|
||||
.append(", Version: ")
|
||||
.append(expansion.getVersion())
|
||||
.append("]\n");
|
||||
|
||||
}
|
||||
|
||||
builder.append('\n');
|
||||
|
||||
builder.append("Expansions Directory:")
|
||||
.append('\n');
|
||||
|
||||
final String[] jars = plugin.getLocalExpansionManager()
|
||||
.getExpansionsFolder()
|
||||
.list((dir, name) -> name.toLowerCase().endsWith(".jar"));
|
||||
|
||||
for (final String jar : jars) {
|
||||
builder.append(" ")
|
||||
.append(jar)
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
builder.append('\n');
|
||||
|
||||
builder.append("Server Info: ")
|
||||
.append(plugin.getServer().getBukkitVersion())
|
||||
.append('/')
|
||||
.append(plugin.getServer().getVersion())
|
||||
.append("\n\n");
|
||||
|
||||
builder.append("Plugin Info:")
|
||||
.append('\n');
|
||||
|
||||
List<Plugin> plugins = Arrays.stream(plugin.getServer().getPluginManager().getPlugins())
|
||||
.sorted(Comparator.comparing(Plugin::getName))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (final String pluginName : plugins.stream().map(Plugin::getName)
|
||||
.collect(Collectors.toList())) {
|
||||
if (pluginName.length() > size) {
|
||||
size = pluginName.length();
|
||||
}
|
||||
}
|
||||
|
||||
for (final Plugin other : plugins) {
|
||||
builder.append(" ")
|
||||
.append(String.format("%-" + size + "s", other.getName()))
|
||||
.append(" [Version: ")
|
||||
.append(other.getDescription().getVersion())
|
||||
.append("]")
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Level;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.manager.LocalExpansionManager;
|
||||
import me.clip.placeholderapi.util.Futures;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandExpansionRegister extends PlaceholderCommand {
|
||||
|
||||
public CommandExpansionRegister() {
|
||||
super("register");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.size() < 1) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify the name of an expansion file.");
|
||||
return;
|
||||
}
|
||||
|
||||
final LocalExpansionManager manager = plugin.getLocalExpansionManager();
|
||||
|
||||
final File file = new File(manager.getExpansionsFolder(), params.get(0));
|
||||
if (!file.exists()) {
|
||||
Msg.msg(sender,
|
||||
"&cThe file &f" + file.getName() + "&c doesn't exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
Futures.onMainThread(plugin, manager.findExpansionInFile(file), (clazz, exception) -> {
|
||||
if (exception != null) {
|
||||
Msg.msg(sender,
|
||||
"&cFailed to find expansion in file: &f" + file);
|
||||
|
||||
plugin.getLogger()
|
||||
.log(Level.WARNING, "failed to find expansion in file: " + file, exception);
|
||||
return;
|
||||
}
|
||||
|
||||
if (clazz == null) {
|
||||
Msg.msg(sender,
|
||||
"&cNo expansion class found in file: &f" + file);
|
||||
return;
|
||||
}
|
||||
|
||||
final Optional<PlaceholderExpansion> expansion = manager.register(clazz);
|
||||
if (!expansion.isPresent()) {
|
||||
Msg.msg(sender,
|
||||
"&cFailed to register expansion from &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
Msg.msg(sender,
|
||||
"&aSuccessfully registered expansion: &f" + expansion.get().getName());
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String[] fileNames = plugin.getLocalExpansionManager().getExpansionsFolder()
|
||||
.list((dir, name) -> name.endsWith(".jar"));
|
||||
if (fileNames == null || fileNames.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(Arrays.stream(fileNames), suggestions,
|
||||
params.isEmpty() ? null : params.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
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.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandExpansionUnregister extends PlaceholderCommand {
|
||||
|
||||
public CommandExpansionUnregister() {
|
||||
super("unregister");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify the name of the expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
final Optional<PlaceholderExpansion> expansion = plugin.getLocalExpansionManager()
|
||||
.findExpansionByName(params.get(0));
|
||||
if (!expansion.isPresent()) {
|
||||
Msg.msg(sender,
|
||||
"&cThere is no expansion loaded with the identifier: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final String message = !expansion.get().unregister() ?
|
||||
"&cFailed to unregister expansion: &f" :
|
||||
"&aSuccessfully unregistered expansion: &f";
|
||||
|
||||
Msg.msg(sender, message + expansion.get().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(PlaceholderAPI.getRegisteredIdentifiers().stream(), suggestions,
|
||||
params.isEmpty() ? null : params.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandHelp extends PlaceholderCommand {
|
||||
|
||||
public CommandHelp() {
|
||||
super("help");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
final PluginDescriptionFile description = plugin.getDescription();
|
||||
|
||||
Msg.msg(sender,
|
||||
"&b&lPlaceholderAPI &8- &7Help Menu &8- &7(&f" + description.getVersion() + "&7)",
|
||||
" ",
|
||||
"&b/papi &fbcparse &9<me/player name> <message>",
|
||||
" &7&oParse a message with placeholders and broadcast it",
|
||||
"&b/papi &fcmdparse &9<me/player> <command with placeholders>",
|
||||
" &7&oParse a message with relational placeholders",
|
||||
"&b/papi &fdump",
|
||||
" &7&oDump all relevant information needed to help debug issues into a paste link.",
|
||||
"&b/papi &finfo &9<placeholder name>",
|
||||
" &7&oView information for a specific expansion",
|
||||
"&b/papi &flist",
|
||||
" &7&oList active expansions",
|
||||
"&b/papi &fparse &9<me/player name> <message>",
|
||||
" &7&oParse a message with placeholders",
|
||||
"&b/papi &fparserel &9<player one> <player two> <message>",
|
||||
" &7&oParse a message with relational placeholders",
|
||||
"&b/papi &fregister &9<file name>",
|
||||
" &7&oRegister an expansion by the name of the file",
|
||||
"&b/papi &freload",
|
||||
" &7&oReload the config of PAPI",
|
||||
"&b/papi &funregister &9<expansion name>",
|
||||
" &7&oUnregister an expansion by name",
|
||||
"&b/papi &fversion",
|
||||
" &7&oView plugin info/version");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
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.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandInfo extends PlaceholderCommand {
|
||||
|
||||
public CommandInfo() {
|
||||
super("info");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.isEmpty()) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must specify the name of the expansion.");
|
||||
return;
|
||||
}
|
||||
|
||||
final PlaceholderExpansion expansion = plugin.getLocalExpansionManager()
|
||||
.findExpansionByName(params.get(0)).orElse(null);
|
||||
if (expansion == null) {
|
||||
Msg.msg(sender,
|
||||
"&cThere is no expansion loaded with the identifier: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("&7Placeholder expansion info for: &r")
|
||||
.append(expansion.getName())
|
||||
.append('\n')
|
||||
.append("&7Status: &r")
|
||||
.append(expansion.isRegistered() ? "&aRegistered" : "7cNotRegistered")
|
||||
.append('\n');
|
||||
|
||||
final String author = expansion.getAuthor();
|
||||
if (author != null) {
|
||||
builder.append("&7Author: &r")
|
||||
.append(author)
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
final String version = expansion.getVersion();
|
||||
if (version != null) {
|
||||
builder.append("&7Version: &r")
|
||||
.append(version)
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
final String requiredPlugin = expansion.getRequiredPlugin();
|
||||
if (requiredPlugin != null) {
|
||||
builder.append("&7Requires plugin: &r")
|
||||
.append(requiredPlugin)
|
||||
.append('\n');
|
||||
}
|
||||
|
||||
final List<String> placeholders = expansion.getPlaceholders();
|
||||
if (placeholders != null && !placeholders.isEmpty()) {
|
||||
builder.append("&8&m-- &7Placeholders &8&m--&r")
|
||||
.append('\n');
|
||||
|
||||
for (final String placeholder : placeholders) {
|
||||
builder.append(placeholder)
|
||||
.append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
Msg.msg(sender, builder.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
suggestByParameter(PlaceholderAPI.getRegisteredIdentifiers().stream(), suggestions,
|
||||
params.isEmpty() ? null : params.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandList extends PlaceholderCommand {
|
||||
|
||||
public CommandList() {
|
||||
super("list");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
final Set<String> identifiers = PlaceholderAPI.getRegisteredIdentifiers();
|
||||
if (identifiers.isEmpty()) {
|
||||
Msg.msg(sender, "&cThere are no placeholder hooks active!");
|
||||
return;
|
||||
}
|
||||
|
||||
final List<List<String>> partitions = Lists
|
||||
.partition(identifiers.stream().sorted().collect(Collectors.toList()), 10);
|
||||
|
||||
Msg.msg(sender,
|
||||
"&7A total of &f" + identifiers.size() + "&7 placeholder hook(s) are active: &a",
|
||||
partitions.stream().map(partition -> String.join("&7, &a", partition))
|
||||
.collect(Collectors.joining("\n")));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandParse extends PlaceholderCommand {
|
||||
|
||||
public CommandParse() {
|
||||
super("parse", "bcparse", "parserel", "cmdparse");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
switch (alias.toLowerCase()) {
|
||||
case "parserel":
|
||||
evaluateParseRelation(sender, params);
|
||||
break;
|
||||
case "parse":
|
||||
evaluateParseSingular(sender, params, false, false);
|
||||
break;
|
||||
case "bcparse":
|
||||
evaluateParseSingular(sender, params, true, false);
|
||||
break;
|
||||
case "cmdparse":
|
||||
evaluateParseSingular(sender, params, false, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
switch (alias.toLowerCase()) {
|
||||
case "parserel":
|
||||
completeParseRelation(params, suggestions);
|
||||
break;
|
||||
case "parse":
|
||||
case "bcparse":
|
||||
case "cmdparse":
|
||||
completeParseSingular(sender, params, suggestions);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void evaluateParseSingular(@NotNull final CommandSender sender,
|
||||
@NotNull @Unmodifiable final List<String> params, final boolean broadcast,
|
||||
final boolean command) {
|
||||
if (params.size() < 2) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must supply a target, and a message: &b/papi " + (broadcast ? "bcparse" : "parse")
|
||||
+ " &7{target} &a{message}");
|
||||
return;
|
||||
}
|
||||
|
||||
@NotNull final OfflinePlayer player;
|
||||
|
||||
if ("me".equalsIgnoreCase(params.get(0))) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Msg.msg(sender, "&cYou must be a player to use &7me&c as a target!");
|
||||
return;
|
||||
}
|
||||
|
||||
player = ((Player) sender);
|
||||
} else {
|
||||
final OfflinePlayer target = resolvePlayer(params.get(0));
|
||||
if (target == null) {
|
||||
Msg.msg(sender, "&cFailed to find player: &7" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
player = target;
|
||||
}
|
||||
|
||||
final String message = PlaceholderAPI
|
||||
.setPlaceholders(player, String.join(" ", params.subList(1, params.size())));
|
||||
|
||||
if (command) {
|
||||
Bukkit.dispatchCommand(sender, message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (broadcast) {
|
||||
Msg.broadcast(message);
|
||||
} else {
|
||||
if (!(sender instanceof Player)) {
|
||||
Msg.msg(sender, message);
|
||||
} else {
|
||||
((Player) sender).spigot().sendMessage(TextComponent.fromLegacyText(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void evaluateParseRelation(@NotNull final CommandSender sender,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
if (params.size() < 3) {
|
||||
Msg.msg(sender,
|
||||
"&cYou must supply two targets, and a message: &b/papi parserel &7{target one} {target two} &a{message}");
|
||||
return;
|
||||
}
|
||||
|
||||
final OfflinePlayer targetOne = resolvePlayer(params.get(0));
|
||||
if (targetOne == null || !targetOne.isOnline()) {
|
||||
Msg.msg(sender, "&cFailed to find player: &f" + params.get(0));
|
||||
return;
|
||||
}
|
||||
|
||||
final OfflinePlayer targetTwo = resolvePlayer(params.get(1));
|
||||
if (targetTwo == null || !targetTwo.isOnline()) {
|
||||
Msg.msg(sender, "&cFailed to find player: &f" + params.get(1));
|
||||
return;
|
||||
}
|
||||
|
||||
final String message = PlaceholderAPI
|
||||
.setRelationalPlaceholders(((Player) targetOne), ((Player) targetTwo),
|
||||
String.join(" ", params.subList(2, params.size())));
|
||||
Msg.msg(sender, message);
|
||||
}
|
||||
|
||||
|
||||
private void completeParseSingular(@NotNull final CommandSender sender,
|
||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||
if (params.size() <= 1) {
|
||||
if (sender instanceof Player && (params.isEmpty() || "me"
|
||||
.startsWith(params.get(0).toLowerCase()))) {
|
||||
suggestions.add("me");
|
||||
}
|
||||
|
||||
final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);
|
||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
final String name = params.get(params.size() - 1);
|
||||
if (!name.startsWith("%") || name.endsWith("%")) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int index = name.indexOf('_');
|
||||
if (index == -1) {
|
||||
return; // no arguments supplied yet
|
||||
}
|
||||
|
||||
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
|
||||
.getLocalExpansionManager().findExpansionByIdentifier(name.substring(1, index))
|
||||
.orElse(null);
|
||||
if (expansion == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Set<String> possible = new HashSet<>(expansion.getPlaceholders());
|
||||
|
||||
PlaceholderAPIPlugin.getInstance()
|
||||
.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(expansion.getName())
|
||||
.ifPresent(cloud -> possible.addAll(cloud.getPlaceholders()));
|
||||
|
||||
suggestByParameter(possible.stream(), suggestions, params.get(params.size() - 1));
|
||||
}
|
||||
|
||||
private void completeParseRelation(@NotNull @Unmodifiable final List<String> params,
|
||||
@NotNull final List<String> suggestions) {
|
||||
if (params.size() > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);
|
||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(params.size() - 1));
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
private OfflinePlayer resolvePlayer(@NotNull final String name) {
|
||||
OfflinePlayer target = Bukkit.getPlayer(name);
|
||||
|
||||
if (target == null) {
|
||||
target = Bukkit.getOfflinePlayer(name); // this is probably not a great idea.
|
||||
}
|
||||
|
||||
return target.hasPlayedBefore() ? target : null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandReload extends PlaceholderCommand {
|
||||
|
||||
public CommandReload() {
|
||||
super("reload");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
plugin.reloadConf(sender);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.commands.impl.local;
|
||||
|
||||
import java.util.List;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CommandVersion extends PlaceholderCommand {
|
||||
|
||||
public CommandVersion() {
|
||||
super("version");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@NotNull @Unmodifiable final List<String> params) {
|
||||
final PluginDescriptionFile description = plugin.getDescription();
|
||||
|
||||
Msg.msg(sender,
|
||||
"&b&lPlaceholderAPI &7(&f" + description.getVersion() + "&7)",
|
||||
"&7Author: &f" + description.getAuthors(),
|
||||
"&7PAPI Commands: &b/papi &fhelp",
|
||||
"&7eCloud Commands&8: &b/papi &fecloud");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.configuration;
|
||||
|
||||
import java.util.Comparator;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum ExpansionSort implements Comparator<CloudExpansion> {
|
||||
|
||||
NAME(Comparator.comparing(CloudExpansion::getName)),
|
||||
AUTHOR(Comparator.comparing(CloudExpansion::getAuthor)),
|
||||
LATEST(Comparator.comparing(CloudExpansion::getLastUpdate).reversed());
|
||||
|
||||
|
||||
@NotNull
|
||||
private final Comparator<CloudExpansion> comparator;
|
||||
|
||||
ExpansionSort(@NotNull final Comparator<CloudExpansion> comparator) {
|
||||
this.comparator = comparator;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final int compare(final CloudExpansion expansion1, final CloudExpansion expansion2) {
|
||||
return comparator.compare(expansion1, expansion2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.configuration;
|
||||
|
||||
import java.util.Optional;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class PlaceholderAPIConfig {
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
|
||||
public PlaceholderAPIConfig(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
||||
public boolean checkUpdates() {
|
||||
return plugin.getConfig().getBoolean("check_updates");
|
||||
}
|
||||
|
||||
public boolean cloudAllowUnverifiedExpansions() {
|
||||
return plugin.getConfig().getBoolean("cloud_allow_unverified_expansions");
|
||||
}
|
||||
|
||||
|
||||
public boolean isCloudEnabled() {
|
||||
return plugin.getConfig().getBoolean("cloud_enabled");
|
||||
}
|
||||
|
||||
public void setCloudEnabled(boolean state) {
|
||||
plugin.getConfig().set("cloud_enabled", state);
|
||||
plugin.saveConfig();
|
||||
}
|
||||
|
||||
|
||||
public boolean isDebugMode() {
|
||||
return plugin.getConfig().getBoolean("debug", false);
|
||||
}
|
||||
|
||||
|
||||
public Optional<ExpansionSort> getExpansionSort() {
|
||||
final String option = plugin.getConfig()
|
||||
.getString("cloud_sorting", ExpansionSort.LATEST.name());
|
||||
|
||||
try {
|
||||
//noinspection ConstantConditions (bad spigot annotation)
|
||||
return Optional.of(ExpansionSort.valueOf(option.toUpperCase()));
|
||||
} catch (final IllegalArgumentException ignored) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public String dateFormat() {
|
||||
//noinspection ConstantConditions (bad spigot annotation)
|
||||
return plugin.getConfig().getString("date_format", "MM/dd/yy HH:mm:ss");
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public String booleanTrue() {
|
||||
//noinspection ConstantConditions (bad spigot annotation)
|
||||
return plugin.getConfig().getString("boolean.true", "true");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String booleanFalse() {
|
||||
//noinspection ConstantConditions (bad spigot annotation)
|
||||
return plugin.getConfig().getString("boolean.false", "false");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.events;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ExpansionRegisterEvent extends Event implements Cancellable {
|
||||
|
||||
@NotNull
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
@NotNull
|
||||
private final PlaceholderExpansion expansion;
|
||||
private boolean cancelled;
|
||||
|
||||
public ExpansionRegisterEvent(@NotNull final PlaceholderExpansion expansion) {
|
||||
this.expansion = expansion;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PlaceholderExpansion getExpansion() {
|
||||
return expansion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.events;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ExpansionUnregisterEvent extends Event {
|
||||
|
||||
@NotNull
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderExpansion expansion;
|
||||
|
||||
public ExpansionUnregisterEvent(@NotNull final PlaceholderExpansion expansion) {
|
||||
this.expansion = expansion;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PlaceholderExpansion getExpansion() {
|
||||
return expansion;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.events;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderHook;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated This event is no longer used.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class PlaceholderHookUnloadEvent extends Event {
|
||||
|
||||
@NotNull
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
|
||||
@NotNull
|
||||
private final String plugin;
|
||||
@NotNull
|
||||
private final PlaceholderHook placeholderHook;
|
||||
|
||||
public PlaceholderHookUnloadEvent(@NotNull final String plugin,
|
||||
@NotNull final PlaceholderHook placeholderHook) {
|
||||
this.plugin = plugin;
|
||||
this.placeholderHook = placeholderHook;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getHookName() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PlaceholderHook getHook() {
|
||||
return placeholderHook;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.exceptions;
|
||||
|
||||
public final class NoDefaultCommandException extends RuntimeException {
|
||||
|
||||
public NoDefaultCommandException(final String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
/**
|
||||
* This interface allows a class which extends a {@link PlaceholderExpansion} to have the clear
|
||||
* method called when the implementing expansion is unregistered from PlaceholderAPI. This is useful
|
||||
* if we want to do things when the implementing hook is unregistered
|
||||
*
|
||||
* @author Ryan McCarthy
|
||||
*/
|
||||
public interface Cacheable {
|
||||
|
||||
/**
|
||||
* Called when the implementing class is unregistered from PlaceholderAPI
|
||||
*/
|
||||
void clear();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* This interface allows a class which extends a {@link PlaceholderExpansion} to have the cleanup
|
||||
* method called every time a player leaves the server. This is useful if we want to clean up after
|
||||
* the player
|
||||
*
|
||||
* @author Ryan McCarthy
|
||||
*/
|
||||
public interface Cleanable {
|
||||
|
||||
/**
|
||||
* Called when a player leaves the server
|
||||
*
|
||||
* @param p (@link Player} who left the server
|
||||
*/
|
||||
void cleanup(Player p);
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
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
|
||||
*
|
||||
* @author Ryan McCarthy
|
||||
*/
|
||||
public interface Configurable {
|
||||
|
||||
/**
|
||||
* This method will be called before the implementing class is registered to obtain a map of
|
||||
* configuration options that the implementing class needs These paths and values will be added to
|
||||
* the PlaceholderAPI config.yml in the configuration section expansions.(placeholder
|
||||
* identifier).(your key): (your value)
|
||||
*
|
||||
* @return Map of config path / values which need to be added / removed from the PlaceholderAPI
|
||||
* config.yml file
|
||||
*/
|
||||
Map<String, Object> getDefaults();
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
public enum NMSVersion {
|
||||
|
||||
UNKNOWN("unknown"),
|
||||
SPIGOT_1_7_R1("v1_7_R1"),
|
||||
SPIGOT_1_7_R2("v1_7_R2"),
|
||||
SPIGOT_1_7_R3("v1_7_R3"),
|
||||
SPIGOT_1_7_R4("v1_7_R4"),
|
||||
SPIGOT_1_8_R1("v1_8_R1"),
|
||||
SPIGOT_1_8_R2("v1_8_R2"),
|
||||
SPIGOT_1_8_R3("v1_8_R3"),
|
||||
SPIGOT_1_9_R1("v1_9_R1"),
|
||||
SPIGOT_1_9_R2("v1_9_R2"),
|
||||
SPIGOT_1_10_R1("v1_10_R1"),
|
||||
SPIGOT_1_11_R1("v1_11_R1"),
|
||||
SPIGOT_1_12_R1("v1_12_R1"),
|
||||
SPIGOT_1_13_R1("v1_13_R1"),
|
||||
SPIGOT_1_13_R2("v1_13_R2"),
|
||||
SPIGOT_1_14_R1("v1_14_R1"),
|
||||
SPIGOT_1_15_R1("v1_15_R1"),
|
||||
SPIGOT_1_16_R1("v1_16_R1");
|
||||
|
||||
private final String version;
|
||||
|
||||
NMSVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public static NMSVersion getVersion(String version) {
|
||||
for (NMSVersion v : values()) {
|
||||
if (v.getVersion().equalsIgnoreCase(version)) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
return NMSVersion.UNKNOWN;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,272 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class PlaceholderExpansion extends PlaceholderHook {
|
||||
|
||||
/**
|
||||
* The placeholder identifier of this expansion
|
||||
*
|
||||
* @return placeholder identifier that is associated with this expansion
|
||||
*/
|
||||
@NotNull
|
||||
public abstract String getIdentifier();
|
||||
|
||||
/**
|
||||
* The author of this expansion
|
||||
*
|
||||
* @return name of the author for this expansion
|
||||
*/
|
||||
@NotNull
|
||||
public abstract String getAuthor();
|
||||
|
||||
/**
|
||||
* The version of this expansion
|
||||
*
|
||||
* @return current version of this expansion
|
||||
*/
|
||||
@NotNull
|
||||
public abstract String getVersion();
|
||||
|
||||
@Nullable
|
||||
@Override /* override for now >:) */
|
||||
public String onRequest(@Nullable final OfflinePlayer player, @NotNull final String params) {
|
||||
return super.onRequest(player, params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The name of this expansion
|
||||
*
|
||||
* @return {@link #getIdentifier()} by default, name of this expansion if specified
|
||||
*/
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return getIdentifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the plugin that this expansion hooks into. by default will null
|
||||
*
|
||||
* @return plugin name that this expansion requires to function
|
||||
*/
|
||||
@Nullable
|
||||
public String getRequiredPlugin() {
|
||||
return getPlugin();
|
||||
}
|
||||
|
||||
/**
|
||||
* The placeholders associated with this expansion
|
||||
*
|
||||
* @return placeholder list that this expansion provides
|
||||
*/
|
||||
@NotNull
|
||||
public List<String> getPlaceholders() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Expansions that do not use the ecloud and instead register from the dependency should set this
|
||||
* to true to ensure that your placeholder expansion is not unregistered when the papi reload
|
||||
* command is used
|
||||
*
|
||||
* @return if this expansion should persist through placeholder reloads
|
||||
*/
|
||||
public boolean persist() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if this placeholder identifier has already been registered
|
||||
*
|
||||
* @return true if the identifier for this expansion is already registered
|
||||
*/
|
||||
public final boolean isRegistered() {
|
||||
return getPlaceholderAPI().getLocalExpansionManager().findExpansionByIdentifier(getIdentifier())
|
||||
.map(it -> it.equals(this)).orElse(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If any requirements need to be checked before this expansion should register, you can check
|
||||
* them here
|
||||
*
|
||||
* @return true if this hook meets all the requirements to register
|
||||
*/
|
||||
public boolean canRegister() {
|
||||
return getRequiredPlugin() == null
|
||||
|| Bukkit.getPluginManager().getPlugin(getRequiredPlugin()) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to register this PlaceholderExpansion
|
||||
*
|
||||
* @return true if this expansion is now registered with PlaceholderAPI
|
||||
*/
|
||||
public boolean register() {
|
||||
return canRegister() && getPlaceholderAPI().getLocalExpansionManager().register(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to unregister this PlaceholderExpansion
|
||||
*
|
||||
* @return true if this expansion is now unregistered with PlaceholderAPI
|
||||
*/
|
||||
public final boolean unregister() {
|
||||
return getPlaceholderAPI().getLocalExpansionManager().unregister(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Quick getter for the {@link PlaceholderAPIPlugin} instance
|
||||
*
|
||||
* @return {@link PlaceholderAPIPlugin} instance
|
||||
*/
|
||||
@NotNull
|
||||
public final PlaceholderAPIPlugin getPlaceholderAPI() {
|
||||
return PlaceholderAPIPlugin.getInstance();
|
||||
}
|
||||
|
||||
// === Configuration ===
|
||||
|
||||
@Nullable
|
||||
public final ConfigurationSection getConfigSection() {
|
||||
return getPlaceholderAPI().getConfig().getConfigurationSection("expansions." + getIdentifier());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final ConfigurationSection getConfigSection(@NotNull final String path) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? null : section.getConfigurationSection(path);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
public final int getInt(@NotNull final String path, final int def) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? def : section.getInt(path, def);
|
||||
}
|
||||
|
||||
public final long getLong(@NotNull final String path, final long def) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? def : section.getLong(path, def);
|
||||
}
|
||||
|
||||
public final double getDouble(@NotNull final String path, final double def) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? def : section.getDouble(path, def);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public final List<String> getStringList(@NotNull final String path) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? Collections.emptyList() : section.getStringList(path);
|
||||
}
|
||||
|
||||
public final boolean configurationContains(@NotNull final String path) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section != null && section.contains(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof PlaceholderExpansion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final PlaceholderExpansion expansion = (PlaceholderExpansion) o;
|
||||
|
||||
return getIdentifier().equals(expansion.getIdentifier()) &&
|
||||
getAuthor().equals(expansion.getAuthor()) &&
|
||||
getVersion().equals(expansion.getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return Objects.hash(getIdentifier(), getAuthor(), getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return String.format("PlaceholderExpansion[name: '%s', author: '%s', version: '%s']", getName(),
|
||||
getAuthor(), getVersion());
|
||||
}
|
||||
|
||||
// === Deprecated API ===
|
||||
|
||||
/**
|
||||
* @deprecated As of versions greater than 2.8.7, use {@link #getRequiredPlugin()}
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public String getPlugin() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to show a description
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to display a link
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||
public String getLink() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface Relational {
|
||||
|
||||
String onPlaceholderRequest(Player one, Player two, String identifier);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
|
||||
public interface Taskable {
|
||||
|
||||
/**
|
||||
* Called when the implementing class has successfully been registered to the placeholder map
|
||||
* Tasks that need to be performed when this expansion is registered should go here
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* Called when the implementing class has been unregistered from PlaceholderAPI Tasks that need to
|
||||
* be performed when this expansion has unregistered should go here
|
||||
*/
|
||||
void stop();
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
public final class Version {
|
||||
|
||||
private final boolean isSpigot;
|
||||
private final String version;
|
||||
|
||||
public Version(String version, boolean isSpigot) {
|
||||
this.version = version;
|
||||
this.isSpigot = isSpigot;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version == null ? "unknown" : version;
|
||||
}
|
||||
|
||||
public boolean isSpigot() {
|
||||
return isSpigot;
|
||||
}
|
||||
|
||||
public boolean compareTo(String version) {
|
||||
return getVersion().equalsIgnoreCase(version);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
/**
|
||||
* Placeholder expansions which use NMS code should be version specific. Implementing this class
|
||||
* allows you to perform checks based on the version the server is running. The isCompatibleWith
|
||||
* method will be passed the server version and allow you to return if your expansion is compatible
|
||||
* with that version.
|
||||
*
|
||||
* @author Ryan McCarthy
|
||||
*/
|
||||
public interface VersionSpecific {
|
||||
|
||||
/**
|
||||
* This method is called before the expansion is attempted to be registered The server version
|
||||
* will be passed to this method so you know what version the server is currently running.
|
||||
*
|
||||
* @return true if your expansion is compatible with the version the server is running.
|
||||
*/
|
||||
boolean isCompatibleWith(Version v);
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion.cloud;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
import me.clip.placeholderapi.util.TimeUtil;
|
||||
|
||||
|
||||
public class CloudExpansion {
|
||||
|
||||
private String name,
|
||||
author,
|
||||
latest_version,
|
||||
description,
|
||||
source_url,
|
||||
dependency_url;
|
||||
|
||||
private boolean hasExpansion,
|
||||
shouldUpdate,
|
||||
verified;
|
||||
|
||||
private long last_update,
|
||||
ratings_count;
|
||||
|
||||
private double average_rating;
|
||||
|
||||
private List<String> placeholders;
|
||||
|
||||
private List<Version> versions;
|
||||
|
||||
public CloudExpansion() {
|
||||
}
|
||||
|
||||
public String getTimeSinceLastUpdate() {
|
||||
int time = (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - getLastUpdate());
|
||||
return TimeUtil.getTime(time);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public Version getVersion() {
|
||||
return getLatestVersion() == null ? null : getVersion(getLatestVersion());
|
||||
}
|
||||
|
||||
public Version getVersion(String version) {
|
||||
return versions == null ? null : versions.stream()
|
||||
.filter(v -> v.getVersion().equals(version))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public List<String> getAvailableVersions() {
|
||||
return versions.stream().map(Version::getVersion).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public String getLatestVersion() {
|
||||
return latest_version;
|
||||
}
|
||||
|
||||
public void setLatestVersion(String latest_version) {
|
||||
this.latest_version = latest_version;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getSourceUrl() {
|
||||
return source_url;
|
||||
}
|
||||
|
||||
public void setSourceUrl(String source_url) {
|
||||
this.source_url = source_url;
|
||||
}
|
||||
|
||||
public String getDependencyUrl() {
|
||||
return dependency_url;
|
||||
}
|
||||
|
||||
public void setDependencyUrl(String dependency_url) {
|
||||
this.dependency_url = dependency_url;
|
||||
}
|
||||
|
||||
public boolean hasExpansion() {
|
||||
return hasExpansion;
|
||||
}
|
||||
|
||||
public void setHasExpansion(boolean hasExpansion) {
|
||||
this.hasExpansion = hasExpansion;
|
||||
}
|
||||
|
||||
public boolean shouldUpdate() {
|
||||
return shouldUpdate;
|
||||
}
|
||||
|
||||
public void setShouldUpdate(boolean shouldUpdate) {
|
||||
this.shouldUpdate = shouldUpdate;
|
||||
}
|
||||
|
||||
public boolean isVerified() {
|
||||
return verified;
|
||||
}
|
||||
|
||||
public long getLastUpdate() {
|
||||
return last_update;
|
||||
}
|
||||
|
||||
public void setLastUpdate(long last_update) {
|
||||
this.last_update = last_update;
|
||||
}
|
||||
|
||||
public long getRatingsCount() {
|
||||
return ratings_count;
|
||||
}
|
||||
|
||||
public double getAverage_rating() {
|
||||
return average_rating;
|
||||
}
|
||||
|
||||
public List<String> getPlaceholders() {
|
||||
return placeholders;
|
||||
}
|
||||
|
||||
public void setPlaceholders(List<String> placeholders) {
|
||||
this.placeholders = placeholders;
|
||||
}
|
||||
|
||||
public List<Version> getVersions() {
|
||||
return versions;
|
||||
}
|
||||
|
||||
public void setVersions(List<Version> versions) {
|
||||
this.versions = versions;
|
||||
}
|
||||
|
||||
public class Version {
|
||||
|
||||
private String url, version, release_notes;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getReleaseNotes() {
|
||||
return release_notes;
|
||||
}
|
||||
|
||||
public void setReleaseNotes(String release_notes) {
|
||||
this.release_notes = release_notes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion.manager;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.io.Resources;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URL;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class CloudExpansionManager {
|
||||
|
||||
@NotNull
|
||||
private static final String API_URL = "http://api.extendedclip.com/v2/";
|
||||
|
||||
@NotNull
|
||||
private static final Gson GSON = new Gson();
|
||||
@NotNull
|
||||
private static final Type TYPE = new TypeToken<Map<String, CloudExpansion>>() {}.getType();
|
||||
|
||||
@NotNull
|
||||
private final Collector<CloudExpansion, ?, Map<String, CloudExpansion>> INDEXED_NAME_COLLECTOR = Collectors
|
||||
.toMap(CloudExpansionManager::toIndexName, Function.identity());
|
||||
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
|
||||
@NotNull
|
||||
private final Map<String, CloudExpansion> cache = new HashMap<>();
|
||||
@NotNull
|
||||
private final Map<String, CompletableFuture<File>> await = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
public CloudExpansionManager(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String toIndexName(@NotNull final String name) {
|
||||
return name.toLowerCase().replace(' ', '_');
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String toIndexName(@NotNull final CloudExpansion expansion) {
|
||||
return toIndexName(expansion.getName());
|
||||
}
|
||||
|
||||
public void load() {
|
||||
clean();
|
||||
fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions());
|
||||
}
|
||||
|
||||
public void kill() {
|
||||
clean();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Map<String, CloudExpansion> getCloudExpansions() {
|
||||
return ImmutableMap.copyOf(cache);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Map<String, CloudExpansion> getCloudExpansionsInstalled() {
|
||||
if (cache.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
return cache.values()
|
||||
.stream()
|
||||
.filter(CloudExpansion::hasExpansion)
|
||||
.collect(INDEXED_NAME_COLLECTOR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Map<String, CloudExpansion> getCloudExpansionsByAuthor(@NotNull final String author) {
|
||||
if (cache.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
return cache.values()
|
||||
.stream()
|
||||
.filter(expansion -> author.equalsIgnoreCase(expansion.getAuthor()))
|
||||
.collect(INDEXED_NAME_COLLECTOR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Set<String> getCloudExpansionAuthors() {
|
||||
return cache.values().stream().map(CloudExpansion::getAuthor).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public int getCloudExpansionAuthorCount() {
|
||||
return getCloudExpansionAuthors().size();
|
||||
}
|
||||
|
||||
public int getCloudUpdateCount() {
|
||||
return ((int) plugin.getLocalExpansionManager()
|
||||
.getExpansions()
|
||||
.stream()
|
||||
.filter(expansion -> findCloudExpansionByName(expansion.getName())
|
||||
.map(CloudExpansion::shouldUpdate).orElse(false))
|
||||
.count());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Optional<CloudExpansion> findCloudExpansionByName(@NotNull final String name) {
|
||||
return Optional.ofNullable(cache.get(toIndexName(name)));
|
||||
}
|
||||
|
||||
public void clean() {
|
||||
cache.clear();
|
||||
|
||||
await.values().forEach(future -> future.cancel(true));
|
||||
await.clear();
|
||||
}
|
||||
|
||||
public void fetch(final boolean allowUnverified) {
|
||||
plugin.getLogger().info("Fetching available expansion information...");
|
||||
|
||||
CompletableFuture<Map<String, CloudExpansion>> future = CompletableFuture.supplyAsync(() -> {
|
||||
final Map<String, CloudExpansion> values = new HashMap<>();
|
||||
|
||||
try {
|
||||
//noinspection UnstableApiUsage
|
||||
final String json = Resources.toString(new URL(API_URL), StandardCharsets.UTF_8);
|
||||
values.putAll(GSON.fromJson(json, TYPE));
|
||||
} catch (final IOException ex) {
|
||||
throw new CompletionException(ex);
|
||||
}
|
||||
|
||||
values.values().removeIf(value -> value.getLatestVersion() == null
|
||||
|| value.getVersion(value.getLatestVersion()) == null);
|
||||
|
||||
return values;
|
||||
});
|
||||
|
||||
if (!allowUnverified) {
|
||||
future = future.thenApplyAsync((values) -> {
|
||||
values.values().removeIf(expansion -> !expansion.isVerified());
|
||||
return values;
|
||||
});
|
||||
}
|
||||
|
||||
future = future.thenApplyAsync((values) -> {
|
||||
|
||||
values.forEach((name, expansion) -> {
|
||||
expansion.setName(name);
|
||||
|
||||
final Optional<PlaceholderExpansion> local = plugin.getLocalExpansionManager()
|
||||
.findExpansionByName(name);
|
||||
if (local.isPresent() && local.get().isRegistered()) {
|
||||
expansion.setHasExpansion(true);
|
||||
expansion.setShouldUpdate(!local.get().getVersion().equals(expansion.getLatestVersion()));
|
||||
}
|
||||
});
|
||||
|
||||
return values;
|
||||
});
|
||||
|
||||
future.whenComplete((expansions, exception) -> {
|
||||
|
||||
if (exception != null) {
|
||||
plugin.getLogger()
|
||||
.log(Level.WARNING, "failed to download expansion information", exception);
|
||||
return;
|
||||
}
|
||||
|
||||
for (final CloudExpansion expansion : expansions.values()) {
|
||||
this.cache.put(toIndexName(expansion), expansion);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean isDownloading(@NotNull final CloudExpansion expansion) {
|
||||
return await.containsKey(toIndexName(expansion));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompletableFuture<File> downloadExpansion(@NotNull final CloudExpansion expansion,
|
||||
@NotNull final CloudExpansion.Version version) {
|
||||
final CompletableFuture<File> previous = await.get(toIndexName(expansion));
|
||||
if (previous != null) {
|
||||
return previous;
|
||||
}
|
||||
|
||||
final File file = new File(plugin.getLocalExpansionManager().getExpansionsFolder(),
|
||||
"Expansion-" + toIndexName(expansion) + ".jar");
|
||||
|
||||
final CompletableFuture<File> download = CompletableFuture.supplyAsync(() -> {
|
||||
try (final ReadableByteChannel source = Channels.newChannel(new URL(version.getUrl())
|
||||
.openStream()); final FileOutputStream target = new FileOutputStream(file)) {
|
||||
target.getChannel().transferFrom(source, 0, Long.MAX_VALUE);
|
||||
} catch (final IOException ex) {
|
||||
throw new CompletionException(ex);
|
||||
}
|
||||
return file;
|
||||
});
|
||||
|
||||
download.whenCompleteAsync((value, exception) -> {
|
||||
await.remove(toIndexName(expansion));
|
||||
|
||||
if (exception != null) {
|
||||
plugin.getLogger().log(Level.SEVERE,
|
||||
"failed to download " + expansion.getName() + ":" + version.getVersion(), exception);
|
||||
}
|
||||
});
|
||||
|
||||
await.put(toIndexName(expansion), download);
|
||||
|
||||
return download;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,376 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.expansion.manager;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.logging.Level;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
|
||||
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
||||
import me.clip.placeholderapi.expansion.Cacheable;
|
||||
import me.clip.placeholderapi.expansion.Cleanable;
|
||||
import me.clip.placeholderapi.expansion.Configurable;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Taskable;
|
||||
import me.clip.placeholderapi.expansion.VersionSpecific;
|
||||
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
|
||||
import me.clip.placeholderapi.util.FileUtil;
|
||||
import me.clip.placeholderapi.util.Futures;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
public final class LocalExpansionManager implements Listener {
|
||||
|
||||
@NotNull
|
||||
private static final String EXPANSIONS_FOLDER_NAME = "expansions";
|
||||
|
||||
|
||||
@NotNull
|
||||
private final File folder;
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
|
||||
@NotNull
|
||||
private final Map<String, PlaceholderExpansion> expansions = new HashMap<>();
|
||||
|
||||
|
||||
public LocalExpansionManager(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
this.folder = new File(plugin.getDataFolder(), EXPANSIONS_FOLDER_NAME);
|
||||
|
||||
if (!this.folder.exists() && !folder.mkdirs()) {
|
||||
plugin.getLogger().log(Level.WARNING, "failed to create expansions folder!");
|
||||
}
|
||||
}
|
||||
|
||||
public void load(@NotNull final CommandSender sender) {
|
||||
registerAll(sender);
|
||||
}
|
||||
|
||||
public void kill() {
|
||||
unregisterAll();
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public File getExpansionsFolder() {
|
||||
return folder;
|
||||
}
|
||||
|
||||
public int getExpansionsCount() {
|
||||
return expansions.size();
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Collection<String> getIdentifiers() {
|
||||
return ImmutableSet.copyOf(expansions.keySet());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
public Collection<PlaceholderExpansion> getExpansions() {
|
||||
return ImmutableSet.copyOf(expansions.values());
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public PlaceholderExpansion getExpansion(@NotNull final String identifier) {
|
||||
return expansions.get(identifier.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public Optional<PlaceholderExpansion> findExpansionByName(@NotNull final String name) {
|
||||
return expansions.values().stream()
|
||||
.filter(expansion -> name.equalsIgnoreCase(expansion.getName())).findFirst();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Optional<PlaceholderExpansion> findExpansionByIdentifier(
|
||||
@NotNull final String identifier) {
|
||||
return Optional.ofNullable(getExpansion(identifier));
|
||||
}
|
||||
|
||||
|
||||
public Optional<PlaceholderExpansion> register(
|
||||
@NotNull final Class<? extends PlaceholderExpansion> clazz) {
|
||||
try {
|
||||
final PlaceholderExpansion expansion = createExpansionInstance(clazz);
|
||||
if (expansion == null || !expansion.register()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(expansion);
|
||||
} catch (final LinkageError ex) {
|
||||
plugin.getLogger().severe("expansion class " + clazz.getSimpleName() + " is outdated: \n" +
|
||||
"Failed to load due to a [" + ex.getClass().getSimpleName() + "], attempted to use " + ex
|
||||
.getMessage());
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not call this method yourself, use {@link PlaceholderExpansion#register()}
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
||||
final String identifier = expansion.getIdentifier().toLowerCase();
|
||||
|
||||
if (expansion instanceof Configurable) {
|
||||
Map<String, Object> defaults = ((Configurable) expansion).getDefaults();
|
||||
String pre = "expansions." + identifier + ".";
|
||||
FileConfiguration cfg = plugin.getConfig();
|
||||
boolean save = false;
|
||||
|
||||
if (defaults != null) {
|
||||
for (Map.Entry<String, Object> entries : defaults.entrySet()) {
|
||||
if (entries.getKey() == null || entries.getKey().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entries.getValue() == null) {
|
||||
if (cfg.contains(pre + entries.getKey())) {
|
||||
save = true;
|
||||
cfg.set(pre + entries.getKey(), null);
|
||||
}
|
||||
} else {
|
||||
if (!cfg.contains(pre + entries.getKey())) {
|
||||
save = true;
|
||||
cfg.set(pre + entries.getKey(), entries.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (save) {
|
||||
plugin.saveConfig();
|
||||
plugin.reloadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if (expansion instanceof VersionSpecific) {
|
||||
VersionSpecific nms = (VersionSpecific) expansion;
|
||||
if (!nms.isCompatibleWith(PlaceholderAPIPlugin.getServerVersion())) {
|
||||
plugin.getLogger().info(
|
||||
"Your server version is not compatible with expansion: " + expansion.getIdentifier()
|
||||
+ " version: " + expansion.getVersion());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
final PlaceholderExpansion removed = expansions.get(identifier);
|
||||
if (removed != null && !removed.unregister()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ExpansionRegisterEvent event = new ExpansionRegisterEvent(expansion);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
expansions.put(identifier, expansion);
|
||||
|
||||
if (expansion instanceof Listener) {
|
||||
Bukkit.getPluginManager().registerEvents(((Listener) expansion), plugin);
|
||||
}
|
||||
|
||||
plugin.getLogger().info("Successfully registered expansion: " + expansion.getIdentifier());
|
||||
|
||||
if (expansion instanceof Taskable) {
|
||||
((Taskable) expansion).start();
|
||||
}
|
||||
|
||||
if (plugin.getPlaceholderAPIConfig().isCloudEnabled()) {
|
||||
final Optional<CloudExpansion> cloudExpansion = plugin.getCloudExpansionManager()
|
||||
.findCloudExpansionByName(identifier);
|
||||
if (cloudExpansion.isPresent()) {
|
||||
cloudExpansion.get().setHasExpansion(true);
|
||||
cloudExpansion.get().setShouldUpdate(
|
||||
!cloudExpansion.get().getLatestVersion().equals(expansion.getVersion()));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not call this method yourself, use {@link PlaceholderExpansion#unregister()}
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public boolean unregister(@NotNull final PlaceholderExpansion expansion) {
|
||||
if (expansions.remove(expansion.getIdentifier()) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ExpansionUnregisterEvent(expansion));
|
||||
|
||||
if (expansion instanceof Listener) {
|
||||
HandlerList.unregisterAll((Listener) expansion);
|
||||
}
|
||||
|
||||
if (expansion instanceof Taskable) {
|
||||
((Taskable) expansion).stop();
|
||||
}
|
||||
|
||||
if (expansion instanceof Cacheable) {
|
||||
((Cacheable) expansion).clear();
|
||||
}
|
||||
|
||||
if (plugin.getPlaceholderAPIConfig().isCloudEnabled()) {
|
||||
plugin.getCloudExpansionManager().findCloudExpansionByName(expansion.getName())
|
||||
.ifPresent(cloud -> {
|
||||
cloud.setHasExpansion(false);
|
||||
cloud.setShouldUpdate(false);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void registerAll(@NotNull final CommandSender sender) {
|
||||
plugin.getLogger().info("Placeholder expansion registration initializing...");
|
||||
|
||||
Futures.onMainThread(plugin, findExpansionsOnDisk(), (classes, exception) -> {
|
||||
if (exception != null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "failed to load class files of expansions", exception);
|
||||
return;
|
||||
}
|
||||
|
||||
final long registered = classes.stream().map(this::register).filter(Optional::isPresent)
|
||||
.count();
|
||||
|
||||
Msg.msg(sender,
|
||||
registered == 0 ? "&6No expansions were registered!"
|
||||
: registered + "&a placeholder hooks successfully registered!");
|
||||
});
|
||||
}
|
||||
|
||||
private void unregisterAll() {
|
||||
for (final PlaceholderExpansion expansion : Sets.newHashSet(expansions.values())) {
|
||||
if (expansion.persist()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
expansion.unregister();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public CompletableFuture<@NotNull List<@NotNull Class<? extends PlaceholderExpansion>>> findExpansionsOnDisk() {
|
||||
return Arrays.stream(folder.listFiles((dir, name) -> name.endsWith(".jar")))
|
||||
.map(this::findExpansionInFile)
|
||||
.collect(Futures.collector());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompletableFuture<@Nullable Class<? extends PlaceholderExpansion>> findExpansionInFile(
|
||||
@NotNull final File file) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
return FileUtil.findClass(file, PlaceholderExpansion.class);
|
||||
} catch (final VerifyError ex) {
|
||||
plugin.getLogger().severe("expansion file " + file.getName() + " is outdated: \n" +
|
||||
"Failed to load due to a [" + ex.getClass().getSimpleName() + "], attempted to use" + ex
|
||||
.getMessage().substring(ex.getMessage().lastIndexOf(' ')));
|
||||
return null;
|
||||
} catch (final Exception ex) {
|
||||
throw new CompletionException(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public PlaceholderExpansion createExpansionInstance(
|
||||
@NotNull final Class<? extends PlaceholderExpansion> clazz) throws LinkageError {
|
||||
try {
|
||||
return clazz.getDeclaredConstructor().newInstance();
|
||||
} catch (final Exception ex) {
|
||||
if (ex.getCause() instanceof LinkageError) {
|
||||
throw ((LinkageError) ex.getCause());
|
||||
}
|
||||
|
||||
plugin.getLogger()
|
||||
.log(Level.SEVERE, "Failed to load placeholder expansion from class: " + clazz.getName(),
|
||||
ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onQuit(@NotNull final PlayerQuitEvent event) {
|
||||
for (final PlaceholderExpansion expansion : getExpansions()) {
|
||||
if (!(expansion instanceof Cleanable)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
((Cleanable) expansion).cleanup(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPluginDisable(@NotNull final PluginDisableEvent event) {
|
||||
final String name = event.getPlugin().getName();
|
||||
if (name.equals(plugin.getName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (final PlaceholderExpansion expansion : getExpansions()) {
|
||||
if (!name.equalsIgnoreCase(expansion.getRequiredPlugin())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
expansion.unregister();
|
||||
plugin.getLogger().info("Unregistered placeholder expansion: " + expansion.getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.listeners;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.ServerLoadEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ServerLoadEventListener implements Listener {
|
||||
|
||||
@NotNull
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
|
||||
public ServerLoadEventListener(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called when the server is first loaded
|
||||
* <p>
|
||||
* The goal of the method is to register all the expansions as soon as possible especially before
|
||||
* players can join
|
||||
* <p>
|
||||
* This will ensure no issues with expansions and hooks.
|
||||
*
|
||||
* @param event the server load event
|
||||
*/
|
||||
@EventHandler
|
||||
public void onServerLoad(@NotNull final ServerLoadEvent event) {
|
||||
HandlerList.unregisterAll(this);
|
||||
plugin.getLocalExpansionManager().load(Bukkit.getConsoleSender());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.replacer;
|
||||
|
||||
import java.util.function.Function;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class CharsReplacer implements Replacer {
|
||||
|
||||
@NotNull
|
||||
private final Closure closure;
|
||||
|
||||
public CharsReplacer(@NotNull final Closure closure) {
|
||||
this.closure = closure;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String apply(@NotNull final String text, @Nullable final OfflinePlayer player,
|
||||
@NotNull final Function<String, @Nullable PlaceholderExpansion> lookup) {
|
||||
final char[] chars = text.toCharArray();
|
||||
final StringBuilder builder = new StringBuilder(text.length());
|
||||
|
||||
final StringBuilder identifier = new StringBuilder();
|
||||
final StringBuilder parameters = new StringBuilder();
|
||||
|
||||
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]);
|
||||
|
||||
if (c != '0' && c != '1' && c != '2' && c != '3' && c != '4' && c != '5' && c != '6'
|
||||
&& c != '7' && c != '8' && c != '9' && c != 'a' && c != 'b' && c != 'c' && c != 'd'
|
||||
&& c != 'e' && c != 'f' && c != 'k' && c != 'l' && c != 'm' && c != 'o' && c != 'r'
|
||||
&& c != 'x') {
|
||||
builder.append(l).append(chars[i]);
|
||||
} else {
|
||||
builder.append(ChatColor.COLOR_CHAR);
|
||||
|
||||
if (c != 'x') {
|
||||
builder.append(chars[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((i > 1 && chars[i - 2] == '\\') /*allow escaping &x*/) {
|
||||
builder.setLength(builder.length() - 2);
|
||||
builder.append('&').append(chars[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.append(c);
|
||||
|
||||
int j = 0;
|
||||
while (++j <= 6) {
|
||||
if (i + j >= chars.length) {
|
||||
break;
|
||||
}
|
||||
|
||||
final char x = chars[i + j];
|
||||
builder.append(ChatColor.COLOR_CHAR).append(x);
|
||||
}
|
||||
|
||||
if (j == 7) {
|
||||
i += 6;
|
||||
} else {
|
||||
builder.setLength(builder.length() - (j * 2)); // undo &x parsing
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (l != closure.head || i + 1 >= chars.length) {
|
||||
builder.append(l);
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean identified = false;
|
||||
boolean oopsitsbad = true;
|
||||
|
||||
while (++i < chars.length) {
|
||||
final char p = chars[i];
|
||||
|
||||
if (p == ' ' && !identified) {
|
||||
break;
|
||||
}
|
||||
if (p == closure.tail) {
|
||||
oopsitsbad = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (p == '_' && !identified) {
|
||||
identified = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identified) {
|
||||
parameters.append(p);
|
||||
} else {
|
||||
identifier.append(p);
|
||||
}
|
||||
}
|
||||
|
||||
final String identifierString = identifier.toString().toLowerCase();
|
||||
final String parametersString = parameters.toString();
|
||||
|
||||
identifier.setLength(0);
|
||||
parameters.setLength(0);
|
||||
|
||||
if (oopsitsbad) {
|
||||
builder.append(closure.head).append(identifierString);
|
||||
|
||||
if (identified) {
|
||||
builder.append('_').append(parametersString);
|
||||
}
|
||||
|
||||
builder.append(' ');
|
||||
continue;
|
||||
}
|
||||
|
||||
final PlaceholderExpansion placeholder = lookup.apply(identifierString);
|
||||
if (placeholder == null) {
|
||||
builder.append(closure.head).append(identifierString);
|
||||
|
||||
if (identified) {
|
||||
builder.append('_');
|
||||
}
|
||||
|
||||
builder.append(parametersString).append(closure.tail);
|
||||
continue;
|
||||
}
|
||||
|
||||
final String replacement = placeholder.onRequest(player, parametersString);
|
||||
if (replacement == null) {
|
||||
builder.append(closure.head).append(identifierString);
|
||||
|
||||
if (identified) {
|
||||
builder.append('_');
|
||||
}
|
||||
|
||||
builder.append(parametersString).append(closure.tail);
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.append(ChatColor.translateAlternateColorCodes('&', replacement));
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.replacer;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class RegexReplacer implements Replacer {
|
||||
|
||||
@NotNull
|
||||
private final Pattern pattern;
|
||||
|
||||
public RegexReplacer(@NotNull final Closure closure) {
|
||||
this.pattern = Pattern.compile(String
|
||||
.format("\\%s((?<identifier>[a-zA-Z0-9]+)_)(?<parameters>[^%s%s]+)\\%s", closure.head,
|
||||
closure.head, closure.tail, closure.tail));
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String apply(@NotNull final String text, @Nullable final OfflinePlayer player,
|
||||
@NotNull final Function<String, @Nullable PlaceholderExpansion> lookup) {
|
||||
final Matcher matcher = pattern.matcher(text);
|
||||
if (!matcher.find()) {
|
||||
return text;
|
||||
}
|
||||
|
||||
final StringBuffer builder = new StringBuffer();
|
||||
|
||||
do {
|
||||
final String identifier = matcher.group("identifier");
|
||||
final String parameters = matcher.group("parameters");
|
||||
|
||||
final PlaceholderExpansion expansion = lookup.apply(identifier);
|
||||
if (expansion == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final String requested = expansion.onRequest(player, parameters);
|
||||
matcher.appendReplacement(builder, requested != null ? requested : matcher.group(0));
|
||||
}
|
||||
while (matcher.find());
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', matcher.appendTail(builder).toString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.replacer;
|
||||
|
||||
import java.util.function.Function;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface Replacer {
|
||||
|
||||
@NotNull
|
||||
String apply(@NotNull final String text, @Nullable final OfflinePlayer player,
|
||||
@NotNull final Function<String, @Nullable PlaceholderExpansion> lookup);
|
||||
|
||||
|
||||
enum Closure {
|
||||
BRACKET('{', '}'),
|
||||
PERCENT('%', '%');
|
||||
|
||||
|
||||
public final char head, tail;
|
||||
|
||||
Closure(final char head, final char tail) {
|
||||
this.head = head;
|
||||
this.tail = tail;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.updatechecker;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||
import me.clip.placeholderapi.util.Msg;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class UpdateChecker implements Listener {
|
||||
|
||||
private final int RESOURCE_ID = 6245;
|
||||
private final PlaceholderAPIPlugin plugin;
|
||||
private final String pluginVersion;
|
||||
private String spigotVersion;
|
||||
private boolean updateAvailable;
|
||||
|
||||
public UpdateChecker(PlaceholderAPIPlugin i) {
|
||||
plugin = i;
|
||||
pluginVersion = i.getDescription().getVersion();
|
||||
}
|
||||
|
||||
public boolean hasUpdateAvailable() {
|
||||
return updateAvailable;
|
||||
}
|
||||
|
||||
public String getSpigotVersion() {
|
||||
return spigotVersion;
|
||||
}
|
||||
|
||||
public void fetch() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
HttpsURLConnection con = (HttpsURLConnection) new URL(
|
||||
"https://api.spigotmc.org/legacy/update.php?resource=" + RESOURCE_ID).openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
spigotVersion = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine();
|
||||
} catch (Exception ex) {
|
||||
plugin.getLogger().info("Failed to check for updates on spigot.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (spigotVersion == null || spigotVersion.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateAvailable = spigotIsNewer();
|
||||
|
||||
if (!updateAvailable) {
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
plugin.getLogger()
|
||||
.info("An update for PlaceholderAPI (v" + getSpigotVersion() + ") is available at:");
|
||||
plugin.getLogger()
|
||||
.info("https://www.spigotmc.org/resources/placeholderapi." + RESOURCE_ID + "/");
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private boolean spigotIsNewer() {
|
||||
if (spigotVersion == null || spigotVersion.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String plV = toReadable(pluginVersion);
|
||||
String spV = toReadable(spigotVersion);
|
||||
return plV.compareTo(spV) < 0;
|
||||
}
|
||||
|
||||
private String toReadable(String version) {
|
||||
if (version.contains("-DEV-")) {
|
||||
version = version.split("-DEV-")[0];
|
||||
}
|
||||
|
||||
return version.replaceAll("\\.", "");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onJoin(PlayerJoinEvent e) {
|
||||
if (e.getPlayer().hasPermission("placeholderapi.updatenotify")) {
|
||||
Msg.msg(e.getPlayer(),
|
||||
"&bAn update for &fPlaceholder&7API &e(&fPlaceholder&7API &fv" + getSpigotVersion()
|
||||
+ "&e)"
|
||||
, "&bis available at &ehttps://www.spigotmc.org/resources/placeholderapi." + RESOURCE_ID
|
||||
+ "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarInputStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FileUtil {
|
||||
|
||||
@Nullable
|
||||
public static <T> Class<? extends T> findClass(@NotNull final File file,
|
||||
@NotNull final Class<T> clazz) throws IOException, ClassNotFoundException {
|
||||
if (!file.exists()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final URL jar = file.toURI().toURL();
|
||||
|
||||
final List<String> matches = new ArrayList<>();
|
||||
final List<Class<? extends T>> classes = new ArrayList<>();
|
||||
|
||||
try (final JarInputStream stream = new JarInputStream(
|
||||
jar.openStream()); final URLClassLoader loader = new URLClassLoader(new URL[]{jar},
|
||||
clazz.getClassLoader())) {
|
||||
JarEntry entry;
|
||||
while ((entry = stream.getNextJarEntry()) != null) {
|
||||
final String name = entry.getName();
|
||||
if (name == null || name.isEmpty() || !name.endsWith(".class")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
matches.add(name.substring(0, name.lastIndexOf('.')).replace('/', '.'));
|
||||
}
|
||||
|
||||
for (final String match : matches) {
|
||||
try {
|
||||
final Class<?> loaded = loader.loadClass(match);
|
||||
if (clazz.isAssignableFrom(loaded)) {
|
||||
classes.add(loaded.asSubclass(clazz));
|
||||
}
|
||||
} catch (final NoClassDefFoundError ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return classes.isEmpty() ? null : classes.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
import static java.lang.Math.max;
|
||||
import static java.lang.Math.min;
|
||||
import static java.util.Arrays.stream;
|
||||
import static java.util.stream.Collectors.joining;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static java.util.stream.IntStream.range;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* For the record, I am not sorry.
|
||||
*/
|
||||
public final class Format {
|
||||
|
||||
private Format() {}
|
||||
|
||||
@NotNull
|
||||
public static Optional<List<String>> tablify(@NotNull final Align align,
|
||||
@NotNull final List<List<String>> rows) {
|
||||
return findSpacing(rows)
|
||||
.map(spacing -> buildFormat(align, spacing))
|
||||
.map(format -> rows.stream()
|
||||
.map(
|
||||
row -> String.format(format, row.toArray()).substring(align == Align.RIGHT ? 2 : 0))
|
||||
.collect(toList()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String buildFormat(@NotNull final Align align, @NotNull final int[] spacing) {
|
||||
return stream(spacing)
|
||||
.mapToObj(space -> "%" + (align == Align.LEFT ? "-" : "") + (space + 2) + "s")
|
||||
.collect(joining());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Optional<int[]> findSpacing(@NotNull final List<List<String>> rows) {
|
||||
return rows.stream()
|
||||
.map(row -> row.stream().mapToInt(String::length).toArray())
|
||||
.reduce((l, r) -> range(0, min(l.length, r.length)).map(i -> max(l[i], r[i])).toArray());
|
||||
}
|
||||
|
||||
public enum Align {
|
||||
LEFT, RIGHT
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class Futures {
|
||||
|
||||
private Futures() {}
|
||||
|
||||
|
||||
public static <T> void onMainThread(@NotNull final Plugin plugin,
|
||||
@NotNull final CompletableFuture<T> future,
|
||||
@NotNull final BiConsumer<T, Throwable> consumer) {
|
||||
future.whenComplete((value, exception) -> {
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
consumer.accept(value, exception);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTask(plugin, () -> consumer.accept(value, exception));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public static <T> Collector<CompletableFuture<T>, ?, CompletableFuture<List<T>>> collector() {
|
||||
return Collectors.collectingAndThen(Collectors.toList(), Futures::of);
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public static <T> CompletableFuture<List<T>> of(
|
||||
@NotNull final Stream<CompletableFuture<T>> futures) {
|
||||
return of(futures.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T> CompletableFuture<List<T>> of(
|
||||
@NotNull final Collection<CompletableFuture<T>> futures) {
|
||||
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]))
|
||||
.thenApplyAsync($ -> awaitCompletion(futures));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static <T> List<T> awaitCompletion(
|
||||
@NotNull final Collection<CompletableFuture<T>> futures) {
|
||||
return futures.stream().map(CompletableFuture::join).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class Msg {
|
||||
|
||||
public static void msg(@NotNull final CommandSender sender, @NotNull final String... messages) {
|
||||
if (messages.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendMessage(Arrays.stream(messages).map(Msg::color).collect(Collectors.joining("\n")));
|
||||
}
|
||||
|
||||
public static void broadcast(@NotNull final String... messages) {
|
||||
if (messages.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.broadcastMessage(
|
||||
Arrays.stream(messages).map(Msg::color).collect(Collectors.joining("\n")));
|
||||
}
|
||||
|
||||
public static String color(@NotNull final String text) {
|
||||
return ChatColor.translateAlternateColorCodes('&', text);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
public enum TimeFormat {
|
||||
DAYS,
|
||||
HOURS,
|
||||
MINUTES,
|
||||
SECONDS
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.util;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
public class TimeUtil {
|
||||
|
||||
public static String getRemaining(int seconds, TimeFormat type) {
|
||||
if (seconds < 60) {
|
||||
switch (type) {
|
||||
case DAYS:
|
||||
case HOURS:
|
||||
case MINUTES:
|
||||
return "0";
|
||||
case SECONDS:
|
||||
return String.valueOf(seconds);
|
||||
}
|
||||
|
||||
return String.valueOf(seconds);
|
||||
}
|
||||
|
||||
int minutes = seconds / 60;
|
||||
int s = 60 * minutes;
|
||||
int secondsLeft = seconds - s;
|
||||
|
||||
if (minutes < 60) {
|
||||
switch (type) {
|
||||
case DAYS:
|
||||
case HOURS:
|
||||
return "0";
|
||||
case MINUTES:
|
||||
return String.valueOf(minutes);
|
||||
case SECONDS:
|
||||
return String.valueOf(secondsLeft);
|
||||
}
|
||||
|
||||
return String.valueOf(seconds);
|
||||
}
|
||||
|
||||
if (minutes < 1440) {
|
||||
int hours = minutes / 60;
|
||||
int inMins = 60 * hours;
|
||||
int leftOver = minutes - inMins;
|
||||
|
||||
switch (type) {
|
||||
case DAYS:
|
||||
return "0";
|
||||
case HOURS:
|
||||
return String.valueOf(hours);
|
||||
case MINUTES:
|
||||
return String.valueOf(leftOver);
|
||||
case SECONDS:
|
||||
return String.valueOf(secondsLeft);
|
||||
}
|
||||
|
||||
return String.valueOf(seconds);
|
||||
}
|
||||
|
||||
int days = minutes / 1440;
|
||||
int inMins = 1440 * days;
|
||||
int leftOver = minutes - inMins;
|
||||
|
||||
if (leftOver < 60) {
|
||||
switch (type) {
|
||||
case DAYS:
|
||||
return String.valueOf(days);
|
||||
case HOURS:
|
||||
return String.valueOf(0);
|
||||
case MINUTES:
|
||||
return String.valueOf(leftOver);
|
||||
case SECONDS:
|
||||
return String.valueOf(secondsLeft);
|
||||
}
|
||||
|
||||
return String.valueOf(seconds);
|
||||
|
||||
} else {
|
||||
int hours = leftOver / 60;
|
||||
int hoursInMins = 60 * hours;
|
||||
int minsLeft = leftOver - hoursInMins;
|
||||
|
||||
switch (type) {
|
||||
case DAYS:
|
||||
return String.valueOf(days);
|
||||
case HOURS:
|
||||
return String.valueOf(hours);
|
||||
case MINUTES:
|
||||
return String.valueOf(minsLeft);
|
||||
case SECONDS:
|
||||
return String.valueOf(secondsLeft);
|
||||
}
|
||||
|
||||
return String.valueOf(seconds);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTime(int seconds) {
|
||||
return getTime(Duration.ofSeconds(seconds));
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the given value with s, m, h and d (seconds, minutes, hours and days)
|
||||
*
|
||||
* @param duration {@link Duration} (eg, Duration.of(20, {@link ChronoUnit#SECONDS}) for 20
|
||||
* seconds)
|
||||
* @return formatted time
|
||||
*/
|
||||
public static String getTime(final Duration duration) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
long seconds = duration.getSeconds();
|
||||
long minutes = seconds / 60;
|
||||
long hours = minutes / 60;
|
||||
long days = hours / 24;
|
||||
|
||||
seconds %= 60;
|
||||
minutes %= 60;
|
||||
hours %= 60;
|
||||
days %= 24;
|
||||
|
||||
if (seconds > 0) {
|
||||
builder.insert(0, seconds + "s");
|
||||
}
|
||||
|
||||
if (minutes > 0) {
|
||||
if (builder.length() > 0) {
|
||||
builder.insert(0, ' ');
|
||||
}
|
||||
|
||||
builder.insert(0, minutes + "m");
|
||||
}
|
||||
|
||||
if (hours > 0) {
|
||||
if (builder.length() > 0) {
|
||||
builder.insert(0, ' ');
|
||||
}
|
||||
|
||||
builder.insert(0, hours + "h");
|
||||
}
|
||||
|
||||
if (days > 0) {
|
||||
if (builder.length() > 0) {
|
||||
builder.insert(0, ' ');
|
||||
}
|
||||
|
||||
builder.insert(0, days + "d");
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
# PlaceholderAPI
|
||||
# Version: @version@
|
||||
# Created by: extended_clip
|
||||
# Contributors: https://github.com/PlaceholderAPI/PlaceholderAPI/graphs/contributors
|
||||
# Issues: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||
# Expansions: https://api.extendedclip.com/all/
|
||||
# Wiki: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||
# Discord: https://helpch.at/discord
|
||||
# No placeholders are provided with this plugin by default.
|
||||
# Download placeholders: /papi ecloud
|
||||
check_updates: true
|
||||
cloud_enabled: true
|
||||
cloud_sorting: "name"
|
||||
cloud_allow_unverified_expansions: false
|
||||
boolean:
|
||||
'true': 'yes'
|
||||
'false': 'no'
|
||||
date_format: MM/dd/yy HH:mm:ss
|
||||
debug: false
|
||||
@@ -1,102 +0,0 @@
|
||||
name: "@name@"
|
||||
main: "me.clip.placeholderapi.PlaceholderAPIPlugin"
|
||||
|
||||
version: "@version@"
|
||||
author: HelpChat
|
||||
|
||||
api-version: "1.13"
|
||||
description: "@description@"
|
||||
|
||||
commands:
|
||||
placeholderapi:
|
||||
description: "PlaceholderAPI Command"
|
||||
aliases: ["papi"]
|
||||
|
||||
permissions:
|
||||
placeholderapi.*:
|
||||
description: "Ability to use all PAPI commands"
|
||||
children:
|
||||
placeholderapi.admin: true
|
||||
placeholderapi.ecloud.*: true
|
||||
placeholderapi.admin:
|
||||
description: "Ability to use all PAPI commands"
|
||||
children:
|
||||
placeholderapi.help: true
|
||||
placeholderapi.info: true
|
||||
placeholderapi.list: true
|
||||
placeholderapi.parse: true
|
||||
placeholderapi.reload: true
|
||||
placeholderapi.version: true
|
||||
placeholderapi.register: true
|
||||
placeholderapi.unregister: true
|
||||
placeholderapi.updatenotify: true
|
||||
placeholderapi.ecloud.*:
|
||||
description: "Ability to use all PAPI ecloud commands"
|
||||
children:
|
||||
placeholderapi.ecloud: true
|
||||
placeholderapi.ecloud.info: true
|
||||
placeholderapi.ecloud.list: true
|
||||
placeholderapi.ecloud.clear: true
|
||||
placeholderapi.ecloud.toggle: true
|
||||
placeholderapi.ecloud.status: true
|
||||
placeholderapi.ecloud.update: true
|
||||
placeholderapi.ecloud.refresh: true
|
||||
placeholderapi.ecloud.download: true
|
||||
placeholderapi.ecloud.placeholders: true
|
||||
placeholderapi.help:
|
||||
default: "op"
|
||||
description: "Allows you to view the list of PAPI commands"
|
||||
placeholderapi.info:
|
||||
default: "op"
|
||||
description: "Allows you to view expansion information"
|
||||
placeholderapi.list:
|
||||
default: "op"
|
||||
description: "Allows you to list active expansions"
|
||||
placeholderapi.ecloud:
|
||||
default: "op"
|
||||
description: "Allows you to access PAPI eCloud"
|
||||
placeholderapi.parse:
|
||||
default: "op"
|
||||
description: "Allows you to parse placeholders"
|
||||
placeholderapi.reload:
|
||||
default: "op"
|
||||
description: "Allows you to reload PAPI and its configuration"
|
||||
placeholderapi.version:
|
||||
default: "op"
|
||||
description: "Allows you to view the version of PAPI installed"
|
||||
placeholderapi.register:
|
||||
default: "op"
|
||||
description: "Allows you to register expansions"
|
||||
placeholderapi.unregister:
|
||||
default: "op"
|
||||
description: "Allows you to unregister expansions"
|
||||
placeholderapi.updatenotify:
|
||||
default: "op"
|
||||
description: "Notifies you when there is a PAPI update"
|
||||
placeholderapi.ecloud.info:
|
||||
default: "op"
|
||||
description: "Allows you to view cloud expansion information"
|
||||
placeholderapi.ecloud.list:
|
||||
default: "op"
|
||||
description: "Allows you to list eCloud expansions"
|
||||
placeholderapi.ecloud.clear:
|
||||
default: "op"
|
||||
description: "Allows you to clear the local eCloud expansion cache"
|
||||
placeholderapi.ecloud.toggle:
|
||||
default: "op"
|
||||
description: "Allows you to toggle/enable/disable the eCloud manager"
|
||||
placeholderapi.ecloud.status:
|
||||
default: "op"
|
||||
description: "Allows you to view the status of eCloud expansions"
|
||||
placeholderapi.ecloud.update:
|
||||
default: "op"
|
||||
description: "Allows you to update registered eCloud expansions"
|
||||
placeholderapi.ecloud.refresh:
|
||||
default: "op"
|
||||
description: "Allows you to refresh the local eCloud expansion cache"
|
||||
placeholderapi.ecloud.download:
|
||||
default: "op"
|
||||
description: "Allows you to download an expansion from the eCloud"
|
||||
placeholderapi.ecloud.placeholders:
|
||||
default: "op"
|
||||
description: "Allows you to view the placeholders of a eCloud expansion"
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.replacer.CharsReplacer;
|
||||
import me.clip.placeholderapi.replacer.RegexReplacer;
|
||||
import me.clip.placeholderapi.replacer.Replacer;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface Values {
|
||||
|
||||
String SMALL_TEXT = "My name is %player_name%";
|
||||
String LARGE_TEXT = "My name is %player_name% and my location is (%player_x%, %player_y%, %player_z%), this placeholder is invalid %server_name%";
|
||||
|
||||
ImmutableMap<String, PlaceholderExpansion> PLACEHOLDERS = ImmutableMap.<String, PlaceholderExpansion>builder()
|
||||
.put("player", new MockPlayerPlaceholderExpansion())
|
||||
.build();
|
||||
|
||||
|
||||
Replacer CHARS_REPLACER = new CharsReplacer(Replacer.Closure.PERCENT);
|
||||
Replacer REGEX_REPLACER = new RegexReplacer(Replacer.Closure.PERCENT);
|
||||
|
||||
|
||||
final class MockPlayerPlaceholderExpansion extends PlaceholderExpansion {
|
||||
|
||||
public static final String PLAYER_X = "10";
|
||||
public static final String PLAYER_Y = "20";
|
||||
public static final String PLAYER_Z = "30";
|
||||
public static final String PLAYER_NAME = "Sxtanna";
|
||||
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "player";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getAuthor() {
|
||||
return "Sxtanna";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onRequest(@Nullable final OfflinePlayer player, @NotNull final String params) {
|
||||
final String[] parts = params.split("_");
|
||||
if (parts.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (parts[0]) {
|
||||
case "name":
|
||||
return PLAYER_NAME;
|
||||
case "x":
|
||||
return PLAYER_X;
|
||||
case "y":
|
||||
return PLAYER_Y;
|
||||
case "z":
|
||||
return PLAYER_Z;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.replacer;
|
||||
|
||||
import me.clip.placeholderapi.Values;
|
||||
import org.openjdk.jmh.annotations.Benchmark;
|
||||
|
||||
public class ReplacerBenchmarks {
|
||||
|
||||
@Benchmark
|
||||
public void measureCharsReplacerSmallText() {
|
||||
Values.CHARS_REPLACER.apply(Values.SMALL_TEXT, null, Values.PLACEHOLDERS::get);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void measureRegexReplacerSmallText() {
|
||||
Values.REGEX_REPLACER.apply(Values.SMALL_TEXT, null, Values.PLACEHOLDERS::get);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void measureCharsReplacerLargeText() {
|
||||
Values.CHARS_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void measureRegexReplacerLargeText() {
|
||||
Values.REGEX_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* This file is part of PlaceholderAPI
|
||||
*
|
||||
* PlaceholderAPI
|
||||
* Copyright (c) 2015 - 2020 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.clip.placeholderapi.replacer;
|
||||
|
||||
import static me.clip.placeholderapi.Values.MockPlayerPlaceholderExpansion.PLAYER_NAME;
|
||||
import static me.clip.placeholderapi.Values.MockPlayerPlaceholderExpansion.PLAYER_X;
|
||||
import static me.clip.placeholderapi.Values.MockPlayerPlaceholderExpansion.PLAYER_Y;
|
||||
import static me.clip.placeholderapi.Values.MockPlayerPlaceholderExpansion.PLAYER_Z;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import me.clip.placeholderapi.Values;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public final class ReplacerUnitTester {
|
||||
|
||||
@Test
|
||||
void testCharsReplacerProducesExpectedSingleValue() {
|
||||
assertEquals(PLAYER_NAME,
|
||||
Values.CHARS_REPLACER.apply("%player_name%", null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRegexReplacerProducesExpectedSingleValue() {
|
||||
assertEquals(PLAYER_NAME,
|
||||
Values.REGEX_REPLACER.apply("%player_name%", null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCharsReplacerProducesExpectedSentence() {
|
||||
assertEquals(String.format(
|
||||
"My name is %s and my location is (%s, %s, %s), this placeholder is invalid %%server_name%%",
|
||||
PLAYER_NAME, PLAYER_X, PLAYER_Y, PLAYER_Z),
|
||||
Values.CHARS_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRegexReplacerProducesExpectedSentence() {
|
||||
assertEquals(String.format(
|
||||
"My name is %s and my location is (%s, %s, %s), this placeholder is invalid %%server_name%%",
|
||||
PLAYER_NAME, PLAYER_X, PLAYER_Y, PLAYER_Z),
|
||||
Values.REGEX_REPLACER.apply(Values.LARGE_TEXT, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testResultsAreTheSameAsReplacement() {
|
||||
final String resultChars = Values.CHARS_REPLACER
|
||||
.apply("%player_name%", null, Values.PLACEHOLDERS::get);
|
||||
final String resultRegex = Values.REGEX_REPLACER
|
||||
.apply("%player_name%", null, Values.PLACEHOLDERS::get);
|
||||
|
||||
assertEquals(resultChars, resultRegex);
|
||||
|
||||
assertEquals(PLAYER_NAME, resultChars);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testResultsAreTheSameNoReplacement() {
|
||||
final String resultChars = Values.CHARS_REPLACER
|
||||
.apply("%player_location%", null, Values.PLACEHOLDERS::get);
|
||||
final String resultRegex = Values.REGEX_REPLACER
|
||||
.apply("%player_location%", null, Values.PLACEHOLDERS::get);
|
||||
|
||||
assertEquals(resultChars, resultRegex);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCharsReplacerIgnoresMalformed() {
|
||||
final String text = "10% and %hello world 15%";
|
||||
|
||||
assertEquals(text, Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCharsReplacerHandlesEscapedHex() {
|
||||
final String text = "\\&xffffffThis should not change.";
|
||||
|
||||
assertEquals(text.substring(1),
|
||||
Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get));
|
||||
}
|
||||
|
||||
}
|
||||
239
wiki/Commands.md
@@ -1,239 +0,0 @@
|
||||
This page shows all commands, including with a detailed description of what every command does.
|
||||
|
||||
## Overview
|
||||
|
||||
- **[Parse Commands](#parse-commands)**
|
||||
- [`/papi bcparse <player|me> <string>`](#papi-bcparse)
|
||||
- [`/papi cmdparse <player|me> <string>`](#papi-cmdparse)
|
||||
- [`/papi parse <player|me> <string>`](#papi-parse)
|
||||
- [`/papi parserel <player> <player> <string>`](#papi-parserel)
|
||||
|
||||
- **[eCloud Commands](#ecloud-commands)**
|
||||
- [`/papi ecloud clear`](#papi-ecloud-clear)
|
||||
- [`/papi ecloud disable`](#papi-ecloud-disable)
|
||||
- [`/papi ecloud download <expansion> [version]`](#papi-ecloud-download)
|
||||
- [`/papi ecloud enable`](#papi-ecloud-enable)
|
||||
- [`/papi ecloud info <expansion> [version]`](#papi-ecloud-info)
|
||||
- [`/papi ecloud list <all|<author>|installed>`](#papi-ecloud-list)
|
||||
- [`/papi ecloud placeholders <expansion>`](#papi-ecloud-placeholders)
|
||||
- [`/papi ecloud refresh`](#papi-ecloud-refresh)
|
||||
- [`/papi ecloud status`](#papi-ecloud-status)
|
||||
|
||||
- **[Expansion Commands](#expansion-commands)**
|
||||
- [`/papi info <expansion>`](#papi-info)
|
||||
- [`/papi list`](#papi-list)
|
||||
- [`/papi register <jar file>`](#papi-register)
|
||||
- [`/papi unregister <jar file>`](#papi-unregister)
|
||||
|
||||
- **[Other Commands](#other-commands)**
|
||||
- [`/papi dump`](#papi-dump)
|
||||
- [`/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.
|
||||
|
||||
**Arguments**:
|
||||
* `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
|
||||
* `<Text with placeholders>` - The text to parse.
|
||||
|
||||
**Example**:
|
||||
```
|
||||
/papi bcparse funnycube My name is %player_name%!
|
||||
```
|
||||
|
||||
----
|
||||
#### `/papi cmdparse`
|
||||
**Description**:
|
||||
Parses placeholders of a String and executes it as a command.
|
||||
|
||||
**Arguments**:
|
||||
- `<player|me>` - The player to parse placeholders against. Use `me` for yourself.
|
||||
- `<Command with placeholders>` - 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**:
|
||||
* `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
|
||||
* `<Text with placeholders>` - The text to parse.
|
||||
|
||||
**Example**:
|
||||
```
|
||||
/papi parse funnycube My group is %vault_group%
|
||||
```
|
||||
|
||||
----
|
||||
#### `/papi parserel`
|
||||
**Description**:
|
||||
Parses a relational placeholder.
|
||||
|
||||
**Arguments**:
|
||||
* `<player1>` - The first player.
|
||||
* `<player2>` - the second player to compare with.
|
||||
* `<Text with placeholders>` - 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 disable`
|
||||
**Description**:
|
||||
Disables the connection to the eCloud.
|
||||
|
||||
----
|
||||
#### `/papi ecloud download`
|
||||
**Description**:
|
||||
Allows you to download an expansion from the eCloud
|
||||
|
||||
**Arguments**:
|
||||
- `<expansion>` - 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**:
|
||||
- `<expansion>` - 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**:
|
||||
- `<all|<author>|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**:
|
||||
- `<expansion>` - 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.
|
||||
|
||||
**Argument(s)**:
|
||||
- `<expansion>` - The Expansion to get info from (Needs to be registered and active).
|
||||
|
||||
**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**:
|
||||
- `<filename>` - The file to register (including the file-extension).
|
||||
|
||||
**Example**:
|
||||
```
|
||||
/papi register MyExpansion.jar
|
||||
```
|
||||
|
||||
----
|
||||
#### `/papi unregister`
|
||||
**Description**:
|
||||
Unregisters the specified expansion.
|
||||
|
||||
**Arguments**:
|
||||
- `<filename>` - 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 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.
|
||||
@@ -1,67 +0,0 @@
|
||||
## About
|
||||
PlaceholderAPI uses an expansion-cloud (A website that has all kinds of expansions stored), to download jar-files, that contain the placeholders for it to use.
|
||||
|
||||
The expansion-cloud can be seen under https://api.extendedclip.com/home
|
||||
|
||||
## How it works
|
||||
PlaceholderAPI connects to the ecloud on startup of your server, to check if the cloud is available and how many expansions are available on it.
|
||||
If you run `/papi ecloud download <expansion>` PlaceholderAPI will connect to the site to first check if the specified expansion exists and then downloads it if it does.
|
||||
Note that not all listed expansions are on the ecloud. Some are in the corresponding plugin itself and are registered on the startup of the server.
|
||||
|
||||
You can disable the connection to the cloud by setting `cloud_enabled` in the config.yml to false.
|
||||
|
||||
## Adding your own expansion
|
||||
You can add your own expansion to the expansion-cloud for others to use.
|
||||
In order to do that, you have to follow those steps:
|
||||
1. Make sure you have created a seperate jar-file like explained on the page [[PlaceholderExpansion]].
|
||||
2. Create an account on the site, or log in, if you already have one.
|
||||
3. Click on `Expansions` and then on [`Upload New`](https://api.extendedclip.com/manage/add/).
|
||||
4. Fill out the required information. `Source URL` and `Dependency URL` are optional.
|
||||
5. Click on the button that says `Choose an file...` and select the jar of your expansion.
|
||||
* **Important**! Make sure, that the name of the jar-file contains the same version like you set in the version-field!
|
||||
6. Click on `Submit Expansion`
|
||||
|
||||
Your expansion is now uploaded and will be reviewed by a moderator.
|
||||
If everything is ok will your expansion be approved and will be available on the ecloud for PlaceholderAPI*.
|
||||
|
||||
> *You can only download verified Expansions through PlaceholderAPIs command, unless you enable the option `cloud_allow_unverified_expansions` in the config.yml
|
||||
> Unverified expansions can be downloaded manually by going to the site and download it yourself.
|
||||
|
||||
## Updating your expansion
|
||||
Before you update, please note the following:
|
||||
If you aren't a verified dev and you upload an update, your expansion will become **unverified** until a moderator reviews the update and approves it!
|
||||
It is recommended to only update the expansion, if it contains huge changes or bug fixes.
|
||||
|
||||
To update your expansion, you first have to go to the list of [your expansions](https://api.extendedclip.com/manage/).
|
||||
For that click on `Expansions` and select `Your Expansions`.
|
||||
After that, follow those steps:
|
||||
1. Click the name of the expansion, that you want to update.
|
||||
2. Click on the button that says `Version`
|
||||
3. Click on `Add Version`
|
||||
4. Fill out the fields and upload the new jar.
|
||||
* **Important**! Make sure, that the name of the jar-file contains the same version like you set in the version-field!
|
||||
5. Click on `Save Changes`
|
||||
|
||||
If you're a verified dev, your version will be approved and is available directly.
|
||||
If you aren't a verified dev, you have to wait until a moderator approves the update.
|
||||
|
||||
## Downloading a specific expansion version
|
||||
In some cases, you may want to use a specific, older version of expansion. Such a case could be for example, when you run an old server version and the newest version of an expansion uses methods that aren't available on that particular server version.
|
||||
For that case is there a way, to download a specific version of expansion. You can download the expansion either manually, or through PlaceholderAPI itself.
|
||||
Here is how you can do it for each.
|
||||
|
||||
### Download with PlaceholderAPI
|
||||
This is the easiest of both methods since it requires the least amount of effort.
|
||||
Run the following command in-game or in your console to download a specific version:
|
||||
`/papi ecloud download <expansion> [version]`
|
||||
|
||||
To find out, what versions are available for the expansion, run `/papi ecloud info <expansion>`
|
||||
You can then run `/papi ecloud versioninfo <expansion> <version>` to receive more infor about a specific version.
|
||||
|
||||
After you downloaded the specific version, run `/papi reload` to refresh the installed expansions.
|
||||
|
||||
### Download manually
|
||||
To download an expansion manually, you first have to connect to the website and go to the expansion of your choice.
|
||||
There, you click on the button that says `Version` and click on the download-icon of the version you want to download.
|
||||
|
||||
Finally, stop your server, upload the jar to the folder in `/plugins/PlaceholderAPI/expansions` (Make sure to delete the old jar, if there's already one) and start the server again.
|
||||
22
wiki/FAQ.md
@@ -1,22 +0,0 @@
|
||||
Here are frequently asked questions about stuff related to PlaceholderAPI.
|
||||
|
||||
## It only shows %placeholder% and not the variable
|
||||
Make sure, that you've tried the following steps:
|
||||
- PlaceholderAPI is installed and running (Shows green in `/pl` and responds to the `/papi` command)
|
||||
- You downloaded the expansion with `/papi ecloud download [expansion]`
|
||||
A list of available expansions and their placeholders can be found [[here|Placeholders]]!
|
||||
Also note that not all placeholders are in a seperate expansion. Some are "hardcoded" into a plugin.
|
||||
- You reloaded PlaceholderAPI with `/papi reload` after downloading an expansion.
|
||||
- Any possible dependency for the expansion (Plugin) is installed and running.
|
||||
- The placeholder doesn't contain any typos.
|
||||
- The plugin that should use the placeholder actually supports PlaceholderAPI.
|
||||
For a list of plugins supporting PlaceholderAPI go [[here|Plugins-using-PlaceholderAPI]].
|
||||
|
||||
## I can't download the expansion
|
||||
Make sure, that the connection to the cloud (https://api.extendedclip.com) isn't blocked by a firewall or similar.
|
||||
Next step would be to check if the expansion actually exists on the cloud. Not all plugins provide their placeholders through a separate jar on the cloud. Some have them build in and register them on startup.
|
||||
|
||||
If both checks failed, go to the cloud-page and download the jar manually. Put it then in the `expansions` folder of PlaceholderAPI (`/plugins/PlaceholderAPI/expansions`)
|
||||
|
||||
## How can other plugins use my placeholders with PlaceholderAPI?
|
||||
A tutorial can be found [[here|Hook into PlaceholderAPI]]!
|
||||
78
wiki/Home.md
@@ -1,78 +0,0 @@
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/puadJ8Z.png" alt="PlaceholderAPI">
|
||||
</p>
|
||||
This wiki gives you information on how to create placeholders in your plugin that can be used in other plugins, how to use other placeholders inside your plugin, or how to make an expansion.
|
||||
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]]
|
||||
- [[Setting placeholders in your plugin|Hook-into-PlaceholderAPI#setting-placeholders-in-your-plugin]]
|
||||
|
||||
### Other
|
||||
**[[Commands]]**
|
||||
**[[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]]
|
||||
- [[A|Placeholders#a]]
|
||||
- [[B|Placeholders#b]]
|
||||
- [[C|Placeholders#c]]
|
||||
- [[D|Placeholders#d]]
|
||||
- [[E|Placeholders#e]]
|
||||
- [[F|Placeholders#f]]
|
||||
- [[G|Placeholders#g]]
|
||||
- [[H|Placeholders#h]]
|
||||
- [[I|Placeholders#i]]
|
||||
- [[J|Placeholders#j]]
|
||||
- [[K|Placeholders#k]]
|
||||
- [[L|Placeholders#l]]
|
||||
- [[M|Placeholders#m]]
|
||||
- [[N|Placeholders#n]]
|
||||
- [[O|Placeholders#o]]
|
||||
- [[P|Placeholders#p]]
|
||||
- [[Q|Placeholders#q]]
|
||||
- [[R|Placeholders#r]]
|
||||
- [[S|Placeholders#s]]
|
||||
- [[T|Placeholders#t]]
|
||||
- [[U|Placeholders#u]]
|
||||
- [[V|Placeholders#v]]
|
||||
- [[W|Placeholders#w]]
|
||||
- [[Z|Placeholders#z]]
|
||||
@@ -1,142 +0,0 @@
|
||||
[APIBadge]: https://img.shields.io/nexus/r/http/repo.extendedclip.com/me.clip/placeholderapi.svg?label=API-Version
|
||||
|
||||
[SpigotBadge]: https://img.shields.io/spiget/version/6245?label=Spigot
|
||||
[Spigot]: https://spigotmc.org/resources/6245
|
||||
|
||||
[GitHubBadge]: https://img.shields.io/github/v/release/PlaceholderAPI/PlaceholderAPI?label=GitHub%20Release
|
||||
[GitHub]: /PlaceholderAPI/PlaceholderAPI/releases/latest
|
||||
|
||||
> [![SpigotBadge]][Spigot] [![GitHubBadge]][GitHub]
|
||||
>
|
||||
> ![APIBadge]
|
||||
>
|
||||
> *The GitHub release may be different from the spigot release*
|
||||
|
||||
This page is about using PlaceholderAPI in your own plugin, to either let other plugins use your plugin, or just use placeholders from other plugins in your own.
|
||||
|
||||
Please note, that the examples in this page are only available for **PlaceholderAPI 2.10.0 or higher**!
|
||||
|
||||
## First steps
|
||||
Before you can actually make use of PlaceholderAPI, you first have to import it into your project.
|
||||
|
||||
### Import with Maven
|
||||
To import PlaceholderAPI, simply add the following code to your **pom.xml**
|
||||
Replace `{VERSION}` with the version listed at the top of this page.
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
### Import with Gradle
|
||||
Here is how you can import PlaceholderAPI through gradle.
|
||||
Put this into your **Gradle.build**.
|
||||
Replace `{VERSION}` with the version listed at the top of this page.
|
||||
```gradle
|
||||
repositories {
|
||||
maven {
|
||||
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'me.clip:placeholderapi:{VERSION}'
|
||||
}
|
||||
```
|
||||
|
||||
### Set PlaceholderAPI as (soft)depend
|
||||
Next step is to go to your plugin.yml and add PlaceholderAPI as a depend or softdepend, depending (no pun intended) on if it is optional or not.
|
||||
|
||||
**Example Softdepend**:
|
||||
```yaml
|
||||
name: ExamplePlugin
|
||||
version: 1.0
|
||||
author: author
|
||||
main: your.main.path.here
|
||||
|
||||
softdepend: [PlaceholderAPI] # This is used, if your plugin works without PlaceholderAPI.
|
||||
```
|
||||
|
||||
**Example Depend**:
|
||||
```yaml
|
||||
name: ExamplePlugin
|
||||
version: 1.0
|
||||
author: author
|
||||
main: your.main.path.here
|
||||
|
||||
depend: [PlaceholderAPI] # If your plugin requires PlaceholderAPI, to work, use this.
|
||||
```
|
||||
|
||||
## Adding placeholders to PlaceholderAPI
|
||||
|
||||
A full guide on how to create expansions can be found on the [[PlaceholderExpansion]] page of this wiki.
|
||||
|
||||
## Setting placeholders in your plugin
|
||||
PlaceholderAPI offers the ability, to automatically parse placeholders from other plugins within your own plugin, giving the ability for your plugin to support thousands of other placeholders without depending on each plugin individually.
|
||||
To use placeholders from other plugins in our own plugin, we simply have to [(soft)depend on PlaceholderAPI](#set-placeholderapi-as-softdepend) and use the `setPlaceholders` method.
|
||||
|
||||
It is also important to point out, that any required plugin/dependency for an expansion has to be on the server and enabled, or the `setPlaceholders` method will just return the placeholder itself (do nothing).
|
||||
|
||||
**Example**:
|
||||
Let's assume we want to send an own join message that shows the group a player has.
|
||||
To achieve that, we can do the following:
|
||||
```java
|
||||
package at.helpch.placeholderapi;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
|
||||
public class JoinExample extends JavaPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
/*
|
||||
* We register the EventListener here, when PlaceholderAPI is installed.
|
||||
* Since all events are in the main class (this class), we simply use "this"
|
||||
*/
|
||||
Bukkit.getPluginManager().registerEvents(this, this);
|
||||
} else {
|
||||
/*
|
||||
* We inform about the fact that PlaceholderAPI isn't installed and then
|
||||
* disable this plugin to prevent issues.
|
||||
*/
|
||||
getLogger().warn("Could not find PlaceholderAPI! This plugin is required.");
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
String joinText = "%player_name% &ajoined the server! They are rank &f%vault_rank%";
|
||||
|
||||
/*
|
||||
* We parse the placeholders using "setPlaceholders"
|
||||
* This would turn %vault_rank% into the name of the Group, that the
|
||||
* joining player has.
|
||||
*/
|
||||
joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);
|
||||
|
||||
event.setJoinMessage(withPlaceholdersSet);
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,411 +0,0 @@
|
||||
## Overview
|
||||
This page covers how you can use the `PlaceholderExpansion` to add own placeholders to PlaceholderAPI, which then can be used by other plugins.
|
||||
|
||||
PlaceholderAPI is using Expansions for its placeholders, with PlaceholderAPI providing the core. Users can download Expansions from the cloud server using commands in-game or by going [here](https://api.extendedclip.com/home/) if they want to use the placeholder.
|
||||
|
||||
## Note
|
||||
You can either make a separate jar file, to upload it to the expansion-cloud (recommended) or have it as a local class inside your plugin.
|
||||
|
||||
## Examples
|
||||
There are multiple methods and ways you can use the PlaceholderExpansion.
|
||||
Those depend on what you want to display through the placeholders in the end.
|
||||
|
||||
* [Without external plugin](#without-external-plugin)
|
||||
* [With external plugin](#with-external-plugin)
|
||||
* [Separate jar](#separate-jar)
|
||||
* [Internal class](#internal-class)
|
||||
|
||||
### Without an external plugin
|
||||
This part here covers how you create an expansion that doesn't require any external/additional plugins to function.
|
||||
Examples of such expansions are:
|
||||
- [Player expansion](/PlaceholderAPI/Player-Expansion)
|
||||
- [Math expansion](https://github.com/Andre601/Math-Expansion)
|
||||
- [Statistics expansion](/PlaceholderAPI/Statistics-Expansion)
|
||||
|
||||
Since it would be weird (and also make no real sense) to have this inside your plugin, we assume you make a separate jar-file as an expansion.
|
||||
|
||||
To begin, first make the class extend the `PlaceholderExpansion` and add the required methods:
|
||||
```java
|
||||
package at.helpch.placeholderapi.example.expansions;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* <br>
|
||||
* <br>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.
|
||||
* <br>This is what tells PlaceholderAPI to call our onRequest
|
||||
* method to obtain a value if a placeholder starts with our
|
||||
* identifier.
|
||||
* <br>This must be unique and can not contain % or _
|
||||
*
|
||||
* @return The identifier in {@code %<identifier>_<value>%} as String.
|
||||
*/
|
||||
@Override
|
||||
public String getIdentifier(){
|
||||
return "example";
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the version of this expansion.
|
||||
* <br>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.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>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;
|
||||
}
|
||||
}
|
||||
```
|
||||
----
|
||||
|
||||
### 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.
|
||||
|
||||
In our examples do we have the plugin `SomePlugin` and want to show certain placeholders with it.
|
||||
|
||||
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.
|
||||
|
||||
#### 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.
|
||||
|
||||
```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.
|
||||
* <br>
|
||||
* <br>If you create such a class inside your own plugin, you have to
|
||||
* register it manually in your plugins {@code onEbale()} 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.
|
||||
* <br>This is what tells PlaceholderAPI to call our onRequest
|
||||
* method to obtain a value if a placeholder starts with our
|
||||
* identifier.
|
||||
* <br>This must be unique and can not contain % or _
|
||||
*
|
||||
* @return The identifier in {@code %<identifier>_<value>%} 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.
|
||||
* <br>Set this to {@code null} if your placeholders do not require
|
||||
* another plugin to be installed on the server for them to work.
|
||||
* <br>
|
||||
* <br>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";
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the version of this expansion.
|
||||
* <br>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.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
----
|
||||
#### 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.
|
||||
|
||||
|
||||
```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 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.
|
||||
*/
|
||||
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.
|
||||
* <br>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();
|
||||
}
|
||||
|
||||
/**
|
||||
* The placeholder identifier should go here.
|
||||
* <br>This is what tells PlaceholderAPI to call our onRequest
|
||||
* method to obtain a value if a placeholder starts with our
|
||||
* identifier.
|
||||
* <br>This must be unique and can not contain % or _
|
||||
*
|
||||
* @return The identifier in {@code %<identifier>_<value>%} as String.
|
||||
*/
|
||||
@Override
|
||||
public String getIdentifier(){
|
||||
return "someplugin";
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the version of the expansion.
|
||||
* <br>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();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the method called when a placeholder with our identifier
|
||||
* is found and needs a value.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class SomePlugin extends JavaPlugin{
|
||||
|
||||
@Override
|
||||
public void onEnable(){
|
||||
// Small check to make sure that PlaceholderAPI is installed
|
||||
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null){
|
||||
new SomeExpansion(this).register();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
4316
wiki/Placeholders.md
@@ -1,947 +0,0 @@
|
||||
This here is a list of all plugins supporting PlaceholderAPI by either having their own placeholders added, or just allowing other placeholders to be used.
|
||||
If your plugin isn't shown here and you want it to be added, [open an issue](/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_wiki.md) and we will add it!
|
||||
|
||||
## Plugins
|
||||
* **[A](#a)**
|
||||
* **[B](#b)**
|
||||
* **[C](#c)**
|
||||
* **[D](#d)**
|
||||
* **[E](#e)**
|
||||
* **[F](#f)**
|
||||
* **[G](#g)**
|
||||
* **[H](#h)**
|
||||
* **[I](#i)**
|
||||
* **[J](#j)**
|
||||
* **[K](#k)**
|
||||
* **[L](#l)**
|
||||
* **[M](#m)**
|
||||
* **[N](#n)**
|
||||
* **[O](#o)**
|
||||
* **[P](#p)**
|
||||
* **[Q](#q)**
|
||||
* **[R](#r)**
|
||||
* **[S](#s)**
|
||||
* **[T](#t)**
|
||||
* **[U](#u)**
|
||||
* **[V](#v)**
|
||||
* **[W](#w)**
|
||||
* **[X](#X)**
|
||||
|
||||
----
|
||||
## A
|
||||
- **[AAC - AdvancedAntiCheat](https://www.spigotmc.org/resources/6442/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#aac]]**]
|
||||
- **[AbstractMenus](https://www.spigotmc.org/resources/75107/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#abstractmenus]]**]
|
||||
- **[AcidIsland](https://www.spigotmc.org/resources/581/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#acidisland]]**]
|
||||
- **[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]
|
||||
- **[AdvancedAFK](https://www.spigotmc.org/resources/60761/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#advancedafk]]**]
|
||||
- **[AdvancedCustomMenu+](https://www.spigotmc.org/resources/47945/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#advancedcustommenu]]**]
|
||||
- **[AdvancedLottery](https://www.spigotmc.org/resources/43668/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#advancedlottery]]**]
|
||||
- **[AdvancedModReq](https://www.spigotmc.org/resources/40528/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#advancedmodreq]]**]
|
||||
- **[Advance Tab](https://www.spigotmc.org/resources/21958/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ajParkour](https://www.spigotmc.org/resources/60909/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ajparkour]]**]
|
||||
- **[AnimatedBoard](https://www.spigotmc.org/resources/13632/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[AnimatedScoreboard](https://www.spigotmc.org/resources/20848/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Animated Menu](https://www.spigotmc.org/resources/4690/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#amimated-menu]]**]
|
||||
- **[AnimatedSpecialBar](https://www.spigotmc.org/resources/24654/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[AnnouncementsEverywhere](https://www.spigotmc.org/resources/59510/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[AParkour](https://www.spigotmc.org/resources/30923/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#aparkour]]**]
|
||||
- **[ASkyBlock](https://www.spigotmc.org/resources/1220/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#askyblock]]**]
|
||||
- **[AsyncKeepAlive](https://www.spigotmc.org/resources/64676/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#asynckeepalive]]**]
|
||||
- **[AutoCommandsPlus](https://www.spigotmc.org/resources/11083/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[AutoRank](https://www.spigotmc.org/resources/3239/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#autorank]]**]
|
||||
- **[AutoSell](https://www.spigotmc.org/resources/2157/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#autosell]]**]
|
||||
|
||||
----
|
||||
## B
|
||||
- **[BankSystem](https://www.spigotmc.org/resources/61580/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#banksystem]]**]
|
||||
- **[BannerBoard](https://www.spigotmc.org/resources/20435/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[BattleLevels](https://www.spigotmc.org/resources/2218/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#battlelevels]]**]
|
||||
- **[BeautyQuests](https://www.spigotmc.org/resources/39255/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#beautyquests]]**]
|
||||
- **[BedWars1058](https://www.spigotmc.org/resources/50942/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#bedwars1058]]**]
|
||||
- **[BentoBox](https://github.com/BentoBoxWorld/BentoBox)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#bentobox]]**]
|
||||
- **[Big Doors Opener](https://www.spigotmc.org/resources/80805/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[BlockParty](https://www.spigotmc.org/resources/7264/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#blockparty]]**]
|
||||
- **[BlockQuests](https://www.spigotmc.org/resources/32729/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#blockquests]]**]
|
||||
- **[BookStats](https://www.spigotmc.org/resources/4313/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[BossBarSet](https://www.spigotmc.org/resources/26963/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[BossVote](https://www.spigotmc.org/resources/16497/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Broadcaster Plugin](https://dev.bukkit.org/projects/broadcaster-plugin)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[BuildBattlePro](https://www.spigotmc.org/resources/49587/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#buildbattlepro]]**]
|
||||
- **[BungeePerms](https://www.spigotmc.org/resources/25/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#bungeeperms]]**]
|
||||
|
||||
----
|
||||
## C
|
||||
- **[CarlTheCreeper](https://www.spigotmc.org/resources/18008/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#carlthecreeper]]**]
|
||||
- **[Characters Premium](https://www.spigotmc.org/resources/45142/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ChatBot](https://www.spigotmc.org/resources/55642/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ChatColor+](https://www.spigotmc.org/resources/1546/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#chatcolor]]**]
|
||||
- **[ChatColor+ Premium](https://www.spigotmc.org/resources/54093/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#chatcolor-premium]]**]
|
||||
- **[ChatControl Pro](https://www.spigotmc.org/resources/10258/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Chat Format](https://www.spigotmc.org/resources/11780/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [**[[Link|Placeholders#chat-format]]**]
|
||||
- **[ChatManager](https://www.spigotmc.org/resources/52245/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ChatReaction](https://www.spigotmc.org/resources/3748/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#chatreaction]]**]
|
||||
- **[CheckNameHistory](https://www.spigotmc.org/resources/3768/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#checknamehistory]]**]
|
||||
- **[ChestCommands](https://dev.bukkit.org/projects/chest-commands)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CitizensBooks](https://www.spigotmc.org/resources/37465/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [**[[Link|Placeholders#citizensbooks]]**]
|
||||
- **[Clans-API for Spigot/Clan tag in chat](https://www.spigotmc.org/resources/31547/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#clans-api-for-spigotclan-tag-in-chat]]**]
|
||||
- **[Clans](https://www.spigotmc.org/resources/34696/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#clans]]**]
|
||||
- **[Clans](https://www.spigotmc.org/resources/78415/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#clans-1]]**]
|
||||
- **[ClicksPerSecond](https://www.spigotmc.org/resources/57214/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CMI](https://www.spigotmc.org/resources/3742/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CombatLogX](https://www.spigotmc.org/resources/31689/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#combatlogx]]**]
|
||||
- **[CommandConditions](https://www.spigotmc.org/resources/41736/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Compassance](https://www.spigotmc.org/resources/18327/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#compassance]]**]
|
||||
- **[Country on Join](https://www.spigotmc.org/resources/34275/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#country-on-join]]**]
|
||||
- **[CraftConomy](https://www.spigotmc.org/resources/2395/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#craftconomy]]**]
|
||||
- **[CraftingStore.net](https://www.spigotmc.org/resources/31331/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#craftingstorenet]]**]
|
||||
- **[CTSNC](https://www.spigotmc.org/resources/10714/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CursedVIP](https://www.spigotmc.org/resources/67068/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#cursedvip]]**]
|
||||
- **[CustomCommands](https://www.spigotmc.org/resources/14363/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CustomGUI (Free)](https://www.spigotmc.org/resources/58440/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CustomGUI (Paid)](https://www.spigotmc.org/resources/7386/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[CustomHelp](https://www.spigotmc.org/resources/20606/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Custom Items](https://www.spigotmc.org/resources/63848/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#custom-items]]**]
|
||||
- **[CustomSigns](https://www.spigotmc.org/resources/63569/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
|
||||
----
|
||||
## D
|
||||
- **[Daily Rewards](https://www.spigotmc.org/resources/16708)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#daily-rewards]]**]
|
||||
- **[DeliveryMan](https://www.spigotmc.org/resources/14131/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#deliveryman]]**]
|
||||
- **[DeluxeChat](https://www.spigotmc.org/resources/1277/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#deluxechat]]**]
|
||||
- **[DeluxeCombat](https://www.spigotmc.org/resources/63970/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#deluxecombat]]**]
|
||||
- **[DeluxeCommands](https://www.spigotmc.org/resources/8033/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[DeluxeMenus](https://www.spigotmc.org/resources/11734/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[DeluxeTags](https://www.spigotmc.org/resources/4390/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#deluxetags]]**]
|
||||
- **[Depinezen](/DenizenScript/Depenizen-For-Bukkit/blob/master/README.md) (For [Denizen](https://www.spigotmc.org/resources/21039/))**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#denizen]]**]
|
||||
- **[DiscordSRV](https://www.spigotmc.org/resources/18494/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#discordsrv]]**]
|
||||
- **[Disease](https://www.spigotmc.org/resources/3911/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#disease]]**]
|
||||
- **DonationParty**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#donationparty]]**]
|
||||
- **[Donations Holograms](https://www.spigotmc.org/resources/1956/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#donations-holograms]]**]
|
||||
- **[DragonSlayer](https://www.spigotmc.org/resources/36250/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#dragonslayer]]**]
|
||||
- **[DungeonsXL](https://www.spigotmc.org/resources/9488/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#dungeonsxl]]**]
|
||||
|
||||
----
|
||||
## E
|
||||
- **[Economy Bank](https://www.spigotmc.org/resources/7674/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#economy-bank]]**]
|
||||
- **[Enjin & DonationCraft 2.x](https://dev.bukkit.org/projects/emp)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#enjin--donationcraft-2x]]**]
|
||||
- **[Enhanced BalTop](https://www.spigotmc.org/resources/20168/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Envoys](https://www.spigotmc.org/resources/20357/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#envoys]]**]
|
||||
- **[EpicCraftingsPlus](https://www.spigotmc.org/resources/39967/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[EpicFriends](https://www.spigotmc.org/resources/11294/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#epicfriends]]**]
|
||||
- **[EpicLevels](https://songoda.com/marketplace/product/44)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#epiclevels]]**]
|
||||
- **[Ersatz](https://www.spigotmc.org/resources/49433/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[essCore](https://www.spigotmc.org/resources/37766/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#esscore]]**]
|
||||
- **[Essentials](https://ci.ender.zone/job/EssentialsX/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#essentials]]**]
|
||||
- **[EZBlocks](https://www.spigotmc.org/resources/1499/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ezblocks]]**]
|
||||
- **[EzChat](https://www.spigotmc.org/resources/75048/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[EZPrestige](https://www.spigotmc.org/resources/1794/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ezprestige]]**]
|
||||
- **[EZRanksPro](https://www.spigotmc.org/resources/10731/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ezrankspro]]**]
|
||||
|
||||
----
|
||||
## F
|
||||
- **[FactionMapScoreboard](https://www.spigotmc.org/resources/23071/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Factions MCore](https://www.spigotmc.org/resources/1900/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#factions-mcore]]**]
|
||||
- **[FactionsUUID](https://www.spigotmc.org/resources/1035/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#factionsuuid]]**]
|
||||
- **[FunnyGuilds](https://github.com/FunnyGuilds/FunnyGuilds)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#funnyguilds]]**]
|
||||
- **[FriendReferral](https://www.spigotmc.org/resources/21626/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
|
||||
----
|
||||
## G
|
||||
- **[GangsPlus](https://www.spigotmc.org/resources/2604/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#gangsplus]]**]
|
||||
- **[GemsEconomy](https://www.spigotmc.org/resources/19655/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#gemseconomy]]**]
|
||||
- **[GriefDefender](https://www.spigotmc.org/resources/68900/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#griefdefender]]**]
|
||||
- **[GriefPrevention](https://www.spigotmc.org/resources/1884/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#griefprevention]]**]
|
||||
- **[Guilds](https://www.spigotmc.org/resources/48920/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#guilds]]**]
|
||||
- **[GUIPlus](https://www.spigotmc.org/resources/38664/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
|
||||
----
|
||||
## H
|
||||
- **[Hawn - Hub/Lobby Management](https://www.spigotmc.org/resources/66907/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Head Database](https://www.spigotmc.org/resources/14280/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#head-database]]**]
|
||||
- **[HelpGUI](https://www.spigotmc.org/resources/33245/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[HeroChat Premium]()**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [**[[Link|Placeholders#herochat-premium]]**]
|
||||
- **[Heroes](https://www.spigotmc.org/resources/305/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#heroes]]**]
|
||||
- **[HoloBlock](https://www.spigotmc.org/resources/43192/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#holoblock]]**]
|
||||
- **[HPWizard](https://www.spigotmc.org/resources/26821/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#hpwizard]]**]
|
||||
- **[Hugs](https://www.spigotmc.org/resources/hugs.39722/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#hugs]]**]
|
||||
|
||||
----
|
||||
## I
|
||||
- **[InteractionVisualizer](https://www.spigotmc.org/resources/77050/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#interactionvisualizer]]**]
|
||||
- **[IslandRate (ASkyBlock Addon)](https://www.spigotmc.org/resources/53519/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#islandrate-askyblock-addon]]**]
|
||||
- **[IslandRate (AcidIsland Addon)](https://www.spigotmc.org/resources/54913/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#islandrate-acidisland-addon]]**]
|
||||
- **[ItemJoin](https://www.spigotmc.org/resources/12661/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
|
||||
----
|
||||
## J
|
||||
- **[Jobs Reborn](https://www.spigotmc.org/resources/4216/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#jobs-reborn]]**]
|
||||
- **[JSONChat](https://www.spigotmc.org/resources/17744/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
|
||||
----
|
||||
## K
|
||||
- **[Karma](https://www.spigotmc.org/resources/71156/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#karma]]**]
|
||||
- **[KillStats](http://dev.bukkit.org/bukkit-plugins/killstats-v1-0/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#killstats]]**]
|
||||
- **[KitPvP](https://www.spigotmc.org/resources/27107/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#kitpvp]]**]
|
||||
- **[Kingdoms+](https://www.spigotmc.org/resources/11833/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#kingdoms]]**]
|
||||
- **[KP-PVP](https://www.spigotmc.org/resources/50969/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#kp-pvp]]**]
|
||||
|
||||
----
|
||||
## L
|
||||
- **[LastLoginAPI](https://www.spigotmc.org/resources/66348/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#lastloginapi]]**]
|
||||
- **[LeaderHeads](https://www.spigotmc.org/resources/2079/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#leaderheads]]**]
|
||||
- **[Leak Parkour](https://www.spigotmc.org/resources/12852/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[LegendQuest](https://www.spigotmc.org/resources/2120/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#legendquest]]**]
|
||||
- **[LemonMobCoins](https://www.spigotmc.org/resources/59402/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#lemonmobcoins]]**]
|
||||
- **[LuckPerms](https://www.spigotmc.org/resources/28140/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#luckperms]]**]
|
||||
- **[LWC (Modern LWC)](https://www.spigotmc.org/resources/2162/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#lwc]]**]
|
||||
|
||||
----
|
||||
## M
|
||||
- **[Marcely's Bedwars](https://www.spigotmc.org/resources/13622/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#marcelys-bedwars]]**]
|
||||
- **[Marriage](https://www.spigotmc.org/resources/81807/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#marriage]]**]
|
||||
- **[Marriage (reloaded)](https://www.spigotmc.org/resources/18998/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#marriage-reloaded]]**]
|
||||
- **[MarriageMaster](http://dev.bukkit.org/bukkit-plugins/marriage-master/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#marriagemaster]]**]
|
||||
- **[MCInfected](https://www.spigotmc.org/resources/2133/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mcinfected]]**]
|
||||
- **[MCInfected-Ranks](https://www.spigotmc.org/resources/2826/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mcinfected-ranks]]**]
|
||||
- **[McJobs](https://dev.bukkit.org/projects/mcjobs/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mcjobs]]**]
|
||||
- **[McMMO](https://www.spigotmc.org/resources/2445/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mcmmo]]**]
|
||||
- **[Menu](https://www.spigotmc.org/resources/50658/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[MineChess](https://www.spigotmc.org/resources/74178/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#minechess]]**]
|
||||
- **[Minecord](https://www.spigotmc.org/resources/44055/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#minecord]]**]
|
||||
- **[MineCrates](https://www.spigotmc.org/resources/4685/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#minecrates]]**]
|
||||
- **[MinetopiaSDB](https://www.spigotmc.org/resources/28830/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[MixStepManager](https://www.spigotmc.org/resources/23531/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[MobHunting](https://www.spigotmc.org/resources/3582/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mobhunting]]**]
|
||||
- **[MultiChat](https://www.spigotmc.org/resources/26204/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[MultiClan 2.0](https://www.spigotmc.org/resources/23927/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Multiverse-Core](https://www.spigotmc.org/resources/390/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#multiverse-core]]**]
|
||||
- **[MurderMystery 2](https://www.spigotmc.org/resources/36894/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[MyCommand](http://dev.bukkit.org/bukkit-plugins/mycommand/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mycommand]]**]
|
||||
- **[MyPet](https://www.spigotmc.org/resources/12725/) [[Premium](https://www.spigotmc.org/resources/17566/)]**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#mypet-premium]]**]
|
||||
- **[MyPrefixSystem](https://www.spigotmc.org/resources/46244/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#myprefixsystem]]**]
|
||||
|
||||
----
|
||||
## N
|
||||
- **[Nameless Plugin](https://www.spigotmc.org/resources/59032/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#nameless-plugin]]**]
|
||||
- **[Nicknamer](https://www.spigotmc.org/resources/5341/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#nicknamer]]**]
|
||||
- **[NickReloaded](https://www.spigotmc.org/resources/46335/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#nickreloaded]]**]
|
||||
- **[Nicky](https://www.spigotmc.org/resources/590/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#nicky]]**]
|
||||
|
||||
----
|
||||
## O
|
||||
- **[OnePlayerSleep](https://www.spigotmc.org/resources/76534/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#oneplayersleep]]**]
|
||||
- **[OneTimeUse](https://www.spigotmc.org/resources/13907/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[OnTime](http://dev.bukkit.org/bukkit-plugins/ontime/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ontime]]**]
|
||||
- **[OreAnnouncer](https://www.spigotmc.org/resources/33464/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#oreannouncer]]**]
|
||||
- **[Outpost](https://www.spigotmc.org/resources/38657/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#outpost]]**]
|
||||
|
||||
----
|
||||
## P
|
||||
- **[Paintball Battle](https://www.spigotmc.org/resources/76676/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#paintball-battle]]**]
|
||||
- **[Parkour](https://www.spigotmc.org/resources/23685/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#parkour]]**]
|
||||
- **[Parties](https://www.spigotmc.org/resources/3709/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#parties]]**]
|
||||
- **[Party and Friends](https://www.spigotmc.org/resources/11633/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#party-and-friends]]**]
|
||||
- **[PingTest](https://www.spigotmc.org/resources/69580/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[PixelVip](https://www.spigotmc.org/resources/30438/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#pixelvip]]**]
|
||||
- **[Plan](https://www.spigotmc.org/resources/32536/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#plan]]**]
|
||||
- **[PlayerBalancerAddon](https://www.spigotmc.org/resources/51220/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[PlayTime](https://www.spigotmc.org/resources/26016/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#playtime]]**]
|
||||
- **[PlayerPoints](http://dev.bukkit.org/bukkit-plugins/playerpoints/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#playerpoints]]**]
|
||||
- **[PlotSquared](https://www.spigotmc.org/resources/1177/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#plotsquared]]**]
|
||||
- **[PointsAPI](https://www.spigotmc.org/resources/13957/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#pointsapi]]**]
|
||||
- **[Potatoes](https://www.spigotmc.org/resources/12353/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[PowerRanks](https://www.spigotmc.org/resources/64696/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#powerranks]]**]
|
||||
- **[PremiumVanish](https://www.spigotmc.org/resources/14404/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#premiumvanish]]**]
|
||||
- **[PrisonMines](https://www.spigotmc.org/resources/4046/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#prisonmines]]**]
|
||||
- **[PrisonRanksX](https://www.spigotmc.org/resources/55899/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#prisonranksx]]**]
|
||||
- **[ProCosmetics](https://www.spigotmc.org/resources/49106/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#procosmetics]]**]
|
||||
- **[ProdigyGadget](https://www.spigotmc.org/resources/1335/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ProfessionalBans](https://www.spigotmc.org/resources/63657/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#professionalbans]]**]
|
||||
- **[ProQuest](https://www.spigotmc.org/resources/18249/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#proquest]]**]
|
||||
- **[ProtectionStones](https://www.spigotmc.org/resources/61797/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#protectionstones]]**]
|
||||
- **[PurpleIRC](https://www.spigotmc.org/resources/2836/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[PvPLevels](https://www.spigotmc.org/resources/20807/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#pvplevels]]**]
|
||||
- **[PvP Stats](http://dev.bukkit.org/bukkit-plugins/pvp-stats/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#pvp-stats]]**]
|
||||
- **[PvPStats Plugin](https://www.spigotmc.org/resources/69984/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#pvpstats-plugin]]**]
|
||||
- **[PyrCore](https://www.spigotmc.org/resources/24180/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
|
||||
----
|
||||
## Q
|
||||
- **[Quests](https://www.spigotmc.org/resources/3711/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#quests]]**]
|
||||
- **[QuestCreator](https://www.spigotmc.org/resources/38734/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#questcreator]]**]
|
||||
- **[QuickBoard](https://www.spigotmc.org/resources/15057/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[QuickSell](https://www.spigotmc.org/resources/6107/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#quicksell]]**]
|
||||
|
||||
----
|
||||
|
||||
## R
|
||||
- **[RabbitsVSPenguins](https://www.spigotmc.org/resources/65277/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#rabbitsvspenguins]]**]
|
||||
- **[RageMode](https://www.spigotmc.org/resources/69169/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ragemode]]**]
|
||||
- **[RankedHelp](https://www.spigotmc.org/resources/61919/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Rankup](https://www.spigotmc.org/resources/17933/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#rankup]]**]
|
||||
- **[RawMSG](https://www.spigotmc.org/resources/35864/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[RecentFind (Treasures Add-on)](https://www.spigotmc.org/resources/33366/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#recentfind]]**]
|
||||
- **[RedProtect](http://spigotmc.org/resources/15841/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#redprotect]]**]
|
||||
- **[ReporterGUI](https://www.spigotmc.org/resources/8596/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[RestrictedDimensions](http://spigotmc.org/resources/80574/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#restricteddimensions]]**]
|
||||
- **[RogueParkour](https://www.spigotmc.org/resources/26563/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#rogueparkour]]**]
|
||||
- **[RoyalCommands](https://www.spigotmc.org/resources/4113/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#royalcommands]]**]
|
||||
- **[ReferralSystem](https://www.spigotmc.org/resources/29709/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#referralsystem]]**]
|
||||
- **[Residence](https://www.spigotmc.org/resources/11480/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[RPGInventory](https://www.spigotmc.org/resources/12498/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#rpginventory]]**]
|
||||
|
||||
----
|
||||
## S
|
||||
- **[Scoreboard Sidebar API](https://www.spigotmc.org/resources/21042/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ScrollBoard](https://www.spigotmc.org/resources/24697/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Skellett (Skript Add-on)](https://forums.skunity.com/resources/24/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SellAll](https://www.spigotmc.org/resources/1221/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#sellall]]**]
|
||||
- **[Server List/Staff List](https://www.spigotmc.org/resources/15119/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ServerSelectorX](https://www.spigotmc.org/resources/32853/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SignLink](https://www.spigotmc.org/resources/39593/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#signlink]]**]
|
||||
- **[SimpleBoard](https://www.spigotmc.org/resources/39597/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SimpleClans](https://www.spigotmc.org/resources/5269/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#simpleclans]]**]
|
||||
- **[SimpleCoinsAPI](https://www.spigotmc.org/resources/1432/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#simplecoinsapi]]**]
|
||||
- **[SimpleKillTracker](https://www.spigotmc.org/resources/17651/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#simplekilltracker]]**]
|
||||
- **[SimplePrefix](http://dev.bukkit.org/bukkit-plugins/simple-prefix/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#simpleprefix]]**]
|
||||
- **[Simple Suffix](http://dev.bukkit.org/bukkit-plugins/simple-suffix/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#simple-suffix]]**]
|
||||
- **[SkillAPI](https://www.spigotmc.org/resources/4824/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#skillapi]]**]
|
||||
- **[Skript](https://github.com/bensku/Skript)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#skript]]**]
|
||||
- **[SkyWars](https://www.spigotmc.org/resources/6525/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SkyWarsReloaded](https://www.spigotmc.org/resources/3796/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#skywarsreloaded]]**]
|
||||
- **[Spark](https://github.com/lucko/spark)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#spark]]**]
|
||||
- **[SpigotBoard](https://www.spigotmc.org/resources/47497/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SpigotLib](https://www.spigotmc.org/resources/5925/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SpigotLobby](https://www.spigotmc.org/resources/58797/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SQLPerms](https://www.spigotmc.org/resources/1462/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#sqlperms]]**]
|
||||
- **[SQLTokens](https://www.spigotmc.org/resources/3482/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#sqltokens]]**]
|
||||
- **[sTablist](https://www.spigotmc.org/resources/12234/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Staff Facilities](https://www.spigotmc.org/resources/13097/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#staff-facilities]]**]
|
||||
- **[Statz](https://www.spigotmc.org/resources/25969/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#statz]]**]
|
||||
- **[StrikePractice 2](https://www.spigotmc.org/resources/46906/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#strikepractice-2]]**]
|
||||
- **[stTitles](https://www.spigotmc.org/resources/8310/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#sttitles]]**]
|
||||
- **[SubServers](https://github.com/ME1312/SubServers-2)**
|
||||
- [ ] Supports Placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#subservers]]**]
|
||||
- **[SuperbVote](https://www.spigotmc.org/resources/11626/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#superbvote]]**]
|
||||
- **[SuperCredits](https://www.spigotmc.org/resources/31074/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#supercredits]]**]
|
||||
- **[SuperScratch](https://www.spigotmc.org/resources/12250/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[SuperVanish](https://www.spigotmc.org/resources/1331/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#supervanish]]**]
|
||||
|
||||
----
|
||||
## T
|
||||
- **[TakaAntiCheat](https://www.spigotmc.org/resources/45167/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[The Time](https://www.spigotmc.org/resources/25146/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#the-time]]**]
|
||||
- **[ThemePark](https://www.spigotmc.org/resources/48648/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#themepark]]**]
|
||||
- **[Thirst](https://www.spigotmc.org/resources/3316/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#thirst]]**]
|
||||
- **[Timed Rewards](https://www.spigotmc.org/resources/34008/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#timed-rewards]]**]
|
||||
- **[Time Tokens](https://www.spigotmc.org/resources/75441/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#time-tokens]]**]
|
||||
- **[TNTRun_Reloaded](https://www.spigotmc.org/resources/53359/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#tntrun_reloaded]]**]
|
||||
- **[TokenEnchant](https://www.spigotmc.org/resources/2287/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#tokenenchant]]**]
|
||||
- **[TokenManager](https://www.spigotmc.org/resources/8610/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#tokenmanager]]**]
|
||||
- **[Tokens](https://www.spigotmc.org/resources/71941/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#tokens]]**]
|
||||
- **[Towny](https://github.com/TownyAdvanced/Towny)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#towny]]**]
|
||||
- **[TownyChat](https://github.com/TownyAdvanced/TownyChat)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#townychat]]**]
|
||||
- **[TransmuteIt](https://www.spigotmc.org/resources/76287/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#transmuteIt]]**]
|
||||
- **[Treasures](https://www.spigotmc.org/resources/14178/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#treasures]]**]
|
||||
- **[Trey's Double Jump](https://www.spigotmc.org/resources/19630/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#treys-double-jump]]**]
|
||||
- **[TrickOrTreat](https://www.spigotmc.org/resources/61370/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#trickortreat]]**]
|
||||
|
||||
----
|
||||
## U
|
||||
- **[UChat](https://www.spigotmc.org/resources/23767/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[UltimateAnnounce+](https://www.spigotmc.org/resources/7459/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[UltimateBossBar](https://www.spigotmc.org/resources/19303/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[UltimateSigns](https://www.spigotmc.org/resources/72462/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
- **[UltraChatFormat](https://www.spigotmc.org/resources/57929/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[UltraMenu](https://www.spigotmc.org/resources/27856/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Ultra Permissions](https://www.spigotmc.org/resources/42678/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Ultra Simple Staff Chat](https://www.spigotmc.org/resources/22064/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[USkyBlock](https://www.spigotmc.org/resources/2280/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#uskyblock]]**]
|
||||
- **[UltimateChat](https://www.spigotmc.org/resources/uchat.23767/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ultimatechat]]**]
|
||||
- **[UltimateVotes](https://www.spigotmc.org/resources/516)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#ultimatevote]]**]
|
||||
- **[UnityGen](https://www.spigotmc.org/resources/26218/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#unitygen]]**]
|
||||
|
||||
----
|
||||
## V
|
||||
- **[VariableTriggers](https://dev.bukkit.org/projects/variabletriggers)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[Vault](http://dev.bukkit.org/bukkit-plugins/vault/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#vault]]**]
|
||||
- **[VentureChat](https://www.spigotmc.org/resources/771/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[ViaVersion](https://www.spigotmc.org/resources/19254/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#viaversion]]**]
|
||||
- **[VoteParty](https://www.spigotmc.org/resources/987/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#voteparty]]**]
|
||||
- **[VoteRoulette](http://dev.bukkit.org/bukkit-plugins/voteroulette/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#voteroulette]]**]
|
||||
- **[VotingPlugin](https://www.spigotmc.org/resources/15358/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#votingplugin]]**]
|
||||
|
||||
----
|
||||
## W
|
||||
- **[WickedSkyWars](https://www.spigotmc.org/resources/556/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#wickedskywars]]**]
|
||||
- **[WonderHUD](https://www.spigotmc.org/resources/12220/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders. [Link]
|
||||
- **[WorldGuard](https://dev.bukkit.org/bukkit-plugins/worldguard/)**
|
||||
- [ ] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#worldguard]]**]
|
||||
- **[WorldJoin](https://www.spigotmc.org/resources/63892/)**
|
||||
- [x] Supports placeholders.
|
||||
- [ ] Provides own placeholders.
|
||||
|
||||
----
|
||||
## X
|
||||
- **[XLTournaments](https://www.spigotmc.org/resources/70630/)**
|
||||
- [x] Supports placeholders.
|
||||
- [x] Provides own placeholders. [**[[Link|Placeholders#xltournaments]]**]
|
||||
@@ -1,82 +0,0 @@
|
||||
[Wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||
[Placeholders]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders
|
||||
[Plugins using PlaceholderAPI]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders
|
||||
|
||||
# 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.
|
||||
|
||||
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.
|
||||
|
||||
## Adding your resource(s)
|
||||
If you have one or multiple resources that support PlaceholderAPI (being it by just supporting placeholders from other plugins, or providing your own) can you add them to the wiki in the following ways.
|
||||
|
||||
### [Plugins using PlaceholderAPI]
|
||||
You should always add your resource to this page, no matter if it only supports placeholders or also provides its own.
|
||||
|
||||
The format of a plugin is always as follows:
|
||||
```md
|
||||
- **[:name](:url)**
|
||||
- [?] Supports placeholders.
|
||||
- [?] Provides own placeholders. [:link]
|
||||
```
|
||||
|
||||
A quick summary over the different parts:
|
||||
|
||||
- `:name` is the name of your resource. The resources are ordered by alphabet and if yours has the same name as another one listed, add it __below__ the other resource.
|
||||
- `:url` should be replaced with a URL to your resource page (Spigot, dev.bukkit, etc.). If you use Spigot, make sure to remove any text after the `/resources/` and only leave the ID. For example will https://www.spigotmc.org/resources/placeholderapi.6245/ become https://www.spigotmc.org/resources/6245/.
|
||||
If you don't have your resource on any resource page can you either ommit the URL (Just provide the name) or provide a link to its source, if available.
|
||||
- `?` should be replaced with either an `x` or a space depending on wether your plugin supports the option or not. So the `[?]` becomes either `[x]` or `[ ]`
|
||||
- `:link` depends on wether your plugin provides own placeholders or not. If it doesn't, then you can just give `Link`. If it does provide placeholders, make sure to provide `[[Link|Placeholders#:name]]` where `:name` would be the name of your resource in the [Placeholders] page.
|
||||
|
||||
### [Placeholders]
|
||||
If your plugin provides its own placeholders through an extension is it recommendet to add this extension to the [Placeholders] page.
|
||||
This page is split up into two sections: PAPI Placeholders and Plugin Placeholders.
|
||||
|
||||
PAPI Placeholders are extensions that don't require an external plugin or other dependency to function normally. Common examples are the Player or Server extensions.
|
||||
The Plugin Placeholders are extensions that require a plugin or other dependency to function. They are often used to provide values from one pluging (e.g. Vault) to another plugin through the help of PlaceholderAPI.
|
||||
|
||||
The overall structure of an entry is always the same:
|
||||
````md
|
||||
- ### **[:name](:url)**
|
||||
> :command
|
||||
|
||||
```
|
||||
:placeholders
|
||||
```
|
||||
----
|
||||
````
|
||||
|
||||
- `:name` is the name of your resource. The resources are ordered by alphabet and if yours has the same name as another one listed, add it __below__ the other resource.
|
||||
- `:url` should be replaced with a URL to your resource page (Spigot, dev.bukkit, etc.). If you use Spigot, make sure to remove any text after the `/resources/` and only leave the ID. For example will https://www.spigotmc.org/resources/placeholderapi.6245/ become https://www.spigotmc.org/resources/6245/.
|
||||
If you don't have your resource on any resource page can you either ommit the URL (Just provide the name) or provide a link to its source, if available.
|
||||
- `:command` depends on if your extension is available on the eCloud or is build into your resource. If you have it on the eCloud should you provide `/papi ecloud download :name` where `:name` is the name your expansion has on the eCloud.
|
||||
If your extension is build into your resource can you just set `NO DOWNLOAD COMMAND` instead.
|
||||
- `:placeholders` would be a list of all placeholders that your extension offers (Sorted by alphabet). If your placeholders support multiple variables like item names, should you use either `<text>` or `[text]` depending on if it is required or optional.
|
||||
|
||||
Always keep an empty line in between the `----` and the next entry below it.
|
||||
If your extension is at the very bottom of the page can you ommit the `----`.
|
||||
|
||||
You will also need to add your extension's name to the list at the very top in the format `- **[:name](#:name)**` where `:name` is the extension name.
|
||||
|
||||
## Other Wiki pages
|
||||
Please follow these general guidelines when editing any other pages.
|
||||
|
||||
### Linking
|
||||
Linking should always be done through either the reference option or through the Wiki link option.
|
||||
When the link leads to a page on the wiki should you use either `[[:page]]` or `[[:name|:page]]` where `:page` would be the name of the Wiki page (Case sensitive) and `:name` the text that would be displayed instead.
|
||||
When linking to a section within a Wiki page should you link to it using a hashtag (`#`). For example would linking to the player extension result in `[[Placeholders#player]]` (Always have the section lowercase.
|
||||
However, when you link to a section in the same wiki page should you do it in the format `[:name](#:section)` where `:name` is the text to display and `:section` is the name of the section.
|
||||
|
||||
|
||||
When you link to an external page that isn't part of the wiki should you do it as a reference link (Exception is the above mentioned cases for resources and extensions).
|
||||
You do this by adding `[:name]: :url` at the top of the page where `:name` is the reference name to use and `:url` is the url to link to.
|
||||
|
||||
You can then just use either `[:name]` or `[:display_text][:name]` to link to the url you set (`:display_text` could be any text (including spaces) to display).
|
||||
Reference links are case-insensitive.
|
||||
|
||||
This system allows us to easly maintain the links without the need to update a URL on several places within the page.
|
||||
|
||||
### 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.
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
[discordImg]: https://img.shields.io/discord/164280494874165248.svg?logo=discord&label=Discord&colorB=7289DA
|
||||
[discord]: https://helpch.at/discord
|
||||
[jenkinsImg]: https://img.shields.io/badge/Download%20from-Jenkins-brightgreen.svg
|
||||
[jenkins]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
||||
[licenseImg]: https://img.shields.io/github/license/PlaceholderAPI/PlaceholderAPI.svg
|
||||
[license]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/LICENSE
|
||||
[issuesImg]: https://img.shields.io/github/issues-raw/PlaceholderAPI/PlaceholderAPI.svg?logo=github&logoColor=white
|
||||
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||
[versionImg]: https://img.shields.io/nexus/r/http/repo.extendedclip.com/me.clip/placeholderapi.svg?label=API-Version
|
||||
[plugin-page]: https://spigotmc.org/resources/6245
|
||||
|
||||
> Thanks for using PlaceholderAPI.
|
||||
>
|
||||
> **[Plugin-page]** | **[[Placeholders]]** | **[[Plugins using PlaceholderAPI]]** | **[[Hook into PlaceholderAPI]]**
|
||||
|
||||
![versionImg] [![jenkinsImg]][jenkins] [![licenseImg]][license] [![issuesImg]][issues] [![discordImg]][discord]
|
||||
@@ -1,78 +0,0 @@
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/Adp7xdh.png" alt="PlaceholderAPI">
|
||||
</p>
|
||||
|
||||
**[[Main page|Home]]**
|
||||
|
||||
### 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]]
|
||||
- [[Setting placeholders in your plugin|Hook-into-PlaceholderAPI#setting-placeholders-in-your-plugin]]
|
||||
|
||||
### Other
|
||||
**[[Commands]]**
|
||||
**[[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]]
|
||||
- [[A|Placeholders#a]]
|
||||
- [[B|Placeholders#b]]
|
||||
- [[C|Placeholders#c]]
|
||||
- [[D|Placeholders#d]]
|
||||
- [[E|Placeholders#e]]
|
||||
- [[F|Placeholders#f]]
|
||||
- [[G|Placeholders#g]]
|
||||
- [[H|Placeholders#h]]
|
||||
- [[I|Placeholders#i]]
|
||||
- [[J|Placeholders#j]]
|
||||
- [[K|Placeholders#k]]
|
||||
- [[L|Placeholders#l]]
|
||||
- [[M|Placeholders#m]]
|
||||
- [[N|Placeholders#n]]
|
||||
- [[O|Placeholders#o]]
|
||||
- [[P|Placeholders#p]]
|
||||
- [[Q|Placeholders#q]]
|
||||
- [[R|Placeholders#r]]
|
||||
- [[S|Placeholders#s]]
|
||||
- [[T|Placeholders#t]]
|
||||
- [[U|Placeholders#u]]
|
||||
- [[V|Placeholders#v]]
|
||||
- [[W|Placeholders#w]]
|
||||
- [[Z|Placeholders#z]]
|
||||