Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0fbdaa2a0 | ||
|
|
17066cb679 | ||
|
|
9eb1ba82af | ||
|
|
06b12c9599 | ||
|
|
fe277d8bfd | ||
|
|
86cba23568 | ||
|
|
5a6140020f | ||
|
|
cb203edecf | ||
|
|
5510e3bb98 | ||
|
|
470c52e6e3 | ||
|
|
03e4c2165e | ||
|
|
45d617106b | ||
|
|
58869742bc | ||
|
|
a8841ca732 | ||
|
|
96ef82aef0 | ||
|
|
5a33b5b892 | ||
|
|
ed2fb77a7b | ||
|
|
8a1c820e42 | ||
|
|
43c5419453 | ||
|
|
4f2caf67d0 | ||
|
|
8b17e43ce0 | ||
|
|
05db0b189b | ||
|
|
93f91923bb | ||
|
|
6dca3ad152 | ||
|
|
637db5afdb | ||
|
|
029fa00e3a | ||
|
|
e1bb95c482 | ||
|
|
667b1b082d | ||
|
|
2097fc4b86 | ||
|
|
49d20c0bc8 | ||
|
|
fe2ac4f02c | ||
|
|
4859c37ef8 | ||
|
|
c818007426 | ||
|
|
c86f07aeb6 | ||
|
|
0a74e338c2 | ||
|
|
d1dc8b392f | ||
|
|
bd5234b479 | ||
|
|
cca9e3dc58 | ||
|
|
c3df294ce6 | ||
|
|
d81a113240 | ||
|
|
f2feafa45a | ||
|
|
f63a743c2c | ||
|
|
2d9c6482fc | ||
|
|
448a9eeea9 | ||
|
|
c8e32696af | ||
|
|
36eb6eafb3 | ||
|
|
040fafe33a | ||
|
|
040e467761 | ||
|
|
e0d28be260 | ||
|
|
1ef2440bf9 | ||
|
|
2a5d5d3bea | ||
|
|
419153d654 | ||
|
|
ed8c504c27 | ||
|
|
2c29f11a8b | ||
|
|
c442cd1deb | ||
|
|
770e3e866c | ||
|
|
4014046444 | ||
|
|
6f378297dd | ||
|
|
1c5c33be6a | ||
|
|
206665a40b | ||
|
|
159eb54e4e | ||
|
|
f63ab7b693 | ||
|
|
97e5f73774 | ||
|
|
9f85149776 | ||
|
|
d6fa68dead | ||
|
|
5e42fdbfbe | ||
|
|
9b20d1754b | ||
|
|
d310fa3688 | ||
|
|
7ab3e8040c | ||
|
|
5173c24546 | ||
|
|
0c1cccfdcd | ||
|
|
d36cd47597 | ||
|
|
6f34d11138 | ||
|
|
bf3f7bb6ad | ||
|
|
28f74aa50a | ||
|
|
dc3c605315 | ||
|
|
5abc8004c7 | ||
|
|
bf1e971edd | ||
|
|
37c767dc74 | ||
|
|
8257b4f7f6 | ||
|
|
0340f4512e | ||
|
|
c45ce0d090 | ||
|
|
add3dcaa26 | ||
|
|
4a88b10e61 | ||
|
|
7001d0f7fc | ||
|
|
fdf72b14eb | ||
|
|
830de0388a | ||
|
|
4a77c6bdd3 | ||
|
|
579844f193 | ||
|
|
4c6073c02a | ||
|
|
b1eb591e20 | ||
|
|
f5ee776586 | ||
|
|
a2bf7c3dfc | ||
|
|
0543a91c5a | ||
|
|
d88868c4f7 | ||
|
|
86dc52f131 | ||
|
|
f7d88a26ef | ||
|
|
ab1468d03a | ||
|
|
3c65365b83 | ||
|
|
bfefbb59d6 | ||
|
|
9d74b5e428 | ||
|
|
f131ce948c | ||
|
|
1a78a23e7c | ||
|
|
16cdfec4d5 | ||
|
|
243300534c | ||
|
|
ea646b8e6f | ||
|
|
bd5532aa71 | ||
|
|
be033793c2 | ||
|
|
28ce76bc60 | ||
|
|
10732ee978 | ||
|
|
7deccf2e26 | ||
|
|
8873fc8263 | ||
|
|
aaaaf2c670 | ||
|
|
1e8421f83f | ||
|
|
a29a7bf5c3 | ||
|
|
fae67a49ce | ||
|
|
c48a0c1083 | ||
|
|
37e29b8643 | ||
|
|
f683cc66c1 | ||
|
|
2059832df8 | ||
|
|
bda5e61898 | ||
|
|
dcb5f67ba8 | ||
|
|
e6065f85cc | ||
|
|
e0d3d36349 | ||
|
|
ab4d2069eb | ||
|
|
84f8f9073d | ||
|
|
1e9828f594 | ||
|
|
a01050125b | ||
|
|
60957be6fe | ||
|
|
a2b094f7d8 | ||
|
|
56e9705a6e | ||
|
|
ad62da3221 | ||
|
|
c1421d6324 | ||
|
|
068c2b704e | ||
|
|
89d21044d2 | ||
|
|
98246613ca | ||
|
|
ee884ee06a | ||
|
|
355ca2cdf0 | ||
|
|
abc37be619 | ||
|
|
20d9c08630 | ||
|
|
523c9e4ef9 | ||
|
|
76b19f7fb3 | ||
|
|
d776d0d798 | ||
|
|
b63da09fe8 | ||
|
|
d626210804 | ||
|
|
777c198471 | ||
|
|
dbd52a9114 | ||
|
|
3208b865e6 | ||
|
|
a78624eafb | ||
|
|
3249a43f4a | ||
|
|
8e15ba0a3a | ||
|
|
25969f35e0 | ||
|
|
6625bf9830 | ||
|
|
a925dcfd88 | ||
|
|
40357def84 | ||
|
|
b4806abf70 | ||
|
|
f847c033fd | ||
|
|
2919d23fd5 | ||
|
|
78412f4717 | ||
|
|
438504a344 | ||
|
|
d27bc2580f | ||
|
|
665865c5b3 | ||
|
|
d4124c78c2 | ||
|
|
63acc39588 | ||
|
|
46d7a3e95c | ||
|
|
39e5b54af6 | ||
|
|
1a47862d22 | ||
|
|
63c73b8871 | ||
|
|
3bfab3518b | ||
|
|
843d47cfb5 | ||
|
|
f7617eba61 | ||
|
|
1c95d37ce4 | ||
|
|
db65b564a5 | ||
|
|
6f88e126e4 | ||
|
|
25ea0b3a37 | ||
|
|
d3bdcc762f | ||
|
|
d72eb0e2a7 | ||
|
|
7b3a458b25 | ||
|
|
e2b79072d0 | ||
|
|
7845741cec | ||
|
|
6e2497dee7 | ||
|
|
7982c3df80 | ||
|
|
a7701f27f1 | ||
|
|
bbe95bf83a | ||
|
|
4e944df7f2 | ||
|
|
6461aac03d | ||
|
|
1ece7935a2 | ||
|
|
e130261a75 | ||
|
|
c65c241b4d | ||
|
|
9876e8e77b | ||
|
|
674c41fec2 | ||
|
|
6c295ec07f | ||
|
|
332b7b667e | ||
|
|
173bd381a5 | ||
|
|
6154efdd50 | ||
|
|
ee0dcf8019 | ||
|
|
6a4740f729 | ||
|
|
ccf58be365 | ||
|
|
b871278d82 | ||
|
|
90bc2dd3ee | ||
|
|
a85b9dce23 | ||
|
|
a171fad307 | ||
|
|
eba230e5c0 | ||
|
|
ffd1f616d4 | ||
|
|
4dfbf0c71f | ||
|
|
c97616eb8d | ||
|
|
6039bb12b8 | ||
|
|
11bf99faf9 | ||
|
|
cbfde9bedd | ||
|
|
0ab0fa5fb5 | ||
|
|
fd460787c3 | ||
|
|
524d22d37a | ||
|
|
220368d037 | ||
|
|
5d86c5297d | ||
|
|
7d69f1e496 | ||
|
|
e2784c6b17 | ||
|
|
f9ce8f325d | ||
|
|
b059fc644a | ||
|
|
5c7e5d2d59 | ||
|
|
3b4dde335d | ||
|
|
f00ca81c28 | ||
|
|
36ef5e15cf | ||
|
|
9a122fb46d | ||
|
|
17fc78a15f | ||
|
|
0718f0976d | ||
|
|
580e7d3061 | ||
|
|
29af36a9e9 | ||
|
|
56d39722cb | ||
|
|
6a202d4768 | ||
|
|
d399684bfa | ||
|
|
1a0da65c66 | ||
|
|
463b303f2e | ||
|
|
abf0e2bebb | ||
|
|
29670f8c22 | ||
|
|
7b08d6806b | ||
|
|
3211e22963 | ||
|
|
2634639f6b | ||
|
|
0798110743 | ||
|
|
2f90e112b1 | ||
|
|
661ea3ce94 | ||
|
|
8d6e95927c | ||
|
|
c138edccc8 | ||
|
|
e59b171aae | ||
|
|
36cfe6c9c6 | ||
|
|
45a413c3a6 | ||
|
|
a640582278 | ||
|
|
94122a1c80 | ||
|
|
0448278ba1 | ||
|
|
097bff23a2 | ||
|
|
be76d8f4af | ||
|
|
6122805c0d | ||
|
|
392d5cb17a | ||
|
|
ec1352d52b | ||
|
|
c3a4db1ac8 | ||
|
|
442eb35a4f | ||
|
|
d0851a9365 | ||
|
|
5273745be5 | ||
|
|
ca937f6879 | ||
|
|
a4c4fa5556 | ||
|
|
480c303f2f | ||
|
|
347640f346 | ||
|
|
1d8314c0eb | ||
|
|
20d95baea9 | ||
|
|
510f400c1b | ||
|
|
c49d0b3ede | ||
|
|
ff197cb6b6 | ||
|
|
9e4605258b | ||
|
|
c54e8bc8bd | ||
|
|
fe937b8f8d | ||
|
|
d262b3689a | ||
|
|
aac5226fce | ||
|
|
1d1b9722ac | ||
|
|
94193501ba | ||
|
|
2b142316dc | ||
|
|
a06124e49c | ||
|
|
c1bd04f117 | ||
|
|
4272d15a8b | ||
|
|
0537dad68e | ||
|
|
c1f09a6bd9 | ||
|
|
69ea7c71b3 | ||
|
|
3052f28b2c | ||
|
|
892d23e0d0 | ||
|
|
b217edeadf | ||
|
|
aa4ad384c1 | ||
|
|
8021024b48 | ||
|
|
d3f246d048 | ||
|
|
9c2dfcab06 | ||
|
|
8b4224a034 | ||
|
|
61bf0007c1 | ||
|
|
151559c50e | ||
|
|
2dccf6e790 | ||
|
|
bc510b1ba0 | ||
|
|
0253d86b8d | ||
|
|
59cd31a6c8 | ||
|
|
068b24bd39 | ||
|
|
7f06797f5f | ||
|
|
3e2bdf4772 | ||
|
|
3b049299b1 | ||
|
|
05670bebeb | ||
|
|
81f73590a6 | ||
|
|
163e4cdadb | ||
|
|
512c02e501 | ||
|
|
25ef8ba315 | ||
|
|
8966feb35a | ||
|
|
0d29be48c7 | ||
|
|
bc2827659d | ||
|
|
0a72247a5d | ||
|
|
a102ec3566 | ||
|
|
f91b02d572 | ||
|
|
0f00741151 | ||
|
|
922302082f | ||
|
|
24e1fbb6e5 | ||
|
|
3026a2d48f | ||
|
|
58101bfea0 | ||
|
|
0a9e46ee85 | ||
|
|
fd67e45c58 | ||
|
|
b6af6de2df | ||
|
|
173051829e | ||
|
|
8a9ef4811f | ||
|
|
4fd6d580b1 | ||
|
|
415970101c | ||
|
|
668dcdd8b4 | ||
|
|
bf24533b54 | ||
|
|
b2daada576 | ||
|
|
9dd2c58134 | ||
|
|
7674c68bc7 | ||
|
|
0b3b0b29f5 | ||
|
|
60370a1a83 | ||
|
|
3bf273e854 | ||
|
|
a8e53c9b62 | ||
|
|
3015cd9604 | ||
|
|
839119e0a9 | ||
|
|
409a0665cc | ||
|
|
0549fe9c21 | ||
|
|
f047bb6176 | ||
|
|
ad04b7e966 | ||
|
|
2591cbf029 | ||
|
|
8213e07c74 | ||
|
|
972f9581e3 | ||
|
|
2e17b3defd | ||
|
|
76dbfb8fdf | ||
|
|
8fd206b119 | ||
|
|
9c6e514234 | ||
|
|
eb66ccb90d | ||
|
|
c004dc6106 | ||
|
|
f54ccbd7b2 | ||
|
|
8cdd0b713b | ||
|
|
2562e749db | ||
|
|
1a1e5d84bb | ||
|
|
d4d23035e3 | ||
|
|
5e334e4a8a | ||
|
|
22991efccf | ||
|
|
5341fbc3ba | ||
|
|
2e0fbd01e6 | ||
|
|
d1d395d9b3 | ||
|
|
9aeedac2ad | ||
|
|
265ed68e0f | ||
|
|
b73daaf917 | ||
|
|
39d8e414f4 | ||
|
|
693541dd00 | ||
|
|
5dce8031c5 | ||
|
|
babef8ccf3 | ||
|
|
7a881206ca | ||
|
|
aed8ecca26 | ||
|
|
25dab3157a | ||
|
|
81d8b535ee | ||
|
|
c94802a141 | ||
|
|
85e31f8292 | ||
|
|
da642cb3b2 | ||
|
|
96c707eca4 | ||
|
|
ce5c469637 | ||
|
|
4126c4a7a1 | ||
|
|
fb430a930b | ||
|
|
2c6f8c79c2 | ||
|
|
1b94f23ff2 | ||
|
|
72c0a88fc1 | ||
|
|
e532987c6a | ||
|
|
2168d92b12 | ||
|
|
d68758f34e | ||
|
|
e1b7844501 | ||
|
|
01b6ed185b | ||
|
|
3ee31012ce | ||
|
|
ba312961b8 | ||
|
|
a2484969ee | ||
|
|
470196741c | ||
|
|
2abce5ebe7 | ||
|
|
20f775c119 | ||
|
|
e0821ed2b1 | ||
|
|
6fbcc89fc8 | ||
|
|
11f86194b0 | ||
|
|
46c112d2ea | ||
|
|
0269578e5e | ||
|
|
fc14b19d9f | ||
|
|
9c25f848c6 | ||
|
|
b7f53aabfb | ||
|
|
926a009085 | ||
|
|
f0737861de | ||
|
|
8e14a92813 | ||
|
|
78fc8069b3 | ||
|
|
eed98ed638 | ||
|
|
f3653c20f6 | ||
|
|
675f4bb6e9 | ||
|
|
4dbb8b7360 | ||
|
|
5040ee2946 | ||
|
|
d7e1408c30 | ||
|
|
73fda9027a | ||
|
|
b762c6000f | ||
|
|
16dcd85807 | ||
|
|
d9b5fcf250 | ||
|
|
b85f49010b | ||
|
|
42b64b86bd | ||
|
|
266014cbe2 | ||
|
|
1e27e28a33 | ||
|
|
1c530c18ce | ||
|
|
c2ebd2251e | ||
|
|
c2fb84dc61 | ||
|
|
39e21bffe7 | ||
|
|
226b6eb01e | ||
|
|
76a40fd889 | ||
|
|
32f43e7713 | ||
|
|
601e57572f | ||
|
|
4a8bd40a8b | ||
|
|
8294e99eeb | ||
|
|
162e7f7faa | ||
|
|
7463074b5a | ||
|
|
bbec19d5c9 | ||
|
|
72ed4223c4 | ||
|
|
603656248b | ||
|
|
4455a0254f | ||
|
|
3227c47d9b | ||
|
|
bf6885875f | ||
|
|
72934d1286 | ||
|
|
2a4840814d | ||
|
|
8b8e8acbc8 | ||
|
|
a4ff2d8dcf | ||
|
|
a6ca0c8121 | ||
|
|
f3e88859d3 | ||
|
|
7249159ec9 | ||
|
|
61c3eccb19 | ||
|
|
4ec800c83e | ||
|
|
20e42b0ae7 | ||
|
|
d95becce22 | ||
|
|
04fd38a10d | ||
|
|
a30b2319f5 | ||
|
|
a1b08f6dd0 | ||
|
|
614193716f | ||
|
|
b68ac4cdd5 | ||
|
|
3767ca2883 | ||
|
|
73b7abf3e6 | ||
|
|
285719ae28 | ||
|
|
22fd1ac1e4 | ||
|
|
6127a2ab23 | ||
|
|
0054b6e06f | ||
|
|
b0f1e0bcb6 | ||
|
|
ddd0dba728 | ||
|
|
9595164f69 | ||
|
|
66092ba3fd | ||
|
|
5c41c7f4c9 | ||
|
|
dfa772af4b | ||
|
|
78f33661aa | ||
|
|
45f2bb2c72 | ||
|
|
f20c7a58ac | ||
|
|
4d1b37c37b | ||
|
|
d323cd7691 | ||
|
|
67fc73b530 | ||
|
|
13872fd9d1 | ||
|
|
a76da52a0a | ||
|
|
36fabe10a6 | ||
|
|
eada7af420 | ||
|
|
63fc7d64be | ||
|
|
0ed5b12f8b | ||
|
|
504f9edbb2 | ||
|
|
8060ece2eb | ||
|
|
254442fa2e | ||
|
|
febead9d5a | ||
|
|
d8cd0c278d | ||
|
|
fe0d7cd671 | ||
|
|
c9d8878bb3 | ||
|
|
0f450e9b60 | ||
|
|
667d0b544e | ||
|
|
6e1e6bd928 | ||
|
|
1cfc447445 | ||
|
|
6d3e68e548 | ||
|
|
855dde196e | ||
|
|
d5a9e1012a | ||
|
|
f5d67833b2 | ||
|
|
a1eb2f63e5 | ||
|
|
a882b8d86f | ||
|
|
0a745ae4c0 | ||
|
|
d38a0549d3 | ||
|
|
6e6394f1fb | ||
|
|
ce58e12740 | ||
|
|
2411354a5f | ||
|
|
13efd0c482 | ||
|
|
8fce74f30d | ||
|
|
3f54c05f86 | ||
|
|
dd1cf02c49 | ||
|
|
b462373dfc | ||
|
|
c6e5d008d2 | ||
|
|
9a91561304 | ||
|
|
1c6981e538 | ||
|
|
b6e366ff9d | ||
|
|
ca0fbe7e3b | ||
|
|
27d8b3e718 | ||
|
|
8430609d0f | ||
|
|
8fe5e87999 | ||
|
|
6b985e19c2 | ||
|
|
4636cc78b2 | ||
|
|
8c66b50749 | ||
|
|
7f6e95d47e | ||
|
|
cd60ade45f | ||
|
|
f82945b97b | ||
|
|
a3e9651378 | ||
|
|
a764ca0ed7 | ||
|
|
d21464560a | ||
|
|
88c5dc7c86 | ||
|
|
b2b2c710c5 | ||
|
|
4175e2d36a | ||
|
|
a84adb367d | ||
|
|
7368158707 | ||
|
|
5d3c1cb553 | ||
|
|
cb1206db0b | ||
|
|
03396e447f | ||
|
|
6dec0826af | ||
|
|
f443f77dfe | ||
|
|
5c4636d8c2 | ||
|
|
51c6c4066b | ||
|
|
161fc6da95 | ||
|
|
aba23f355e | ||
|
|
ac78b4d350 | ||
|
|
0c01f8d3c1 | ||
|
|
77dc7d51f5 | ||
|
|
ee5c4db0c9 | ||
|
|
f9b47c5c63 | ||
|
|
d7dc82b1a7 | ||
|
|
c5041edd8a | ||
|
|
d52b7f85b3 | ||
|
|
3e4564578a | ||
|
|
65312cd2a1 | ||
|
|
b2db9675ca | ||
|
|
0a66c2dd7e | ||
|
|
7c02cb91f4 | ||
|
|
3a390659cd | ||
|
|
99bd32c8f5 | ||
|
|
de894a98b2 | ||
|
|
8c668289ce | ||
|
|
95e850cb84 | ||
|
|
d2134abc45 | ||
|
|
3316662889 | ||
|
|
5b3ced6ca9 | ||
|
|
50a5169543 | ||
|
|
c8d5e2f4b5 | ||
|
|
3dcd78e4f5 | ||
|
|
de570574c9 | ||
|
|
116eda2866 | ||
|
|
30f1576510 | ||
|
|
64e897615a | ||
|
|
2dfd8dcfa5 | ||
|
|
00791766f1 | ||
|
|
4d2c783d85 | ||
|
|
19f1664662 | ||
|
|
ca2e6fb530 | ||
|
|
eca7c6641a | ||
|
|
47fe6b57e2 | ||
|
|
911819c69b | ||
|
|
cda72b5c5b | ||
|
|
75a3da98fa | ||
|
|
ced74fdee3 | ||
|
|
b8460ff755 | ||
|
|
50bb1facc4 | ||
|
|
5ed21949e1 | ||
|
|
253e4937db | ||
|
|
192685ceec | ||
|
|
16de063e51 | ||
|
|
1d3ce9ed64 | ||
|
|
d357c927c8 | ||
|
|
1143595238 | ||
|
|
0917c36889 | ||
|
|
c113214ae0 | ||
|
|
b2c444d125 | ||
|
|
78fdce0eab | ||
|
|
feff09eccb | ||
|
|
d0646472bf | ||
|
|
8471f50402 | ||
|
|
621450dae4 | ||
|
|
84e415e4bc | ||
|
|
54bbc8c740 | ||
|
|
7b1ab7e833 | ||
|
|
acb8f8a43f | ||
|
|
279759b52f | ||
|
|
02ca0b1fc8 | ||
|
|
d57e3d1006 | ||
|
|
d54769eb82 | ||
|
|
35f6a3df15 | ||
|
|
46b66466ba | ||
|
|
53fbe4e5e2 | ||
|
|
53ef7a7086 | ||
|
|
b0e08721fa | ||
|
|
29dad6ca25 | ||
|
|
7c3e5eb09b | ||
|
|
a7776ec97c | ||
|
|
d598082c0a | ||
|
|
4539b5b22a | ||
|
|
02fe645d1e | ||
|
|
ee8af6a314 | ||
|
|
a4b78c7d16 | ||
|
|
d22fe462e5 | ||
|
|
c19182a2b4 | ||
|
|
6905c3988b | ||
|
|
23be120adc | ||
|
|
dae863f88f | ||
|
|
d12f73d2fa | ||
|
|
316ee90713 | ||
|
|
1495fad96f | ||
|
|
8e0de1709b | ||
|
|
ad22802e10 | ||
|
|
6de0345f06 | ||
|
|
7338a7d8ba | ||
|
|
3ca12f2c91 | ||
|
|
262e7c48c7 | ||
|
|
0b62d99f9d | ||
|
|
ea30de47d1 | ||
|
|
a76daf3aba | ||
|
|
e1ff13f4bf | ||
|
|
12f941cf83 | ||
|
|
243377a76a | ||
|
|
d7eab03860 | ||
|
|
ddd1f473f1 | ||
|
|
3e52bb0936 | ||
|
|
eb60220b1e | ||
|
|
00902bd597 | ||
|
|
d3606088cd | ||
|
|
ef2512e4e2 | ||
|
|
7f95a1c7c3 | ||
|
|
68a2fe27ff | ||
|
|
b05317c460 | ||
|
|
62fee6f347 | ||
|
|
ef7d4254e1 | ||
|
|
b6720ccc1f | ||
|
|
69d3d33008 | ||
|
|
7a193c87a9 | ||
|
|
f2cf2fb734 | ||
|
|
836079b5ea | ||
|
|
a7f6456480 | ||
|
|
82f25c3899 | ||
|
|
cb2cdbd4fc | ||
|
|
40d2b651a8 | ||
|
|
a999d9e9bb | ||
|
|
b144f2db9c | ||
|
|
24060a10ed | ||
|
|
4c8919804f | ||
|
|
66618260bb | ||
|
|
f441ede6b0 | ||
|
|
593ae76354 | ||
|
|
aa49dc5bc1 | ||
|
|
8941d909ca | ||
|
|
2946792dec | ||
|
|
0567f0ac66 | ||
|
|
fe78992477 | ||
|
|
195e1c82bd | ||
|
|
9479fe06c0 | ||
|
|
0807caed98 | ||
|
|
9fdcf5aa78 | ||
|
|
8d26e66dc0 | ||
|
|
14e61ba6bf | ||
|
|
6d361cc83f | ||
|
|
1e32fd65e0 | ||
|
|
5f0d8fff2f | ||
|
|
0d828a99bc | ||
|
|
0e8bd23784 | ||
|
|
a8af2a49ad | ||
|
|
54b08019ec | ||
|
|
27f01a6c3a | ||
|
|
337aab384f | ||
|
|
a94e1c1dd6 | ||
|
|
1445d97ce0 | ||
|
|
9e8abe0768 | ||
|
|
ca92a76b15 | ||
|
|
637c8a158b | ||
|
|
85b1ed9916 | ||
|
|
389c9a138e | ||
|
|
7dc5c32db3 | ||
|
|
dcc1e375a9 | ||
|
|
176373e2a4 | ||
|
|
2cd7d5db00 | ||
|
|
05fc747557 | ||
|
|
528ca45b26 | ||
|
|
b4b420479e | ||
|
|
10a44f5999 | ||
|
|
03f012eef4 | ||
|
|
e302c29a9e | ||
|
|
9d7454f9c3 | ||
|
|
0731288028 | ||
|
|
bb061c400f | ||
|
|
0ef664efcd | ||
|
|
0a6c64f9a1 | ||
|
|
3fd328ed91 | ||
|
|
4923ca6f64 | ||
|
|
7e88e4350d | ||
|
|
04ea20b2c2 | ||
|
|
8491e2e45b | ||
|
|
88c1d91675 | ||
|
|
c45c9dc970 | ||
|
|
63807f2617 | ||
|
|
bfeb112774 | ||
|
|
d45119ccca | ||
|
|
7d5f64636b | ||
|
|
fbb61808ba | ||
|
|
800c89f240 | ||
|
|
20cc999f0d | ||
|
|
3604abb307 | ||
|
|
4b56d642e5 | ||
|
|
81f0d46aea | ||
|
|
a2f7336b53 | ||
|
|
38ae2c32dc | ||
|
|
d6b2d21e7c | ||
|
|
83bcae4a59 | ||
|
|
b9c862580b | ||
|
|
c30f725ed2 | ||
|
|
ca8eb546a5 | ||
|
|
0335608162 | ||
|
|
593899a434 | ||
|
|
8eb8d746d9 | ||
|
|
b8ef63c9ba | ||
|
|
dfb8610489 | ||
|
|
3801059cf6 | ||
|
|
2b3aea7f83 | ||
|
|
af42aa4b50 | ||
|
|
2d2b35522e | ||
|
|
2a586324d4 | ||
|
|
5bd9c926ba | ||
|
|
e76c30fca2 | ||
|
|
e42bd3725a | ||
|
|
660c8d9501 | ||
|
|
44a65bc347 | ||
|
|
f3d27f4816 | ||
|
|
4c3891fa0a | ||
|
|
5072265549 | ||
|
|
788b58f9cd | ||
|
|
0db34f815f | ||
|
|
900237b7ea | ||
|
|
7fa7c2baf9 | ||
|
|
eec8d706ee | ||
|
|
d292ae4a18 | ||
|
|
f7d04f87db | ||
|
|
59e2f3da99 | ||
|
|
2a5b6c23da | ||
|
|
62560be2ab | ||
|
|
64993b8b53 | ||
|
|
18c4cd6b6d | ||
|
|
35e14f7a76 | ||
|
|
5c6490159b | ||
|
|
29f0c19a74 | ||
|
|
664500d61b | ||
|
|
e208cdf49b | ||
|
|
e295795ec4 | ||
|
|
c9d24b5e88 | ||
|
|
f09311e6fc | ||
|
|
02ea389f12 | ||
|
|
14ccfa3730 | ||
|
|
51ffe88557 | ||
|
|
7daa0545f3 | ||
|
|
ef7b9cb55a | ||
|
|
a410567de0 | ||
|
|
f00aeab649 | ||
|
|
a4494fc2e7 | ||
|
|
6333760508 | ||
|
|
012547f950 | ||
|
|
631d9c9a1c | ||
|
|
a61e3176a8 | ||
|
|
c013835725 | ||
|
|
ea8ed1e950 | ||
|
|
7dcb3a5f62 | ||
|
|
ed70727a76 | ||
|
|
3418d461e4 | ||
|
|
1e5ec8226a | ||
|
|
993fa19f85 | ||
|
|
7d3d777cb5 | ||
|
|
9829864a96 | ||
|
|
eec87f642f | ||
|
|
9cba16814a | ||
|
|
44ebd17356 | ||
|
|
ba2312ed46 | ||
|
|
2d8f9e1ca1 | ||
|
|
7556a203c2 | ||
|
|
67b8fbcc88 | ||
|
|
4c9f7f76b9 | ||
|
|
df388ca0e3 | ||
|
|
1d8fc309ff | ||
|
|
42a159ea82 | ||
|
|
a62187e0cb | ||
|
|
7896b2f08a | ||
|
|
034d031d79 | ||
|
|
e228fd6fed | ||
|
|
baa85d7222 | ||
|
|
5fd2d976a2 | ||
|
|
03ac8627df | ||
|
|
63d6f2829c | ||
|
|
9824a891b6 | ||
|
|
a648074757 | ||
|
|
5e3a3621bc | ||
|
|
01a645083f | ||
|
|
8b9aced63c | ||
|
|
6eba6aee3b | ||
|
|
0fbbaaee5d | ||
|
|
57e973b371 | ||
|
|
c93f8f06f2 | ||
|
|
6a742dbecc | ||
|
|
c3edbf946c | ||
|
|
24fcd076b8 | ||
|
|
a6ac022cb3 | ||
|
|
363c57158f | ||
|
|
d22e22480e | ||
|
|
daf1d95c82 | ||
|
|
35d588477d | ||
|
|
2ba3ee0323 | ||
|
|
ed1ccc0623 | ||
|
|
2332079002 | ||
|
|
3b7f8afe76 | ||
|
|
4c33f3d03c | ||
|
|
cfd317f5a8 | ||
|
|
063b44aa67 | ||
|
|
a42c00ecf5 | ||
|
|
9e36f0a500 | ||
|
|
f13386ad29 | ||
|
|
1c3dbcc8d6 | ||
|
|
1d4f34ec84 | ||
|
|
2ef4194a51 | ||
|
|
98f60f1350 | ||
|
|
02f98c739f | ||
|
|
766fa58157 | ||
|
|
ebf0c2fb4f | ||
|
|
bc3cfc7986 | ||
|
|
e516f5ee87 | ||
|
|
7abe7c6224 | ||
|
|
e46a9c7476 | ||
|
|
891f4a9d24 | ||
|
|
df6d771e4d | ||
|
|
0f861c4ab7 | ||
|
|
510d4d1895 | ||
|
|
cd4af0ff5d | ||
|
|
77f508682e | ||
|
|
3a41a94f47 | ||
|
|
cba19065a4 | ||
|
|
19a652a1fa | ||
|
|
c8f8077159 | ||
|
|
60db0e87f4 | ||
|
|
f581ce26fb | ||
|
|
0cc06a0b1f | ||
|
|
27dfa7e481 | ||
|
|
0659fd8b84 | ||
|
|
8512eef6c0 | ||
|
|
e860195847 | ||
|
|
3c34798d1a | ||
|
|
1275a10de5 | ||
|
|
99c2e9aa1f | ||
|
|
d3b0787f90 | ||
|
|
faad7d3b85 | ||
|
|
099596fdde | ||
|
|
ab202ffe1c | ||
|
|
b935d7f578 | ||
|
|
d505d197ba | ||
|
|
12c9aab745 | ||
|
|
3c10cb2340 | ||
|
|
f57cc3bc06 | ||
|
|
eb4afec6db | ||
|
|
35b4df196d | ||
|
|
038e8fb98a | ||
|
|
b84a14f849 | ||
|
|
eeda3875e4 | ||
|
|
a584a78734 | ||
|
|
e408c07f85 | ||
|
|
4700684f03 | ||
|
|
8ef7631eed |
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: BenCodez # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
#patreon: # Replace with a single Patreon username
|
||||
#open_collective: # Replace with a single Open Collective username
|
||||
#ko_fi: # Replace with a single Ko-fi username
|
||||
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
#liberapay: # Replace with a single Liberapay username
|
||||
#issuehunt: # Replace with a single IssueHunt username
|
||||
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
#polar: # Replace with a single Polar username
|
||||
#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
custom: ["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YQBX25RTXJ5DG"]
|
||||
@@ -0,0 +1,11 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "maven" # See documentation for possible values
|
||||
directory: "/VotingPlugin/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -1,17 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 20
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 5
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- Priority
|
||||
- nonstale
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Deploy Javadoc
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy JavaDoc 🚀
|
||||
uses: MathieuSoysal/Javadoc-publisher.yml@main
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
javadoc-branch: gh-pages
|
||||
java-version: 17
|
||||
target-folder: ''
|
||||
project: maven # or gradle
|
||||
# subdirectories: moduleA moduleB #for subdirectories support, needs to be run with custom command
|
||||
custom-command: mvn -f VotingPlugin/pom.xml deploy -P javadoc javadoc:aggregate
|
||||
javadoc-source-folder: 'VotingPlugin/target/apidocs'
|
||||
@@ -0,0 +1,27 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '19 16 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'Stale issue message'
|
||||
stale-pr-message: 'Stale pull request message'
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
File renamed without changes.
@@ -2,30 +2,25 @@
|
||||
Plugin on SpigotMC
|
||||
https://www.spigotmc.org/resources/votingplugin.15358/
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## License
|
||||
### Creative Commons Arttribution 3.0 Unported
|
||||
https://github.com/Ben12345rocks/VotingPlugin/blob/master/VotingPlugin/Resources/LICENSE.txt
|
||||
https://github.com/BenCodez/VotingPlugin/blob/master/VotingPlugin/Resources/LICENSE.txt
|
||||
|
||||
### Maven:
|
||||
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
<id>BenCodez Repo</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.BenCodez</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>votingplugin</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
|
||||
Versions:
|
||||
LATEST - latest stable release
|
||||
BRANCH-SNAPHSOT - unstable builds
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="Resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
@@ -1,3 +1,8 @@
|
||||
/bin/
|
||||
/target/
|
||||
/doc/
|
||||
/doc/
|
||||
/.idea/
|
||||
/*.iml
|
||||
/.settings/
|
||||
/.classpath
|
||||
/.factorypath
|
||||
@@ -1,7 +0,0 @@
|
||||
add_todo=false
|
||||
eclipse.preferences.version=1
|
||||
include_subpackages=true
|
||||
mode=mode_replace
|
||||
project_specific_settings=true
|
||||
replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
|
||||
use_internal_formatter=true
|
||||
@@ -1,4 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=Cp1252
|
||||
encoding/Resources=Cp1252
|
||||
encoding/src=Cp1252
|
||||
@@ -1,30 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.doc.comment.support=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
||||
@@ -1,4 +0,0 @@
|
||||
activeProfiles=dev
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -1,3 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
project.repository.kind=github
|
||||
project.repository.url=http\://github.com/Ben12345rocks/VotingPlugin
|
||||
@@ -1,8 +0,0 @@
|
||||
DELEGATES_PREFERENCE=delegateValidatorList
|
||||
USER_BUILD_PREFERENCE=enabledBuildValidatorList
|
||||
USER_MANUAL_PREFERENCE=enabledManualValidatorList
|
||||
USER_PREFERENCE=overrideGlobalPreferencesfalse
|
||||
eclipse.preferences.version=1
|
||||
override=false
|
||||
suspend=false
|
||||
vf.version=3
|
||||
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.jboss.ide.eclipse.as.core.singledeployable.deployableList=\n
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,21 +1,32 @@
|
||||
# --------------------------
|
||||
##########################################
|
||||
# Bungee Setup
|
||||
# Only if using votingplugin bungee to send votes
|
||||
# REQUIRES RESTART FOR CHANGES TO TAKE EFFECT
|
||||
# --------------------------
|
||||
##########################################
|
||||
|
||||
# Plugin using bungee, requires plugin on bungee server
|
||||
UseBungeecord: false
|
||||
|
||||
# What type of bungee setup
|
||||
# Requires restart and set on all servers
|
||||
# https://github.com/Ben12345rocks/VotingPlugin/wiki/Bungeecoord-Setups
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki/Bungeecord-Setups
|
||||
# Available:
|
||||
# SOCKETS
|
||||
# PLUGINMESSAGING
|
||||
# PLUGINMESSAGING (Recommended)
|
||||
# MYSQL
|
||||
# REDIS (2nd Most Recommended)
|
||||
BungeeMethod: PLUGINMESSAGING
|
||||
|
||||
# Use Redis for between server communication, set BungeeMethod to REDIS to use this
|
||||
Redis:
|
||||
Host: localhost
|
||||
Port: 6379
|
||||
# To get the user name, run redis-cli, if you set a password, run "auth <your password>" and if the out put is "OK" run "ACL USERS"
|
||||
Username: 'default'
|
||||
Password: ''
|
||||
# Set a prefix from an entire proxy network if using multi-proxy setup below
|
||||
Prefix: ''
|
||||
|
||||
# Enables more debug messages for communication between servers
|
||||
# Use /votingpluginbungee status for testing communication
|
||||
BungeeDebug: false
|
||||
@@ -29,28 +40,89 @@ BungeeBroadcast: false
|
||||
# Whether to broadcast on cached votes
|
||||
BungeeBroadcastAlways: false
|
||||
|
||||
# If true, the server won't broadcast votes
|
||||
# To be used in conjuction with Broadcast setting on bungee
|
||||
DisableBroadcast: false
|
||||
|
||||
# If true, offline rewards will be stored per server, rather than global
|
||||
# This shouldn't need to be set unless you get alot of cross server rewards issues
|
||||
# You can also specify the server within the rewards
|
||||
# Requires server name below to be correct
|
||||
PerServerRewards: false
|
||||
|
||||
# If true, milestones work per server
|
||||
# Please note totals still sync, but milestones can be claimed on each server
|
||||
# Needs to be set across all needed servers
|
||||
PerServerMilestones: false
|
||||
|
||||
# If true, points will be given on a per server level
|
||||
# Points will be added when server gets vote from bungee
|
||||
PerServerPoints: false
|
||||
|
||||
# If true, plugin will trigger VotifierEvent
|
||||
# Should allow some compability with other plugins
|
||||
TriggerVotifierEvent: false
|
||||
|
||||
# If enabled plugin will give extra allsites reward if deterimned that it should
|
||||
# E.g. user votes offline for 7 days, they will only get 1 allsites reward by default
|
||||
# When enabled, they should get 7
|
||||
# Only applies to PLUGINMESSAGING
|
||||
# Recommend enabling ExtraAllSitesCheck in config.yml as well
|
||||
GiveExtraAllSitesRewards: false
|
||||
|
||||
# What server this is in bungee (must match)
|
||||
# Also can be applied to rewards
|
||||
Server: PleaseSet
|
||||
|
||||
# -----------------------------
|
||||
# For socket setup below only
|
||||
# -----------------------------
|
||||
# Rewards from bungee vote party
|
||||
# Gives to only players only
|
||||
# Use regular voteparty rewards otherwise
|
||||
# Can edit via /av gui
|
||||
BungeeVotePartyRewards: {}
|
||||
|
||||
# Bungee communication, add bungee host/port here
|
||||
# For socket method
|
||||
BungeeServer:
|
||||
Host: '127.0.0.1'
|
||||
Port: 1297
|
||||
|
||||
# Bungee communication, add this to bungee server
|
||||
# For socket method
|
||||
SpigotServer:
|
||||
Host: '127.0.0.1'
|
||||
Port: 1298
|
||||
# List of commands to run on bungee party
|
||||
# This runs a one time command only
|
||||
BungeeVotePartyGlobalCommands: []
|
||||
|
||||
####################################################################################
|
||||
# Global mysql data handle for between server commmunications
|
||||
# This is NOT required for bungee voting to work
|
||||
# This is still a WIP, use with caution
|
||||
# This will create a different table then from users storing server info to process
|
||||
#
|
||||
# If you use this you need to enable this on BungeeSettings.yml on each server with votingplugin
|
||||
# Make sure server name is set correctly in BungeeSettings.yml or this will not work correctly
|
||||
#
|
||||
# Please use PLUGINMESSAGING for this, SOCKETS should work as well, but not fully tested
|
||||
#
|
||||
# This will make votes cache until time change has finished processing
|
||||
# In the event a server is offline or time change fails, the time change process
|
||||
# will continue after a set amount of time (in essense skipping a specific server)
|
||||
# This will also respect blocked servers in bungeeconfig.yml
|
||||
GlobalData:
|
||||
Enabled: false
|
||||
# Use existing mysql connection from config.yml
|
||||
UseMainMySQL: true
|
||||
# Mysql settings only used if above is false
|
||||
Host: ''
|
||||
# Default port is 3306
|
||||
Port: 3306
|
||||
Database: ''
|
||||
Username: ''
|
||||
Password: ''
|
||||
# Max number of connections
|
||||
MaxConnections: 1
|
||||
# Must be the same on all servers
|
||||
Prefix: ''
|
||||
#UseSSL: true
|
||||
#PublicKeyRetrieval: false
|
||||
#Attempt to use mariadb driver
|
||||
#UseMariaDB: false
|
||||
|
||||
##########################################
|
||||
# For socket setup
|
||||
# Recommend to try PLUGINMESSAGING setup first
|
||||
# Options hidden by default to avoid confusion
|
||||
##########################################
|
||||
# Options available here:
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki/Bungee-Setup-SOCKETS
|
||||
+366
-214
@@ -1,13 +1,16 @@
|
||||
# VotingPlugin by Ben12345rocks
|
||||
# VotingPlugin by BenCodez
|
||||
# Main Config
|
||||
# See wiki for help:
|
||||
# https://github.com/Ben12345rocks/VotingPlugin/wiki
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki
|
||||
# Config is sorted in sections
|
||||
# Use Control + F to search with Notepad++
|
||||
#
|
||||
|
||||
|
||||
###########################################
|
||||
# User storage
|
||||
###########################################
|
||||
# Valid Options:
|
||||
# - SQLITE
|
||||
# - FLAT
|
||||
# - MYSQL
|
||||
DataStorage: SQLITE
|
||||
|
||||
@@ -22,87 +25,52 @@ MySQL:
|
||||
Password: ''
|
||||
# Max number of connections
|
||||
MaxConnections: 1
|
||||
# Maxium size of caching mysql
|
||||
# -1 for no limit
|
||||
# Affecting this value may affect performance
|
||||
MaxSize: -1
|
||||
# Table name prefix, for use with mutliple servers
|
||||
# Don't use with PLUGINMESSAGING bungee setup
|
||||
Prefix: ''
|
||||
#UseSSL: true
|
||||
#PublicKeyRetrieval: false
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Mysql cache options
|
||||
# Clearing cache forces the plugin to pull from database
|
||||
# Not needed unless you are using multiple servers
|
||||
# If using a bungee setup most of these options are overriden automatically
|
||||
# ---------------------------------------------------------
|
||||
#MaxLifeTime: -1
|
||||
#Additional info on connection string
|
||||
#Line: ''
|
||||
#Attempt to use mariadb driver
|
||||
#UseMariaDB: false
|
||||
|
||||
# Clear cache on update, setting to true reduces update speed
|
||||
# Also may require AlwaysUpdate set to true
|
||||
ClearCacheOnUpdate: false
|
||||
|
||||
# Clear cache on player join always
|
||||
ClearCacheOnJoin: false
|
||||
|
||||
# Clears cache for the player who voted only
|
||||
# Only effects if using mysql
|
||||
# Would recommend for some bungee setups
|
||||
ClearCacheOnVote: false
|
||||
|
||||
# Clear cache when player leaves
|
||||
ClearCacheOnLeave: false
|
||||
|
||||
ClearCacheOnVoteShopPurchase: true
|
||||
|
||||
# --------------------
|
||||
# AllowUnJoined options
|
||||
# May need to set to true for bungee setup
|
||||
# --------------------
|
||||
|
||||
# Let players who never joined before vote
|
||||
# Recommend: False (Will prevent creating random user data)
|
||||
AllowUnjoined: false
|
||||
|
||||
# Use server lookup for when allowunjoined is set to false
|
||||
# Recommend leaving enabled unless you face issues
|
||||
AllowUnJoinedCheckServer: true
|
||||
|
||||
# ------------------------------------------------
|
||||
###########################################
|
||||
# VoteReminding
|
||||
# ------------------------------------------------
|
||||
###########################################
|
||||
|
||||
# Configuration for VoteReminding
|
||||
# By default this should be all setup to work
|
||||
# as long as vote delays are done properly
|
||||
# as long as vote delays are done properly in votesites.yml
|
||||
VoteReminding:
|
||||
# Enable vote reminding
|
||||
# This will remind player when he can vote on all sites
|
||||
# Requires VoteDelays to be setup properly
|
||||
# Use /vote next to see when you can be reminded
|
||||
# Players require the perm "VotingPlugin.Login.RemindVotes" or "VotingPlugin.Player"
|
||||
# To remind if all votesites are available (rather than any) use the permission "VotingPlugin.Login.RemindVotes.All"
|
||||
Enabled: true
|
||||
|
||||
# Will remind player on login if he can vote
|
||||
RemindOnLogin: true
|
||||
|
||||
# Whether or not to remind only once when the player can vote
|
||||
# Does not apply to login reminds.
|
||||
RemindOnlyOnce: true
|
||||
|
||||
# Will remind player on login if he can vote
|
||||
# Ignores value above
|
||||
RemindOnLogin: true
|
||||
|
||||
# Delay to remind votes in minutes
|
||||
# Only works if above is false
|
||||
# Set to -1 to disable
|
||||
RemindDelay: 30
|
||||
|
||||
# Run reward files on remind
|
||||
# By default, the reward file will be created for you
|
||||
# Run rewards
|
||||
# and have the default message
|
||||
# Edit the message at AdvancedCore/Rewards/Remind.yml (or any other reward listed)
|
||||
# Can add titles and more in the reward file
|
||||
# Can add titles and more in the reward
|
||||
# This can also be edited via /av gui
|
||||
Rewards:
|
||||
Messages:
|
||||
Player: '&aRemember to vote!'
|
||||
Player: '&aYou have %sitesavailable% sites to vote on still!'
|
||||
Title:
|
||||
Enabled: false
|
||||
Title: '&cRemember to vote!'
|
||||
@@ -114,9 +82,9 @@ VoteReminding:
|
||||
Message: '&cRemember to vote'
|
||||
Delay: 30
|
||||
|
||||
# ------------------------------------------------
|
||||
# Format
|
||||
# ------------------------------------------------
|
||||
###########################################
|
||||
# Format options
|
||||
###########################################
|
||||
|
||||
# Common PlacesHolders:
|
||||
# Special PlaceHolders will be commented where available
|
||||
@@ -132,11 +100,24 @@ Format:
|
||||
|
||||
# Broadcast vote message
|
||||
# Set to an empty message to disable
|
||||
# Use %NewLine% for a new line
|
||||
BroadcastMsg: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%'
|
||||
# If true uses broadcast setting below for offline votes
|
||||
OnlyOneOfflineBroadcast: false
|
||||
OfflineBroadcast: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %numberofvotes% times!'
|
||||
|
||||
# Broadcast only when player is online
|
||||
BroadcastWhenOnline: false
|
||||
|
||||
# Broadcast every x number of minutes with number of players that voted
|
||||
AlternateBroadcast:
|
||||
Enabled: false
|
||||
# Use %players% for all players names
|
||||
# Use %numberofplayers% for number of players that voted
|
||||
Broadcast: '&6[&4Broadcast&6] &2%numberofplayers% voted in the last half hour! /vote'
|
||||
# Delay in minutes
|
||||
Delay: 30
|
||||
|
||||
Commands:
|
||||
# Format for /vote
|
||||
# %num% = the number of the site, for a numbered list
|
||||
@@ -191,6 +172,8 @@ Format:
|
||||
TimeFormat: '%amount% %TimeType%'
|
||||
LastVoted: '%times% ago'
|
||||
NeverVoted: 'Never voted'
|
||||
# Whether or not to include seconds into last voted time
|
||||
IncludeSeconds: true
|
||||
|
||||
# Format for /vote total
|
||||
Total:
|
||||
@@ -224,6 +207,9 @@ Format:
|
||||
Title: '&6&lVoting Player Help'
|
||||
# Format for help message in /v help
|
||||
Line: '&6%Command% - &6%HelpMessage%'
|
||||
# Hover color for help message
|
||||
# Hex format: #HEXCOLOR
|
||||
HoverColor: AQUA
|
||||
# Require permission to see command in /v help or /av help
|
||||
RequirePermission: true
|
||||
|
||||
@@ -247,7 +233,7 @@ Format:
|
||||
|
||||
Today:
|
||||
Title:
|
||||
- '&cToday's Votes %page%/%maxpage%'
|
||||
- "&cToday's Votes %page%/%maxpage%"
|
||||
- '&cPlayerName : VoteSite : Time'
|
||||
Line: '&6%player% : %VoteSite% : %Time%'
|
||||
|
||||
@@ -261,9 +247,23 @@ Format:
|
||||
# %Points% = player points
|
||||
Points: '&a%Player% currently has &a&l%Points%&a Points!'
|
||||
|
||||
# /vote givepoints command
|
||||
# Transfer between players command
|
||||
# Enable command below
|
||||
GivePoints:
|
||||
NotEnoughPoints: '&cNot enough points'
|
||||
NotJoinedServer: '&c%player% has not joined the server'
|
||||
NumberLowerThanZero: '&cNumber of points needs to be greater than 0'
|
||||
TransferFrom: '&c%transfer% points given to %touser%'
|
||||
TransferTo: '&cYou received %transfer% points from %fromuser%'
|
||||
|
||||
ToggleBroadcasts:
|
||||
Enabled: '&cYou will now see vote broadcasts'
|
||||
Disabled: '&cYou will no longer see vote broadcasts'
|
||||
|
||||
ToggleReminders:
|
||||
Enabled: '&cVote reminders enabled'
|
||||
Disabled: '&cVote reminders disabled'
|
||||
|
||||
# Msg on top voter award, will only send message if that place has a reward set
|
||||
# %place% = place - 1,2,3,etc
|
||||
@@ -308,6 +308,7 @@ Format:
|
||||
# Shop messages when using the /vote shop
|
||||
ShopPurchase: '&aYou bought the %Identifier% for %Points% Points!'
|
||||
ShopFailed: '&cYou do not have %Points% points to purchase this!'
|
||||
ShopNotPurchasable: '&cThis item is not buyable!'
|
||||
|
||||
# User not exist message, from commands such as /vote next (player)
|
||||
UserNotExist: '&cUser does not exist: %player%'
|
||||
@@ -332,11 +333,24 @@ Format:
|
||||
Weekly: 'Weekly'
|
||||
Monthly: 'Monthly'
|
||||
AllTime: 'AllTime'
|
||||
|
||||
# Invalid command messages
|
||||
InvalidCommand:
|
||||
Vote: '&4No valid arguments, see /vote help!'
|
||||
AdminVote: '&4No valid arguments, see /adminvote help!'
|
||||
|
||||
# Playernames to not be broadcasted when voting
|
||||
# case sensitive
|
||||
VotingBroadcastBlacklist: []
|
||||
|
||||
# ------------------------------------------------
|
||||
# Playernames to not be broadcasted when broadcast comes from reward file
|
||||
# case sensitive
|
||||
BroadcastBlacklist: []
|
||||
|
||||
###########################################
|
||||
# Top Voter
|
||||
# Top voter rewards available in specialrewards.yml
|
||||
# ------------------------------------------------
|
||||
###########################################
|
||||
|
||||
# Top voter blacklist
|
||||
# Hide these names from top voter lists
|
||||
@@ -364,7 +378,7 @@ LoadTopVoter:
|
||||
|
||||
# Maxium number of players to show on top voter
|
||||
# Set to -1 for no limit
|
||||
MaxiumNumberOfTopVotersToLoad: -1
|
||||
MaxiumNumberOfTopVotersToLoad: 1000
|
||||
|
||||
# When top voter awards are given (even if there are none listed) it will store top voters
|
||||
# Files will created in TopVoters folder.
|
||||
@@ -372,101 +386,13 @@ MaxiumNumberOfTopVotersToLoad: -1
|
||||
StoreTopVoters:
|
||||
Weekly: false
|
||||
Daily: false
|
||||
|
||||
# ------------------------------------------------
|
||||
# Advanced
|
||||
# Most of these values can be left untouched for most setups
|
||||
# ------------------------------------------------
|
||||
|
||||
# If true vanished players are treated as if they are offline
|
||||
TreatVanishAsOffline: false
|
||||
|
||||
# If true, cooldown check is disabled
|
||||
DisableCoolDownCheck: false
|
||||
|
||||
# Delays login event, delays vote reminding and more
|
||||
# In ticks
|
||||
DelayLoginEvent: 0
|
||||
|
||||
# If false, votestreaks will be disabled
|
||||
UseVoteStreaks: true
|
||||
|
||||
# If false, storing best totals will be disabled
|
||||
UseHighestTotals: true
|
||||
|
||||
# If true, /vote will open /vote gui by default
|
||||
UseVoteGUIMainCommand: false
|
||||
|
||||
# Number of points to give on vote
|
||||
# Set to 0 to give no points
|
||||
PointsOnVote: 1
|
||||
|
||||
# Set this to false to disable the plugin adding totals
|
||||
# Not really recommended
|
||||
AddTotals: true
|
||||
|
||||
# If true, items given for rewards are dropped on the ground
|
||||
# If false, items will be given when there is space
|
||||
DropOnFullInv: true
|
||||
|
||||
# If true, allsites will have an extra check to prevent duplicate allsites from being given
|
||||
ExtraAllSitesCheck: false
|
||||
|
||||
# Click sound when using gui
|
||||
# Set to none for no sound
|
||||
ClickSound:
|
||||
Sound: 'UI_BUTTON_CLICK'
|
||||
Volume: 1.0
|
||||
Pitch: 1.0
|
||||
|
||||
# Playernames to not be broadcasted when voting
|
||||
# case sensitive
|
||||
VotingBroadcastBlacklist: []
|
||||
|
||||
# When enabled, javascript will be parsed on placeholders (from placeholderapi)
|
||||
# allows more fancy placeholders with math for example
|
||||
UseJavascriptPlaceholders: false
|
||||
|
||||
# Limit monthly votes to number of days of a month multipled by the number of sites
|
||||
LimitMonthlyVotes: false
|
||||
|
||||
# This is an extra safe guard to prevent milestones
|
||||
# from being executed more than once
|
||||
# Shoudn't be needed, but enable if you have trouble with milestones
|
||||
PreventRepeatMilestones: false
|
||||
|
||||
# When enabled the command /vote setprimaryaccount (playername)
|
||||
# will be shown (after restart)
|
||||
# Primary account will be used instead of the players account to get
|
||||
# placeholder and other data such as vote reminding
|
||||
# Mainly to be used for alts and such
|
||||
UsePrimaryAccountForPlaceholders: false
|
||||
|
||||
# If true, permissions will be handled differently
|
||||
MultiplePermissionsCheck: false
|
||||
|
||||
AddCustomCommands: false
|
||||
|
||||
# Injects custom command to /vote
|
||||
# Requires AddCustomCommand: true to be set
|
||||
CustomCommands:
|
||||
# identifier, not specific name
|
||||
command1:
|
||||
Args:
|
||||
- token
|
||||
# Message to send on command
|
||||
Message: 'token message'
|
||||
# Permission for this command
|
||||
Permission: 'votingplugin.commands.vote.token'
|
||||
# help message
|
||||
HelpMessage: 'See tokens'
|
||||
# Forces player to run this command
|
||||
Commands:
|
||||
- tokencommand
|
||||
|
||||
######################
|
||||
###########################################
|
||||
# Debug
|
||||
######################
|
||||
###########################################
|
||||
|
||||
# Debug levels:
|
||||
# NONE
|
||||
@@ -488,16 +414,83 @@ DebugInGame: false
|
||||
# Not recommended though
|
||||
LogVotesToFile: false
|
||||
|
||||
# Only update in the background when needed when set to false
|
||||
AlwaysUpdate: false
|
||||
###########################################
|
||||
# Placeholderapi placeholders settings
|
||||
###########################################
|
||||
|
||||
# Update in the background only if players are online
|
||||
UpdateWithPlayersOnlineOnly: false
|
||||
# When enabled the command /vote setprimaryaccount (playername)
|
||||
# will be shown (after restart)
|
||||
# Primary account will be used instead of the players account to get
|
||||
# placeholder and other data such as vote reminding
|
||||
# Mainly to be used for alts and such
|
||||
UsePrimaryAccountForPlaceholders: false
|
||||
|
||||
# Delay between background updates like signs and more
|
||||
# Default: 3 Minutes
|
||||
# Longer times result in longer wait in stuff updating after a vote, like topvoter
|
||||
DelayBetweenUpdates: 3
|
||||
# Valid Options:
|
||||
# AUTOALL - Auto cache placeholders after they have been used and cache all players placeholder all the time
|
||||
# AUTO - Auto cache after they have been used and cache online players placeholders (Recommended)
|
||||
# SPECIFIC - Only cache certain placeholders for online players
|
||||
# SPECIFICALL - Only cache certain placeholders for all players
|
||||
# NONE - Don't cache any placeholders
|
||||
PlaceholderCacheLevel: AUTO
|
||||
|
||||
# Placeholder controls
|
||||
# Add _process to end of placeholder to force a return value rather than . or .. if no cached value is ready
|
||||
# Add _nocache to end of placeholder to skip cache and retrive a live value, uses a direct mysql connection, do not use on main thread
|
||||
#
|
||||
|
||||
# Set which placeholders to cache at all times
|
||||
# Use for placeholders to are pulled constantly or on the main thread
|
||||
# Mainly aimed for scoreboards that pull placeholders often
|
||||
# Placeholders may auto cache in certain conditions (if enabled above)
|
||||
# Will use additional memory, but not a lot
|
||||
# Still in early stages, please report bugs
|
||||
# Please remove VotingPlugin_ from the placeholder listed here
|
||||
CachedPlaceholders: []
|
||||
#- Total_AllTime
|
||||
|
||||
# When enabled, javascript will be parsed on placeholders (from placeholderapi)
|
||||
# allows more fancy placeholders with math for example
|
||||
UseJavascriptPlaceholders: false
|
||||
|
||||
# Custom placeholder returns
|
||||
# For the example below use %votingplugin_custom_enoughpoints_5%
|
||||
# DO NOT USE ON MAIN THREAD IF POSSIBLE
|
||||
# Keep everything lowercase
|
||||
# Example:
|
||||
#CustomPlaceholderReturns:
|
||||
# 'enoughpoints_5':
|
||||
# 'true': 'User has enough points'
|
||||
# 'false': 'User does not have enough points'
|
||||
CustomPlaceholderReturns: {}
|
||||
|
||||
###########################################
|
||||
# Login options
|
||||
###########################################
|
||||
|
||||
# If true vanished players are treated as if they are offline
|
||||
TreatVanishAsOffline: false
|
||||
|
||||
# Delays login event, delays vote reminding and more
|
||||
# In miliseconds, 1000 = 1 second
|
||||
DelayLoginEvent: 0
|
||||
|
||||
# Wait until user is logged in with AuthMe
|
||||
# Requires AuthMe or LoginSecurity
|
||||
WaitUntilLoggedIn: true
|
||||
|
||||
###########################################
|
||||
# Disable/Enable features
|
||||
###########################################
|
||||
|
||||
# If true, cooldown check is disabled
|
||||
DisableCoolDownCheck: false
|
||||
|
||||
# If true, disable PlayerInteractEvent (for clicking signs and skulls)
|
||||
DisableInteractEvent: false
|
||||
|
||||
# Disable this on a hub server for example
|
||||
# Still processes rewards for offline rewards (just won't give any)
|
||||
ProcessRewards: true
|
||||
|
||||
# Set to true to disable no service site message on voting
|
||||
# You should never have to touch this if everything is setup properly
|
||||
@@ -508,6 +501,128 @@ DisableNoServiceSiteMessage: false
|
||||
# If true fake votes will give points and totals
|
||||
CountFakeVotes: true
|
||||
|
||||
# Whether or not to disable update checks
|
||||
DisableUpdateChecking: false
|
||||
|
||||
# Enable per site cooldown events, requires more resources to use
|
||||
# Requires restart
|
||||
PerSiteCoolDownEvents: false
|
||||
|
||||
# Queue votes during a time change (doesn't apply to bungee voting)
|
||||
# Votes will be given when time change is completed
|
||||
QueueVotesDuringTimeChange: false
|
||||
|
||||
# If true, plugin will automaticly generate votesites
|
||||
# Disable this if you experience issues with sites being created randomly
|
||||
# Most cases this will work all the time
|
||||
AutoCreateVoteSites: true
|
||||
|
||||
# Experiemtental feature
|
||||
# Uses https://github.com/BenCodez/VotingPlugin/wiki/Minecraft-Server-Lists
|
||||
# Not all voting sites use the domain name as the service sites
|
||||
# This feature is an attempt to ease setup for new users by matching domain name to actual service site
|
||||
AdvancedServiceSiteHandling: false
|
||||
|
||||
# Set this to false to disable the plugin adding totals
|
||||
# Not really recommended
|
||||
AddTotals: true
|
||||
|
||||
# Disabling this prevents offline votes from adding totals to users
|
||||
AddTotalsOffline: true
|
||||
|
||||
# If false, votestreaks will be disabled
|
||||
UseVoteStreaks: true
|
||||
|
||||
# If false, storing best totals will be disabled
|
||||
UseHighestTotals: true
|
||||
|
||||
# Geyser/Bedrock player support
|
||||
# Set prefix used for voting
|
||||
# Players should vote with prefix
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki/Bedrock-Player-Support
|
||||
BedrockPlayerPrefix: '.'
|
||||
|
||||
# Whether or not to create daily backups. (Only the most recent ones get kept)
|
||||
CreateBackups: true
|
||||
|
||||
# Automaticly download the latest version
|
||||
# Will require a restart to actually update
|
||||
# Note: It takes 30-40 minutes before being able to download the latest build
|
||||
# You can also use /av download
|
||||
AutoDownload: false
|
||||
|
||||
# If false plugin will use offline player UUIDs
|
||||
OnlineMode: true
|
||||
|
||||
# Disable checking on world change
|
||||
# May improve performance
|
||||
#DisableCheckOnWorldChange: false
|
||||
|
||||
# Disable javascript processing in messages/rewards
|
||||
DisableJavascript: false
|
||||
|
||||
# If true, number of vote shop purchases will be tracked
|
||||
# Data will be tracked in serverdata.yml, may change in the future
|
||||
# No commands to view data currently
|
||||
TrackShopPurchases: false
|
||||
|
||||
# Limits about of offline votesites
|
||||
# Does not currently work with bungee votes from votingplugin
|
||||
OfflineVotesLimit:
|
||||
# Enable or disable
|
||||
Enabled: false
|
||||
# Limit of votes per votesite
|
||||
Amount: 5
|
||||
|
||||
# Default worlds set for all rewards
|
||||
DefaultRewardWorlds: []
|
||||
|
||||
# Default blackedlisted worlds set for all rewards
|
||||
DefaultRewardBlackListedWorlds: []
|
||||
|
||||
###########################################
|
||||
# Skull settings
|
||||
###########################################
|
||||
|
||||
# Preload skulls to improve performance for vote top
|
||||
# when using skulls as the item to display players
|
||||
# If false, skulls will be cached as they are used
|
||||
# assuming loadskulls is enabled
|
||||
PreloadSkulls: false
|
||||
|
||||
# Setting to false disables saving skulls in a cache to improve speeds
|
||||
# Will reduce ram usage (very little) if disabled, but slow GUI speeds when using skulls
|
||||
LoadSkulls: true
|
||||
|
||||
###########################################
|
||||
# Extra checks on vote
|
||||
###########################################
|
||||
|
||||
# If true, allsites will have an extra check to prevent duplicate allsites from being given
|
||||
ExtraAllSitesCheck: false
|
||||
|
||||
# This is an extra safe guard to prevent milestones
|
||||
# from being executed more than once
|
||||
# Shoudn't be needed, but enable if you have trouble with milestones
|
||||
PreventRepeatMilestones: false
|
||||
|
||||
# Number of points to give on vote
|
||||
# Set to 0 to give no points
|
||||
PointsOnVote: 1
|
||||
|
||||
# May need to enable this for bungee setups
|
||||
# Let players who never joined before vote
|
||||
# Recommend: False (Will prevent creating random user data)
|
||||
AllowUnjoined: false
|
||||
|
||||
# Use server lookup for when allowunjoined is set to false
|
||||
# Recommend leaving enabled unless you face issues
|
||||
AllowUnJoinedCheckServer: true
|
||||
|
||||
##############################################
|
||||
# Command/Permission settings
|
||||
##############################################
|
||||
|
||||
# Give VotingPlugin.Player by default
|
||||
# Requires restart to take affect
|
||||
GiveDefaultPermission: true
|
||||
@@ -516,56 +631,17 @@ GiveDefaultPermission: true
|
||||
# Permissions listed here will no be accessible with the default permission
|
||||
DisabledDefaultPermissions: []
|
||||
|
||||
# Remove old player files
|
||||
# Happens on startup or /av purge
|
||||
PurgeOldData: false
|
||||
|
||||
# Minimum number of days offline in order to purge
|
||||
PurgeMin: 90
|
||||
|
||||
# Whether or not to create daily backups. (Only the most recent ones get kept)
|
||||
CreateBackups: true
|
||||
|
||||
# If true, plugin will automaticly generate votesites
|
||||
# Disable this if you experience issues with sites being created randomly
|
||||
# Most cases this will work all the time
|
||||
AutoCreateVoteSites: true
|
||||
|
||||
# Automaticly download the latest version
|
||||
# Will require a restart to actually update
|
||||
# Note: It takes 30-40 minutes before being able to download the latest build
|
||||
# You can also use /av download
|
||||
AutoDownload: false
|
||||
|
||||
# Whether or not to disable update checks
|
||||
DisableUpdateChecking: false
|
||||
|
||||
# Allow transfer of vote points between players
|
||||
AllowVotePointTransfers: false
|
||||
|
||||
# Disable this on a hub server for example
|
||||
# Still processes rewards for offline rewards (just won't give any)
|
||||
ProcessRewards: true
|
||||
# If true, /vote will open /vote gui by default
|
||||
UseVoteGUIMainCommand: false
|
||||
|
||||
# Disable checking permissions on tab complete
|
||||
# Could increase performance slightly, but probably not
|
||||
DisableAdvancedTab: false
|
||||
|
||||
# Load command aliases, such as /avgui
|
||||
# Requires restart to take effect
|
||||
LoadCommandAliases: true
|
||||
|
||||
# Wait until user is logged in with AuthMe
|
||||
# Requires AuthMe
|
||||
WaitUntilLoggedIn: true
|
||||
|
||||
# Preload skulls to improve performance
|
||||
# If false, skulls will be cached as they are used
|
||||
PreloadSkulls: false
|
||||
|
||||
# Setting to false disables saving skulls in a cache to improve speeds
|
||||
# Will reduce ram usage if disabled
|
||||
LoadSkulls: true
|
||||
|
||||
# Use vault for permission checks
|
||||
# May not work on some plugins
|
||||
UseVaultPermissions: false
|
||||
@@ -576,22 +652,104 @@ UseVaultPermissions: false
|
||||
# - PERMISSION
|
||||
DisabledCommands: []
|
||||
|
||||
# If true, permissions will be handled differently
|
||||
MultiplePermissionsCheck: false
|
||||
|
||||
# Allow transfer of vote points between players
|
||||
# Requires restart for command to load
|
||||
# Command: /vote givepoints (player) (points)
|
||||
AllowVotePointTransfers: false
|
||||
|
||||
AddCustomCommands: false
|
||||
|
||||
# Injects custom command to /vote
|
||||
# Requires AddCustomCommand: true to be set
|
||||
CustomCommands:
|
||||
# identifier, not specific name
|
||||
command1:
|
||||
Args:
|
||||
- token
|
||||
# Message to send on command
|
||||
Message: 'token message'
|
||||
# Permission for this command
|
||||
Permission: 'votingplugin.commands.vote.token'
|
||||
# help message
|
||||
HelpMessage: 'See tokens'
|
||||
# Forces player to run this command
|
||||
Commands:
|
||||
- tokencommand
|
||||
|
||||
##############################################
|
||||
# Background task settings
|
||||
##############################################
|
||||
|
||||
# Only update in the background when needed when set to false
|
||||
AlwaysUpdate: false
|
||||
|
||||
# Update in the background only if players are online
|
||||
UpdateWithPlayersOnlineOnly: false
|
||||
|
||||
# Delay between background updates like signs and more
|
||||
# Default: 3 Minutes
|
||||
# Longer times result in longer wait in stuff updating after a vote, like topvoter
|
||||
DelayBetweenUpdates: 3
|
||||
|
||||
# Enable to true for extra player checks
|
||||
# Recommend leaving this to false
|
||||
ExtraBackgroundUpdate: false
|
||||
|
||||
##########################################
|
||||
# Inventory controls
|
||||
##########################################
|
||||
|
||||
# Click sound when using gui
|
||||
# Set to none for no sound
|
||||
ClickSound:
|
||||
Sound: 'UI_BUTTON_CLICK'
|
||||
Volume: 1.0
|
||||
Pitch: 1.0
|
||||
|
||||
# If true, items given for rewards are dropped on the ground
|
||||
# If false, items will be given when there is space
|
||||
DropOnFullInv: true
|
||||
|
||||
# This will prevent spam clicking GUI's to prevent exploits
|
||||
# Number is time in between clicking in milliseconds
|
||||
SpamClickTime: 350
|
||||
SpamClickTime: 100
|
||||
# Message to send when inventory forced closed when spam clicking
|
||||
# Uncomment to use
|
||||
#SpamClickMessage: '&cDetected spam clicking GUI, closing to prevent exploits'
|
||||
|
||||
# ###############################################################
|
||||
# Deprecated options, don't recommend using any of these
|
||||
|
||||
# Will force GUI's to close on every click
|
||||
AlwaysCloseInventory: false
|
||||
|
||||
# Close inventory on player vote
|
||||
# This is to prevent any possible exploits
|
||||
CloseInventoryOnVote: true
|
||||
|
||||
# This will close GUI's if you shift click them rather than a regular
|
||||
# This can help prevent exploits
|
||||
CloseGUIOnShiftClick: false
|
||||
|
||||
###########################################
|
||||
# Purge settings
|
||||
###########################################
|
||||
# Remove old player files
|
||||
# Happens on startup or /av purge
|
||||
PurgeOldData: false
|
||||
|
||||
# Minimum number of days offline in order to purge
|
||||
PurgeMin: 90
|
||||
|
||||
##########################################
|
||||
# Extra options
|
||||
# Options below don't need to be touched
|
||||
##########################################
|
||||
|
||||
# If enabled, data is repulled from storage on vote shop purchase
|
||||
# This prevents possible exploits with vote shop
|
||||
ExtraVoteShopCheck: true
|
||||
|
||||
# Options for request api
|
||||
# Current methods:
|
||||
# ANVIL
|
||||
@@ -602,9 +760,3 @@ RequestAPI:
|
||||
DefaultMethod: 'Anvil'
|
||||
DisabledMethods: []
|
||||
|
||||
# Shouldn't need to change this
|
||||
#AutoKillInvs: true
|
||||
|
||||
# Disable checking on world change
|
||||
# May improve performance
|
||||
#DisableCheckOnWorldChange: false
|
||||
@@ -12,6 +12,7 @@ GUIMethod:
|
||||
Last: CHEST #BOOK not available (future update?)
|
||||
Next: CHEST
|
||||
Total: CHEST #BOOK not available (future update?)
|
||||
# GUI for /vote
|
||||
URL: CHEST
|
||||
Best: CHEST #BOOK not available (future update?)
|
||||
Streak: CHEST #BOOK not available (future update?)
|
||||
@@ -70,7 +71,7 @@ CHEST:
|
||||
Name: '&4Vote Shop'
|
||||
Lore:
|
||||
- '&aYou currently have %points% points'
|
||||
# 'ExtraName' below is an identifier, can be whatever
|
||||
# 'ExtraItem' below is an identifier, can be whatever
|
||||
# ExtraItem:
|
||||
# Item:
|
||||
# Material: 'DIRT'
|
||||
@@ -78,8 +79,8 @@ CHEST:
|
||||
# Name: 'Extra item'
|
||||
## Works on most GUI items
|
||||
# Slot: 10
|
||||
## Send rewards on click, run commands, check conditions, etc
|
||||
# Rewards: []
|
||||
## Send rewards on click, run commands, check conditions, etc
|
||||
# Rewards: []
|
||||
|
||||
# GUI for /vote url, /vote
|
||||
VoteURL:
|
||||
@@ -119,8 +120,10 @@ CHEST:
|
||||
Material: 'EMERALD_BLOCK'
|
||||
Data: 0
|
||||
Amount: 1
|
||||
# URL when clicking item in /vote (GUI version)
|
||||
URLText: '%VoteUrl%'
|
||||
# #Add Extra items
|
||||
# This extra item format works across other gui settings below
|
||||
# ExtraItems:
|
||||
# Item1:
|
||||
# Material: DIRT
|
||||
@@ -132,9 +135,18 @@ CHEST:
|
||||
VoteLast:
|
||||
Name: 'VoteLast: %player%'
|
||||
BackButton: true
|
||||
# Lines for each vote site
|
||||
# %time% = time, using timeformat below
|
||||
# %timesince% = time since vote
|
||||
Line: '&6%timeSince%'
|
||||
ClickableLinks: true
|
||||
VoteNext:
|
||||
Name: 'VoteNext: %player%'
|
||||
BackButton: true
|
||||
# Extra customization for displaying site names in GUI only
|
||||
#CustomSiteNamesDisplays:
|
||||
# Site1: site name display
|
||||
LoreLine: '%time%'
|
||||
VoteToday:
|
||||
Name: 'VoteToday'
|
||||
Line: '&6%VoteSite% : %Time%'
|
||||
@@ -147,18 +159,24 @@ CHEST:
|
||||
Amount: 1
|
||||
VoteTop:
|
||||
Name: 'VoteTop %topvoter%'
|
||||
BackButton: false
|
||||
BackButton: true
|
||||
# Item of top voter (change material below)
|
||||
Item:
|
||||
Name: '&3&l%position%: &3%player%'
|
||||
Lore: '&3&lVotes: &3%votes%'
|
||||
# Opens main GUI of the specific player that gets clicked
|
||||
OpenMainGUIOnClick: true
|
||||
# Close GUI when clicking on a player item
|
||||
CloseGUIOnClick: true
|
||||
SwitchItem:
|
||||
Name: '&3Switch TopVoter'
|
||||
Lore: '&bCurrently: %Top%'
|
||||
Material: 'OAK_SIGN'
|
||||
Amount: 1
|
||||
# Top voters for the switch item to use
|
||||
#TopVoters:
|
||||
#- ALLTIME
|
||||
#- MONTHLY
|
||||
# 8 Slots over from the bottom left
|
||||
# Bottom of GUI
|
||||
Slot: 7
|
||||
@@ -169,6 +187,15 @@ CHEST:
|
||||
# Item for player in GUI if use skull is false
|
||||
PlayerItem:
|
||||
Material: 'PAPER'
|
||||
Customization:
|
||||
Enabled: false
|
||||
# List of slots for top voter
|
||||
PlayerSlots: []
|
||||
# Add extra items
|
||||
ExtraItems: {}
|
||||
RemoveBottomBar: false
|
||||
# Set slot for backbutton
|
||||
BackButtonSlot: 0
|
||||
VoteTotal:
|
||||
Name: 'VoteTotal: %player%'
|
||||
BackButton: true
|
||||
@@ -198,6 +225,7 @@ CHEST:
|
||||
Amount: 1
|
||||
VoteBest:
|
||||
Name: 'VoteBest: %player%'
|
||||
BackButton: true
|
||||
DayBest:
|
||||
Item:
|
||||
Material: 'CLOCK'
|
||||
@@ -268,6 +296,10 @@ CHEST:
|
||||
Name: '&8Back to VoteGUI'
|
||||
# If true, clicking back button will open VoteURL
|
||||
OpenVoteURL: false
|
||||
# If true, backbutton will be the last slot of the GUI
|
||||
EndOfGUI: false
|
||||
# If true, this item will become an exit button instead
|
||||
Exit: false
|
||||
|
||||
VoteShopBackButton: true
|
||||
VoteShopEnabled: true
|
||||
@@ -277,6 +309,12 @@ CHEST:
|
||||
VoteShopLimitReached: '&aYou reached your limit'
|
||||
VoteShopRequireConfirmation: false
|
||||
VoteShopDisabled: '&cVote shop disabled'
|
||||
# If true, shop gui will reopen, updating all placeholders
|
||||
VoteShopReopenGUIOnPurchase: false
|
||||
# VoteShop extra items for display only
|
||||
#VoteShopExtraItems:
|
||||
#Item:
|
||||
#...
|
||||
Shop:
|
||||
# Identifier
|
||||
# Used in placeholders for formats
|
||||
@@ -297,6 +335,8 @@ CHEST:
|
||||
Cost: 3
|
||||
# Permission required, leave blank for no permission
|
||||
Permission: ''
|
||||
# Hide if player doesn't have permission (only if permission is set)
|
||||
HideOnNoPermission: true
|
||||
# Whether or not to keep GUI open after purchase
|
||||
CloseGUI: true
|
||||
# Require confirmation on purchase, overrides global option above
|
||||
@@ -340,7 +380,11 @@ BOOK:
|
||||
CanVoteText: 'Click me'
|
||||
CanVoteColor: 'GREEN'
|
||||
AlreadyVotedText: 'Click me'
|
||||
AlreadyVotedColor: 'RED'
|
||||
AlreadyVotedColor: 'RED'
|
||||
# If true the layout below is the full book text
|
||||
Manual: false
|
||||
# Only works if Manual is enabled
|
||||
TopLayout: []
|
||||
Layout:
|
||||
- '&3&l%Sitename%'
|
||||
- '[UrlText]'
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
# To disable reward set value to []
|
||||
# To disable reward set value to {}
|
||||
# or remove entirely
|
||||
# Eg:
|
||||
# FirstVote: [] (All in one line)
|
||||
# Rewards will be given if there is a reward to give
|
||||
# FirstVote: {} (All in one line)
|
||||
# Rewards will be given if there is a reward to give, otherwise they will be ignored
|
||||
|
||||
# First vote rewards
|
||||
FirstVote:
|
||||
Messages:
|
||||
Player: '&aYou voted for your first time!'
|
||||
|
||||
# First vote of the day reward
|
||||
FirstVoteToday: {}
|
||||
|
||||
# All vote rewards
|
||||
# Reward for voting on all sites in one day
|
||||
# One time reward for voting on all sites in one day
|
||||
# Enable ExtraAllSitesCheck if you get double rewards
|
||||
AllSites:
|
||||
Messages:
|
||||
Player: '&aYou voted on all sites in 1 day!'
|
||||
|
||||
# Give a reward for voting on all sites minus 1
|
||||
# Similar to allsites
|
||||
#AlmostAllSites:
|
||||
# Messages:
|
||||
# Player: '&aYou almost voted on all sites in 1 day!'
|
||||
|
||||
|
||||
# If true only cumulative reward at a time can be given
|
||||
# The cumulative rewards will go in order as listed under Cumulative, so if true
|
||||
# the first cumulative (in the order as listed) that can be given will, then will ignore the rest
|
||||
OnlyOneCumulative: false
|
||||
# NOTE: This is not a 1 time reward, that's what milestones are for!
|
||||
# If total votes (Can be changed) divided by cumulative amount
|
||||
# and as no remainder (So divides perfectly)then a reward is given
|
||||
# and with no remainder (So divides perfectly) then a reward is given
|
||||
Cumulative:
|
||||
# Number of votes required
|
||||
# Allows multiple cumulative rewards
|
||||
@@ -25,12 +40,20 @@ Cumulative:
|
||||
# Can have multiple listed here
|
||||
'20':
|
||||
Enabled: false
|
||||
# Wether or not votes must be made in same day/week
|
||||
# Whether or not votes must be made in same day/week
|
||||
# Useful if you want to require a certain number of voting sites to be voted on
|
||||
# for a daily/weekly reward instead of all of them
|
||||
VotesInSameDay: false
|
||||
VotesInSameWeek: false
|
||||
VotesInSameMonth: false
|
||||
# Valid options
|
||||
# AllTime
|
||||
# Monthly
|
||||
# Weekly
|
||||
# Daily
|
||||
TotalToUse: AllTime
|
||||
# Blacklist recurring votes
|
||||
#BlackList:
|
||||
#- 40
|
||||
# Whether or not to gives cumulative reward for every x number of votes, default: true
|
||||
#Recurring: true
|
||||
Rewards:
|
||||
Messages:
|
||||
Player: '&aYou got %cumulative% cumulative votes!'
|
||||
@@ -47,6 +70,9 @@ VoteParty:
|
||||
# recieve the reward
|
||||
# If false, only players who voted get rewards
|
||||
GiveAllPlayers: false
|
||||
# If true, give online players the vote party reward
|
||||
# Can also use RewardType: ONLINE if you wanted
|
||||
GiveOnlinePlayersOnly: true
|
||||
# If true, the vote count will reset each day
|
||||
ResetEachDay: false
|
||||
# If true, the vote count will reset each week
|
||||
@@ -55,7 +81,11 @@ VoteParty:
|
||||
ResetMonthly: false
|
||||
# If true, will give voteparty only once per day
|
||||
OnlyOncePerDay: false
|
||||
# Reset extra votes
|
||||
# If true, will give voteparty once per week only
|
||||
OnlyOncePerWeek: false
|
||||
# Reset extra votes weekly
|
||||
ResetExtraVotesWeekly: false
|
||||
# Reset extra votes monthly
|
||||
ResetExtraVotesMonthly: false
|
||||
# Count votes from /av vote?
|
||||
CountFakeVotes: true
|
||||
@@ -65,9 +95,16 @@ VoteParty:
|
||||
CountOfflineVotes: true
|
||||
# Broadcast when vote party reached
|
||||
Broadcast: '&cReached the vote party amount!'
|
||||
# Send a broadcast at a certain number of votes left and send a vote reminder
|
||||
VoteReminderBroadcast: '%votesrequired% left to go, go vote!'
|
||||
# List of votes required amounts for when to send vote party reminders
|
||||
VoteReminderAtVotes: []
|
||||
# List of commands to execute, these only execute once.
|
||||
# %player% does not work here
|
||||
Commands: []
|
||||
GlobalCommands: []
|
||||
# List of commands to execute once
|
||||
# Only run will run
|
||||
GlobalRandomCommand: []
|
||||
# Rewards to give per player
|
||||
Rewards:
|
||||
# Uncomment below for online players to be rewarded only
|
||||
@@ -100,6 +137,7 @@ VoteStreak:
|
||||
# Number of days in a row
|
||||
# Each day requires one vote
|
||||
# Add a - to give a reward for every multiple (e.g. 2- = 2,4,6,8, and so on)
|
||||
# This may not work perfectly on bungee setups at this time
|
||||
'2':
|
||||
# Enabled or not
|
||||
Enabled: false
|
||||
@@ -136,8 +174,10 @@ VoteStreak:
|
||||
Week: 50
|
||||
Month: 50
|
||||
|
||||
# Reward given when vote cooldown ended
|
||||
# Using this is a little memory intensive
|
||||
# Reward given when all votesites are available to vote on
|
||||
# Don't use this unless you really need it
|
||||
# Little performance intensive
|
||||
# Recommend add RewardType: ONLINE for it to only work online
|
||||
VoteCoolDownEndedReward: []
|
||||
|
||||
# ONLY USE THIS FOR TITLES/SOUNDS AND OTHER EFFECTS
|
||||
@@ -157,6 +197,11 @@ LogoutRewards: {}
|
||||
|
||||
EnableMonthlyAwards: true
|
||||
|
||||
# TopVoter Placeholders:
|
||||
#%place% - place in topvoter
|
||||
#%topvoter% - topvoter type
|
||||
#%votes% - current total votes related to top voter
|
||||
|
||||
# Rewards to give
|
||||
MonthlyAwards:
|
||||
# Position. 1 is first in top voter, 2 is second, etc...
|
||||
|
||||
@@ -2,6 +2,7 @@ VoteSites:
|
||||
# VoteSite key
|
||||
# Used for saving data for votesites
|
||||
# Use a short name if you can
|
||||
# No spaces or dots
|
||||
ExampleVoteSite:
|
||||
# Enable voteSite
|
||||
# If false, votesite will not be loaded by plugin
|
||||
@@ -26,7 +27,7 @@ VoteSites:
|
||||
ServiceSite: 'PlanetMinecraft.com'
|
||||
|
||||
# vote url for /vote
|
||||
# Format for this can be set in Format.yml
|
||||
# Format for this can be set in Config.yml
|
||||
# Do not include colors here
|
||||
# If you need to force a url set the url as this:
|
||||
# VoteURL: '[Text="ANY TEXT TO CLICK ON HERE",url="URLHERE"]'
|
||||
@@ -37,6 +38,7 @@ VoteSites:
|
||||
VoteDelay: 24
|
||||
|
||||
# Use to have a minute votedelay
|
||||
# Must set a value on VoteDelay if you plan on only using this setting
|
||||
#VoteDelayMin: 30
|
||||
|
||||
# Require waiting until votedelay time has pasted in order to accept vote
|
||||
@@ -47,8 +49,11 @@ VoteSites:
|
||||
# Recommend: false
|
||||
VoteDelayDaily: false
|
||||
|
||||
#Offset time for /vote next caculations
|
||||
#TimeOffSet: 0
|
||||
# Replaces offset, set the exact hour based on server time
|
||||
# Include server time offset when setting this
|
||||
# 2 = 2 am server time
|
||||
# Use 1-24
|
||||
#VoteDelayDailyHour: 14
|
||||
|
||||
# If true, rewards can be executed offline (requires ForceOffline to be true in the reward)
|
||||
# Setting this to true will execute the reward offline while the player is offline
|
||||
@@ -60,9 +65,15 @@ VoteSites:
|
||||
DisplayItem:
|
||||
Material: 'DIAMOND'
|
||||
Amount: 1
|
||||
|
||||
# Reward to run when cooldown ends for this votesite
|
||||
# Enable PerSiteCoolDownEvents in Config.yml to use this
|
||||
#CoolDownEndRewards:
|
||||
# Messages:
|
||||
# Player: '&aTime to go vote on site1'
|
||||
|
||||
# Rewards to give
|
||||
# https://github.com/Ben12345rocks/AdvancedCore/wiki/Rewards
|
||||
# https://github.com/BenCodez/AdvancedCore/wiki/Rewards
|
||||
Rewards:
|
||||
# Execute console commands
|
||||
Commands:
|
||||
@@ -108,7 +119,7 @@ VoteSites:
|
||||
Messages:
|
||||
Player: 'You got unlucky'
|
||||
|
||||
# Give 1 diamond
|
||||
# Give 1 diamond regardless of above
|
||||
Items:
|
||||
item1:
|
||||
Material: DIAMOND
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
name: ${project.name}
|
||||
version: ${project.version}
|
||||
main: com.bencodez.votingplugin.bungee.VotingPluginBungee
|
||||
author: BenCodez
|
||||
author: BenCodez
|
||||
softDepends:
|
||||
- RedisBungee
|
||||
@@ -11,75 +11,215 @@ Username: ''
|
||||
Password: ''
|
||||
# Max number of connections
|
||||
MaxConnections: 1
|
||||
# Maxium size of caching mysql
|
||||
# -1 for no limit
|
||||
# Affecting this value may affect performance
|
||||
MaxSize: -1
|
||||
# Table name prefix, for use with mutliple servers
|
||||
# Don't use with PLUGINMESSAGING bungee setup
|
||||
Prefix: ''
|
||||
#UseSSL: true
|
||||
#PublicKeyRetrieval: false
|
||||
#Attempt to use mariadb driver
|
||||
#UseMariaDB: false
|
||||
|
||||
|
||||
####################################################################################
|
||||
# Global mysql data handle for between server commmunications
|
||||
# This is NOT required for bungee voting to work
|
||||
# This is still a WIP, use with caution
|
||||
# This will create a different table then from users storing server info to process
|
||||
#
|
||||
# If you use this you need to enable this on BungeeSettings.yml on each server with votingplugin
|
||||
# Make sure server name is set correctly in BungeeSettings.yml or this will not work correctly
|
||||
#
|
||||
# Please use PLUGINMESSAGING for this, SOCKETS should work as well, but not fully tested
|
||||
#
|
||||
# This will make votes cache until time change has finished processing
|
||||
# In the event a server is offline or time change fails, the time change process
|
||||
# will continue after a set amount of time (in essense skipping a specific server)
|
||||
# This will also respect blocked servers
|
||||
GlobalData:
|
||||
Enabled: false
|
||||
# Use existing connection above
|
||||
UseMainMySQL: true
|
||||
# Mysql settings only used if above is false
|
||||
Host: ''
|
||||
# Default port is 3306
|
||||
Port: 3306
|
||||
Database: ''
|
||||
Username: ''
|
||||
Password: ''
|
||||
# Max number of connections
|
||||
MaxConnections: 1
|
||||
# Must be the same on all servers
|
||||
Prefix: ''
|
||||
#UseSSL: true
|
||||
#PublicKeyRetrieval: false
|
||||
#Attempt to use mariadb driver
|
||||
#UseMariaDB: false
|
||||
|
||||
# Time offset for time changes
|
||||
# Must match on all servers
|
||||
TimeHourOffSet: 0
|
||||
|
||||
####################################################################################
|
||||
|
||||
Debug: false
|
||||
# Have a reward on each server
|
||||
# If false, will send to online server only
|
||||
SendVotesToAllServers: true
|
||||
# List of servers the plugin won't send the vote to
|
||||
# Uses names from bungeecoord config if not using SOCKETS method
|
||||
# Uses names from bungeecoord config, only needed for non SOCKETS setup
|
||||
BlockedServers:
|
||||
- hub
|
||||
|
||||
|
||||
# Similar to BlockServers
|
||||
# If a server is listed then blockedservers is ignored
|
||||
WhiteListedServers: []
|
||||
|
||||
# What type of bungee setup
|
||||
# Requires restart and set on all servers
|
||||
# https://github.com/Ben12345rocks/VotingPlugin/wiki/Bungeecoord-Setups
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki/Bungeecoord-Setups
|
||||
# Available:
|
||||
# SOCKETS
|
||||
# PLUGINMESSAGING
|
||||
# PLUGINMESSAGING (Recommended)
|
||||
# MYSQL
|
||||
# REDIS
|
||||
BungeeMethod: PLUGINMESSAGING
|
||||
|
||||
# Use Redis for between server communication, set BungeeMethod to REDIS to use this
|
||||
Redis:
|
||||
Host: localhost
|
||||
Port: 6379
|
||||
Username: ''
|
||||
Password: ''
|
||||
# Set a prefix from an entire proxy network if using mutli-proxy setup below
|
||||
Prefix: ''
|
||||
|
||||
# If false, votes will be checked if user is a valid player that has joined to server
|
||||
# Works for PLUGINMESSAGING and SOCKETS methods only
|
||||
# This requires spigot servers AllowUnJoined to be set to true in Config.yml
|
||||
AllowUnJoined: false
|
||||
|
||||
# Points to give on vote
|
||||
PointsOnVote: 1
|
||||
|
||||
# If true, bungee will handle adding totals
|
||||
# If false, spigot servers will EACH set their own totals
|
||||
# If false, AllowUnJoined should false on bungee, spigot servers will handle that
|
||||
# Recommened to leave true, setting to false setups are currently unsupported
|
||||
# If false, AllowUnJoined should be enabled on bungee, spigot servers will handle that
|
||||
# Recommeneded to leave enabled, setups with this disabled are currently unsupported
|
||||
BungeeManageTotals: true
|
||||
|
||||
# ----------------------------
|
||||
# PLUGINMESSAGING Settings
|
||||
# ----------------------------
|
||||
|
||||
# Applies to PLUGINMESSAGING & when SendVotesToAllServers is true
|
||||
# Votes will be forwarded when specific player is online
|
||||
WaitForUserOnline: false
|
||||
|
||||
# ----------------------------
|
||||
# SOCKET Settings, do not touch otherwise
|
||||
# ----------------------------
|
||||
|
||||
# Tell servers to broadcast
|
||||
# For socket method
|
||||
# Set DisableBroadcast to true on spigot servers (BungeeSettings.yml) as well
|
||||
Broadcast: true
|
||||
|
||||
# Server to send vote to if player is offline
|
||||
FallBackServer: factions
|
||||
# Geyser/bedrock player settings
|
||||
# https://github.com/BenCodez/VotingPlugin/wiki/Bedrock-Player-Support
|
||||
BedrockPlayerPrefix: '.'
|
||||
|
||||
# Bungee communication, Add this to each spigot server
|
||||
# For socket method
|
||||
BungeeServer:
|
||||
Host: '127.0.0.1'
|
||||
Port: 1297
|
||||
# Time votes will be cached on proxy
|
||||
# -1 means no time limit
|
||||
# Time in days
|
||||
VoteCacheTime: -1
|
||||
|
||||
# Maxium number of votes possible per day
|
||||
# Usually matches the amount of votesites
|
||||
# Will limit vote totals to match accordingly
|
||||
# Only applies for month total
|
||||
# Set to -1 to disable
|
||||
MaxAmountOfVotesPerDay: -1
|
||||
|
||||
VoteParty:
|
||||
# If enabled, will trigger vote party reward
|
||||
# in BungeeSettings.yml under BungeeVotePartyReward
|
||||
# Only runs rewards for online players
|
||||
Enabled: false
|
||||
# Votes required
|
||||
VotesRequired: 100
|
||||
# Increase amount required on each vote party
|
||||
IncreaseVotesRequired: 0
|
||||
# If false, will only send to servers listed below
|
||||
SendToAllServers: true
|
||||
# Servers to send to, if SendToAllServers is false
|
||||
ServersToSend: []
|
||||
# List of commands to run on bungee server
|
||||
# Set spigot commands in BungeeSettings.yml
|
||||
BungeeCommands: []
|
||||
Broadcast: '&aVote party has been reached!'
|
||||
|
||||
# Bungee communication, add each spigot server here
|
||||
# For socket method
|
||||
SpigotServers:
|
||||
lobby:
|
||||
Host: '127.0.0.1'
|
||||
Port: 1298
|
||||
factions:
|
||||
Host: '127.0.0.1'
|
||||
Port: 1999
|
||||
# Online mode for UUIDS
|
||||
# Offline mode setups are not fully tested and are not supported currently
|
||||
OnlineMode: true
|
||||
|
||||
##########################################
|
||||
# PLUGINMESSAGING Settings
|
||||
##########################################
|
||||
|
||||
# Applies to PLUGINMESSAGING only
|
||||
# Votes will be forwarded when specific player is online
|
||||
# If set to false, rewards should still reward when player logs in (by default)
|
||||
WaitForUserOnline: false
|
||||
|
||||
|
||||
##########################################
|
||||
# Multi-proxy setup
|
||||
# This is still a WIP, use with caution
|
||||
# Primary server needs votifier and config option enabled
|
||||
# Set socket host on each proxy and primary server set sub proxies
|
||||
# All servers should be on pluginmessaging or sockets setup
|
||||
##########################################
|
||||
|
||||
# Support for multiple proxies
|
||||
MultiProxySupport: false
|
||||
|
||||
# Enable on primary proxy server with votifier
|
||||
PrimaryServer: false
|
||||
|
||||
# If enabled, player will only get 1 reward on a server on the network
|
||||
# Must be enabled on all proxies for this to work
|
||||
# Must also disable sendtoallservers
|
||||
MultiProxyOneGlobalReward: false
|
||||
|
||||
# Multi-proxy available methods:
|
||||
# SOCKET
|
||||
# REDIS
|
||||
MultiProxyMethod: SOCKET
|
||||
|
||||
##########################################
|
||||
# REDIS Settings
|
||||
##########################################
|
||||
|
||||
# Set multiproxymethod to REDIS to use redis
|
||||
MultiProxyRedis:
|
||||
# If true the plugin will use the exsiting connection set above
|
||||
# Must be on REDIS method to use this setting
|
||||
UseExistingConnection: false
|
||||
Host: localhost
|
||||
Port: 6379
|
||||
Username: ''
|
||||
Password: ''
|
||||
|
||||
# Set each server it's own proxy name here (can be anything)
|
||||
ProxyServerName: proxy1
|
||||
|
||||
# Set names of other proxy servers
|
||||
# Must match what's set as the proxy server name above from other servers
|
||||
# On non primary proxy server just set the primary proxy server name here
|
||||
ProxyServers:
|
||||
- proxy2
|
||||
- proxy3
|
||||
|
||||
##########################################
|
||||
# SOCKET settings for mutli-proxy
|
||||
##########################################
|
||||
|
||||
# Set this for each proxy
|
||||
MultiProxySocketHost:
|
||||
Host: 0.0.0.0
|
||||
Port: 1234
|
||||
|
||||
# Set other sub proxies here
|
||||
# On non primary proxy only set primary proxy
|
||||
MultiProxyServers:
|
||||
secondproxy:
|
||||
Host: 0.0.0.0
|
||||
Port: 1235
|
||||
+271
-250
@@ -1,250 +1,271 @@
|
||||
name: ${project.name}
|
||||
version: ${project.version}
|
||||
main: com.bencodez.votingplugin.VotingPluginMain
|
||||
description: Highly Customizable Voting Listener!
|
||||
website: https://www.spigotmc.org/resources/votingplugin.15358/
|
||||
author: BenCodez
|
||||
softdepend: [MVdWPlaceholders, Votifier, VotifierPlus, NuVotifier, CMI, Vault, PlaceholderAPI, ProtocolLib, MVdWPlaceholderAPI, AuthMe]
|
||||
api-version: 1.13
|
||||
commands:
|
||||
vote:
|
||||
description: Vote command
|
||||
adminvote:
|
||||
description: Admin commands for VotingPlugin
|
||||
av:
|
||||
description: Admin commands for VotingPlugin
|
||||
votehelp:
|
||||
description: See access to a list of commands, Formated in Format.yml
|
||||
aliases: vhelp
|
||||
votetotal:
|
||||
description: See totals of votes
|
||||
aliases: vtotal
|
||||
votelast:
|
||||
description: See the last time you voted
|
||||
aliases: vlast
|
||||
votenext:
|
||||
description: See when you can vote next
|
||||
aliases: vnext
|
||||
votetop:
|
||||
description: See top voters
|
||||
aliases: vtop
|
||||
votetoday:
|
||||
description: See who voted today
|
||||
aliases: vtoday
|
||||
votegui:
|
||||
description: Open VoteGUI
|
||||
aliases: vgui
|
||||
voteurl:
|
||||
description: Open VoteURL
|
||||
aliases: vurl
|
||||
votereward:
|
||||
description: Open VoteReward GUI
|
||||
aliases: vreward
|
||||
vote?:
|
||||
description: View Help
|
||||
aliases: v?
|
||||
voteparty:
|
||||
description: A command
|
||||
aliases: vparty
|
||||
voteshop:
|
||||
description: A command
|
||||
aliases: vshop
|
||||
votebest:
|
||||
description: A command
|
||||
aliases: vbest
|
||||
votestreak:
|
||||
description: A command
|
||||
aliases: vstreak
|
||||
votetogglebroadcast:
|
||||
description: A command
|
||||
aliases: vtogglebroadcast
|
||||
votepoints:
|
||||
description: A command
|
||||
aliases: vpoints
|
||||
votelist:
|
||||
description: A command
|
||||
aliases: vlist
|
||||
voteall:
|
||||
description: A command
|
||||
aliases: vall
|
||||
votechoices:
|
||||
description: A command
|
||||
alaises: vchoices
|
||||
votegivepoints:
|
||||
description: A command
|
||||
alaises: vgivepoints
|
||||
adminvotehelp:
|
||||
description: Open adminvote help
|
||||
aliases: avhelp
|
||||
adminvote?:
|
||||
description: Open adminvote help
|
||||
aliases: av?
|
||||
adminvotereport:
|
||||
description: Command Alias
|
||||
aliases: avreport
|
||||
adminvoteperms:
|
||||
description: Command Alias
|
||||
aliases: avperms
|
||||
adminvoteDownload:
|
||||
description: Command Alias
|
||||
aliases: avdownload
|
||||
adminvotereload:
|
||||
description: Command Alias
|
||||
aliases: avreload
|
||||
adminvotetestreward:
|
||||
description: Command Alias
|
||||
aliases: avtestreward
|
||||
adminvoteversion:
|
||||
description: Command Alias
|
||||
aliases: avversion
|
||||
adminvotesites:
|
||||
description: Command Alias
|
||||
aliases: avsites
|
||||
adminvoterewards:
|
||||
description: Command Alias
|
||||
aliases: avrewards
|
||||
adminvoteuuid:
|
||||
description: Command Alias
|
||||
aliases: avuuid
|
||||
adminvotevotesite:
|
||||
description: Command Alias
|
||||
aliases: avvotesite
|
||||
adminvoteconfig:
|
||||
description: Command Alias
|
||||
aliases: avconfig
|
||||
adminvoteupdatecheck:
|
||||
description: Command Alias
|
||||
aliases: avupdatecheck
|
||||
adminvotevote:
|
||||
description: Command Alias
|
||||
aliases: [avvote, fakevote]
|
||||
adminvotegui:
|
||||
description: Command Alias
|
||||
aliases: avgui
|
||||
adminvotegivereward:
|
||||
description: Command Alias
|
||||
aliases: avgivereward
|
||||
adminvoteConvertFromData:
|
||||
description: Command Alias
|
||||
aliases: avConvertFromData
|
||||
adminvoteClearTotal:
|
||||
description: Command Alias
|
||||
adminvoteBackgroundUpdate:
|
||||
description: Command Alias
|
||||
aliases: avBackgroundUpdate
|
||||
adminvoteClearCache:
|
||||
description: Command Alias
|
||||
aliases: avClearCache
|
||||
adminvoteServiceSites:
|
||||
description: Command Alias
|
||||
aliases: avServiceSites
|
||||
adminvoteSetVotePartyCount:
|
||||
description: Command Alias
|
||||
aliases: avSetVotePartyCount
|
||||
adminvoteChoices:
|
||||
description: Command Alias
|
||||
aliases: avChoices
|
||||
adminvoteReloadAll:
|
||||
description: Command Alias
|
||||
aliases: avReloadAll
|
||||
adminvotePermsPlayer:
|
||||
description: Command Alias
|
||||
aliases: avPermsPlayer
|
||||
adminvoteResyncMilestonesAlreadyGiven:
|
||||
description: Command Alias
|
||||
aliases: avResyncMilestonesAlreadyGiven
|
||||
voteSetPrimaryAccount:
|
||||
description: Command Alias
|
||||
adminvoteClearOfflineVotes:
|
||||
description: Command Alias
|
||||
aliases: avClearOfflineVotes
|
||||
adminvoteGiveAll:
|
||||
description: Command Alias
|
||||
aliases: avGiveAll
|
||||
adminvoteGiveAllOnline:
|
||||
description: Command Alias
|
||||
aliases: avGiveAllOnline
|
||||
adminvoteForceTimeChanged:
|
||||
description: Command Alias
|
||||
aliases: avForceTimeChanged
|
||||
adminvoteplayername:
|
||||
description: Command Alias
|
||||
aliases: avplayername
|
||||
adminvoteResyncMilestones:
|
||||
description: Command Alias
|
||||
aliases: avResyncMilestones
|
||||
adminvoteClearOfflineRewards:
|
||||
description: Command Alias
|
||||
aliases: avClearOfflineRewards
|
||||
adminvoteUserRemove:
|
||||
description: Command Alias
|
||||
aliases: avUserRemove
|
||||
adminvotePurge:
|
||||
description: Command Alias
|
||||
aliases: avPurge
|
||||
adminvoteJavascript:
|
||||
description: Command Alias
|
||||
aliases: avJavascript
|
||||
adminvoteStatus:
|
||||
description: Command Alias
|
||||
aliases: avStatus
|
||||
adminvoteTest:
|
||||
description: Command Alias
|
||||
aliases: avTest
|
||||
adminvotePlaceholders:
|
||||
description: Command Alias
|
||||
aliases: avPlaceholders
|
||||
adminvoteDownloadJenkins:
|
||||
description: Command Alias
|
||||
aliases: avDownloadJenkins
|
||||
adminvoteForceVoteParty:
|
||||
description: Command Alias
|
||||
aliases: avForceVoteParty
|
||||
adminvoteSetRequestMethod:
|
||||
description: Command Alias
|
||||
aliases: avSetRequestMethod
|
||||
adminvoteUser:
|
||||
description: Command Alias
|
||||
aliases: avUser
|
||||
adminvoteCurrentPluginTime:
|
||||
description: Command Alias
|
||||
aliases: avCurrentPluginTime
|
||||
adminvoteResetPoints:
|
||||
description: Command Alias
|
||||
aliases: avResetPoints
|
||||
adminvoteVotePartyExtraRequired:
|
||||
description: Command Alias
|
||||
aliases: avVotePartyExtraRequired
|
||||
adminvoteRunCMD:
|
||||
description: Command Alias
|
||||
aliases: avRunCMD
|
||||
|
||||
permissions:
|
||||
VotingPlugin.Player:
|
||||
description: Allows basic access player commands
|
||||
VotingPlugin.Mod:
|
||||
description: Allows mod commands
|
||||
VotingPlugin.Admin:
|
||||
description: Allows admincommands
|
||||
VotingPlugin.Login.RemindVotes:
|
||||
description: Allows players to get remined on login if they can vote
|
||||
default: true
|
||||
VotingPlugin.Admin.Debug:
|
||||
description: Permission to view debug info ingame
|
||||
VotingPlugin.Signs.Create:
|
||||
description: Allows access to create signs
|
||||
VotingPlugin.TopVoter.Ignore:
|
||||
description: Allows you to be exempt from top voter
|
||||
VotingPlugin.NoRemind:
|
||||
description: Ignore vote reminding
|
||||
default: false
|
||||
VotingPlugin.Sign.Create:
|
||||
description: Permission to create sign
|
||||
VotingPlugin.Admin.GenerateServiceSite:
|
||||
description: Permission for generating votesite message
|
||||
VotingPlugin.Login.RemindVotes:
|
||||
description: Permission to allow timed reminders
|
||||
VotingPlugin.Login.RemindVotes.Any:
|
||||
description: Remind if player can vote on any website, rather than all
|
||||
default: false
|
||||
|
||||
name: ${project.name}
|
||||
version: ${project.version}
|
||||
main: com.bencodez.votingplugin.VotingPluginMain
|
||||
description: Highly Customizable Voting Listener!
|
||||
website: https://www.spigotmc.org/resources/votingplugin.15358/
|
||||
author: BenCodez
|
||||
softdepend:
|
||||
- MVdWPlaceholders
|
||||
- Votifier
|
||||
- VotifierPlus
|
||||
- NuVotifier
|
||||
- Vault
|
||||
- PlaceholderAPI
|
||||
- ProtocolLib
|
||||
- MVdWPlaceholderAPI
|
||||
- AuthMe
|
||||
- SuperVanish
|
||||
- PremiumVanish
|
||||
- LuckPerms
|
||||
loadbefore:
|
||||
- MCPerks
|
||||
api-version: 1.13
|
||||
folia-supported: true
|
||||
libraries:
|
||||
- org.openjdk.nashorn:nashorn-core:15.3
|
||||
commands:
|
||||
vote:
|
||||
description: Vote command
|
||||
adminvote:
|
||||
description: Admin commands for VotingPlugin
|
||||
av:
|
||||
description: Admin commands for VotingPlugin
|
||||
votehelp:
|
||||
description: See access to a list of commands, Formated in Format.yml
|
||||
aliases: vhelp
|
||||
votetotal:
|
||||
description: See totals of votes
|
||||
aliases: vtotal
|
||||
votelast:
|
||||
description: See the last time you voted
|
||||
aliases: vlast
|
||||
votenext:
|
||||
description: See when you can vote next
|
||||
aliases: vnext
|
||||
votetop:
|
||||
description: See top voters
|
||||
aliases: vtop
|
||||
votetoday:
|
||||
description: See who voted today
|
||||
aliases: vtoday
|
||||
votegui:
|
||||
description: Open VoteGUI
|
||||
aliases: vgui
|
||||
voteurl:
|
||||
description: Open VoteURL
|
||||
aliases: vurl
|
||||
votereward:
|
||||
description: Open VoteReward GUI
|
||||
aliases: vreward
|
||||
voteparty:
|
||||
description: A command
|
||||
aliases: vparty
|
||||
voteshop:
|
||||
description: A command
|
||||
aliases: vshop
|
||||
votebest:
|
||||
description: A command
|
||||
aliases: vbest
|
||||
votestreak:
|
||||
description: A command
|
||||
aliases: vstreak
|
||||
votetogglebroadcast:
|
||||
description: A command
|
||||
aliases: vtogglebroadcast
|
||||
votepoints:
|
||||
description: A command
|
||||
aliases: vpoints
|
||||
votetogglereminders:
|
||||
aliases:
|
||||
- vtogglereminder
|
||||
- vtoggle
|
||||
votelist:
|
||||
description: A command
|
||||
aliases: vlist
|
||||
voteall:
|
||||
description: A command
|
||||
aliases: vall
|
||||
votechoices:
|
||||
description: A command
|
||||
alaises: vchoices
|
||||
votegivepoints:
|
||||
description: A command
|
||||
alaises: vgivepoints
|
||||
adminvotehelp:
|
||||
description: Open adminvote help
|
||||
aliases: avhelp
|
||||
adminvote?:
|
||||
description: Open adminvote help
|
||||
aliases: av?
|
||||
adminvotereport:
|
||||
description: Command Alias
|
||||
aliases: avreport
|
||||
adminvoteperms:
|
||||
description: Command Alias
|
||||
aliases: avperms
|
||||
adminvotereload:
|
||||
description: Command Alias
|
||||
aliases: avreload
|
||||
adminvotetestreward:
|
||||
description: Command Alias
|
||||
aliases: avtestreward
|
||||
adminvoteversion:
|
||||
description: Command Alias
|
||||
aliases: avversion
|
||||
adminvotesites:
|
||||
description: Command Alias
|
||||
aliases: avsites
|
||||
adminvoterewards:
|
||||
description: Command Alias
|
||||
aliases: avrewards
|
||||
adminvoteuuid:
|
||||
description: Command Alias
|
||||
aliases: avuuid
|
||||
adminvotevotesite:
|
||||
description: Command Alias
|
||||
aliases: avvotesite
|
||||
adminvoteconfig:
|
||||
description: Command Alias
|
||||
aliases: avconfig
|
||||
adminvoteupdatecheck:
|
||||
description: Command Alias
|
||||
aliases: avupdatecheck
|
||||
adminvotevote:
|
||||
description: Command Alias
|
||||
aliases:
|
||||
- avvote
|
||||
- fakevote
|
||||
adminvotegui:
|
||||
description: Command Alias
|
||||
aliases: avgui
|
||||
adminvotegivereward:
|
||||
description: Command Alias
|
||||
aliases: avgivereward
|
||||
adminvoteconvertfromdata:
|
||||
description: Command Alias
|
||||
aliases: avconvertfromdata
|
||||
adminvoteonverttodata:
|
||||
description: Command Alias
|
||||
aliases: avconverttodata
|
||||
adminvotecleartotal:
|
||||
description: Command Alias
|
||||
adminvotebackgroundupdate:
|
||||
description: Command Alias
|
||||
aliases: avbackgroundupdate
|
||||
adminvoteclearcache:
|
||||
description: Command Alias
|
||||
aliases: avclearcache
|
||||
adminvoteservicesites:
|
||||
description: Command Alias
|
||||
aliases: avservicesites
|
||||
adminvotevoteparty:
|
||||
description: Command Alias
|
||||
aliases: avvoteparty
|
||||
adminvotechoices:
|
||||
description: Command Alias
|
||||
aliases: avchoices
|
||||
adminvotereloadall:
|
||||
description: Command Alias
|
||||
aliases: avreloadall
|
||||
adminvotepermsplayer:
|
||||
description: Command Alias
|
||||
aliases: avpermsplayer
|
||||
adminvoteresyncmilestonesalreadygiven:
|
||||
description: Command Alias
|
||||
aliases: avresyncmilestonesalreadygiven
|
||||
votesetprimaryaccount:
|
||||
description: Command Alias
|
||||
adminvoteclearofflinevotes:
|
||||
description: Command Alias
|
||||
aliases: avclearofflinevotes
|
||||
adminvotegiveall:
|
||||
description: Command Alias
|
||||
aliases: avgiveall
|
||||
adminvotegiveallonline:
|
||||
description: Command Alias
|
||||
aliases: avgiveallonline
|
||||
adminvoteforcetimechanged:
|
||||
description: Command Alias
|
||||
aliases: avforcetimechanged
|
||||
adminvoteplayername:
|
||||
description: Command Alias
|
||||
aliases: avplayername
|
||||
adminvoteresyncmilestones:
|
||||
description: Command Alias
|
||||
aliases: avresyncmilestones
|
||||
adminvoteclearofflinerewards:
|
||||
description: Command Alias
|
||||
aliases: avclearofflinerewards
|
||||
adminvoteuserremove:
|
||||
description: Command Alias
|
||||
aliases: avuserremove
|
||||
adminvotepurge:
|
||||
description: Command Alias
|
||||
aliases: avpurge
|
||||
adminvotejavascript:
|
||||
description: Command Alias
|
||||
aliases: avjavascript
|
||||
adminvotestatus:
|
||||
description: Command Alias
|
||||
aliases: avstatus
|
||||
adminvotetest:
|
||||
description: Command Alias
|
||||
aliases: avtest
|
||||
adminvoteplaceholders:
|
||||
description: Command Alias
|
||||
aliases: avplaceholders
|
||||
adminvotedownloadjenkins:
|
||||
description: Command Alias
|
||||
aliases: avdownloadjenkins
|
||||
adminvotesetrequestmethod:
|
||||
description: Command Alias
|
||||
aliases: avsetrequestmethod
|
||||
adminvoteuser:
|
||||
description: Command Alias
|
||||
aliases: avuser
|
||||
adminvotecurrentplugintime:
|
||||
description: Command Alias
|
||||
aliases: avcurrentplugintime
|
||||
adminvoteresetpoints:
|
||||
description: Command Alias
|
||||
aliases: avresetpoints
|
||||
adminvoteruncmd:
|
||||
description: Command Alias
|
||||
aliases: avruncmd
|
||||
adminvoteuseruuidremove:
|
||||
description: Command Alias
|
||||
aliases: avuseruuidremove
|
||||
adminvoteedit:
|
||||
description: Command Alias
|
||||
aliases: avedit
|
||||
adminvoteresetmilestonecount:
|
||||
description: Command Alias
|
||||
aliases: avresetmilestonecount
|
||||
permissions:
|
||||
VotingPlugin.Player:
|
||||
description: Allows basic access player commands
|
||||
VotingPlugin.Mod:
|
||||
description: Allows mod commands
|
||||
VotingPlugin.Admin:
|
||||
description: Allows admincommands
|
||||
VotingPlugin.Admin.Debug:
|
||||
description: Permission to view debug info ingame
|
||||
VotingPlugin.Signs.Create:
|
||||
description: Allows access to create signs
|
||||
VotingPlugin.TopVoter.Ignore:
|
||||
description: Allows you to be exempt from top voter
|
||||
VotingPlugin.NoRemind:
|
||||
description: Ignore vote reminding
|
||||
default: false
|
||||
VotingPlugin.BypassWaitUntilVoteDelay:
|
||||
description: Bypass WaitUntilVoteDelay
|
||||
default: false
|
||||
VotingPlugin.Sign.Create:
|
||||
description: Permission to create sign
|
||||
VotingPlugin.Admin.GenerateServiceSite:
|
||||
description: Permission for generating votesite message
|
||||
VotingPlugin.Login.RemindVotes:
|
||||
description: Permission to allow timed reminders
|
||||
VotingPlugin.Login.RemindVotes.All:
|
||||
description: Remind if player can vote on all votesites, rather than any
|
||||
default: false
|
||||
@@ -1,2 +1,4 @@
|
||||
time: '${timestamp}'
|
||||
profile: ${build.profile.id}
|
||||
profile: '${build.profile.id}'
|
||||
version: '${project.version}'
|
||||
buildnumber: '${build.number}'
|
||||
+299
-110
@@ -1,25 +1,15 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>6.2</version>
|
||||
<artifactId>${version.art}</artifactId>
|
||||
<version>6.16.1</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<github.global.server>github</github.global.server>
|
||||
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
|
||||
<build.number>NOTSET</build.number>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>internal.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${project.build.directory}/mvn-repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
@@ -69,7 +59,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
<version>3.4.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
@@ -79,7 +69,7 @@
|
||||
<plugin>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<version>1.18.12.0</version>
|
||||
<version>1.18.20.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>delombok</id>
|
||||
@@ -98,19 +88,23 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<version>3.5.3</version>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>mysql-connector-java</artifact>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
</filters>
|
||||
<relocations>
|
||||
<!-- Lets relocate the shaded API so we dont cause any conflicts with
|
||||
other plugins -->
|
||||
<relocation>
|
||||
<pattern>com.bencodez.advancedcore</pattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.advancedcore</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Lets relocate the shaded API so we dont cause any conflicts with
|
||||
other plugins -->
|
||||
<relocation>
|
||||
<pattern>net.pl3x.bukkit.chatapi</pattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin</shadedPattern>
|
||||
@@ -128,8 +122,12 @@
|
||||
<shadedPattern>${project.groupId}.votingplugin.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>xyz.upperlevel.spigot.book</pattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.upperlevel.book</shadedPattern>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.bstats</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>xyz.upperlevel.spigot</pattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.advancedcore.xyz.upperlevel.spigot</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
@@ -148,57 +146,23 @@
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<sourcepath>${project.basedir}/target/delombok</sourcepath>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.github</groupId>
|
||||
<artifactId>site-maven-plugin</artifactId>
|
||||
<version>0.12</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc</id>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<message>Maven javadoc for ${project.version}</message>
|
||||
<noJekyll>true</noJekyll>
|
||||
<outputDirectory>${project.build.directory}/apidocs
|
||||
</outputDirectory>
|
||||
<branch>refs/heads/gh-pages</branch>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<repositoryName>VotingPlugin</repositoryName>
|
||||
<repositoryOwner>BenCodez</repositoryOwner>
|
||||
<server>github</server>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
@@ -228,14 +192,6 @@
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>maven-central</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public</url>
|
||||
@@ -249,103 +205,336 @@
|
||||
<url>https://nexus.velocitypowered.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>bintray-repo</id>
|
||||
<url>https://dl.bintray.com/ichbinjoe/public/</url>
|
||||
<id>bencodez repo</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!--<dependency> <groupId>com.github.Ben12345rocks</groupId> <artifactId>AdvancedCore</artifactId>
|
||||
<version>3.0-SNAPSHOT</version> </dependency> -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<version>1.20.6-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.32</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>LATEST</version>
|
||||
<version>1.20-R0.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vexsoftware</groupId>
|
||||
<artifactId>nuvotifier-universal</artifactId>
|
||||
<version>2.6.0</version>
|
||||
<version>2.7.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tchristofferson</groupId>
|
||||
<artifactId>ConfigUpdater</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.6</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>be.maximvdw</groupId>
|
||||
<artifactId>MVdWPlaceholderAPI</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/Jars/MVdWPlaceholderAPI.jar</systemPath>
|
||||
<artifactId>mvdwplaceholderapi</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.velocitypowered</groupId>
|
||||
<artifactId>velocity-api</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-velocity</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<id>normal</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<build.profile.id>prod</build.profile.id>
|
||||
<build.profile.id>normal</build.profile.id>
|
||||
<version.art>votingplugin</version.art>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.bencodez</groupId>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>advancedcore</artifactId>
|
||||
<version>master-SNAPSHOT</version>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>normal-folia</id>
|
||||
<properties>
|
||||
<build.profile.id>normal</build.profile.id>
|
||||
<version.art>votingplugin-folia</version.art>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>advancedcore-folia</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod2</id>
|
||||
<properties>
|
||||
<version.art>votingplugin</version.art>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<build.profile.id>prod2</build.profile.id>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>internal.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${project.build.directory}/mvn-repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>AdvancedCore</artifactId>
|
||||
<artifactId>advancedcore</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<id>deploy-snapshot</id>
|
||||
<properties>
|
||||
<build.profile.id>dev</build.profile.id>
|
||||
<version.art>votingplugin</version.art>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<build.profile.id>deploy-snapshot</build.profile.id>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>nexus</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>AdvancedCore</artifactId>
|
||||
<artifactId>advancedcore</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.13</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<serverId>nexus</serverId>
|
||||
<nexusUrl>https://nexus.bencodez.com/nexus/</nexusUrl>
|
||||
<skipStaging>true</skipStaging>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>javadoc</id>
|
||||
<properties>
|
||||
<version.art>votingplugin</version.art>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<build.profile.id>javadoc</build.profile.id>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>internal.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${project.build.directory}/mvn-repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>advancedcore</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<sourcepath>${project.basedir}/target/delombok</sourcepath>
|
||||
<outputDirectory>${project.basedir}/target/apidocs</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>deploy</id>
|
||||
<properties>
|
||||
<version.art>votingplugin</version.art>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<build.profile.id>deploy</build.profile.id>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>advancedcore</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>nexus</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<sourcepath>${project.basedir}/target/delombok</sourcepath>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.13</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-deploy</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<serverId>nexus</serverId>
|
||||
<nexusUrl>https://nexus.bencodez.com/nexus/</nexusUrl>
|
||||
<skipStaging>true</skipStaging>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--<plugin>
|
||||
<groupId>com.github.github</groupId>
|
||||
<artifactId>site-maven-plugin</artifactId>
|
||||
<version>0.12</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc</id>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<message>Maven javadoc for ${project.version}</message>
|
||||
<noJekyll>true</noJekyll>
|
||||
<outputDirectory>${project.build.directory}/apidocs
|
||||
</outputDirectory>
|
||||
<branch>refs/heads/gh-pages</branch>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<repositoryName>VotingPlugin</repositoryName>
|
||||
<repositoryOwner>BenCodez</repositoryOwner>
|
||||
<server>github</server>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -2,29 +2,30 @@ package com.Ben12345rocks.VotingPlugin.Objects;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
@Deprecated
|
||||
public class User {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public User(Player p) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(p);
|
||||
user = VotingPluginMain.plugin.getVotingPluginUserManager().getVotingPluginUser(p);
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
return user.getPoints();
|
||||
}
|
||||
|
||||
public void setPoints(int points) {
|
||||
user.setPoints(points);
|
||||
}
|
||||
|
||||
|
||||
public void addPoints(int points) {
|
||||
user.addPoints(points);
|
||||
}
|
||||
|
||||
|
||||
public int getPoints() {
|
||||
return user.getPoints();
|
||||
}
|
||||
|
||||
public boolean removePoints(int points) {
|
||||
return user.removePoints(points);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPoints(int points) {
|
||||
user.setPoints(points);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,35 @@
|
||||
package com.bencodez.votingplugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.misc.MiscUtils;
|
||||
import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.advancedcore.api.time.TimeType;
|
||||
import com.bencodez.advancedcore.api.user.UserStorage;
|
||||
import com.bencodez.advancedcore.api.user.usercache.value.DataValue;
|
||||
import com.bencodez.advancedcore.api.user.usercache.value.DataValueBoolean;
|
||||
import com.bencodez.advancedcore.api.user.userstorage.mysql.api.config.MysqlConfigSpigot;
|
||||
import com.bencodez.advancedcore.bungeeapi.GlobalMessage.GlobalMessageHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.GlobalMessage.GlobalMessageListener;
|
||||
import com.bencodez.advancedcore.bungeeapi.globaldata.GlobalDataHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.globaldata.GlobalMySQL;
|
||||
import com.bencodez.advancedcore.bungeeapi.pluginmessage.PluginMessageHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.redis.RedisHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.redis.RedisListener;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.ClientHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.SocketHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver;
|
||||
@@ -13,12 +37,11 @@ import com.bencodez.votingplugin.bungee.BungeeMessageData;
|
||||
import com.bencodez.votingplugin.bungee.BungeeMethod;
|
||||
import com.bencodez.votingplugin.bungee.BungeeVersion;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public class BungeeHandler {
|
||||
public class BungeeHandler implements Listener {
|
||||
@Getter
|
||||
private ClientHandler clientHandler;
|
||||
|
||||
@@ -29,16 +52,217 @@ public class BungeeHandler {
|
||||
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
@Getter
|
||||
private int bungeeVotePartyCurrent = -2;
|
||||
|
||||
@Getter
|
||||
private int bungeeVotePartyRequired = -2;
|
||||
|
||||
@Getter
|
||||
private SocketHandler socketHandler;
|
||||
|
||||
private GlobalDataHandler globalDataHandler;
|
||||
|
||||
@Getter
|
||||
private ScheduledExecutorService timer;
|
||||
|
||||
@Getter
|
||||
private RedisHandler redisHandler;
|
||||
|
||||
@Getter
|
||||
private GlobalMessageHandler globalMessageHandler;
|
||||
|
||||
private Thread redisThread;
|
||||
|
||||
public BungeeHandler(VotingPluginMain plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
socketHandler.closeConnection();
|
||||
clientHandler.stopConnection();
|
||||
if (socketHandler != null) {
|
||||
socketHandler.closeConnection();
|
||||
}
|
||||
if (clientHandler != null) {
|
||||
clientHandler.stopConnection();
|
||||
}
|
||||
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
|
||||
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
|
||||
if (globalDataHandler != null) {
|
||||
globalDataHandler.getGlobalMysql().close();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @EventHandler public void onDateChange(DateChangedEvent event) { if
|
||||
* (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
* plugin.getPluginMessaging().sendPluginMessage("timeupdate",
|
||||
* plugin.getServerDataFile().getPrevMonth() + "//" +
|
||||
* plugin.getServerDataFile().getPrevDay() + "//" +
|
||||
* plugin.getServerDataFile().getPrevWeekDay()); } }
|
||||
*/
|
||||
|
||||
public void checkGlobalData() {
|
||||
HashMap<String, DataValue> data = globalDataHandler.getExact(plugin.getBungeeSettings().getServer());
|
||||
// plugin.debug(data.toString());
|
||||
|
||||
if (data.containsKey("ForceUpdate")) {
|
||||
boolean b = checkGlobalDataTimeValue(data.get("ForceUpdate"));
|
||||
if (b) {
|
||||
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
plugin.getMysql().clearCacheBasic();
|
||||
}
|
||||
plugin.getUserManager().getDataManager().clearCache();
|
||||
plugin.setUpdate(true);
|
||||
plugin.update();
|
||||
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), "ForceUpdate", false);
|
||||
}
|
||||
}
|
||||
|
||||
boolean forceUpdate = false;
|
||||
|
||||
if (checkGlobalDataTime(TimeType.MONTH, data)) {
|
||||
forceUpdate = true;
|
||||
}
|
||||
if (checkGlobalDataTime(TimeType.WEEK, data)) {
|
||||
forceUpdate = true;
|
||||
}
|
||||
if (checkGlobalDataTime(TimeType.DAY, data)) {
|
||||
forceUpdate = true;
|
||||
}
|
||||
|
||||
if (forceUpdate) {
|
||||
HashMap<String, DataValue> dataToSet = new HashMap<String, DataValue>();
|
||||
dataToSet.put("FinishedProcessing", new DataValueBoolean(true));
|
||||
dataToSet.put("Processing", new DataValueBoolean(false));
|
||||
globalDataHandler.setData(plugin.getBungeeSettings().getServer(), dataToSet);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkGlobalDataTimeValue(DataValue data) {
|
||||
if (data.isBoolean()) {
|
||||
return data.getBoolean();
|
||||
}
|
||||
return Boolean.valueOf(data.getString());
|
||||
}
|
||||
|
||||
public boolean checkGlobalDataTime(TimeType type, HashMap<String, DataValue> data) {
|
||||
boolean isProcessing = false;
|
||||
if (data.containsKey(type.toString())) {
|
||||
|
||||
DataValue value = data.get(type.toString());
|
||||
boolean b = checkGlobalDataTimeValue(value);
|
||||
if (b) {
|
||||
long lastUpdated = Long.valueOf(data.get("LastUpdated").getString()).longValue();
|
||||
plugin.debug("LastUpdated: " + lastUpdated);
|
||||
if (LocalDateTime.now().atZone(ZoneOffset.UTC).toInstant().toEpochMilli() - lastUpdated > 1000 * 60 * 60
|
||||
* 2) {
|
||||
plugin.getLogger().warning("Ignoring bungee time change since it was more than 2 hours ago");
|
||||
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), type.toString(), false);
|
||||
return false;
|
||||
}
|
||||
|
||||
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), "Processing", true);
|
||||
isProcessing = true;
|
||||
|
||||
plugin.debug("Detected time change from bungee: " + type.toString());
|
||||
plugin.getTimeChecker().forceChanged(type, false, true, true);
|
||||
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), type.toString(), false);
|
||||
}
|
||||
}
|
||||
return isProcessing;
|
||||
}
|
||||
|
||||
public void loadGlobalMysql() {
|
||||
if (plugin.getBungeeSettings().isGloblalDataEnabled()) {
|
||||
if (timer != null) {
|
||||
timer.shutdown();
|
||||
try {
|
||||
timer.awaitTermination(5, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
timer.shutdownNow();
|
||||
}
|
||||
timer = Executors.newScheduledThreadPool(1);
|
||||
timer.scheduleWithFixedDelay(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
checkGlobalData();
|
||||
}
|
||||
}, 60, 10, TimeUnit.SECONDS);
|
||||
timer.scheduleWithFixedDelay(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
globalDataHandler.setString(plugin.getBungeeSettings().getServer(), "LastOnline",
|
||||
"" + LocalDateTime.now().atZone(ZoneOffset.UTC).toInstant().toEpochMilli());
|
||||
}
|
||||
}, 1, 60, TimeUnit.MINUTES);
|
||||
if (globalDataHandler != null) {
|
||||
globalDataHandler.getGlobalMysql().close();
|
||||
}
|
||||
if (plugin.getBungeeSettings().isGloblalDataUseMainMySQL()
|
||||
&& plugin.getStorageType().equals(UserStorage.MYSQL)) {
|
||||
globalDataHandler = new GlobalDataHandler(
|
||||
new GlobalMySQL("VotingPlugin_GlobalData", plugin.getMysql().getMysql()) {
|
||||
|
||||
@Override
|
||||
public void warning(String text) {
|
||||
plugin.getLogger().warning(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void severe(String text) {
|
||||
plugin.getLogger().severe(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(Exception e) {
|
||||
plugin.debug(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String text) {
|
||||
plugin.debug(text);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
globalDataHandler = new GlobalDataHandler(
|
||||
new GlobalMySQL("VotingPlugin_GlobalData", new MysqlConfigSpigot(
|
||||
plugin.getBungeeSettings().getData().getConfigurationSection("GlobalData"))) {
|
||||
|
||||
@Override
|
||||
public void warning(String text) {
|
||||
plugin.getLogger().warning(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void severe(String text) {
|
||||
plugin.getLogger().severe(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(Exception e) {
|
||||
plugin.debug(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String text) {
|
||||
plugin.debug(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("IgnoreTime", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("MONTH", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("WEEK", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("DAY", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("FinishedProcessing", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("Processing", "VARCHAR(5)");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("LastUpdated", "MEDIUMTEXT");
|
||||
globalDataHandler.getGlobalMysql().alterColumnType("ForceUpdate", "VARCHAR(5)");
|
||||
plugin.getTimeChecker().setProcessingEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
@@ -48,141 +272,446 @@ public class BungeeHandler {
|
||||
|
||||
plugin.getLogger().info("Using BungeeMethod: " + method.toString());
|
||||
|
||||
if (method.equals(BungeeMethod.MYSQL)) {
|
||||
plugin.registerBungeeChannels("vp:vp");
|
||||
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
plugin.registerBungeeChannels("vp:vp");
|
||||
loadGlobalMysql();
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("Vote") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
if (args.size() > 8) {
|
||||
int bungeeVersion = Integer.parseInt(args.get(8));
|
||||
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
return;
|
||||
}
|
||||
globalMessageHandler = new GlobalMessageHandler() {
|
||||
|
||||
String player = args.get(0);
|
||||
String uuid = args.get(1);
|
||||
String service = args.get(2);
|
||||
long time = Long.parseLong(args.get(3));
|
||||
plugin.debug("pluginmessaging vote received from " + player + "/" + uuid + " on " + service);
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(uuid),
|
||||
player);
|
||||
@Override
|
||||
public void sendMessage(String subChannel, String... messageData) {
|
||||
if (method.equals(BungeeMethod.MYSQL)) {
|
||||
plugin.getPluginMessaging().sendPluginMessage(subChannel, messageData);
|
||||
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
plugin.getPluginMessaging().sendPluginMessage(subChannel, messageData);
|
||||
} else if (method.equals(BungeeMethod.SOCKETS)) {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add(subChannel);
|
||||
list.addAll(ArrayUtils.getInstance().convert(messageData));
|
||||
sendData(ArrayUtils.getInstance().convert(list));
|
||||
} else if (method.equals(BungeeMethod.REDIS)) {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add(subChannel);
|
||||
list.addAll(ArrayUtils.getInstance().convert(messageData));
|
||||
redisHandler.sendMessage(plugin.getBungeeSettings().getRedisPrefix() + "VotingPlugin",
|
||||
ArrayUtils.getInstance().convert(list));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
boolean wasOnline = Boolean.valueOf(args.get(4));
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("Vote") {
|
||||
|
||||
BungeeMessageData text = new BungeeMessageData(args.get(6));
|
||||
|
||||
boolean setTotals = Boolean.valueOf(args.get(7));
|
||||
|
||||
user.clearCache();
|
||||
|
||||
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline);
|
||||
|
||||
if (!plugin.getBungeeSettings().isBungeeBroadcast()) {
|
||||
if (wasOnline || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
|
||||
VoteSite site = plugin.getVoteSite(service);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + service);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Boolean.valueOf(args.get(5))) {
|
||||
plugin.getServerData().addServiceSite(service);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
if (args.size() > 8) {
|
||||
int bungeeVersion = Integer.parseInt(args.get(8));
|
||||
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers"
|
||||
+ bungeeVersion + ":" + BungeeVersion.getPluginMessageVersion());
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteOnline") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
if (args.size() > 8) {
|
||||
int bungeeVersion = Integer.parseInt(args.get(8));
|
||||
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
return;
|
||||
}
|
||||
String player = args.get(0);
|
||||
String uuid = args.get(1);
|
||||
String service = args.get(2);
|
||||
long time = Long.parseLong(args.get(3));
|
||||
BungeeMessageData text = new BungeeMessageData(args.get(6));
|
||||
plugin.debug(
|
||||
"pluginmessaging voteonline received from " + player + "/" + uuid + " on " + service);
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(uuid),
|
||||
player);
|
||||
user.clearCache();
|
||||
|
||||
boolean setTotals = Boolean.valueOf(args.get(7));
|
||||
|
||||
boolean wasOnline = Boolean.valueOf(args.get(4));
|
||||
|
||||
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline);
|
||||
|
||||
if (!plugin.getBungeeSettings().isBungeeBroadcast()) {
|
||||
if (Boolean.valueOf(args.get(4)) || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
|
||||
VoteSite site = plugin.getVoteSite(service);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + service);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Boolean.valueOf(args.get(5))) {
|
||||
plugin.getServerData().addServiceSite(service);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteUpdate") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
String player = args.get(0);
|
||||
plugin.debug("pluginmessaging voteupdate received for " + player);
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(player));
|
||||
user.clearCache();
|
||||
String uuid = args.get(1);
|
||||
String service = args.get(2);
|
||||
long time = Long.parseLong(args.get(3));
|
||||
plugin.debug("pluginmessaging vote received from " + player + "/" + uuid + " on " + service);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(uuid), player);
|
||||
|
||||
user.offVote();
|
||||
boolean wasOnline = Boolean.valueOf(args.get(4));
|
||||
|
||||
plugin.setUpdate(true);
|
||||
BungeeMessageData text = new BungeeMessageData(args.get(6));
|
||||
|
||||
bungeeVotePartyCurrent = text.getVotePartyCurrent();
|
||||
bungeeVotePartyRequired = text.getVotePartyRequired();
|
||||
plugin.getPlaceholders().onBungeeVotePartyUpdate();
|
||||
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
|
||||
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
|
||||
|
||||
boolean setTotals = Boolean.valueOf(args.get(7));
|
||||
|
||||
user.cache();
|
||||
|
||||
boolean broadcast = true;
|
||||
boolean bungeeBroadcast = false;
|
||||
|
||||
if (args.size() > 9) {
|
||||
bungeeBroadcast = Boolean.valueOf(args.get(9));
|
||||
}
|
||||
|
||||
int num = 1;
|
||||
if (args.size() > 10) {
|
||||
num = Integer.valueOf(args.get(10));
|
||||
}
|
||||
int numberOfVotes = 1;
|
||||
if (args.size() > 11) {
|
||||
numberOfVotes = Integer.valueOf(args.get(11));
|
||||
}
|
||||
|
||||
if (!bungeeBroadcast) {
|
||||
if (!plugin.getBungeeSettings().isBungeeBroadcast()
|
||||
&& !plugin.getBungeeSettings().isDisableBroadcast()) {
|
||||
if (wasOnline || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
|
||||
if (plugin.getConfigFile().isFormatOnlyOneOfflineBroadcast() && !wasOnline) {
|
||||
if (num == 1) {
|
||||
user.offlineBroadcast(user, plugin.getBungeeSettings().isUseBungeecoord(),
|
||||
numberOfVotes);
|
||||
}
|
||||
} else {
|
||||
VoteSite site = plugin.getVoteSite(service, true);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
broadcast = false;
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + service);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
broadcast = false;
|
||||
}
|
||||
|
||||
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline, broadcast, num);
|
||||
if (plugin.getBungeeSettings().isPerServerPoints()) {
|
||||
user.addPoints(plugin.getConfigFile().getPointsOnVote());
|
||||
}
|
||||
|
||||
plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num);
|
||||
|
||||
if (Boolean.valueOf(args.get(5))) {
|
||||
plugin.getServerData().addServiceSite(service);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteBroadcast") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VoteOnline") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
if (args.size() > 8) {
|
||||
int bungeeVersion = Integer.parseInt(args.get(8));
|
||||
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
return;
|
||||
}
|
||||
String player = args.get(0);
|
||||
String uuid = args.get(1);
|
||||
String service = args.get(2);
|
||||
long time = Long.parseLong(args.get(3));
|
||||
BungeeMessageData text = new BungeeMessageData(args.get(6));
|
||||
|
||||
bungeeVotePartyCurrent = text.getVotePartyCurrent();
|
||||
bungeeVotePartyRequired = text.getVotePartyRequired();
|
||||
plugin.getPlaceholders().onBungeeVotePartyUpdate();
|
||||
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
|
||||
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
|
||||
|
||||
plugin.debug("pluginmessaging voteonline received from " + player + "/" + uuid + " on " + service);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(uuid), player);
|
||||
user.cache();
|
||||
|
||||
if (plugin.getBungeeSettings().isPerServerPoints()) {
|
||||
user.addPoints(plugin.getConfigFile().getPointsOnVote());
|
||||
}
|
||||
|
||||
boolean setTotals = Boolean.valueOf(args.get(7));
|
||||
|
||||
boolean wasOnline = Boolean.valueOf(args.get(4));
|
||||
|
||||
boolean broadcast = true;
|
||||
boolean bungeeBroadcast = false;
|
||||
|
||||
if (args.size() > 9) {
|
||||
bungeeBroadcast = Boolean.valueOf(args.get(9));
|
||||
}
|
||||
|
||||
int num = 1;
|
||||
if (args.size() > 10) {
|
||||
num = Integer.valueOf(args.get(10));
|
||||
}
|
||||
|
||||
int numberOfVotes = 1;
|
||||
if (args.size() > 11) {
|
||||
numberOfVotes = Integer.valueOf(args.get(11));
|
||||
}
|
||||
|
||||
if (!bungeeBroadcast) {
|
||||
if (!plugin.getBungeeSettings().isBungeeBroadcast()
|
||||
&& !plugin.getBungeeSettings().isDisableBroadcast()) {
|
||||
if (wasOnline || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
|
||||
if (plugin.getConfigFile().isFormatOnlyOneOfflineBroadcast() && !wasOnline) {
|
||||
if (num == 1) {
|
||||
user.offlineBroadcast(user, plugin.getBungeeSettings().isUseBungeecoord(),
|
||||
numberOfVotes);
|
||||
}
|
||||
} else {
|
||||
VoteSite site = plugin.getVoteSite(service, true);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
broadcast = false;
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + service);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
broadcast = false;
|
||||
}
|
||||
|
||||
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline, broadcast, num);
|
||||
if (plugin.getBungeeSettings().isPerServerPoints()) {
|
||||
user.addPoints(plugin.getConfigFile().getPointsOnVote());
|
||||
}
|
||||
|
||||
plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num);
|
||||
|
||||
if (Boolean.valueOf(args.get(5))) {
|
||||
plugin.getServerData().addServiceSite(service);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VoteUpdate") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
String player = args.get(0);
|
||||
plugin.debug("pluginmessaging voteupdate received for " + player);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(player));
|
||||
user.cache();
|
||||
|
||||
user.offVote();
|
||||
|
||||
if (args.size() > 3 && plugin.getBungeeSettings().isPerServerMilestones()) {
|
||||
BungeeMessageData text = new BungeeMessageData(args.get(3));
|
||||
plugin.getSpecialRewards().checkMilestone(user, text, true);
|
||||
}
|
||||
|
||||
if (args.size() > 2) {
|
||||
bungeeVotePartyCurrent = Integer.parseInt(args.get(1));
|
||||
bungeeVotePartyRequired = Integer.parseInt(args.get(2));
|
||||
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
|
||||
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
|
||||
}
|
||||
|
||||
plugin.setUpdate(true);
|
||||
}
|
||||
});
|
||||
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("BungeeTimeChange") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
checkGlobalData();
|
||||
}
|
||||
});
|
||||
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VoteBroadcast") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
if (args.size() > 2) {
|
||||
String uuid = args.get(0);
|
||||
String service = args.get(1);
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(uuid));
|
||||
VoteSite site = plugin.getVoteSite(service);
|
||||
String service = args.get(2);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(uuid), args.get(1));
|
||||
VoteSite site = plugin.getVoteSite(service, true);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + service);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VoteBroadcastOffline") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
if (args.size() > 2) {
|
||||
String uuid = args.get(0);
|
||||
String votes = args.get(2);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(uuid), args.get(1));
|
||||
user.offlineBroadcast(user, false, Integer.parseInt(votes));
|
||||
}
|
||||
}
|
||||
});
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("Status") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
String server = args.get(0);
|
||||
sendMessage(globalMessageHandler, "statusokay", server);
|
||||
}
|
||||
});
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("ServerName") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
String server = args.get(0);
|
||||
if (!plugin.getOptions().getServer().equals(server)) {
|
||||
plugin.getLogger().warning("Server name doesn't match in BungeeSettings.yml, should be " + server);
|
||||
}
|
||||
}
|
||||
});
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VotePartyBungee") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
for (final String cmd : plugin.getBungeeSettings().getBungeeVotePartyGlobalCommands()) {
|
||||
plugin.getBukkitScheduler().runTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), cmd);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
new RewardBuilder(plugin.getBungeeSettings().getData(), "BungeeVotePartyRewards").send(p);
|
||||
}
|
||||
}
|
||||
});
|
||||
globalMessageHandler.addListener(new GlobalMessageListener("VotePartyBroadcast") {
|
||||
|
||||
@Override
|
||||
public void onReceive(ArrayList<String> args) {
|
||||
String broadcast = args.get(0);
|
||||
MiscUtils.getInstance().broadcast(broadcast);
|
||||
}
|
||||
});
|
||||
|
||||
if (method.equals(BungeeMethod.MYSQL)) {
|
||||
plugin.registerBungeeChannels("vp:vp");
|
||||
} else if (method.equals(BungeeMethod.REDIS)) {
|
||||
redisHandler = new RedisHandler(plugin.getBungeeSettings().getRedisHost(),
|
||||
plugin.getBungeeSettings().getRedisPort(), plugin.getBungeeSettings().getRedisUsername(),
|
||||
plugin.getBungeeSettings().getRedisPassword()) {
|
||||
|
||||
@Override
|
||||
protected void onMessage(String channel, String[] message) {
|
||||
plugin.getLogger().info(channel
|
||||
+ ArrayUtils.getInstance().makeStringList(ArrayUtils.getInstance().convert(message)));
|
||||
if (message.length > 0) {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
for (int i = 1; i < message.length; i++) {
|
||||
list.add(message[i]);
|
||||
}
|
||||
globalMessageHandler.onMessage(message[0], list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String message) {
|
||||
if (plugin.getBungeeSettings().isBungeeDebug()) {
|
||||
plugin.debug(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
redisThread = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin.isEnabled()) {
|
||||
redisHandler.loadListener(
|
||||
new RedisListener(redisHandler, plugin.getBungeeSettings().getRedisPrefix()
|
||||
+ "VotingPlugin_" + plugin.getBungeeSettings().getServer()));
|
||||
}
|
||||
}
|
||||
});
|
||||
redisThread.start();
|
||||
|
||||
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
|
||||
plugin.registerBungeeChannels("vp:vp");
|
||||
|
||||
bungeeVotePartyCurrent = plugin.getServerData().getBungeeVotePartyCurrent();
|
||||
bungeeVotePartyRequired = plugin.getServerData().getBungeeVotePartyRequired();
|
||||
|
||||
plugin.getPluginMessaging().setDebug(plugin.getBungeeSettings().isBungeeDebug());
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("Vote") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("Vote", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteOnline") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VoteOnline", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteUpdate") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VoteUpdate", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("BungeeTimeChange") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("BungeeTimeChange", args);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteBroadcast") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VoteBroadcast", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteBroadcastOffline") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VoteBroadcastOffline", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("Status") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
String server = args.get(0);
|
||||
plugin.getPluginMessaging().sendPluginMessage("statusokay", server);
|
||||
globalMessageHandler.onMessage("Status", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("ServerName") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("ServerName", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VotePartyBungee") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VotePartyBungee", args);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("VotePartyBroadcast") {
|
||||
@Override
|
||||
public void onRecieve(String subChannel, ArrayList<String> args) {
|
||||
globalMessageHandler.onMessage("VotePartyBroadcast", args);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -195,7 +724,13 @@ public class BungeeHandler {
|
||||
|
||||
socketHandler = new SocketHandler(plugin.getVersion(), plugin.getBungeeSettings().getSpigotServerHost(),
|
||||
plugin.getBungeeSettings().getSpigotServerPort(), encryptionHandler,
|
||||
plugin.getBungeeSettings().isBungeeDebug());
|
||||
plugin.getBungeeSettings().isBungeeDebug()) {
|
||||
|
||||
@Override
|
||||
public void log(String str) {
|
||||
plugin.getLogger().info(str);
|
||||
}
|
||||
};
|
||||
|
||||
socketHandler.add(new SocketReceiver("bungeevote") {
|
||||
|
||||
@@ -206,18 +741,30 @@ public class BungeeHandler {
|
||||
String uuid = data[1];
|
||||
VotingPluginUser user = null;
|
||||
if (!uuid.isEmpty()) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(uuid));
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(UUID.fromString(uuid));
|
||||
} else {
|
||||
user = UserManager.getInstance().getVotingPluginUser(data[2]);
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(data[2]);
|
||||
}
|
||||
|
||||
user.clearCache();
|
||||
user.cache();
|
||||
|
||||
if (plugin.getBungeeSettings().isPerServerPoints()) {
|
||||
user.addPoints(plugin.getConfigFile().getPointsOnVote());
|
||||
}
|
||||
|
||||
user.bungeeVote(data[3], new BungeeMessageData(data[4]), !Boolean.valueOf(data[5]));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("BungeeTimeChange") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
checkGlobalData();
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("bungeevoteonline") {
|
||||
|
||||
@Override
|
||||
@@ -227,26 +774,60 @@ public class BungeeHandler {
|
||||
String uuid = data[1];
|
||||
VotingPluginUser user = null;
|
||||
if (!uuid.isEmpty()) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(UUID.fromString(uuid));
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(UUID.fromString(uuid));
|
||||
} else {
|
||||
user = UserManager.getInstance().getVotingPluginUser(data[2]);
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(data[2]);
|
||||
}
|
||||
|
||||
user.clearCache();
|
||||
user.cache();
|
||||
|
||||
if (plugin.getBungeeSettings().isPerServerPoints()) {
|
||||
user.addPoints(plugin.getConfigFile().getPointsOnVote());
|
||||
}
|
||||
|
||||
user.bungeeVoteOnline(data[3], new BungeeMessageData(data[4]), !Boolean.valueOf(data[5]));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("BroadcastOffline") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
if (data.length > 2) {
|
||||
String votes = data[0];
|
||||
String p = data[1];
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
|
||||
user.offlineBroadcast(user, false, Integer.parseInt(votes));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("BungeeBroadcast") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
if (data.length > 2) {
|
||||
VoteSite site = plugin.getVoteSite(data[1]);
|
||||
VoteSite site = plugin.getVoteSite(data[1], true);
|
||||
String p = data[3];
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(p);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
} else {
|
||||
plugin.getLogger().warning("No votesite for " + data[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("Broadcast") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
if (data.length > 2) {
|
||||
VoteSite site = plugin.getVoteSite(data[1], true);
|
||||
String p = data[2];
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
|
||||
if (site != null) {
|
||||
site.broadcastVote(user, false);
|
||||
} else {
|
||||
@@ -276,6 +857,25 @@ public class BungeeHandler {
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("VotePartyBungee") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
new RewardBuilder(plugin.getBungeeSettings().getData(), "BungeeVotePartyRewards").send(p);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketHandler.add(new SocketReceiver("VotePartyBroadcast") {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
String broadcast = data[0];
|
||||
MiscUtils.getInstance().broadcast(broadcast);
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin.getOptions().getServer().equalsIgnoreCase("pleaseset")) {
|
||||
plugin.getLogger().warning("Server name for bungee voting is not set, please set it");
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.bencodez.votingplugin;
|
||||
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.advancedcore.api.rewards.injected.RewardInject;
|
||||
import com.bencodez.advancedcore.api.rewards.injectedrequirement.RequirementInject;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VotingPluginHooks {
|
||||
private static VotingPluginHooks instance = new VotingPluginHooks();
|
||||
@@ -13,11 +15,17 @@ public class VotingPluginHooks {
|
||||
}
|
||||
|
||||
public void addCustomRequirement(RequirementInject inject) {
|
||||
RewardHandler.getInstance().addInjectedRequirements(inject);
|
||||
getMainClass().getRewardHandler().addInjectedRequirements(inject);
|
||||
}
|
||||
|
||||
public void addCustomReward(RewardInject inject) {
|
||||
RewardHandler.getInstance().addInjectedReward(inject);
|
||||
getMainClass().getRewardHandler().addInjectedReward(inject);
|
||||
}
|
||||
|
||||
public void backgroundUpdate(Player player) {
|
||||
VotingPluginUser user = getUserManager().getVotingPluginUser(player);
|
||||
user.offVote();
|
||||
user.checkOfflineRewards();
|
||||
}
|
||||
|
||||
public VotingPluginMain getMainClass() {
|
||||
@@ -25,7 +33,7 @@ public class VotingPluginHooks {
|
||||
}
|
||||
|
||||
public UserManager getUserManager() {
|
||||
return UserManager.getInstance();
|
||||
return getMainClass().getVotingPluginUserManager();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,54 +1,54 @@
|
||||
package com.bencodez.votingplugin;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import com.bencodez.advancedcore.api.metrics.BStatsMetrics;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
|
||||
public class VotingPluginMetrics {
|
||||
|
||||
public void load(VotingPluginMain plugin) {
|
||||
BStatsMetrics metrics = new BStatsMetrics(plugin);
|
||||
BStatsMetrics metrics = new BStatsMetrics(plugin, 38);
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_firstvote") {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_firstvote", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
public String call() throws Exception {
|
||||
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getFirstVoteRewardsPath())) {
|
||||
return "True";
|
||||
} else {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_everysite") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_everysite", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (RewardHandler.getInstance().hasRewards(plugin.getConfigVoteSites().getData(),
|
||||
public String call() throws Exception {
|
||||
if (plugin.getRewardHandler().hasRewards(plugin.getConfigVoteSites().getData(),
|
||||
plugin.getConfigVoteSites().getEverySiteRewardPath())) {
|
||||
return "True";
|
||||
} else {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_allsites") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_allsites", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
public String call() throws Exception {
|
||||
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getAllSitesRewardPath())) {
|
||||
return "True";
|
||||
} else {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_cumulative") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_cumulative", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
if (plugin.getSpecialRewardsConfig().getCumulativeVotes().size() == 0) {
|
||||
return "False";
|
||||
} else {
|
||||
@@ -60,22 +60,29 @@ public class VotingPluginMetrics {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_voteparty") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_voteparty", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (!plugin.getSpecialRewardsConfig().getVotePartyEnabled()) {
|
||||
public String call() throws Exception {
|
||||
if (!plugin.getSpecialRewardsConfig().isVotePartyEnabled()) {
|
||||
return "False";
|
||||
} else {
|
||||
return "True";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_milestone") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("placeholder_cache_level", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
return plugin.getPlaceholders().getCacheLevel().toString();
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_milestone", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
if (plugin.getSpecialRewardsConfig().getMilestoneVotes().size() == 0) {
|
||||
return "False";
|
||||
} else {
|
||||
@@ -87,27 +94,27 @@ public class VotingPluginMetrics {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_anysitereward") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_anysitereward", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
if (RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
public String call() throws Exception {
|
||||
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getAnySiteRewardsPath())) {
|
||||
return "True";
|
||||
} else {
|
||||
return "False";
|
||||
}
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakday") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakday", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Day")) {
|
||||
|
||||
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Day", s)
|
||||
&& RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Day", s))) {
|
||||
return "True";
|
||||
}
|
||||
@@ -115,16 +122,16 @@ public class VotingPluginMetrics {
|
||||
}
|
||||
return "False";
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakweek") {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakweek", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Week")) {
|
||||
|
||||
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Week", s)
|
||||
&& RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Week", s))) {
|
||||
return "True";
|
||||
}
|
||||
@@ -132,16 +139,16 @@ public class VotingPluginMetrics {
|
||||
|
||||
return "False";
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakmonth") {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakmonth", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Month")) {
|
||||
|
||||
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Month", s)
|
||||
&& RewardHandler.getInstance().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
|
||||
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Month", s))) {
|
||||
return "True";
|
||||
}
|
||||
@@ -149,95 +156,223 @@ public class VotingPluginMetrics {
|
||||
|
||||
return "False";
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofsites") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofsites", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + plugin.getVoteSites().size();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getVoteSitesEnabled().size();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofrewards") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofrewards", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + RewardHandler.getInstance().getRewards().size();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getRewardHandler().getRewards().size();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("autocreatevotesites") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("autocreatevotesites", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isAutoCreateVoteSites();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofusers") {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofusers", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
int total = UserManager.getInstance().getAllUUIDs().size();
|
||||
if (total < 1000) {
|
||||
return "<1000";
|
||||
public String call() throws Exception {
|
||||
int total = plugin.getUserManager().getAllUUIDs().size();
|
||||
if (total > 800000) {
|
||||
return ">800000";
|
||||
} else if (total > 700000) {
|
||||
return "700000-800000";
|
||||
} else if (total > 600000) {
|
||||
return "600000-700000";
|
||||
} else if (total > 500000) {
|
||||
return "500000-600000";
|
||||
} else if (total > 400000) {
|
||||
return "400000-500000";
|
||||
} else if (total > 300000) {
|
||||
return "300000-400000";
|
||||
} else if (total > 200000) {
|
||||
return "200000-300000";
|
||||
} else if (total > 100000) {
|
||||
return "100000-200000";
|
||||
} else if (total > 10000) {
|
||||
return ">10000";
|
||||
} else {
|
||||
return "1000-10000";
|
||||
return ">10000-100000";
|
||||
}
|
||||
return "<10000";
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("data_storage") {
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("data_storage", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
return plugin.getOptions().getStorageType().toString();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("DisableCheckOnWorldChange") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("DisableCheckOnWorldChange", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getOptions().isDisableCheckOnWorldChange();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("votereminding_enabled") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("votereminding_enabled", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + plugin.getConfigFile().getVoteRemindingEnabled();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isVoteRemindingEnabled();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Monthly") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Monthly", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + plugin.getConfigFile().getLoadTopVoterMonthly();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isLoadTopVoterMonthly();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Weekly") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Weekly", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + plugin.getConfigFile().getLoadTopVoterWeekly();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isLoadTopVoterWeekly();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Daily") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Daily", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return "" + plugin.getConfigFile().getLoadTopVoterDaily();
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isLoadTopVoterDaily();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeemethod") {
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeemethod", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
public String call() throws Exception {
|
||||
if (plugin.getBungeeSettings().isUseBungeecoord()) {
|
||||
return "" + plugin.getBungeeHandler().getMethod().toString();
|
||||
} else {
|
||||
return "Disabled";
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
if (plugin.getBungeeSettings().isUseBungeecoord()) {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeebroadcast", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isBungeeBroadcast();
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeebroadcastalways", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isBungeeBroadcastAlways();
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("perserverrewards", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isPerServerRewards();
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("perserverpoints", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isPerServerPoints();
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("triggervotifierevent", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isTriggerVotifierEvent();
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("globaldata_enabled", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isGloblalDataEnabled();
|
||||
}
|
||||
}));
|
||||
if (plugin.getBungeeSettings().isGloblalDataEnabled()) {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("globaldata_usemainmysql", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBungeeSettings().isGloblalDataUseMainMySQL();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("persitecooldownevents", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isPerSiteCoolDownEvents();
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("bedrockplayerprefix", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getOptions().getBedrockPlayerPrefix();
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("using_dev_build", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getProfile().contains("dev");
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("votepointtransfering", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getConfigFile().isAllowVotePointTransfers();
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("votecooldown_check_enabled", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + (!plugin.getConfigFile().isDisableCoolDownCheck() && plugin.getRewardHandler()
|
||||
.hasRewards(plugin.getSpecialRewardsConfig().getData(), "VoteCoolDownEndedReward"));
|
||||
}
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("background_task_time_taken", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getLastBackgroundTaskTimeTaken();
|
||||
}
|
||||
}));
|
||||
|
||||
if (!plugin.getBuildNumber().equals("NOTSET")) {
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("dev_build_number", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "" + plugin.getBuildNumber();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.bencodez.votingplugin.broadcast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.MiscUtils;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
public class BroadcastHandler {
|
||||
private VotingPluginMain plugin;
|
||||
private ScheduledExecutorService timer;
|
||||
ConcurrentLinkedQueue<String> votedPlayers = new ConcurrentLinkedQueue<String>();
|
||||
|
||||
public BroadcastHandler(VotingPluginMain plugin, int delay) {
|
||||
this.plugin = plugin;
|
||||
schedule(delay);
|
||||
}
|
||||
|
||||
public void check() {
|
||||
int size = votedPlayers.size();
|
||||
if (size > 0) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
votedPlayers.poll();
|
||||
}
|
||||
String bc = StringParser.getInstance()
|
||||
.colorize(plugin.getConfigFile().getFormatAlternateBroadcastBroadcast());
|
||||
String playersText = "";
|
||||
while (!votedPlayers.isEmpty()) {
|
||||
playersText += votedPlayers.remove();
|
||||
if (!votedPlayers.isEmpty()) {
|
||||
playersText += ", ";
|
||||
}
|
||||
}
|
||||
HashMap<String, String> placeholders = new HashMap<String, String>();
|
||||
placeholders.put("numberofplayers", "" + size);
|
||||
placeholders.put("players", playersText);
|
||||
bc = StringParser.getInstance().replacePlaceHolder(bc, placeholders);
|
||||
ArrayList<Player> players = new ArrayList<Player>();
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (!plugin.getVotingPluginUserManager().getVotingPluginUser(p).getDisableBroadcast()) {
|
||||
players.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
MiscUtils.getInstance().broadcast(bc, players);
|
||||
}
|
||||
}
|
||||
|
||||
public void onVote(String player) {
|
||||
votedPlayers.add(player);
|
||||
}
|
||||
|
||||
public void schedule(int delay) {
|
||||
if (timer != null) {
|
||||
timer.shutdownNow();
|
||||
timer = Executors.newScheduledThreadPool(1);
|
||||
} else {
|
||||
timer = Executors.newScheduledThreadPool(1);
|
||||
}
|
||||
timer.scheduleWithFixedDelay(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
check();
|
||||
}
|
||||
}, 60, 60 * delay, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,24 +3,49 @@ package com.bencodez.votingplugin.bungee;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class BungeeMessageData {
|
||||
|
||||
// Message string
|
||||
// alltimetotal//monthtotal//weeklytotal//dailytotal//points//milestonecount
|
||||
// alltimetotal//monthtotal//weeklytotal//dailytotal//points//milestonecount//votepartycurrent//votepartyrequired
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int allTimeTotal = 0;
|
||||
@Getter
|
||||
private int monthTotal = 0;
|
||||
@Getter
|
||||
private int weeklyTotal = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int dailyTotal = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int milestoneCount = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int monthTotal = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int points = 0;
|
||||
@Getter
|
||||
private int milestoneCount = 0;
|
||||
@Setter
|
||||
private int weeklyTotal = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int votePartyCurrent = 0;
|
||||
@Getter
|
||||
@Setter
|
||||
private int votePartyRequired = 0;
|
||||
|
||||
public BungeeMessageData(int allTimeTotal, int monthTotal, int weeklyTotal, int dailyTotal, int points,
|
||||
int milestoneCount, int votePartyCurrent, int votePartyRequired) {
|
||||
this.allTimeTotal = allTimeTotal;
|
||||
this.monthTotal = monthTotal;
|
||||
this.weeklyTotal = weeklyTotal;
|
||||
this.dailyTotal = dailyTotal;
|
||||
this.points = points;
|
||||
this.milestoneCount = milestoneCount;
|
||||
this.votePartyCurrent = votePartyCurrent;
|
||||
this.votePartyRequired = votePartyRequired;
|
||||
}
|
||||
|
||||
public BungeeMessageData(String str) {
|
||||
String[] data = str.split(Pattern.quote("//"));
|
||||
@@ -32,22 +57,16 @@ public class BungeeMessageData {
|
||||
points = Integer.parseInt(data[4]);
|
||||
milestoneCount = Integer.parseInt(data[5]);
|
||||
}
|
||||
if (data.length >= 8) {
|
||||
votePartyCurrent = Integer.parseInt(data[6]);
|
||||
votePartyRequired = Integer.parseInt(data[7]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return allTimeTotal + "//" + monthTotal + "//" + weeklyTotal + "//" + dailyTotal + "//" + points + "//"
|
||||
+ milestoneCount;
|
||||
}
|
||||
|
||||
public BungeeMessageData(int allTimeTotal, int monthTotal, int weeklyTotal, int dailyTotal, int points,
|
||||
int milestoneCount) {
|
||||
this.allTimeTotal = allTimeTotal;
|
||||
this.monthTotal = monthTotal;
|
||||
this.weeklyTotal = weeklyTotal;
|
||||
this.dailyTotal = dailyTotal;
|
||||
this.points = points;
|
||||
this.milestoneCount = milestoneCount;
|
||||
+ milestoneCount + "//" + votePartyCurrent + "//" + votePartyRequired;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.bencodez.votingplugin.bungee;
|
||||
|
||||
public enum BungeeMethod {
|
||||
MYSQL, PLUGINMESSAGING, SOCKETS;
|
||||
MYSQL, PLUGINMESSAGING, SOCKETS, REDIS;
|
||||
|
||||
public static BungeeMethod getByName(String str) {
|
||||
for (BungeeMethod method : values()) {
|
||||
@@ -9,6 +9,6 @@ public enum BungeeMethod {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
return SOCKETS;
|
||||
return PLUGINMESSAGING;
|
||||
}
|
||||
}
|
||||
@@ -1,472 +0,0 @@
|
||||
package com.bencodez.votingplugin.bungee;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.bencodez.advancedcore.api.user.userstorage.mysql.api.queries.Query;
|
||||
import com.bencodez.advancedcore.api.user.userstorage.sql.Column;
|
||||
import com.bencodez.advancedcore.api.user.userstorage.sql.DataType;
|
||||
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
|
||||
public class BungeeMySQL {
|
||||
private List<String> columns = Collections.synchronizedList(new ArrayList<String>());
|
||||
|
||||
private List<String> intColumns = new ArrayList<String>();
|
||||
|
||||
// private HashMap<String, ArrayList<Column>> table;
|
||||
|
||||
// ConcurrentMap<String, ArrayList<Column>> table = new
|
||||
// ConcurrentHashMap<String, ArrayList<Column>>();
|
||||
|
||||
private com.bencodez.advancedcore.api.user.userstorage.mysql.api.MySQL mysql;
|
||||
|
||||
private String name;
|
||||
|
||||
private Object object2 = new Object();
|
||||
|
||||
private Object object3 = new Object();
|
||||
|
||||
private Object object4 = new Object();
|
||||
|
||||
private Set<String> uuids = Collections.synchronizedSet(new HashSet<String>());
|
||||
|
||||
public BungeeMySQL(String tableName, Configuration section) {
|
||||
String tablePrefix = section.getString("Prefix");
|
||||
String hostName = section.getString("Host");
|
||||
int port = section.getInt("Port");
|
||||
String user = section.getString("Username");
|
||||
String pass = section.getString("Password");
|
||||
String database = section.getString("Database");
|
||||
long lifeTime = section.getLong("MaxLifeTime", -1);
|
||||
int maxThreads = section.getInt("MaxConnections", 1);
|
||||
String str = section.getString("Line", "");
|
||||
if (maxThreads < 1) {
|
||||
maxThreads = 1;
|
||||
}
|
||||
boolean useSSL = section.getBoolean("UseSSL", false);
|
||||
boolean publicKeyRetrieval = section.getBoolean("PublicKeyRetrieval", false);
|
||||
if (!section.getString("Name", "").isEmpty()) {
|
||||
tableName = section.getString("Name", "");
|
||||
}
|
||||
|
||||
name = tableName;
|
||||
if (tablePrefix != null) {
|
||||
name = tablePrefix + tableName;
|
||||
}
|
||||
mysql = new com.bencodez.advancedcore.api.user.userstorage.mysql.api.MySQL(maxThreads);
|
||||
if (!mysql.connect(hostName, "" + port, user, pass, database, useSSL, lifeTime, str, publicKeyRetrieval)) {
|
||||
|
||||
}
|
||||
try {
|
||||
Query q = new Query(mysql, "USE " + database + ";");
|
||||
q.executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String sql = "CREATE TABLE IF NOT EXISTS " + getName() + " (";
|
||||
sql += "uuid VARCHAR(37),";
|
||||
sql += "PRIMARY KEY ( uuid )";
|
||||
sql += ");";
|
||||
Query query;
|
||||
try {
|
||||
query = new Query(mysql, sql);
|
||||
|
||||
query.executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
loadData();
|
||||
|
||||
// tempoary to improve performance from old tables
|
||||
// addToQue("ALTER TABLE " + getName() + " MODIFY uuid VARCHAR(37);");
|
||||
alterColumnType("uuid", "VARCHAR(37)");
|
||||
}
|
||||
|
||||
public void addColumn(String column, DataType dataType) {
|
||||
synchronized (object3) {
|
||||
String sql = "ALTER TABLE " + getName() + " ADD COLUMN " + column + " text" + ";";
|
||||
try {
|
||||
Query query = new Query(mysql, sql);
|
||||
query.executeUpdate();
|
||||
|
||||
getColumns().add(column);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void alterColumnType(String column, String newType) {
|
||||
checkColumn(column, DataType.STRING);
|
||||
if (newType.contains("INT")) {
|
||||
try {
|
||||
new Query(mysql, "UPDATE " + getName() + " SET " + column + " = '0' where trim(coalesce(" + column
|
||||
+ ", '')) = '';").executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
;
|
||||
if (!intColumns.contains(column)) {
|
||||
intColumns.add(column);
|
||||
}
|
||||
}
|
||||
try {
|
||||
new Query(mysql, "ALTER TABLE " + getName() + " MODIFY " + column + " " + newType + ";")
|
||||
.executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void checkColumn(String column, DataType dataType) {
|
||||
synchronized (object4) {
|
||||
if (!getColumns().contains(column)) {
|
||||
if (!getColumnsQueury().contains(column)) {
|
||||
addColumn(column, dataType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clearCache() {
|
||||
clearCacheBasic();
|
||||
}
|
||||
|
||||
public void clearCacheBasic() {
|
||||
columns.clear();
|
||||
columns.addAll(getColumnsQueury());
|
||||
uuids.clear();
|
||||
uuids.addAll(getUuidsQuery());
|
||||
}
|
||||
|
||||
public void close() {
|
||||
mysql.disconnect();
|
||||
}
|
||||
|
||||
public boolean containsKeyQuery(String index) {
|
||||
String sqlStr = "SELECT uuid FROM " + getName() + ";";
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement(sqlStr)) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
/*
|
||||
* Query query = new Query(mysql, sql); ResultSet rs = query.executeQuery();
|
||||
*/
|
||||
while (rs.next()) {
|
||||
if (rs.getString("uuid").equals(index)) {
|
||||
rs.close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> getColumns() {
|
||||
if (columns == null || columns.size() == 0) {
|
||||
loadData();
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
|
||||
public ArrayList<String> getColumnsQueury() {
|
||||
ArrayList<String> columns = new ArrayList<String>();
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement("SELECT * FROM " + getName() + ";")) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
/*
|
||||
* Query query = new Query(mysql, "SELECT * FROM " + getName() + ";"); ResultSet
|
||||
* rs = query.executeQuery();
|
||||
*/
|
||||
|
||||
ResultSetMetaData metadata = rs.getMetaData();
|
||||
int columnCount = 0;
|
||||
if (metadata != null) {
|
||||
columnCount = metadata.getColumnCount();
|
||||
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
String columnName = metadata.getColumnName(i);
|
||||
columns.add(columnName);
|
||||
}
|
||||
rs.close();
|
||||
return columns;
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return columns;
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<Column> getExactQuery(Column column) {
|
||||
ArrayList<Column> result = new ArrayList<>();
|
||||
String query = "SELECT * FROM " + getName() + " WHERE `" + column.getName() + "`='"
|
||||
+ column.getValue().toString() + "';";
|
||||
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement(query)) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
|
||||
/*
|
||||
* Query sql = new Query(mysql, query); sql.setParameter(1,
|
||||
* column.getValue().toString()); ResultSet rs = sql.executeQuery();
|
||||
*/
|
||||
if (rs.next()) {
|
||||
for (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
|
||||
String columnName = rs.getMetaData().getColumnLabel(i);
|
||||
Column rCol = null;
|
||||
if (intColumns.contains(columnName)) {
|
||||
rCol = new Column(columnName, DataType.INTEGER);
|
||||
} else {
|
||||
rCol = new Column(columnName, DataType.STRING);
|
||||
}
|
||||
// System.out.println(i + " " +
|
||||
// rs.getMetaData().getColumnLabel(i));
|
||||
rCol.setValue(rs.getString(i));
|
||||
// System.out.println(rCol.getValue());
|
||||
result.add(rCol);
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
}
|
||||
|
||||
for (String col : getColumns()) {
|
||||
result.add(new Column(col, DataType.STRING));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ArrayList<String> getNamesQuery() {
|
||||
ArrayList<String> uuids = new ArrayList<String>();
|
||||
|
||||
checkColumn("PlayerName", DataType.STRING);
|
||||
ArrayList<Column> rows = getRowsNameQuery();
|
||||
if (rows != null) {
|
||||
for (Column c : rows) {
|
||||
uuids.add((String) c.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
return uuids;
|
||||
}
|
||||
|
||||
public ArrayList<Column> getRowsNameQuery() {
|
||||
ArrayList<Column> result = new ArrayList<Column>();
|
||||
String sqlStr = "SELECT PlayerName FROM " + getName() + ";";
|
||||
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement(sqlStr)) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
/*
|
||||
* Query query = new Query(mysql, sql); ResultSet rs = query.executeQuery();
|
||||
*/
|
||||
|
||||
while (rs.next()) {
|
||||
Column rCol = new Column("PlayerName", rs.getString("PlayerName"), DataType.STRING);
|
||||
result.add(rCol);
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public ArrayList<Column> getRowsQuery() {
|
||||
ArrayList<Column> result = new ArrayList<Column>();
|
||||
String sqlStr = "SELECT uuid FROM " + getName() + ";";
|
||||
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement(sqlStr)) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
/*
|
||||
* Query query = new Query(mysql, sql); ResultSet rs = query.executeQuery();
|
||||
*/
|
||||
|
||||
while (rs.next()) {
|
||||
Column rCol = new Column("uuid", rs.getString("uuid"), DataType.STRING);
|
||||
result.add(rCol);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getUUID(String playerName) {
|
||||
String query = "SELECT uuid FROM " + getName() + " WHERE " + "PlayerName" + "='" + playerName + "';";
|
||||
try (Connection conn = mysql.getConnectionManager().getConnection();
|
||||
PreparedStatement sql = conn.prepareStatement(query)) {
|
||||
ResultSet rs = sql.executeQuery();
|
||||
/*
|
||||
* Query sql = new Query(mysql, query); ResultSet rs = sql.executeQuery();
|
||||
*/
|
||||
if (rs.next()) {
|
||||
String uuid = rs.getString("uuid");
|
||||
if (uuid != null && !uuid.isEmpty()) {
|
||||
rs.close();
|
||||
return uuid;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Set<String> getUuids() {
|
||||
if (uuids == null || uuids.size() == 0) {
|
||||
uuids.clear();
|
||||
uuids.addAll(getUuidsQuery());
|
||||
return uuids;
|
||||
}
|
||||
return uuids;
|
||||
}
|
||||
|
||||
public ArrayList<String> getUuidsQuery() {
|
||||
ArrayList<String> uuids = new ArrayList<String>();
|
||||
|
||||
ArrayList<Column> rows = getRowsQuery();
|
||||
for (Column c : rows) {
|
||||
uuids.add((String) c.getValue());
|
||||
}
|
||||
|
||||
return uuids;
|
||||
}
|
||||
|
||||
public void insert(String index, String column, Object value, DataType dataType) {
|
||||
insertQuery(index, Arrays.asList(new Column(column, value, dataType)));
|
||||
}
|
||||
|
||||
public void insertQuery(String index, List<Column> cols) {
|
||||
String query = "INSERT " + getName() + " ";
|
||||
|
||||
query += "set uuid='" + index + "', ";
|
||||
|
||||
for (int i = 0; i < cols.size(); i++) {
|
||||
Column col = cols.get(i);
|
||||
if (i == cols.size() - 1) {
|
||||
query += col.getName() + "='" + col.getValue().toString() + "';";
|
||||
} else {
|
||||
query += col.getName() + "='" + col.getValue().toString() + "', ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
uuids.add(index);
|
||||
new Query(mysql, query).executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isIntColumn(String key) {
|
||||
return intColumns.contains(key);
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
columns = getColumnsQueury();
|
||||
}
|
||||
|
||||
public void update(String index, List<Column> cols, boolean queue) {
|
||||
for (Column col : cols) {
|
||||
checkColumn(col.getName(), col.getDataType());
|
||||
}
|
||||
if (getUuids().contains(index)) {
|
||||
synchronized (object2) {
|
||||
|
||||
String query = "UPDATE " + getName() + " SET ";
|
||||
|
||||
for (int i = 0; i < cols.size(); i++) {
|
||||
Column col = cols.get(i);
|
||||
if (i == cols.size() - 1) {
|
||||
if (col.getDataType().equals(DataType.STRING)) {
|
||||
query += col.getName() + "='" + col.getValue().toString() + "';";
|
||||
} else {
|
||||
query += col.getName() + "=" + col.getValue().toString() + ";";
|
||||
}
|
||||
} else {
|
||||
if (col.getDataType().equals(DataType.STRING)) {
|
||||
query += col.getName() + "='" + col.getValue().toString() + "', ";
|
||||
} else {
|
||||
query += col.getName() + "=" + col.getValue().toString() + ", ";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
query += " WHERE `uuid`=";
|
||||
query += "'" + index + "';";
|
||||
|
||||
try {
|
||||
Query q = new Query(mysql, query);
|
||||
q.executeUpdateAsync();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
insertQuery(index, cols);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(String index, String column, Object value, DataType dataType) {
|
||||
checkColumn(column, dataType);
|
||||
if (getUuids().contains(index)) {
|
||||
synchronized (object2) {
|
||||
String query = "UPDATE " + getName() + " SET ";
|
||||
|
||||
if (dataType == DataType.STRING) {
|
||||
query += column + "='" + value.toString() + "'";
|
||||
} else {
|
||||
query += column + "=" + value;
|
||||
|
||||
}
|
||||
query += " WHERE `uuid`=";
|
||||
query += "'" + index + "';";
|
||||
|
||||
try {
|
||||
Query q = new Query(mysql, query);
|
||||
q.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
insert(index, column, value, dataType);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,30 +21,66 @@ public class Config {
|
||||
this.bungee = bungee;
|
||||
}
|
||||
|
||||
public List<String> getBlockedServers() {
|
||||
return getData().getStringList("BlockedServers");
|
||||
public String getRedisHost() {
|
||||
return getData().getString("Redis.Host", "");
|
||||
}
|
||||
|
||||
public boolean getBroadcast() {
|
||||
return getData().getBoolean("Broadcast", false);
|
||||
public int getRedisPort() {
|
||||
return getData().getInt("Redis.Port", 6379);
|
||||
}
|
||||
|
||||
public boolean getWaitForUserOnline() {
|
||||
return getData().getBoolean("WaitForUserOnline", false);
|
||||
public String getRedisUsername() {
|
||||
return getData().getString("Redis.Username", "");
|
||||
}
|
||||
|
||||
public boolean getBungeeManageTotals() {
|
||||
return getData().getBoolean("BungeeManageTotals", true);
|
||||
public String getRedisPrefix() {
|
||||
return getData().getString("Redis.Prefix", "");
|
||||
}
|
||||
|
||||
public String getRedisPassword() {
|
||||
return getData().getString("Redis.Password", "");
|
||||
}
|
||||
|
||||
public boolean getAllowUnJoined() {
|
||||
return getData().getBoolean("AllowUnJoined", false);
|
||||
}
|
||||
|
||||
public List<String> getBlockedServers() {
|
||||
return getData().getStringList("BlockedServers");
|
||||
}
|
||||
|
||||
public List<String> getWhiteListedServers() {
|
||||
return getData().getStringList("WhiteListedServers");
|
||||
}
|
||||
|
||||
public boolean getBroadcast() {
|
||||
return getData().getBoolean("Broadcast", false);
|
||||
}
|
||||
|
||||
public String getBedrockPlayerPrefix() {
|
||||
return getData().getString("BedrockPlayerPrefix", ".");
|
||||
}
|
||||
|
||||
public boolean getOnlineMode() {
|
||||
return getData().getBoolean("OnlineMode", true);
|
||||
}
|
||||
|
||||
public boolean getGlobalDataEnabled() {
|
||||
return getData().getBoolean("GlobalData.Enabled", false);
|
||||
}
|
||||
|
||||
public boolean getGlobalDataUseMainMySQL() {
|
||||
return getData().getBoolean("GlobalData.UseMainMySQL", true);
|
||||
}
|
||||
|
||||
public String getBungeeHost() {
|
||||
return getData().getString("BungeeServer.Host", "");
|
||||
}
|
||||
|
||||
public boolean getBungeeManageTotals() {
|
||||
return getData().getBoolean("BungeeManageTotals", true);
|
||||
}
|
||||
|
||||
public String getBungeeMethod() {
|
||||
return getData().getString("BungeeMethod", "SOCKETS");
|
||||
}
|
||||
@@ -57,10 +93,46 @@ public class Config {
|
||||
return getData().getBoolean("Debug", false);
|
||||
}
|
||||
|
||||
public boolean getMultiProxySupport() {
|
||||
return getData().getBoolean("MultiProxySupport", false);
|
||||
}
|
||||
|
||||
public int getMaxAmountOfVotesPerDay() {
|
||||
return getData().getInt("MaxAmountOfVotesPerDay", -1);
|
||||
}
|
||||
|
||||
public int getMultiProxySocketHostPort() {
|
||||
return getData().getInt("MultiProxySocketHost.Port", 1297);
|
||||
}
|
||||
|
||||
public String getMultiProxySocketHostHost() {
|
||||
return getData().getString("MultiProxySocketHost.Host", "");
|
||||
}
|
||||
|
||||
public boolean getMultiProxyOneGlobalReward() {
|
||||
return getData().getBoolean("MultiProxyOneGlobalReward", false);
|
||||
}
|
||||
|
||||
public Configuration getMultiProxyServersConfiguration(String s) {
|
||||
return getData().getSection("MultiProxyServers." + s);
|
||||
}
|
||||
|
||||
public Collection<String> getMultiProxyServers() {
|
||||
return getData().getSection("MultiProxyServers").getKeys();
|
||||
}
|
||||
|
||||
public boolean getPrimaryServer() {
|
||||
return getData().getBoolean("PrimaryServer", false);
|
||||
}
|
||||
|
||||
public String getFallBack() {
|
||||
return getData().getString("FallBackServer", "");
|
||||
}
|
||||
|
||||
public int getPointsOnVote() {
|
||||
return getData().getInt("PointsOnVote", 1);
|
||||
}
|
||||
|
||||
public boolean getSendVotesToAllServers() {
|
||||
return getData().getBoolean("SendVotesToAllServers");
|
||||
}
|
||||
@@ -73,6 +145,74 @@ public class Config {
|
||||
return getData().getSection("SpigotServers").getKeys();
|
||||
}
|
||||
|
||||
public boolean getWaitForUserOnline() {
|
||||
return getData().getBoolean("WaitForUserOnline", false);
|
||||
}
|
||||
|
||||
public boolean getVotePartyEnabled() {
|
||||
return getData().getBoolean("VoteParty.Enabled", false);
|
||||
}
|
||||
|
||||
public boolean getVotePartySendToAllServers() {
|
||||
return getData().getBoolean("VoteParty.SendToAllServers", true);
|
||||
}
|
||||
|
||||
public int getVotePartyVotesRequired() {
|
||||
return getData().getInt("VoteParty.VotesRequired", 100);
|
||||
}
|
||||
|
||||
public int getVotePartyIncreaseVotesRequired() {
|
||||
return getData().getInt("VoteParty.IncreaseVotesRequired", 0);
|
||||
}
|
||||
|
||||
public int getVoteCacheTime() {
|
||||
return getData().getInt("VoteCacheTime", -1);
|
||||
}
|
||||
|
||||
public String getVotePartyBroadcast() {
|
||||
return getData().getString("VoteParty.Broadcast", "");
|
||||
}
|
||||
|
||||
public String getMultiProxyMethod() {
|
||||
return getData().getString("MultiProxyMethod", "SOCKET");
|
||||
}
|
||||
|
||||
public String getProxyServerName() {
|
||||
return getData().getString("ProxyServerName", "SOCKET");
|
||||
}
|
||||
|
||||
public List<String> getProxyServers() {
|
||||
return getData().getStringList("ProxyServers");
|
||||
}
|
||||
|
||||
public boolean getMultiProxyRedisUseExistingConnection() {
|
||||
return getData().getBoolean("MultiProxyRedis.UseExistingConnection", false);
|
||||
}
|
||||
|
||||
public List<String> getVotePartyServersToSend() {
|
||||
return getData().getStringList("VoteParty.ServersToSend");
|
||||
}
|
||||
|
||||
public List<String> getVotePartyBungeeCommands() {
|
||||
return getData().getStringList("VoteParty.BungeeCommands");
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisHost() {
|
||||
return getData().getString("MultiProxyRedis.Host", "");
|
||||
}
|
||||
|
||||
public int getMultiProxyRedisPort() {
|
||||
return getData().getInt("MultiProxyRedis.Port", 6379);
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisUsername() {
|
||||
return getData().getString("MultiProxyRedis.Username", "");
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisPassword() {
|
||||
return getData().getString("MultiProxyRedis.Password", "");
|
||||
}
|
||||
|
||||
public void load() {
|
||||
if (!bungee.getDataFolder().exists()) {
|
||||
bungee.getDataFolder().mkdir();
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.Getter;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.JsonConfiguration;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
|
||||
public class NonVotedPlayersCache {
|
||||
@@ -24,21 +25,16 @@ public class NonVotedPlayersCache {
|
||||
}
|
||||
}
|
||||
|
||||
private void addPlayer(String uuid, String playerName) {
|
||||
public void addPlayer(String uuid, String playerName) {
|
||||
getData().set("NonVotedPlayers." + playerName + ".UUID", uuid);
|
||||
getData().set("NonVotedPlayers." + playerName + ".LastTime", System.currentTimeMillis());
|
||||
save();
|
||||
}
|
||||
|
||||
public String playerExists(String playerName) {
|
||||
if (getData().getSection("NonVotedPlayers").getKeys().contains(playerName)) {
|
||||
return getData().getString("NonVotedPlayers." + playerName + ".UUID", "");
|
||||
public void addPlayerCheck(String uuid, String playerName) {
|
||||
if (!bungee.getMysql().containsKeyQuery(uuid)) {
|
||||
addPlayer(uuid, playerName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void remove(String player) {
|
||||
bungee.debug("Removing nonvotedplayer: " + player);
|
||||
getData().set("NonVotedPlayers." + player, null);
|
||||
}
|
||||
|
||||
public void check() {
|
||||
@@ -65,7 +61,8 @@ public class NonVotedPlayersCache {
|
||||
bungee.getDataFolder().mkdir();
|
||||
}
|
||||
|
||||
File file = new File(bungee.getDataFolder(), "nonvotedplayerscache.yml");
|
||||
File yamlFile = new File(bungee.getDataFolder(), "nonvotedplayerscache.yml");
|
||||
File file = new File(bungee.getDataFolder(), "nonvotedplayerscache.json");
|
||||
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
@@ -74,18 +71,45 @@ public class NonVotedPlayersCache {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (yamlFile.exists()) {
|
||||
try {
|
||||
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "nonvotedplayerscache.yml"));
|
||||
yamlFile.renameTo(new File(bungee.getDataFolder(), "oldnonvotedplayerscache.yml"));
|
||||
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "oldnonvotedplayerscache.yml"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
try {
|
||||
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "nonvotedplayerscache.yml"));
|
||||
data = ConfigurationProvider.getProvider(JsonConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "nonvotedplayerscache.json"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String playerExists(String playerName) {
|
||||
if (getData().getSection("NonVotedPlayers").getKeys().contains(playerName)) {
|
||||
return getData().getString("NonVotedPlayers." + playerName + ".UUID", "");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void remove(String player) {
|
||||
bungee.debug("Removing nonvotedplayer: " + player);
|
||||
getData().set("NonVotedPlayers." + player, null);
|
||||
}
|
||||
|
||||
public void save() {
|
||||
try {
|
||||
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "nonvotedplayerscache.yml"));
|
||||
ConfigurationProvider.getProvider(JsonConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "nonvotedplayerscache.json"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -4,9 +4,12 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.bencodez.votingplugin.timequeue.VoteTimeQueue;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.JsonConfiguration;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
|
||||
public class VoteCache {
|
||||
@@ -18,6 +21,30 @@ public class VoteCache {
|
||||
this.bungee = bungee;
|
||||
}
|
||||
|
||||
public int getVotePartyCurrentVotes() {
|
||||
return getData().getInt("VoteParty.CurrentVotes", 0);
|
||||
}
|
||||
|
||||
public int getVotePartyInreaseVotesRequired() {
|
||||
return getData().getInt("VoteParty.IncreaseVotes", 0);
|
||||
}
|
||||
|
||||
public void setVotePartyCurrentVotes(int amount) {
|
||||
getData().set("VoteParty.CurrentVotes", amount);
|
||||
}
|
||||
|
||||
public void setVotePartyInreaseVotesRequired(int amount) {
|
||||
getData().set("VoteParty.IncreaseVotes", amount);
|
||||
}
|
||||
|
||||
public void setVotePartyCache(String server, int amount) {
|
||||
getData().set("VoteParty.Cache." + server, amount);
|
||||
}
|
||||
|
||||
public int getVotePartyCache(String server) {
|
||||
return getData().getInt("VoteParty.Cache." + server, 0);
|
||||
}
|
||||
|
||||
public void addVote(String server, int num, OfflineBungeeVote voteData) {
|
||||
Configuration section = getData().getSection("VoteCache." + server + "." + num);
|
||||
section.set("Name", voteData.getPlayerName());
|
||||
@@ -26,7 +53,13 @@ public class VoteCache {
|
||||
section.set("Time", voteData.getTime());
|
||||
section.set("Real", voteData.isRealVote());
|
||||
section.set("Text", voteData.getText());
|
||||
save();
|
||||
}
|
||||
|
||||
public void addTimedVote(int num, VoteTimeQueue voteTimedQueue) {
|
||||
Configuration section = getData().getSection("TimedVoteCache." + num);
|
||||
section.set("Name", voteTimedQueue.getName());
|
||||
section.set("Service", voteTimedQueue.getService());
|
||||
section.set("Time", voteTimedQueue.getTime());
|
||||
}
|
||||
|
||||
public void addVoteOnline(String player, int num, OfflineBungeeVote voteData) {
|
||||
@@ -37,7 +70,6 @@ public class VoteCache {
|
||||
section.set("Time", voteData.getTime());
|
||||
section.set("Real", voteData.isRealVote());
|
||||
section.set("Text", voteData.getText());
|
||||
save();
|
||||
}
|
||||
|
||||
public void clearData() {
|
||||
@@ -62,6 +94,14 @@ public class VoteCache {
|
||||
return getData().getSection("VoteCache").getKeys();
|
||||
}
|
||||
|
||||
public Configuration getTimedVoteCache(String key) {
|
||||
return getData().getSection("TimedVoteCache." + key);
|
||||
}
|
||||
|
||||
public Collection<String> getTimedVoteCache() {
|
||||
return getData().getSection("TimedVoteCache").getKeys();
|
||||
}
|
||||
|
||||
public Collection<String> getServerVotes(String server) {
|
||||
return getData().getSection("VoteCache." + server).getKeys();
|
||||
}
|
||||
@@ -75,7 +115,9 @@ public class VoteCache {
|
||||
bungee.getDataFolder().mkdir();
|
||||
}
|
||||
|
||||
File file = new File(bungee.getDataFolder(), "votecache.yml");
|
||||
File yamlFile = new File(bungee.getDataFolder(), "votecache.yml");
|
||||
|
||||
File file = new File(bungee.getDataFolder(), "votecache.json");
|
||||
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
@@ -84,9 +126,23 @@ public class VoteCache {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (yamlFile.exists()) {
|
||||
try {
|
||||
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "votecache.yml"));
|
||||
yamlFile.renameTo(new File(bungee.getDataFolder(), "oldvotecache.yml"));
|
||||
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "oldvotecache.yml"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
try {
|
||||
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "votecache.yml"));
|
||||
data = ConfigurationProvider.getProvider(JsonConfiguration.class)
|
||||
.load(new File(bungee.getDataFolder(), "votecache.json"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -94,8 +150,8 @@ public class VoteCache {
|
||||
|
||||
public void save() {
|
||||
try {
|
||||
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "votecache.yml"));
|
||||
ConfigurationProvider.getProvider(JsonConfiguration.class).save(data,
|
||||
new File(bungee.getDataFolder(), "votecache.json"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -14,10 +14,24 @@ public class VoteEventBungee implements net.md_5.bungee.api.plugin.Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onVote(VotifierEvent event) {
|
||||
Vote vote = event.getVote();
|
||||
plugin.getLogger().info("Vote received " + vote.getUsername() + " from service site " + vote.getServiceName());
|
||||
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
|
||||
|
||||
plugin.vote(vote.getUsername(), vote.getServiceName(), true);
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void run() {
|
||||
Vote vote = event.getVote();
|
||||
String serviceSite = vote.getServiceName();
|
||||
plugin.getLogger().info("Vote received " + vote.getUsername() + " from service site " + serviceSite);
|
||||
|
||||
if (serviceSite.isEmpty()) {
|
||||
serviceSite = "Empty";
|
||||
vote.setServiceName(serviceSite);
|
||||
}
|
||||
|
||||
plugin.vote(vote.getUsername(), serviceSite, true, true, 0, null, null);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,7 @@
|
||||
package com.bencodez.votingplugin.bungee;
|
||||
|
||||
import com.bencodez.advancedcore.api.time.TimeType;
|
||||
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
@@ -17,40 +19,97 @@ public class VotingPluginBungeeCommand extends Command {
|
||||
if (sender.hasPermission("votingplugin.admin")) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
bungee.reload();
|
||||
bungee.reload(false);
|
||||
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee"));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("reloadmysql")) {
|
||||
bungee.reload(true);
|
||||
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee with MySQL"));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("vote")) {
|
||||
if (args.length >= 2) {
|
||||
String user = args[1];
|
||||
String site = args[2];
|
||||
bungee.vote(user, site, false);
|
||||
bungee.vote(user, site, false, true, 0, null, null);
|
||||
sender.sendMessage(new TextComponent("Sending vote"));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("forcetimechange")) {
|
||||
if (args.length >= 2) {
|
||||
bungee.getBungeeTimeChecker().forceChanged(TimeType.getTimeType(args[1]));
|
||||
sender.sendMessage(new TextComponent("Triggering time change: " + args[1]));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("status")) {
|
||||
if (bungee.getMethod().equals(BungeeMethod.SOCKETS)) {
|
||||
sender.sendMessage(new TextComponent(
|
||||
"Checking status, waiting for response, check console, method: sockets"));
|
||||
"&aChecking status, waiting for response, check console, method: sockets"));
|
||||
bungee.status(sender);
|
||||
} else if (bungee.getMethod().equals(BungeeMethod.PLUGINMESSAGING)){
|
||||
} else if (bungee.getMethod().equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
sender.sendMessage(new TextComponent(
|
||||
"Checking status, waiting for response, check console, method: plugin messaging"));
|
||||
"&aChecking status, waiting for response, check console, method: plugin messaging"));
|
||||
bungee.status(sender);
|
||||
bungee.sendServerNameMessage();
|
||||
} else if (bungee.getMethod().equals(BungeeMethod.REDIS)) {
|
||||
sender.sendMessage(new TextComponent(
|
||||
"&aChecking status, waiting for response, check console, method: redis"));
|
||||
bungee.status(sender);
|
||||
bungee.sendServerNameMessage();
|
||||
} else {
|
||||
sender.sendMessage(new TextComponent("Not using socket/pluginmessage method, command unavailable"));
|
||||
sender.sendMessage(
|
||||
new TextComponent("&aNot using socket/pluginmessage/redis method, command unavailable"));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("multiproxystatus")) {
|
||||
bungee.getMultiProxyHandler().sendMultiProxyServerMessage("Status");
|
||||
sender.sendMessage(new TextComponent("Sending status message"));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
TextComponent[] msg = new TextComponent[3];
|
||||
TextComponent[] msg = new TextComponent[7];
|
||||
msg[0] = new TextComponent("&avotingpluginbungee reload - Reload plugin");
|
||||
msg[1] = new TextComponent("&avotingpluginbungee vote (player) (servicesite) - Send bungee vote");
|
||||
msg[2] = new TextComponent("&avotingplugin status - Check socket connection status");
|
||||
msg[1] = new TextComponent("&avotingpluginbungee reloadmysql - Reload plugin including mysql");
|
||||
msg[2] = new TextComponent("&avotingpluginbungee vote (player) (servicesite) - Send bungee vote");
|
||||
msg[3] = new TextComponent("&avotingpluginbungee status - Check socket connection status");
|
||||
msg[4] = new TextComponent("&avotingpluginbungee forcetimechange (timetype) - Force a time change");
|
||||
msg[5] = new TextComponent("&avotingpluginbungee voteparty force - Force a vote party");
|
||||
msg[6] = new TextComponent(
|
||||
"&avotingpluginbungee voteparty setvotecount (number) - Set current vote party votes");
|
||||
sender.sendMessage(msg);
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("voteparty")) {
|
||||
if (args.length > 1) {
|
||||
if (args[1].equalsIgnoreCase("Force")) {
|
||||
bungee.setCurrentVotePartyVotes(bungee.getCurrentVotePartyVotesRequired());
|
||||
bungee.checkVoteParty();
|
||||
sender.sendMessage(new TextComponent("Vote party forced"));
|
||||
}
|
||||
if (args.length > 2) {
|
||||
if (args[1].equalsIgnoreCase("SetVoteCount")) {
|
||||
if (isInt(args[2])) {
|
||||
bungee.setCurrentVotePartyVotes(Integer.parseInt(args[2]));
|
||||
sender.sendMessage(new TextComponent("Set current vote party votes to " + args[2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(new TextComponent("You do not have permission to do this!"));
|
||||
sender.sendMessage(new TextComponent("&cYou do not have permission to do this!"));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isInt(String st) {
|
||||
if (st == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@SuppressWarnings("unused")
|
||||
int num = Integer.parseInt(st);
|
||||
return true;
|
||||
|
||||
} catch (NumberFormatException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
package com.bencodez.votingplugin.bungee.global.multiproxy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.redis.RedisHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.redis.RedisListener;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.ClientHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.SocketHandler;
|
||||
import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver;
|
||||
import com.bencodez.votingplugin.bungee.BungeeMessageData;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class MultiProxyHandler {
|
||||
public abstract boolean getMultiProxySupportEnabled();
|
||||
|
||||
public abstract EncryptionHandler getEncryptionHandler();
|
||||
|
||||
public abstract File getPluginDataFolder();
|
||||
|
||||
public abstract void setEncryptionHandler(EncryptionHandler encryptionHandler);
|
||||
|
||||
public abstract void logInfo(String msg);
|
||||
|
||||
public abstract boolean getDebug();
|
||||
|
||||
public abstract String getVersion();
|
||||
|
||||
private HashMap<String, ClientHandler> multiproxyClientHandles;
|
||||
|
||||
private SocketHandler multiproxySocketHandler;
|
||||
|
||||
@Getter
|
||||
private RedisHandler multiProxyRedis;
|
||||
|
||||
public MultiProxyHandler() {
|
||||
|
||||
}
|
||||
|
||||
public void sendMultiProxyServerMessage(String... messageData) {
|
||||
if (getMultiProxyMethod().equals(MultiProxyMethod.SOCKETS)) {
|
||||
for (ClientHandler h : multiproxyClientHandles.values()) {
|
||||
h.sendMessage(messageData);
|
||||
}
|
||||
} else if (getMultiProxyMethod().equals(MultiProxyMethod.REDIS)) {
|
||||
for (String server : getProxyServers()) {
|
||||
multiProxyRedis.sendMessage("VotingPluginProxy_" + server, messageData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract List<String> getProxyServers();
|
||||
|
||||
public void close() {
|
||||
if (multiproxySocketHandler != null) {
|
||||
multiproxySocketHandler.closeConnection();
|
||||
multiproxySocketHandler = null;
|
||||
}
|
||||
if (multiProxyRedis != null && !getMultiProxyRedisUseExistingConnection()) {
|
||||
multiProxyRedis.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadMultiProxySupport() {
|
||||
if (getMultiProxySupportEnabled()) {
|
||||
if (getMultiProxyMethod().equals(MultiProxyMethod.SOCKETS)) {
|
||||
if (getEncryptionHandler() == null) {
|
||||
setEncryptionHandler(new EncryptionHandler(new File(getPluginDataFolder(), "secretkey.key")));
|
||||
}
|
||||
|
||||
if (multiproxySocketHandler != null) {
|
||||
multiproxySocketHandler.closeConnection();
|
||||
multiproxySocketHandler = null;
|
||||
}
|
||||
multiproxySocketHandler = new SocketHandler(getVersion(), getMultiProxySocketHostHost(),
|
||||
getMultiProxySocketHostPort(), getEncryptionHandler(), getDebug()) {
|
||||
|
||||
@Override
|
||||
public void log(String str) {
|
||||
logInfo(str);
|
||||
}
|
||||
};
|
||||
|
||||
multiproxySocketHandler.add(new SocketReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(String[] data) {
|
||||
if (data.length > 0) {
|
||||
if (data[0].equalsIgnoreCase("Status")) {
|
||||
logInfo("Multi-proxy status message received");
|
||||
} else if (data[0].equalsIgnoreCase("ClearVote")) {
|
||||
clearVote(data[2]);
|
||||
if (getPrimaryServer()) {
|
||||
sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]);
|
||||
}
|
||||
} else if (data[0].equalsIgnoreCase("ClearVotePrimary")) {
|
||||
clearVote(data[2]);
|
||||
} else if (data[0].equalsIgnoreCase("login")) {
|
||||
addNonVotedPlayerCache(data[1], data[2]);
|
||||
// nonVotedPlayersCache.addPlayer(data[1], data[2]);
|
||||
}
|
||||
}
|
||||
if (data.length > 8) {
|
||||
if (data[0].equalsIgnoreCase("Vote")) {
|
||||
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
|
||||
new BungeeMessageData(data[8]), data[1]);
|
||||
} else if (data[0].equalsIgnoreCase("VoteOnline")) {
|
||||
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
|
||||
new BungeeMessageData(data[8]), data[1]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
multiproxyClientHandles = new HashMap<String, ClientHandler>();
|
||||
for (String s : getMultiProxyServers()) {
|
||||
MultiProxyServerSocketConfiguration d = getMultiProxyServersConfiguration(s);
|
||||
multiproxyClientHandles.put(s,
|
||||
new ClientHandler(d.getHost(), d.getPort(), getEncryptionHandler(), getDebug()));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (getMultiProxyRedisUseExistingConnection() && getRedisHandler() != null) {
|
||||
multiProxyRedis = getRedisHandler();
|
||||
} else {
|
||||
multiProxyRedis = new RedisHandler(getMultiProxyRedisHost(), getMultiProxyRedisPort(),
|
||||
getMultiProxyUsername(), getMultiProxyPassword()) {
|
||||
|
||||
@Override
|
||||
public void onMessage(String channel, String[] data) {
|
||||
if (data.length > 0) {
|
||||
if (data[0].equalsIgnoreCase("Status")) {
|
||||
logInfo("Multi-proxy status message received");
|
||||
} else if (data[0].equalsIgnoreCase("ClearVote")) {
|
||||
clearVote(data[2]);
|
||||
if (getPrimaryServer()) {
|
||||
sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]);
|
||||
}
|
||||
} else if (data[0].equalsIgnoreCase("ClearVotePrimary")) {
|
||||
clearVote(data[2]);
|
||||
} else if (data[0].equalsIgnoreCase("login")) {
|
||||
addNonVotedPlayerCache(data[1], data[2]);
|
||||
// nonVotedPlayersCache.addPlayer(data[1], data[2]);
|
||||
}
|
||||
}
|
||||
if (data.length > 8) {
|
||||
if (data[0].equalsIgnoreCase("Vote")) {
|
||||
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
|
||||
new BungeeMessageData(data[8]), data[1]);
|
||||
} else if (data[0].equalsIgnoreCase("VoteOnline")) {
|
||||
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
|
||||
new BungeeMessageData(data[8]), data[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String message) {
|
||||
if (getDebug()) {
|
||||
logInfo("MultiProxyRedis: " + message);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
runAsnc(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
multiProxyRedis.loadListener(
|
||||
new RedisListener(multiProxyRedis, "VotingPluginProxy_" + getMultiProxyServerName()));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
logInfo("Loaded multi-proxy support: " + getMultiProxyMethod().toString());
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void runAsnc(Runnable runnable);
|
||||
|
||||
public abstract MultiProxyMethod getMultiProxyMethod();
|
||||
|
||||
public abstract RedisHandler getRedisHandler();
|
||||
|
||||
public abstract boolean getMultiProxyRedisUseExistingConnection();
|
||||
|
||||
public abstract String getMultiProxyPassword();
|
||||
|
||||
public abstract String getMultiProxyUsername();
|
||||
|
||||
public abstract String getMultiProxyServerName();
|
||||
|
||||
public abstract int getMultiProxyRedisPort();
|
||||
|
||||
public abstract String getMultiProxyRedisHost();
|
||||
|
||||
public abstract boolean getPrimaryServer();
|
||||
|
||||
public void login(String uuid, String playerName) {
|
||||
if (!getMultiProxySupportEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (getPrimaryServer()) {
|
||||
return;
|
||||
}
|
||||
sendMultiProxyServerMessage("Login", uuid, playerName);
|
||||
}
|
||||
|
||||
public abstract int getMultiProxySocketHostPort();
|
||||
|
||||
public abstract String getMultiProxySocketHostHost();
|
||||
|
||||
public abstract MultiProxyServerSocketConfiguration getMultiProxyServersConfiguration(String s);
|
||||
|
||||
public abstract Collection<String> getMultiProxyServers();
|
||||
|
||||
public abstract void triggerVote(String player, String service, boolean realVote, boolean timeQueue, long queueTime,
|
||||
BungeeMessageData text, String uuid);
|
||||
|
||||
public abstract void addNonVotedPlayerCache(String string, String string2);
|
||||
|
||||
public abstract void clearVote(String string);
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bencodez.votingplugin.bungee.global.multiproxy;
|
||||
|
||||
public enum MultiProxyMethod {
|
||||
SOCKETS, REDIS;
|
||||
|
||||
public static MultiProxyMethod getByName(String str) {
|
||||
for (MultiProxyMethod method : values()) {
|
||||
if (method.toString().equalsIgnoreCase(str)) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
return MultiProxyMethod.SOCKETS;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bencodez.votingplugin.bungee.global.multiproxy;
|
||||
|
||||
public interface MultiProxyServerSocketConfiguration {
|
||||
String getServerName();
|
||||
|
||||
String getHost();
|
||||
|
||||
int getPort();
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bencodez.votingplugin.bungee.global.multiproxy;
|
||||
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
|
||||
public class MultiProxyServerSocketConfigurationBungee implements MultiProxyServerSocketConfiguration {
|
||||
private String server;
|
||||
private String host;
|
||||
private int port;
|
||||
|
||||
public MultiProxyServerSocketConfigurationBungee(String s, Configuration config) {
|
||||
server = s;
|
||||
host = config.getString("Host", "");
|
||||
port = config.getInt("Port", 1234);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServerName() {
|
||||
return server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.bencodez.votingplugin.bungee.global.multiproxy;
|
||||
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
|
||||
public class MultiProxyServerSocketConfigurationVelocity implements MultiProxyServerSocketConfiguration {
|
||||
|
||||
private String server;
|
||||
private String host;
|
||||
private int port;
|
||||
|
||||
public MultiProxyServerSocketConfigurationVelocity(String s, ConfigurationNode config) {
|
||||
server = s;
|
||||
host = config.getNode("Host").getString("0.0.0.0");
|
||||
port = config.getNode("Port").getInt(1298);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServerName() {
|
||||
return server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import com.bencodez.advancedcore.bungeeapi.velocity.VelocityYMLFile;
|
||||
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
|
||||
public class Config extends VelocityYMLFile {
|
||||
|
||||
public Config(File file) {
|
||||
super(file);
|
||||
}
|
||||
|
||||
public boolean getAllowUnJoined() {
|
||||
return getBoolean(getNode("AllowUnJoined"), false);
|
||||
}
|
||||
|
||||
public List<String> getBlockedServers() {
|
||||
return getStringList(getNode("BlockedServers"), new ArrayList<String>());
|
||||
}
|
||||
|
||||
public List<String> getWhiteListedServers() {
|
||||
return getStringList(getNode("WhiteListedServers"), new ArrayList<String>());
|
||||
}
|
||||
|
||||
public boolean getBroadcast() {
|
||||
return getBoolean(getNode("Broadcast"), false);
|
||||
}
|
||||
|
||||
public boolean getOnlineMode() {
|
||||
return getBoolean(getNode("OnlineMode"), true);
|
||||
}
|
||||
|
||||
public boolean getGlobalDataEnabled() {
|
||||
return getBoolean(getNode("GlobalData", "Enabled"), false);
|
||||
}
|
||||
|
||||
public boolean getGlobalDataUseMainMySQL() {
|
||||
return getBoolean(getNode("GlobalData", "UseMainMySQL"), true);
|
||||
}
|
||||
|
||||
public boolean getBungeeManageTotals() {
|
||||
return getBoolean(getNode("BungeeManageTotals"), true);
|
||||
}
|
||||
|
||||
public String getBungeeMethod() {
|
||||
return getString(getNode("BungeeMethod"), "PLUGINMESSAGING");
|
||||
}
|
||||
|
||||
public String getRedisHost() {
|
||||
return getString(getNode("Redis", "Host"), "");
|
||||
}
|
||||
|
||||
public int getRedisPort() {
|
||||
return getInt(getNode("Redis", "Port"), 6379);
|
||||
}
|
||||
|
||||
public String getRedisUsername() {
|
||||
return getString(getNode("Redis", "Username"), "");
|
||||
}
|
||||
|
||||
public String getRedisPrefix() {
|
||||
return getString(getNode("Redis", "Prefix"), "");
|
||||
}
|
||||
|
||||
public String getRedisPassword() {
|
||||
return getString(getNode("Redis", "Password"), "");
|
||||
}
|
||||
|
||||
public String getBungeeHost() {
|
||||
return getString(getNode("BungeeServer", "Host"), "");
|
||||
}
|
||||
|
||||
public int getBungeePort() {
|
||||
return getInt(getNode("BungeeServer", "Port"), 1297);
|
||||
}
|
||||
|
||||
public int getMaxAmountOfVotesPerDay() {
|
||||
return getInt(getNode("MaxAmountOfVotesPerDay"), -1);
|
||||
}
|
||||
|
||||
public int getVoteCacheTime() {
|
||||
return getInt(getNode("VoteCacheTime"), -1);
|
||||
}
|
||||
|
||||
public boolean getDebug() {
|
||||
return getBoolean(getNode("Debug"), false);
|
||||
}
|
||||
|
||||
public String getFallBack() {
|
||||
return getString(getNode("FallBackServer"), "");
|
||||
}
|
||||
|
||||
public ConfigurationNode getMysqlNode() {
|
||||
return getNode("MySQL");
|
||||
}
|
||||
|
||||
public int getPointsOnVote() {
|
||||
return getInt(getNode("PointsOnVote"), 1);
|
||||
}
|
||||
|
||||
public boolean getSendVotesToAllServers() {
|
||||
return getBoolean(getNode("SendVotesToAllServers"), true);
|
||||
}
|
||||
|
||||
public boolean getVotePartyEnabled() {
|
||||
return getBoolean(getVotePartyNode().getNode("Enabled"), false);
|
||||
}
|
||||
|
||||
public ConfigurationNode getVotePartyNode() {
|
||||
return getNode("VoteParty");
|
||||
}
|
||||
|
||||
public boolean getVotePartySendToAllServers() {
|
||||
return getBoolean(getVotePartyNode().getNode("SendToAllServers"), false);
|
||||
}
|
||||
|
||||
public int getVotePartyVotesRequired() {
|
||||
return getInt(getVotePartyNode().getNode("VotesRequired"), 100);
|
||||
}
|
||||
|
||||
public int getVotePartyIncreaseVotesRequired() {
|
||||
return getInt(getVotePartyNode().getNode("IncreaseVotesRequired"), 0);
|
||||
}
|
||||
|
||||
public String getVotePartyBroadcast() {
|
||||
return getString(getVotePartyNode().getNode("Broadcast"), "");
|
||||
}
|
||||
|
||||
public List<String> getVotePartyServersToSend() {
|
||||
return getStringList(getVotePartyNode().getNode("ServersToSend"), new ArrayList<String>());
|
||||
}
|
||||
|
||||
public List<String> getVotePartyBungeeCommands() {
|
||||
return getStringList(getVotePartyNode().getNode("BungeeCommands"), new ArrayList<String>());
|
||||
}
|
||||
|
||||
public ConfigurationNode getSpigotServerConfiguration(String s) {
|
||||
return getNode("SpigotServers", s);
|
||||
}
|
||||
|
||||
public @NonNull Collection<? extends ConfigurationNode> getSpigotServers() {
|
||||
return getNode("SpigotServers").getChildrenMap().values();
|
||||
}
|
||||
|
||||
public boolean getWaitForUserOnline() {
|
||||
return getBoolean(getNode("WaitForUserOnline"), false);
|
||||
}
|
||||
|
||||
public boolean getMultiProxySupport() {
|
||||
return getBoolean(getNode("MultiProxySupport"), false);
|
||||
}
|
||||
|
||||
public boolean getMultiProxyOneGlobalReward() {
|
||||
return getBoolean(getNode("MultiProxyOneGlobalReward"), false);
|
||||
}
|
||||
|
||||
public boolean getPrimaryServer() {
|
||||
return getBoolean(getNode("PrimaryServer"), false);
|
||||
}
|
||||
|
||||
public String getBedrockPlayerPrefix() {
|
||||
return getString(getNode("BedrockPlayerPrefix"), ".");
|
||||
}
|
||||
|
||||
public ConfigurationNode getMultiProxyServers(String s) {
|
||||
return getNode("MultiProxyServers", s);
|
||||
}
|
||||
|
||||
public @NonNull Collection<? extends ConfigurationNode> getMultiProxyServers() {
|
||||
return getNode("MultiProxyServers").getChildrenMap().values();
|
||||
}
|
||||
|
||||
public String getMultiProxySocketHostHost() {
|
||||
return getString(getNode("MultiProxySocketHost", "Host"), "");
|
||||
}
|
||||
|
||||
public int getMultiProxySocketHostPort() {
|
||||
return getInt(getNode("MultiProxySocketHost", "Port"), 1297);
|
||||
}
|
||||
|
||||
public String getMultiProxyMethod() {
|
||||
return getString(getNode("MultiProxyMethod"), "SOCKET");
|
||||
}
|
||||
|
||||
public String getProxyServerName() {
|
||||
return getString(getNode("ProxyServerName"), "SOCKET");
|
||||
}
|
||||
|
||||
public List<String> getProxyServers() {
|
||||
return getStringList(getNode("ProxyServers"), new ArrayList<String>());
|
||||
}
|
||||
|
||||
public boolean getMultiProxyRedisUseExistingConnection() {
|
||||
return getBoolean(getNode("MultiProxyRedis", "UseExistingConnection"), false);
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisHost() {
|
||||
return getString(getNode("MultiProxyRedis", "Host"), "");
|
||||
}
|
||||
|
||||
public int getMultiProxyRedisPort() {
|
||||
return getInt(getNode("MultiProxyRedis", "Port"), 6379);
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisUsername() {
|
||||
return getString(getNode("MultiProxyRedis", "Username"), "");
|
||||
}
|
||||
|
||||
public String getMultiProxyRedisPassword() {
|
||||
return getString(getNode("MultiProxyRedis", "Password"), "");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.bencodez.advancedcore.bungeeapi.velocity.VelocityJSONFile;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
|
||||
public class NonVotedPlayersCache extends VelocityJSONFile {
|
||||
|
||||
private VotingPluginVelocity plugin;
|
||||
|
||||
public NonVotedPlayersCache(File file, VotingPluginVelocity plugin) {
|
||||
super(file);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void addPlayer(Player player) {
|
||||
if (!plugin.getMysql().containsKeyQuery(player.getUniqueId().toString())) {
|
||||
addPlayer(player.getUniqueId().toString(), player.getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
public void addPlayer(String uuid, String playerName) {
|
||||
getNode("NonVotedPlayers", playerName, "UUID").setValue(uuid);
|
||||
getNode("NonVotedPlayers", playerName, "LastTime").setValue(System.currentTimeMillis());
|
||||
save();
|
||||
}
|
||||
|
||||
public void addPlayerCheck(String uuid, String playerName) {
|
||||
if (!plugin.getMysql().containsKeyQuery(uuid)) {
|
||||
addPlayer(uuid, playerName);
|
||||
}
|
||||
}
|
||||
|
||||
public void check() {
|
||||
for (String player : getKeys(getNode("NonVotedPlayers"))) {
|
||||
long time = getNode("NonVotedPlayers", player, "LastTime").getLong(0);
|
||||
if ((System.currentTimeMillis() - time) > 1000 * 60 * 60 * 24 * 5) {
|
||||
remove(player);
|
||||
} else {
|
||||
String uuid = getNode("NonVotedPlayers", player, "UUID").getString("");
|
||||
if (!uuid.isEmpty()) {
|
||||
if (plugin.getMysql().containsKeyQuery(uuid)) {
|
||||
remove(player);
|
||||
}
|
||||
} else {
|
||||
remove(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
save();
|
||||
}
|
||||
|
||||
public String playerExists(String playerName) {
|
||||
if (!getNode("NonVotedPlayers", playerName).isEmpty()) {
|
||||
return getNode("NonVotedPlayers", playerName, "UUID").getString("");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void remove(String player) {
|
||||
plugin.debug("Removing nonvotedplayer: " + player);
|
||||
|
||||
getNode("NonVotedPlayers", player).setValue(null);
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.bencodez.advancedcore.bungeeapi.velocity.VelocityJSONFile;
|
||||
import com.bencodez.votingplugin.bungee.OfflineBungeeVote;
|
||||
import com.bencodez.votingplugin.timequeue.VoteTimeQueue;
|
||||
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
|
||||
public class VoteCache extends VelocityJSONFile {
|
||||
|
||||
public VoteCache(File file) {
|
||||
super(file);
|
||||
}
|
||||
|
||||
public int getVotePartyCurrentVotes() {
|
||||
return getInt(getNode("VoteParty").getNode("CurrentVotes"), 0);
|
||||
}
|
||||
|
||||
public int getVotePartyInreaseVotesRequired() {
|
||||
return getInt(getNode("VoteParty").getNode("IncreaseVotes"), 0);
|
||||
}
|
||||
|
||||
public void setVotePartyCurrentVotes(int amount) {
|
||||
getNode("VoteParty").getNode("CurrentVotes").setValue(amount);
|
||||
}
|
||||
|
||||
public void setVotePartyInreaseVotesRequired(int amount) {
|
||||
getNode("VoteParty").getNode("IncreaseVotes").setValue(amount);
|
||||
}
|
||||
|
||||
public void setVotePartyCache(String server, int amount) {
|
||||
getNode("VoteParty").getNode("Cache").getNode(server).setValue(amount);
|
||||
}
|
||||
|
||||
public int getVotePartyCache(String server) {
|
||||
return getNode("VoteParty").getNode("Cache").getNode(server).getInt(0);
|
||||
}
|
||||
|
||||
public void addVote(String server, int num, OfflineBungeeVote voteData) {
|
||||
String[] path = new String[] { "VoteCache", server, "" + num };
|
||||
|
||||
getNode(path, "Name").setValue(voteData.getPlayerName());
|
||||
getNode(path, "Service").setValue(voteData.getService());
|
||||
getNode(path, "UUID").setValue(voteData.getUuid());
|
||||
getNode(path, "Time").setValue(voteData.getTime());
|
||||
getNode(path, "Real").setValue(voteData.isRealVote());
|
||||
getNode(path, "Text").setValue(voteData.getText());
|
||||
}
|
||||
|
||||
public void addTimedVote(int num, VoteTimeQueue voteTimedQueue) {
|
||||
String[] path = new String[] { "TimedVoteCache", "" + num };
|
||||
getNode(path, "Name").setValue(voteTimedQueue.getName());
|
||||
getNode(path, "Service").setValue(voteTimedQueue.getService());
|
||||
getNode(path, "Time").setValue(voteTimedQueue.getTime());
|
||||
}
|
||||
|
||||
public void addVoteOnline(String player, int num, OfflineBungeeVote voteData) {
|
||||
String[] path = new String[] { "OnlineCache", player, "" + num };
|
||||
|
||||
getNode(path, "Name").setValue(voteData.getPlayerName());
|
||||
getNode(path, "Service").setValue(voteData.getService());
|
||||
getNode(path, "UUID").setValue(voteData.getUuid());
|
||||
getNode(path, "Time").setValue(voteData.getTime());
|
||||
getNode(path, "Real").setValue(voteData.isRealVote());
|
||||
getNode(path, "Text").setValue(voteData.getText());
|
||||
}
|
||||
|
||||
public void clearData() {
|
||||
getNode("VoteCache").setValue(null);
|
||||
getNode("OnlineCache").setValue(null);
|
||||
save();
|
||||
}
|
||||
|
||||
public Collection<String> getOnlineVotes(String name) {
|
||||
return getKeys(getNode("OnlineCache", name));
|
||||
}
|
||||
|
||||
public ConfigurationNode getTimedVoteCache(String name) {
|
||||
return getNode("TimedVoteCache", name);
|
||||
}
|
||||
|
||||
public ConfigurationNode getOnlineVotes(String name, String num) {
|
||||
return getNode("OnlineCache", name, num);
|
||||
}
|
||||
|
||||
public Collection<String> getPlayers() {
|
||||
return getKeys(getNode("OnlineCache"));
|
||||
}
|
||||
|
||||
public Collection<String> getServers() {
|
||||
return getKeys(getNode("VoteCache"));
|
||||
}
|
||||
|
||||
public Collection<String> getTimedVoteCache() {
|
||||
return getKeys(getNode("TimedVoteCache"));
|
||||
}
|
||||
|
||||
public Collection<String> getServerVotes(String server) {
|
||||
return getKeys(getNode("OnlineCache", server));
|
||||
}
|
||||
|
||||
public ConfigurationNode getServerVotes(String server, String num) {
|
||||
return getNode("VoteCache", server, num);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.vexsoftware.votifier.velocity.event.VotifierEvent;
|
||||
|
||||
public class VoteEventVelocity {
|
||||
private VotingPluginVelocity plugin;
|
||||
|
||||
public VoteEventVelocity(VotingPluginVelocity plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVotifierEvent(VotifierEvent event) {
|
||||
final String serviceSiteVote = event.getVote().getServiceName();
|
||||
final String name = event.getVote().getUsername();
|
||||
plugin.getTimer().execute(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String serviceSite = serviceSiteVote;
|
||||
plugin.getLogger().info("Vote received " + name + " from service site " + serviceSite);
|
||||
if (serviceSite.isEmpty()) {
|
||||
serviceSite = "Empty";
|
||||
}
|
||||
|
||||
plugin.vote(name, serviceSite, true, false, 0, null, null);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||
|
||||
public class VotingPluginChannelIdentifier implements ChannelIdentifier {
|
||||
public VotingPluginChannelIdentifier() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "vp:vp";
|
||||
}
|
||||
|
||||
}
|
||||
+1726
File diff suppressed because it is too large.
Load diff
+127
@@ -0,0 +1,127 @@
|
||||
package com.bencodez.votingplugin.bungee.velocity;
|
||||
|
||||
import com.bencodez.advancedcore.api.time.TimeType;
|
||||
import com.bencodez.votingplugin.bungee.BungeeMethod;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.command.SimpleCommand;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
||||
public class VotingPluginVelocityCommand implements SimpleCommand {
|
||||
private VotingPluginVelocity plugin;
|
||||
|
||||
public VotingPluginVelocityCommand(VotingPluginVelocity plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final Invocation invocation) {
|
||||
CommandSource source = invocation.source();
|
||||
// Get the arguments after the command alias
|
||||
String[] args = invocation.arguments();
|
||||
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
plugin.reload(false);
|
||||
source.sendMessage(Component.text("Reloading VotingPluginBungee").color(NamedTextColor.AQUA));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("reloadmysql")) {
|
||||
plugin.reload(true);
|
||||
source.sendMessage(Component.text("Reloading VotingPluginBungee MySQL").color(NamedTextColor.AQUA));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("vote")) {
|
||||
if (args.length >= 2) {
|
||||
String user = args[1];
|
||||
String site = args[2];
|
||||
plugin.vote(user, site, false, true, 0, null, null);
|
||||
source.sendMessage(Component.text("Sending vote").color(NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("forcetimechange")) {
|
||||
if (args.length >= 2) {
|
||||
plugin.getBungeeTimeChecker().forceChanged(TimeType.getTimeType(args[1]));
|
||||
source.sendMessage(Component.text("Triggering time change: " + args[1]).color(NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("status")) {
|
||||
if (plugin.getMethod().equals(BungeeMethod.SOCKETS)) {
|
||||
source.sendMessage(
|
||||
Component.text("Checking status, waiting for response, check console, method: sockets")
|
||||
.color(NamedTextColor.AQUA));
|
||||
plugin.status();
|
||||
} else if (plugin.getMethod().equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
source.sendMessage(Component
|
||||
.text("Checking status, waiting for response, check console, method: pluginmessaging")
|
||||
.color(NamedTextColor.AQUA));
|
||||
plugin.status();
|
||||
plugin.sendServerNameMessage();
|
||||
} else if (plugin.getMethod().equals(BungeeMethod.REDIS)) {
|
||||
source.sendMessage(
|
||||
Component.text("Checking status, waiting for response, check console, method: redis")
|
||||
.color(NamedTextColor.AQUA));
|
||||
plugin.status();
|
||||
plugin.sendServerNameMessage();
|
||||
} else {
|
||||
source.sendMessage(Component.text("Not using socket/pluginmessage method, command unavailable")
|
||||
.color(NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("multiproxystatus")) {
|
||||
plugin.getMultiProxyHandler().sendMultiProxyServerMessage("Status");
|
||||
|
||||
source.sendMessage(Component.text("Sending status message").color(NamedTextColor.AQUA));
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
String[] msg = new String[7];
|
||||
msg[0] = "votingpluginbungee reload - Reload plugin";
|
||||
msg[1] = "votingpluginbungee reloadmysql - Reload plugin including mysql";
|
||||
msg[2] = "votingpluginbungee vote (player) (servicesite) - Send bungee vote";
|
||||
msg[3] = "votingpluginbungee status - Check socket connection status";
|
||||
msg[4] = "&avotingpluginbungee forcetimechange (timetype) - Force a time change";
|
||||
msg[5] = "&avotingpluginbungee voteparty force - Force a vote party";
|
||||
msg[6] = "&avotingpluginbungee voteparty setvotecount (number) - Set current vote party votes";
|
||||
for (String m : msg) {
|
||||
source.sendMessage(Component.text(m).color(NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("voteparty")) {
|
||||
if (args.length > 1) {
|
||||
if (args[1].equalsIgnoreCase("Force")) {
|
||||
plugin.setCurrentVotePartyVotes(plugin.getCurrentVotePartyVotesRequired());
|
||||
plugin.checkVoteParty();
|
||||
source.sendMessage(Component.text("Vote party forced").color(NamedTextColor.AQUA));
|
||||
}
|
||||
if (args.length > 2) {
|
||||
if (args[1].equalsIgnoreCase("SetVoteCount")) {
|
||||
if (isInt(args[2])) {
|
||||
plugin.setCurrentVotePartyVotes(Integer.parseInt(args[2]));
|
||||
source.sendMessage(Component.text("Set current vote party votes to " + args[2])
|
||||
.color(NamedTextColor.AQUA));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isInt(String st) {
|
||||
if (st == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@SuppressWarnings("unused")
|
||||
int num = Integer.parseInt(st);
|
||||
return true;
|
||||
|
||||
} catch (NumberFormatException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(final Invocation invocation) {
|
||||
return invocation.source().hasPermission("votingpluginbungee.admin");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,11 +1,11 @@
|
||||
package com.bencodez.votingplugin.commands.executers;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.bencodez.advancedcore.api.command.CommandHandler;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
@@ -36,7 +36,7 @@ public class CommandAdminVote implements CommandExecutor {
|
||||
}
|
||||
|
||||
// invalid command
|
||||
sender.sendMessage(ChatColor.RED + "No valid arguments, see /adminvote help!");
|
||||
sender.sendMessage(StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.bencodez.votingplugin.commands.executers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.bencodez.advancedcore.api.command.CommandHandler;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
@@ -91,9 +91,11 @@ public class CommandAliases implements CommandExecutor {
|
||||
|
||||
// invalid command
|
||||
if (adminCommand) {
|
||||
sender.sendMessage(ChatColor.RED + "No valid arguments, see /adminvote help!");
|
||||
sender.sendMessage(
|
||||
StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandAdminVote()));
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.RED + "No valid arguments, see /vote help!");
|
||||
sender.sendMessage(
|
||||
StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandVote()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.bencodez.votingplugin.commands.executers;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.bencodez.advancedcore.api.command.CommandHandler;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
@@ -61,7 +61,7 @@ public class CommandVote implements CommandExecutor {
|
||||
}
|
||||
|
||||
// invalid command
|
||||
sender.sendMessage(ChatColor.RED + "No valid arguments, see /vote help!");
|
||||
sender.sendMessage(StringParser.getInstance().colorize(plugin.getConfigFile().getFormatInvalidCommandVote()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueSt
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.misc.PlayerUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.valuerequest.InputMethod;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequest;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder;
|
||||
import com.bencodez.advancedcore.api.valuerequest.listeners.StringListener;
|
||||
import com.bencodez.advancedcore.api.yml.editor.ConfigEditor;
|
||||
import com.bencodez.advancedcore.command.gui.RewardEditGUI;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.commands.gui.admin.AdminVoteVoteParty;
|
||||
@@ -65,6 +65,7 @@ public class AdminGUI {
|
||||
plugin.getConfigVoteSites().generateVoteSite(value);
|
||||
player.sendMessage("Generated site");
|
||||
plugin.reload();
|
||||
openAdminGUIVoteSiteSite(player, plugin.getVoteSite(value, true));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -109,7 +110,15 @@ public class AdminGUI {
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("FirstVote"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("FirstVote"));
|
||||
}
|
||||
});
|
||||
buttons.add(new BInventoryButton(new ItemBuilder(Material.STONE, 1).setName("&cEdit FirstVoteToday reward")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
plugin.getRewardHandler().getDirectlyDefined("FirstVoteToday"));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -118,25 +127,80 @@ public class AdminGUI {
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("AllSites"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("AllSites"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
buttons.add(new BInventoryButton(new ItemBuilder(Material.STONE, 1).setName("&cEdit AlmostAllSites reward")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
plugin.getRewardHandler().getDirectlyDefined("AlmostAllSites"));
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(new ItemBuilder(Material.STONE, 1).setName("&cEdit AnySiteRewards")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("AnySiteRewards"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("AnySiteRewards"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
buttons.add(new BInventoryButton(new ItemBuilder(Material.STONE, 1).setName("&cEdit EverySiteReward")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("EverySiteReward"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("EverySiteReward"));
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(new ItemBuilder(Material.STONE, 1).setName("&cEdit BungeeVotePartyRewards")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
plugin.getRewardHandler().getDirectlyDefined("BungeeVotePartyRewards"));
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(
|
||||
new ItemBuilder("GRASS_BLOCK").setName("&cEdit BungeeSettings.yml").addLoreLine("&aCurrently WIP")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new ConfigEditor(plugin, plugin.getBungeeSettings()).open(clickEvent.getPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(
|
||||
new ItemBuilder("GRASS_BLOCK").setName("&cEdit Config.yml").addLoreLine("&aCurrently WIP")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new ConfigEditor(plugin, plugin.getConfigFile(), plugin.getOptions().getYmlConfig(),
|
||||
plugin.getOptions().getClass()).open(clickEvent.getPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(
|
||||
new ItemBuilder(Material.CHEST).setName("&cEdit GUI.yml").addLoreLine("&aCurrently WIP")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new ConfigEditor(plugin, plugin.getGui()).open(clickEvent.getPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(
|
||||
new ItemBuilder("GRASS_BLOCK").setName("&cEdit SpecialRewards.yml").addLoreLine("&aCurrently WIP")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new ConfigEditor(plugin, plugin.getSpecialRewardsConfig()).open(clickEvent.getPlayer());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -148,6 +212,17 @@ public class AdminGUI {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
buttons.add(new BInventoryButton(
|
||||
new ItemBuilder(Material.STONE, 1).setName("&cBackground task time").addLoreLine("&aClick to see")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
event.getPlayer().sendMessage("Last background task time: " + plugin.getLastBackgroundTaskTimeTaken());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
@@ -167,7 +242,9 @@ public class AdminGUI {
|
||||
int count = 0;
|
||||
for (VoteSite voteSite : plugin.getVoteSites()) {
|
||||
ArrayList<String> lore = new ArrayList<String>();
|
||||
lore.add("Enabled: " + voteSite.isEnabled());
|
||||
lore.add("Priority: " + voteSite.getPriority());
|
||||
|
||||
lore.add("Name: " + voteSite.getDisplayName());
|
||||
lore.add("ServiceSite: " + voteSite.getServiceSite());
|
||||
lore.add("VoteURL: " + voteSite.getVoteURL());
|
||||
@@ -216,7 +293,13 @@ public class AdminGUI {
|
||||
if (ob != null) {
|
||||
VoteSite site = (VoteSite) ob;
|
||||
PlayerVoteEvent voteEvent = new PlayerVoteEvent(site, value, site.getServiceSite(), false);
|
||||
plugin.getServer().getPluginManager().callEvent(voteEvent);
|
||||
plugin.getVoteTimer().submit(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.getServer().getPluginManager().callEvent(voteEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, ArrayUtils.getInstance().convert(playerNames)).usingMethod(InputMethod.INVENTORY)
|
||||
@@ -276,7 +359,7 @@ public class AdminGUI {
|
||||
plugin.reload();
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
inv.addButton(new EditGUIButton(new EditGUIValueNumber("VoteDelayMin", voteSite.getVoteDelay()) {
|
||||
|
||||
@Override
|
||||
@@ -288,6 +371,17 @@ public class AdminGUI {
|
||||
}
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new EditGUIValueNumber("VoteDelayDailyHour", voteSite.getVoteDelayDailyHour()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, Number num) {
|
||||
VoteSite voteSite = (VoteSite) getInv().getMeta(player, "VoteSite");
|
||||
String siteName = voteSite.getKey();
|
||||
plugin.getConfigVoteSites().setVoteDelay(siteName, num.intValue());
|
||||
plugin.reload();
|
||||
}
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new EditGUIValueBoolean("Enabled", voteSite.isEnabled()) {
|
||||
|
||||
@Override
|
||||
@@ -338,12 +432,35 @@ public class AdminGUI {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(), RewardHandler.getInstance()
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(), plugin.getRewardHandler()
|
||||
.getDirectlyDefined("VoteSites." + voteSite.getKey() + ".Rewards"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (voteSite.getSiteData().isList("CoolDownEndRewards")) {
|
||||
|
||||
inv.addButton(new EditGUIButton(new EditGUIValueList("CoolDownEndRewards",
|
||||
voteSite.getSiteData().getStringList("CoolDownEndRewards")) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player p, ArrayList<String> rewards) {
|
||||
VoteSite voteSite = (VoteSite) getInv().getMeta(player, "VoteSite");
|
||||
plugin.getConfigVoteSites().set(voteSite.getKey(), "CoolDownEndRewards", rewards);
|
||||
plugin.reload();
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.DISPENSER, 1).setName("&cCoolDownEndRewards")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(), plugin.getRewardHandler()
|
||||
.getDirectlyDefined("VoteSites." + voteSite.getKey() + ".CoolDownEndRewards"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inv.openInventory(player);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -21,7 +21,7 @@ public abstract class AdminVoteConfirmation extends GUIHandler {
|
||||
private String title;
|
||||
|
||||
public AdminVoteConfirmation(VotingPluginMain plugin, CommandSender player, String title) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.title = title;
|
||||
}
|
||||
@@ -40,10 +40,6 @@ public abstract class AdminVoteConfirmation extends GUIHandler {
|
||||
|
||||
}
|
||||
|
||||
public abstract void onConfirm(Player p);
|
||||
|
||||
public abstract void onDeny(Player p);
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory(title);
|
||||
@@ -64,6 +60,10 @@ public abstract class AdminVoteConfirmation extends GUIHandler {
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
public abstract void onConfirm(Player p);
|
||||
|
||||
public abstract void onDeny(Player p);
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
open(GUIMethod.CHEST);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class AdminVoteHelp extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteHelp(VotingPluginMain plugin, CommandSender player, int page) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.page = page;
|
||||
}
|
||||
@@ -64,12 +64,10 @@ public class AdminVoteHelp extends GUIHandler {
|
||||
ArrayList<TextComponent> msg = new ArrayList<TextComponent>();
|
||||
HashMap<String, TextComponent> unsorted = new HashMap<String, TextComponent>();
|
||||
|
||||
boolean requirePerms = plugin.getConfigFile().getFormatCommandsVoteHelpRequirePermission();
|
||||
boolean requirePerms = plugin.getConfigFile().isFormatCommandsVoteHelpRequirePermission();
|
||||
|
||||
for (CommandHandler cmdHandle : plugin.getAdminVoteCommand()) {
|
||||
if (requirePerms && sender.hasPermission(cmdHandle.getPerm())) {
|
||||
unsorted.put(cmdHandle.getHelpLineCommand("/adminvote"), cmdHandle.getHelpLine("/adminvote"));
|
||||
} else {
|
||||
if (!requirePerms || cmdHandle.hasPerm(sender)) {
|
||||
unsorted.put(cmdHandle.getHelpLineCommand("/adminvote"), cmdHandle.getHelpLine("/adminvote"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ public class AdminVotePerms extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVotePerms(VotingPluginMain plugin, CommandSender player, int page) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public AdminVotePerms(VotingPluginMain plugin, CommandSender player, int page, String playerName) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.page = page;
|
||||
this.playerName = playerName;
|
||||
|
||||
+16
-16
@@ -11,6 +11,7 @@ import com.bencodez.advancedcore.api.bookgui.BookWrapper;
|
||||
import com.bencodez.advancedcore.api.bookgui.Layout;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.placeholder.NonPlayerPlaceHolder;
|
||||
import com.bencodez.advancedcore.api.placeholder.PlaceHolder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
@@ -19,11 +20,10 @@ import xyz.upperlevel.spigot.book.BookUtil;
|
||||
|
||||
public class AdminVotePlaceholders extends GUIHandler {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVotePlaceholders(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -38,14 +38,14 @@ public class AdminVotePlaceholders extends GUIHandler {
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getPlaceholders()) {
|
||||
String msg = "";
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "#";
|
||||
}
|
||||
if (placeholder.hasDescription()) {
|
||||
msg = "VotingPlugin_" + identifier + " - " + placeholder.getDescription();
|
||||
msg = "votingplugin_" + identifier + " - " + placeholder.getDescription();
|
||||
} else {
|
||||
msg = "VotingPlugin_" + identifier + "";
|
||||
msg = "votingplugin_" + identifier + "";
|
||||
}
|
||||
|
||||
Layout layout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
@@ -54,16 +54,16 @@ public class AdminVotePlaceholders extends GUIHandler {
|
||||
book.addLayout(layout);
|
||||
}
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
for (NonPlayerPlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
String msg = "";
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "#";
|
||||
}
|
||||
if (placeholder.hasDescription()) {
|
||||
msg = "VotingPlugin_" + identifier + " - " + placeholder.getDescription();
|
||||
msg = "votingplugin_" + identifier + " - " + placeholder.getDescription();
|
||||
} else {
|
||||
msg = "VotingPlugin_" + identifier + "";
|
||||
msg = "votingplugin_" + identifier + "";
|
||||
}
|
||||
|
||||
Layout layout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
@@ -82,26 +82,26 @@ public class AdminVotePlaceholders extends GUIHandler {
|
||||
ArrayList<String> msg = new ArrayList<String>();
|
||||
msg.add("&cPlaceholders:");
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "#";
|
||||
}
|
||||
if (placeholder.hasDescription()) {
|
||||
msg.add("VotingPlugin_" + identifier + " - " + placeholder.getDescription());
|
||||
msg.add("votingplugin_" + identifier + " - " + placeholder.getDescription());
|
||||
} else {
|
||||
msg.add("VotingPlugin_" + identifier + "");
|
||||
msg.add("votingplugin_" + identifier + "");
|
||||
}
|
||||
}
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier();
|
||||
for (NonPlayerPlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "#";
|
||||
}
|
||||
if (placeholder.hasDescription()) {
|
||||
msg.add("VotingPlugin_" + identifier + " - " + placeholder.getDescription());
|
||||
msg.add("votingplugin_" + identifier + " - " + placeholder.getDescription());
|
||||
} else {
|
||||
msg.add("VotingPlugin_" + identifier + "");
|
||||
msg.add("votingplugin_" + identifier + "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-16
@@ -11,21 +11,20 @@ import com.bencodez.advancedcore.api.bookgui.BookWrapper;
|
||||
import com.bencodez.advancedcore.api.bookgui.Layout;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.placeholder.NonPlayerPlaceHolder;
|
||||
import com.bencodez.advancedcore.api.placeholder.PlaceHolder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
import xyz.upperlevel.spigot.book.BookUtil;
|
||||
|
||||
public class AdminVotePlaceholdersPlayer extends GUIHandler {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private VotingPluginMain plugin;
|
||||
private VotingPluginUser user;
|
||||
|
||||
public AdminVotePlaceholdersPlayer(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -40,11 +39,11 @@ public class AdminVotePlaceholdersPlayer extends GUIHandler {
|
||||
BookWrapper book = new BookWrapper("Placeholders");
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "1";
|
||||
}
|
||||
String value = placeholder.placeholderRequest(user.getOfflinePlayer(), user, identifier);
|
||||
String value = placeholder.placeholderRequest(user, identifier);
|
||||
String msg = identifier + " = " + value;
|
||||
Layout layout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
layout.replaceTextComponent("[Json]", BookUtil.TextBuilder.of(msg).color(ChatColor.AQUA)
|
||||
@@ -52,13 +51,13 @@ public class AdminVotePlaceholdersPlayer extends GUIHandler {
|
||||
book.addLayout(layout);
|
||||
}
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
for (NonPlayerPlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "1";
|
||||
}
|
||||
String value = placeholder.placeholderRequest(user.getOfflinePlayer(), user, identifier);
|
||||
String value = placeholder.placeholderRequest(identifier);
|
||||
String msg = identifier + " = " + value;
|
||||
|
||||
Layout layout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
@@ -75,25 +74,23 @@ public class AdminVotePlaceholdersPlayer extends GUIHandler {
|
||||
msg.add("&cPlaceholders:");
|
||||
VotingPluginUser placeholderUser = user;
|
||||
if (plugin.getConfigFile().isUsePrimaryAccountForPlaceholders() && user.hasPrimaryAccount()) {
|
||||
placeholderUser = UserManager.getInstance().getVotingPluginUser(user.getPrimaryAccount());
|
||||
placeholderUser = plugin.getVotingPluginUserManager().getVotingPluginUser(user.getPrimaryAccount());
|
||||
}
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier();
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "1";
|
||||
}
|
||||
msg.add("VotingPlugin_" + identifier + " = "
|
||||
+ placeholder.placeholderRequest(user.getOfflinePlayer(), placeholderUser, identifier));
|
||||
msg.add("votingplugin_" + identifier + " = " + placeholder.placeholderRequest(placeholderUser, identifier));
|
||||
}
|
||||
|
||||
for (PlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier();
|
||||
for (NonPlayerPlaceHolder<VotingPluginUser> placeholder : plugin.getPlaceholders().getNonPlayerPlaceholders()) {
|
||||
String identifier = placeholder.getIdentifier().toLowerCase();
|
||||
if (identifier.endsWith("_")) {
|
||||
identifier += "1";
|
||||
}
|
||||
|
||||
msg.add("VotingPlugin_" + identifier + " = "
|
||||
+ placeholder.placeholderRequest(user.getOfflinePlayer(), placeholderUser, identifier));
|
||||
msg.add("votingplugin_" + identifier + " = " + placeholder.placeholderRequest(identifier));
|
||||
}
|
||||
sendMessage(msg);
|
||||
}
|
||||
|
||||
+28
-20
@@ -17,7 +17,6 @@ import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueLi
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueNumber;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueString;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder;
|
||||
import com.bencodez.advancedcore.api.valuerequest.listeners.NumberListener;
|
||||
import com.bencodez.advancedcore.command.gui.RewardEditGUI;
|
||||
@@ -28,7 +27,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVoteParty(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -46,12 +45,6 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
|
||||
}
|
||||
|
||||
private void setPathData(String path, Object value) {
|
||||
plugin.getSpecialRewardsConfig().getData().set("VoteParty." + path, value);
|
||||
plugin.getSpecialRewardsConfig().saveData();
|
||||
plugin.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
EditGUI inv = new EditGUI("Edit VoteParty");
|
||||
@@ -59,7 +52,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
|
||||
// to add
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1),
|
||||
new EditGUIValueBoolean("Enabled", plugin.getSpecialRewardsConfig().getVotePartyEnabled()) {
|
||||
new EditGUIValueBoolean("Enabled", plugin.getSpecialRewardsConfig().isVotePartyEnabled()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -77,7 +70,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.LADDER, 1), new EditGUIValueNumber(
|
||||
"IncreaseVotesRquired", plugin.getSpecialRewardsConfig().getVotePartyIncreaseVotesRquired()) {
|
||||
"IncreaseVotesRquired", plugin.getSpecialRewardsConfig().getVotePartyIncreaseVotesRequired()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, Number num) {
|
||||
@@ -99,7 +92,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}, new Number[] { 0, 10, 50, 100 })
|
||||
.currentValue("" + plugin.getServerData().getVotePartyExtraRequired()).allowCustomOption(true)
|
||||
.request(clickEvent.getPlayer());
|
||||
;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -113,7 +106,16 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1), new EditGUIValueBoolean("GiveAllPlayers",
|
||||
plugin.getSpecialRewardsConfig().getVotePartyGiveAllPlayers()) {
|
||||
plugin.getSpecialRewardsConfig().isVotePartyGiveAllPlayers()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
setPathData(getKey(), name);
|
||||
}
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1), new EditGUIValueBoolean(
|
||||
"GiveOnlinePlayersOnly", plugin.getSpecialRewardsConfig().isVotePartyGiveOnlinePlayersOnly()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -122,7 +124,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1),
|
||||
new EditGUIValueBoolean("ResetEachDay", plugin.getSpecialRewardsConfig().getVotePartyResetEachDay()) {
|
||||
new EditGUIValueBoolean("ResetEachDay", plugin.getSpecialRewardsConfig().isVotePartyResetEachDay()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -131,7 +133,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1),
|
||||
new EditGUIValueBoolean("ResetWeekly", plugin.getSpecialRewardsConfig().getVotePartyResetWeekly()) {
|
||||
new EditGUIValueBoolean("ResetWeekly", plugin.getSpecialRewardsConfig().isVotePartyResetWeekly()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -140,7 +142,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1),
|
||||
new EditGUIValueBoolean("ResetMonthly", plugin.getSpecialRewardsConfig().getVotePartyResetMontly()) {
|
||||
new EditGUIValueBoolean("ResetMonthly", plugin.getSpecialRewardsConfig().isVotePartyResetMonthly()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -149,7 +151,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1), new EditGUIValueBoolean("OnlyOncePerDay",
|
||||
plugin.getSpecialRewardsConfig().getVotePartyOnlyOncePerDay()) {
|
||||
plugin.getSpecialRewardsConfig().isVotePartyOnlyOncePerDay()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -167,7 +169,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1), new EditGUIValueBoolean("CountFakeVotes",
|
||||
plugin.getSpecialRewardsConfig().getVotePartyCountFakeVotes()) {
|
||||
plugin.getSpecialRewardsConfig().isVotePartyCountFakeVotes()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -176,7 +178,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1), new EditGUIValueBoolean("CountOfflineVotes",
|
||||
plugin.getSpecialRewardsConfig().getVotePartyCountOfflineVotes()) {
|
||||
plugin.getSpecialRewardsConfig().isVotePartyCountOfflineVotes()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, boolean name) {
|
||||
@@ -194,7 +196,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
}));
|
||||
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.PAPER, 1),
|
||||
new EditGUIValueList("Commands", plugin.getSpecialRewardsConfig().getVotePartyCommands()) {
|
||||
new EditGUIValueList("Commands", plugin.getSpecialRewardsConfig().getVotePartyGlobalCommands()) {
|
||||
|
||||
@Override
|
||||
public void setValue(Player player, ArrayList<String> value) {
|
||||
@@ -209,7 +211,7 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("VoteParty.Rewards"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("VoteParty.Rewards"));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -223,4 +225,10 @@ public class AdminVoteVoteParty extends GUIHandler {
|
||||
open(GUIMethod.CHEST);
|
||||
}
|
||||
|
||||
private void setPathData(String path, Object value) {
|
||||
plugin.getSpecialRewardsConfig().getData().set("VoteParty." + path, value);
|
||||
plugin.getSpecialRewardsConfig().saveData();
|
||||
plugin.reload();
|
||||
}
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.bencodez.votingplugin.commands.gui.admin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.EditGUI;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.events.PlayerVoteEvent;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
|
||||
public class AdminVoteVotePlayer extends GUIHandler {
|
||||
|
||||
private String playerName;
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVotePlayer(VotingPluginMain plugin, CommandSender player, String playerName) {
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.playerName = playerName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getChat(CommandSender sender) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBook(Player player) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChat(CommandSender sender) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
EditGUI inv = new EditGUI("Trigger vote for " + playerName);
|
||||
inv.requirePermission("VotingPlugin.Commands.AdminVote.Vote|VotingPlugin.Admin");
|
||||
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
inv.addButton(new BInventoryButton(site.getItem().setName(site.getKey())) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
VoteSite site = (VoteSite) getData("site");
|
||||
PlayerVoteEvent voteEvent = new PlayerVoteEvent(site, playerName, site.getServiceSite(), false);
|
||||
sendMessage(clickEvent.getPlayer(), "&cTriggering vote...");
|
||||
if (voteEvent.getVoteSite() != null) {
|
||||
if (!voteEvent.getVoteSite().isVaidServiceSite()) {
|
||||
sendMessage(clickEvent.getPlayer(),
|
||||
"&cPossible issue with service site, has the server gotten the vote from "
|
||||
+ voteEvent.getServiceSite() + "?");
|
||||
}
|
||||
}
|
||||
plugin.getServer().getPluginManager().callEvent(voteEvent);
|
||||
|
||||
if (plugin.isYmlError()) {
|
||||
sendMessage(clickEvent.getPlayer(),
|
||||
"&3Detected yml error, please check server log for details");
|
||||
}
|
||||
}
|
||||
}.addData("site", site));
|
||||
}
|
||||
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
open(GUIMethod.CHEST);
|
||||
}
|
||||
|
||||
}
|
||||
+26
-23
@@ -13,7 +13,6 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.valuerequest.InputMethod;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequest;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder;
|
||||
@@ -26,7 +25,7 @@ public class AdminVoteCumulative extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteCumulative(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -48,30 +47,34 @@ public class AdminVoteCumulative extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory("Edit Cumulative");
|
||||
inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.Cumulative");
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER).setName("&cEdit existing cumulative rewards")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
ArrayList<Integer> nums = new ArrayList<Integer>();
|
||||
for (String num : plugin.getSpecialRewardsConfig().getCumulativeVotes()) {
|
||||
if (StringParser.getInstance().isInt(num)) {
|
||||
nums.add(Integer.parseInt(num));
|
||||
}
|
||||
}
|
||||
Number[] options = new Number[nums.size()];
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
options[i] = nums.get(i);
|
||||
}
|
||||
new ValueRequestBuilder(new NumberListener() {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(Material.PAPER).setName("&cEdit existing cumulative rewards")) {
|
||||
|
||||
@Override
|
||||
public void onInput(Player player, Number value) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("Cumulative." + value.intValue() + ".Rewards"));
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
ArrayList<Integer> nums = new ArrayList<Integer>();
|
||||
for (String num : plugin.getSpecialRewardsConfig().getCumulativeVotes()) {
|
||||
if (StringParser.getInstance().isInt(num)) {
|
||||
nums.add(Integer.parseInt(num));
|
||||
}
|
||||
}
|
||||
Number[] options = new Number[nums.size()];
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
options[i] = nums.get(i);
|
||||
}
|
||||
new ValueRequestBuilder(new NumberListener() {
|
||||
|
||||
@Override
|
||||
public void onInput(Player player, Number value) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
plugin.getRewardHandler()
|
||||
.getDirectlyDefined("Cumulative." + value.intValue() + ".Rewards"));
|
||||
}
|
||||
}, options).allowCustomOption(false).usingMethod(InputMethod.INVENTORY)
|
||||
.request(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
}, options).allowCustomOption(false).usingMethod(InputMethod.INVENTORY).request(clickEvent.getPlayer());;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.EMERALD_BLOCK).setName("&aAdd cumulative reward")) {
|
||||
|
||||
|
||||
+8
-7
@@ -20,7 +20,7 @@ public class AdminVoteCumulativeRemove extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteCumulativeRemove(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -50,18 +50,19 @@ public class AdminVoteCumulativeRemove extends GUIHandler {
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new AdminVoteConfirmation(plugin, clickEvent.getPlayer(), "Remove cumulative " + votes + "?") {
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteCumulative(plugin, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirm(Player p) {
|
||||
plugin.getSpecialRewardsConfig().removeCumulative(votes);
|
||||
p.sendMessage("Removed cumulative " + votes);
|
||||
plugin.reload();
|
||||
}
|
||||
}.open();;
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteCumulative(plugin, p);
|
||||
}
|
||||
}.open();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
+8
-7
@@ -20,7 +20,7 @@ public class AdminVoteMilestoneRemove extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteMilestoneRemove(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -50,18 +50,19 @@ public class AdminVoteMilestoneRemove extends GUIHandler {
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new AdminVoteConfirmation(plugin, clickEvent.getPlayer(), "Remove milestone " + votes + "?") {
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteMilestones(plugin, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirm(Player p) {
|
||||
plugin.getSpecialRewardsConfig().removeMilestone(votes);
|
||||
p.sendMessage("Removed milestone " + votes);
|
||||
plugin.reload();
|
||||
}
|
||||
}.open();;
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteMilestones(plugin, p);
|
||||
}
|
||||
}.open();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
+5
-4
@@ -13,7 +13,6 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.valuerequest.InputMethod;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequest;
|
||||
import com.bencodez.advancedcore.api.valuerequest.ValueRequestBuilder;
|
||||
@@ -26,7 +25,7 @@ public class AdminVoteMilestones extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteMilestones(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -68,10 +67,12 @@ public class AdminVoteMilestones extends GUIHandler {
|
||||
@Override
|
||||
public void onInput(Player player, Number value) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance()
|
||||
plugin.getRewardHandler()
|
||||
.getDirectlyDefined("MileStones." + value.intValue() + ".Rewards"));
|
||||
}
|
||||
}, options).allowCustomOption(false).usingMethod(InputMethod.INVENTORY).request(clickEvent.getPlayer());;
|
||||
}, options).allowCustomOption(false).usingMethod(InputMethod.INVENTORY)
|
||||
.request(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public class AdminVoteVoteShop extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVoteShop(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
||||
+38
-12
@@ -1,6 +1,8 @@
|
||||
package com.bencodez.votingplugin.commands.gui.admin.voteshop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -9,25 +11,24 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.EditGUI;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.EditGUIButton;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueList;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueNumber;
|
||||
import com.bencodez.advancedcore.api.inventory.editgui.valuetypes.EditGUIValueString;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.command.gui.RewardEditGUI;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
public class AdminVoteVoteShopItem extends GUIHandler {
|
||||
|
||||
private VotingPluginMain plugin;
|
||||
private String identifier;
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVoteShopItem(VotingPluginMain plugin, CommandSender player, String identifier) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.identifier = identifier;
|
||||
}
|
||||
@@ -46,12 +47,6 @@ public class AdminVoteVoteShopItem extends GUIHandler {
|
||||
|
||||
}
|
||||
|
||||
private void setPathData(String path, Object value) {
|
||||
plugin.getGui().getData().set("CHEST.Shop." + identifier + "." + path, value);
|
||||
plugin.getGui().saveData();
|
||||
plugin.reload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
EditGUI inv = new EditGUI("Edit VoteShop Item: " + identifier);
|
||||
@@ -92,7 +87,7 @@ public class AdminVoteVoteShopItem extends GUIHandler {
|
||||
|
||||
// display item
|
||||
ConfigurationSection displayItemData = plugin.getGui().getChestShopIdentifierSection(identifier);
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(Material.valueOf(displayItemData.getString("Material")), 1),
|
||||
inv.addButton(new EditGUIButton(new ItemBuilder(displayItemData.getString("Material")).setAmount(1),
|
||||
new EditGUIValueString("Material", displayItemData.getString("Material")) {
|
||||
|
||||
@Override
|
||||
@@ -116,12 +111,37 @@ public class AdminVoteVoteShopItem extends GUIHandler {
|
||||
setPathData(getKey(), value);
|
||||
}
|
||||
}));
|
||||
inv.addButton(new BInventoryButton(
|
||||
new ItemBuilder(player.getInventory().getItemInMainHand().clone()).addLoreLine("&cClick to add")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
ItemBuilder item = new ItemBuilder(clickEvent.getPlayer().getInventory().getItemInMainHand().clone());
|
||||
Map<String, Object> map = item.getConfiguration(false);
|
||||
for (Entry<String, Object> entry : map.entrySet()) {
|
||||
setPathData(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(player.getInventory().getItemInMainHand().clone())
|
||||
.addLoreLine("&cClick to add with exact data")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
ItemBuilder item = new ItemBuilder(clickEvent.getPlayer().getInventory().getItemInMainHand().clone());
|
||||
Map<String, Object> map = item.getConfiguration(true);
|
||||
for (Entry<String, Object> entry : map.entrySet()) {
|
||||
setPathData("ItemStack." + entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.DISPENSER, 1).setName("&cRewards")) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
RewardEditGUI.getInstance().openRewardGUI(clickEvent.getPlayer(),
|
||||
RewardHandler.getInstance().getDirectlyDefined("CHEST.Shop." + identifier + ".Rewards"));
|
||||
plugin.getRewardHandler().getDirectlyDefined("CHEST.Shop." + identifier + ".Rewards"));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -135,4 +155,10 @@ public class AdminVoteVoteShopItem extends GUIHandler {
|
||||
open(GUIMethod.CHEST);
|
||||
}
|
||||
|
||||
private void setPathData(String path, Object value) {
|
||||
plugin.getGui().getData().set("CHEST.Shop." + identifier + "." + path, value);
|
||||
plugin.getGui().saveData();
|
||||
plugin.reload();
|
||||
}
|
||||
|
||||
}
|
||||
+9
-8
@@ -19,7 +19,7 @@ public class AdminVoteVoteShopItemRemove extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVoteShopItemRemove(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AdminVoteVoteShopItemRemove extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory("Edit VoteShop Remove Item");
|
||||
inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.VoteShop");
|
||||
|
||||
|
||||
for (final String identifier : plugin.getGui().getChestShopIdentifiers()) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestShopIdentifierSection(identifier))
|
||||
@@ -52,18 +52,19 @@ public class AdminVoteVoteShopItemRemove extends GUIHandler {
|
||||
new AdminVoteConfirmation(plugin, clickEvent.getPlayer(),
|
||||
"Remove shop item " + identifier + "?") {
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteVoteShop(plugin, p).open();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirm(Player p) {
|
||||
plugin.getGui().removeShop(identifier);
|
||||
p.sendMessage("Removed " + identifier);
|
||||
plugin.reload();
|
||||
}
|
||||
}.open();;
|
||||
|
||||
@Override
|
||||
public void onDeny(Player p) {
|
||||
new AdminVoteVoteShop(plugin, p).open();
|
||||
}
|
||||
}.open();
|
||||
|
||||
|
||||
}
|
||||
}.addData("ident", identifier));
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ public class AdminVoteVoteShopItems extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public AdminVoteVoteShopItems(VotingPluginMain plugin, CommandSender player) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class AdminVoteVoteShopItems extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory("Edit VoteShop Items");
|
||||
inv.requirePermission("VotingPlugin.Commands.AdminVote.Edit.VoteShop");
|
||||
|
||||
|
||||
for (String identifier : plugin.getGui().getChestShopIdentifiers()) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestShopIdentifierSection(identifier))) {
|
||||
@@ -49,7 +49,7 @@ public class AdminVoteVoteShopItems extends GUIHandler {
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new AdminVoteVoteShopItem(plugin, clickEvent.getPlayer(), (String) getData("ident"))
|
||||
.open(GUIMethod.CHEST);
|
||||
;
|
||||
|
||||
}
|
||||
}.addData("ident", identifier));
|
||||
}
|
||||
|
||||
@@ -13,17 +13,17 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteBest extends GUIHandler {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private VotingPluginMain plugin;
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteBest(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -88,6 +88,26 @@ public class VoteBest extends GUIHandler {
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin.getGui().isChestVoteBestBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
|
||||
String guiPath = "VoteBest";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardOptions;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteGUI extends GUIHandler {
|
||||
@@ -25,7 +25,7 @@ public class VoteGUI extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteGUI(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -43,15 +43,15 @@ public class VoteGUI extends GUIHandler {
|
||||
|
||||
String str = plugin.getConfigFile().getVoteTopDefault();
|
||||
if (lore.length == 0) {
|
||||
if (slot.equalsIgnoreCase("url")) {
|
||||
if (StringParser.getInstance().startsWithIgnoreCase(slot, "url")) {
|
||||
lore = new String[] { "&aClick me" };
|
||||
} else if (slot.equalsIgnoreCase("next")) {
|
||||
} else if (StringParser.getInstance().startsWithIgnoreCase(slot, "next")) {
|
||||
lore = ArrayUtils.getInstance().convert(new VoteNext(plugin, player, user).getChat(player));
|
||||
} else if (slot.equalsIgnoreCase("last")) {
|
||||
} else if (StringParser.getInstance().startsWithIgnoreCase(slot, "last")) {
|
||||
lore = ArrayUtils.getInstance().convert(new VoteLast(plugin, player, user).getChat(player));
|
||||
} else if (slot.equalsIgnoreCase("total")) {
|
||||
} else if (StringParser.getInstance().startsWithIgnoreCase(slot, "total")) {
|
||||
lore = ArrayUtils.getInstance().convert(new VoteTotal(plugin, player, user).getChat(player));
|
||||
} else if (slot.equalsIgnoreCase("top")) {
|
||||
} else if (StringParser.getInstance().startsWithIgnoreCase(slot, "top")) {
|
||||
|
||||
if (str.equalsIgnoreCase("monthly")) {
|
||||
lore = plugin.getTopVoterHandler().topVoterMonthly(1);
|
||||
@@ -121,21 +121,28 @@ public class VoteGUI extends GUIHandler {
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
if (this.user == null) {
|
||||
user = UserManager.getInstance().getVotingPluginUser((Player) player);
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
}
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteGUIName());
|
||||
if (!plugin.getConfigFile().isAlwaysCloseInventory()) {
|
||||
inv.dontClose();
|
||||
}
|
||||
|
||||
if (player.getUniqueId().toString().equals(user.getUUID())) {
|
||||
inv.requirePermission("VotingPlugin.Commands.Vote.GUI");
|
||||
} else {
|
||||
inv.requirePermission("VotingPlugin.Commands.Vote.GUI.Other");
|
||||
}
|
||||
|
||||
inv.addPlaceholder("points", "" + user.getPoints());
|
||||
inv.addPlaceholder("player", user.getPlayerName());
|
||||
inv.addPlaceholder("top", plugin.getConfigFile().getVoteTopDefault());
|
||||
inv.addPlaceholder("sitesavailable", "" + user.getSitesNotVotedOn());
|
||||
|
||||
for (String slot : plugin.getGui().getChestVoteGUISlots()) {
|
||||
for (final String slot : plugin.getGui().getChestVoteGUISlots()) {
|
||||
ItemBuilder builder = getItemSlot(slot, player);
|
||||
|
||||
inv.addButton(new UpdatingBInventoryButton(builder, 1000, 1000) {
|
||||
inv.addButton(new UpdatingBInventoryButton(plugin, builder, 1000, 1000) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -153,31 +160,21 @@ public class VoteGUI extends GUIHandler {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (slot.equalsIgnoreCase("url")) {
|
||||
new VoteURL(plugin, player, user, true).open();
|
||||
} else if (slot.equalsIgnoreCase("next")) {
|
||||
new VoteNext(plugin, player, user).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("last")) {
|
||||
new VoteLast(plugin, player, user).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("total")) {
|
||||
new VoteTotal(plugin, player, user).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("top")) {
|
||||
new VoteTopVoter(plugin, player, user, TopVoter.getDefault(), 1).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("today")) {
|
||||
new VoteToday(plugin, player, user, 1).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("help")) {
|
||||
player.performCommand("vote help");
|
||||
} else if (slot.equalsIgnoreCase("shop")) {
|
||||
new VoteShop(plugin, player, user).open(GUIMethod.CHEST);
|
||||
} else if (slot.equalsIgnoreCase("lastmonth")) {
|
||||
new VoteTopVoterLastMonth(plugin, player, user).open(GUIMethod.CHEST);
|
||||
}
|
||||
plugin.getCommandLoader().processSlotClick(player, user, slot);
|
||||
}
|
||||
String prefix = "";
|
||||
if (event.getButton().getBuilder().isConditional()) {
|
||||
prefix = "Item.";
|
||||
}
|
||||
|
||||
if (RewardHandler.getInstance().hasRewards(plugin.getGui().getData(),
|
||||
plugin.getGui().getChestVoteGUISlotRewardsPath(slot))) {
|
||||
RewardHandler.getInstance().giveReward(UserManager.getInstance().getVotingPluginUser(player),
|
||||
plugin.getGui().getData(), plugin.getGui().getChestVoteGUISlotRewardsPath(slot),
|
||||
if (plugin.getRewardHandler().hasRewards(plugin.getGui().getData(),
|
||||
plugin.getGui().getChestVoteGUISlotRewardsPath(slot,
|
||||
prefix + event.getButton().getLastRewardsPath(player)))) {
|
||||
plugin.getRewardHandler().giveReward(
|
||||
plugin.getVotingPluginUserManager().getVotingPluginUser(player),
|
||||
plugin.getGui().getData(),
|
||||
plugin.getGui().getChestVoteGUISlotRewardsPath(slot,
|
||||
prefix + event.getButton().getLastRewardsPath(player)),
|
||||
new RewardOptions().addPlaceholder("identifier", slot));
|
||||
}
|
||||
}
|
||||
@@ -185,16 +182,33 @@ public class VoteGUI extends GUIHandler {
|
||||
@Override
|
||||
public ItemBuilder onUpdate(Player player) {
|
||||
ItemBuilder item = getItemSlot(slot, player);
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
item.addPlaceholder("points", "" + user.getPoints());
|
||||
item.addPlaceholder("player", user.getPlayerName());
|
||||
item.addPlaceholder("top", plugin.getConfigFile().getVoteTopDefault());
|
||||
item.addPlaceholder("sitesavailable", "" + user.getSitesNotVotedOn());
|
||||
return item;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
String guiPath = "VoteGUI";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,10 @@ import com.bencodez.advancedcore.api.command.CommandHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.simpleapi.nms.NMSManager;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
public class VoteHelp extends GUIHandler {
|
||||
@@ -21,7 +23,7 @@ public class VoteHelp extends GUIHandler {
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public VoteHelp(VotingPluginMain plugin, CommandSender player, int page) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.page = page;
|
||||
}
|
||||
@@ -35,14 +37,43 @@ public class VoteHelp extends GUIHandler {
|
||||
ArrayList<TextComponent> msg = new ArrayList<TextComponent>();
|
||||
HashMap<String, TextComponent> unsorted = new HashMap<String, TextComponent>();
|
||||
|
||||
boolean requirePerms = plugin.getConfigFile().getFormatCommandsVoteHelpRequirePermission();
|
||||
boolean requirePerms = plugin.getConfigFile().isFormatCommandsVoteHelpRequirePermission();
|
||||
|
||||
String colorStr = plugin.getConfigFile().getFormatCommandsVoteHelpHoverColor();
|
||||
ChatColor hoverColor = null;
|
||||
try {
|
||||
hoverColor = ChatColor.of(colorStr);
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().warning("Failed to get color for hover help message");
|
||||
e.printStackTrace();
|
||||
hoverColor = ChatColor.AQUA;
|
||||
}
|
||||
for (CommandHandler cmdHandle : plugin.getVoteCommand()) {
|
||||
if (!requirePerms || cmdHandle.hasPerm(sender)) {
|
||||
unsorted.put(cmdHandle.getHelpLineCommand("/vote"), cmdHandle.getHelpLine("/vote",
|
||||
plugin.getConfigFile().getFormatCommandsVoteHelpLine(), hoverColor));
|
||||
}
|
||||
}
|
||||
ArrayList<String> unsortedList = new ArrayList<String>();
|
||||
unsortedList.addAll(unsorted.keySet());
|
||||
Collections.sort(unsortedList, String.CASE_INSENSITIVE_ORDER);
|
||||
for (String cmd : unsortedList) {
|
||||
msg.add(unsorted.get(cmd));
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
public ArrayList<TextComponent> helpTextLegacy(CommandSender sender) {
|
||||
ArrayList<TextComponent> msg = new ArrayList<TextComponent>();
|
||||
HashMap<String, TextComponent> unsorted = new HashMap<String, TextComponent>();
|
||||
|
||||
boolean requirePerms = plugin.getConfigFile().isFormatCommandsVoteHelpRequirePermission();
|
||||
|
||||
for (CommandHandler cmdHandle : plugin.getVoteCommand()) {
|
||||
if (requirePerms && sender.hasPermission(cmdHandle.getPerm())) {
|
||||
if (!requirePerms || cmdHandle.hasPerm(sender)) {
|
||||
unsorted.put(cmdHandle.getHelpLineCommand("/vote"),
|
||||
cmdHandle.getHelpLine("/vote", plugin.getConfigFile().getFormatCommandsVoteHelpLine()));
|
||||
} else {
|
||||
unsorted.put(cmdHandle.getHelpLineCommand("/vote"), cmdHandle.getHelpLine("/vote"));
|
||||
}
|
||||
}
|
||||
ArrayList<String> unsortedList = new ArrayList<String>();
|
||||
@@ -78,7 +109,12 @@ public class VoteHelp extends GUIHandler {
|
||||
public ArrayList<TextComponent> voteHelpText(CommandSender sender) {
|
||||
int pagesize = plugin.getConfigFile().getFormatPageSize();
|
||||
ArrayList<TextComponent> msg = new ArrayList<TextComponent>();
|
||||
ArrayList<TextComponent> text = helpText(sender);
|
||||
ArrayList<TextComponent> text = new ArrayList<TextComponent>();
|
||||
if (NMSManager.getInstance().isVersion("1.12")) {
|
||||
text = helpTextLegacy(sender);
|
||||
} else {
|
||||
text = helpText(sender);
|
||||
}
|
||||
|
||||
int maxPage = text.size() / pagesize;
|
||||
if ((text.size() % pagesize) != 0) {
|
||||
|
||||
@@ -9,10 +9,12 @@ import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
@@ -23,7 +25,7 @@ public class VoteLast extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteLast(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -37,7 +39,7 @@ public class VoteLast extends GUIHandler {
|
||||
msg.add(StringParser.getInstance().replaceIgnoreCase(plugin.getConfigFile().getFormatCommandsVoteLastTitle(),
|
||||
"%player%", playerName));
|
||||
|
||||
for (VoteSite voteSite : plugin.getVoteSites()) {
|
||||
for (VoteSite voteSite : plugin.getVoteSitesEnabled()) {
|
||||
if (!voteSite.isHidden()) {
|
||||
msg.add(user.voteCommandLastLine(voteSite));
|
||||
}
|
||||
@@ -60,27 +62,59 @@ public class VoteLast extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteLastName());
|
||||
inv.addPlaceholder("player", user.getPlayerName());
|
||||
for (VoteSite site : plugin.getVoteSites()) {
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
if (!site.isHidden()) {
|
||||
inv.addButton(inv.getNextSlot(),
|
||||
new UpdatingBInventoryButton(site.getItem().setName(site.getDisplayName())
|
||||
.setLore(user.voteCommandLastLine(site)).setAmountNone(1), 1000, 1000) {
|
||||
new UpdatingBInventoryButton(plugin, site.getItem().setName(site.getDisplayName())
|
||||
.setLore(user.voteCommandLastGUILine(site)).setAmountNone(1), 1000, 1000) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
public void onClick(ClickEvent event) {
|
||||
if (plugin.getGui().isChestVoteLastClickableLinks()) {
|
||||
Player player = event.getPlayer();
|
||||
if (player != null) {
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
user.sendMessage(
|
||||
StringParser.getInstance()
|
||||
.replacePlaceHolder(
|
||||
StringParser.getInstance().replacePlaceHolder(
|
||||
StringParser.getInstance()
|
||||
.replacePlaceHolder(plugin.getGui()
|
||||
.getChestVoteURLURLText(),
|
||||
"voteurl", site.getVoteURL()),
|
||||
"sitename", site.getDisplayName()),
|
||||
"player", player.getName()));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemBuilder onUpdate(Player p) {
|
||||
return site.getItem().setName(site.getDisplayName())
|
||||
.setLore(user.voteCommandLastLine(site)).setAmountNone(1);
|
||||
.setLore(user.voteCommandLastGUILine(site)).setAmountNone(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteLastBackButton()) {
|
||||
String guiPath = "VoteLast";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteLastBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,12 @@ import com.bencodez.advancedcore.api.bookgui.Layout;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
@@ -27,7 +29,7 @@ public class VoteNext extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteNext(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -41,9 +43,8 @@ public class VoteNext extends GUIHandler {
|
||||
msg.add(StringParser.getInstance().colorize(StringParser.getInstance()
|
||||
.replaceIgnoreCase(plugin.getConfigFile().getFormatCommandsVoteNextTitle(), "%player%", playerName)));
|
||||
|
||||
for (VoteSite voteSite : plugin.getVoteSites()) {
|
||||
for (VoteSite voteSite : plugin.getVoteSitesEnabled()) {
|
||||
if (!voteSite.isHidden()) {
|
||||
|
||||
String msgLine = plugin.getConfigFile().getFormatCommandsVoteNextLayout();
|
||||
|
||||
msgLine = StringParser.getInstance().replaceIgnoreCase(msgLine, "%info%",
|
||||
@@ -62,13 +63,15 @@ public class VoteNext extends GUIHandler {
|
||||
BookWrapper book = new BookWrapper(plugin.getGui().getBookVoteURLBookGUITitle());
|
||||
|
||||
// add colors/config options
|
||||
for (VoteSite site : plugin.getVoteSites()) {
|
||||
Layout nextLayout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
nextLayout.replaceTextComponent("[Json]",
|
||||
BookUtil.TextBuilder.of(book.colorize(site.getDisplayName()))
|
||||
.onClick(BookUtil.ClickAction.openUrl(site.getVoteURLJsonStrip()))
|
||||
.onHover(BookUtil.HoverAction.showText(user.voteCommandNextInfo(site))).build());
|
||||
book.addLayout(nextLayout);
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
if (!site.isHidden()) {
|
||||
Layout nextLayout = new Layout(new ArrayList<String>(Arrays.asList("[Json]")));
|
||||
nextLayout.replaceTextComponent("[Json]",
|
||||
BookUtil.TextBuilder.of(book.colorize(site.getDisplayName()))
|
||||
.onClick(BookUtil.ClickAction.openUrl(site.getVoteURLJsonStrip()))
|
||||
.onHover(BookUtil.HoverAction.showText(user.voteCommandNextInfo(site))).build());
|
||||
book.addLayout(nextLayout);
|
||||
}
|
||||
}
|
||||
book.addLine();
|
||||
|
||||
@@ -84,24 +87,50 @@ public class VoteNext extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteNextName());
|
||||
inv.addPlaceholder("player", user.getPlayerName());
|
||||
for (VoteSite site : plugin.getVoteSites()) {
|
||||
inv.addButton(inv.getNextSlot(), new UpdatingBInventoryButton(site.getItem().setName(site.getDisplayName())
|
||||
.setLore(user.voteCommandNextInfo(site)).setAmountNone(1), 1000, 1000) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
if (!site.isHidden()) {
|
||||
String siteNameDisplay = plugin.getGui().getChestVoteNextCustomSiteNamesDisplays(site.getKey());
|
||||
if (siteNameDisplay.isEmpty()) {
|
||||
siteNameDisplay = site.getDisplayName();
|
||||
}
|
||||
inv.addButton(inv.getNextSlot(),
|
||||
new UpdatingBInventoryButton(plugin, site.getItem().setName(siteNameDisplay)
|
||||
.setLore(StringParser.getInstance().replacePlaceHolder(
|
||||
plugin.getGui().getChestVoteNextLine(), "time", user.voteCommandNextInfo(site)))
|
||||
.setAmountNone(1), 1000, 1000) {
|
||||
|
||||
@Override
|
||||
public ItemBuilder onUpdate(Player player) {
|
||||
return site.getItem().setName(site.getDisplayName()).setLore(user.voteCommandNextInfo(site))
|
||||
.setAmountNone(1).addPlaceholder("player", user.getPlayerName());
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemBuilder onUpdate(Player player) {
|
||||
return site.getItem().setName(site.getDisplayName())
|
||||
.setLore(user.voteCommandNextInfo(site)).setAmountNone(1)
|
||||
.addPlaceholder("player", user.getPlayerName());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteNextBackButton()) {
|
||||
String guiPath = "VoteNext";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteNextBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
inv.openInventory(player);
|
||||
|
||||
@@ -13,10 +13,9 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardOptions;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteShop extends GUIHandler {
|
||||
@@ -25,7 +24,7 @@ public class VoteShop extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteShop(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -46,12 +45,21 @@ public class VoteShop extends GUIHandler {
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
if (!plugin.getGui().getChestVoteShopEnabled()) {
|
||||
if (!plugin.getGui().isChestVoteShopEnabled()) {
|
||||
player.sendMessage(StringParser.getInstance().colorize(plugin.getGui().getChestVoteShopDisabled()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.user == null) {
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
}
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
/*
|
||||
* if (!plugin.getConfigFile().isExtraVoteShopCheck()) { user.cacheAsync(); }
|
||||
*/
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteShopName());
|
||||
inv.addPlaceholder("points", "" + user.getPoints());
|
||||
inv.addPlaceholder("sitesavailable", "" + user.getSitesNotVotedOn());
|
||||
inv.dontClose();
|
||||
|
||||
for (final String identifier : plugin.getGui().getChestShopIdentifiers()) {
|
||||
@@ -61,21 +69,25 @@ public class VoteShop extends GUIHandler {
|
||||
if (perm.isEmpty()) {
|
||||
hasPerm = true;
|
||||
} else {
|
||||
hasPerm = player.hasPermission(perm);
|
||||
if (perm.startsWith("!")) {
|
||||
hasPerm = !player.hasPermission(perm.substring(1));
|
||||
} else {
|
||||
hasPerm = player.hasPermission(perm);
|
||||
}
|
||||
}
|
||||
|
||||
int limit = plugin.getGui().getChestShopIdentifierLimit(identifier);
|
||||
|
||||
boolean limitPass = true;
|
||||
if (limit > 0) {
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
if (user.getVoteShopIdentifierLimit(identifier) >= limit) {
|
||||
limitPass = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!plugin.getGui().getChestVoteShopNotBuyable(identifier)) {
|
||||
if (hasPerm && (limitPass || !plugin.getGui().isChestVoteShopHideLimitedReached())) {
|
||||
if ((hasPerm || !plugin.getGui().getChestVoteShopHideOnNoPermission(identifier))
|
||||
&& (limitPass || !plugin.getGui().isChestVoteShopHideLimitedReached())) {
|
||||
ItemBuilder builder = new ItemBuilder(plugin.getGui().getChestShopIdentifierSection(identifier));
|
||||
|
||||
inv.addButton(new BInventoryButton(builder) {
|
||||
@@ -84,18 +96,18 @@ public class VoteShop extends GUIHandler {
|
||||
public void onClick(ClickEvent event) {
|
||||
Player player = event.getWhoClicked();
|
||||
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
if (plugin.getConfigFile().isClearCacheOnVoteShopPurchase()
|
||||
|| plugin.getBungeeSettings().isUseBungeecoord()) {
|
||||
user.clearCache();
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
if (plugin.getConfigFile().isExtraVoteShopCheck()) {
|
||||
user.cache();
|
||||
}
|
||||
|
||||
String identifier = (String) getData("identifier");
|
||||
int limit = (int) getData("Limit");
|
||||
int points = plugin.getGui().getChestShopIdentifierCost(identifier);
|
||||
if (identifier != null) {
|
||||
if (plugin.getGui().getChestVoteShopCloseGUI(identifier)) {
|
||||
event.getButton().getInv().closeInv(player, null);
|
||||
}
|
||||
// if (plugin.getGui().getChestVoteShopCloseGUI(identifier)) {
|
||||
// event.closeInventory();
|
||||
// }
|
||||
|
||||
// limit fail-safe, should never be needed, except in rare cases
|
||||
boolean limitPass = true;
|
||||
@@ -112,14 +124,20 @@ public class VoteShop extends GUIHandler {
|
||||
plugin.getGui().getChestShopIdentifierIdentifierName(identifier));
|
||||
placeholders.put("points", "" + points);
|
||||
placeholders.put("limit", "" + limit);
|
||||
if (user.removePoints(points)) {
|
||||
if (user.removePoints(points, true)) {
|
||||
plugin.getLogger().info("VoteShop: " + user.getPlayerName() + "/"
|
||||
+ user.getUUID() + " bought " + identifier + " for " + points);
|
||||
if (plugin.getConfigFile().isTrackShopPurchases()) {
|
||||
plugin.getServerData().addVoteShopPurchase(identifier);
|
||||
}
|
||||
|
||||
RewardHandler.getInstance().giveReward(user, plugin.getGui().getData(),
|
||||
plugin.getRewardHandler().giveReward(user, plugin.getGui().getData(),
|
||||
plugin.getGui().getChestShopIdentifierRewardsPath(identifier),
|
||||
new RewardOptions().setPlaceholders(placeholders));
|
||||
|
||||
user.sendMessage(StringParser.getInstance().replacePlaceHolder(
|
||||
plugin.getGui().getCHESTVoteShopPurchase(identifier), placeholders));
|
||||
plugin.getGui().getCHESTVoteShopPurchase(identifier),
|
||||
placeholders));
|
||||
if (limit > 0) {
|
||||
user.setVoteShopIdentifierLimit(identifier,
|
||||
user.getVoteShopIdentifierLimit(identifier) + 1);
|
||||
@@ -129,12 +147,23 @@ public class VoteShop extends GUIHandler {
|
||||
plugin.getConfigFile().getFormatShopFailedMsg(), placeholders));
|
||||
}
|
||||
} else {
|
||||
new VoteShopConfirm(plugin, player, user, identifier).open(GUIMethod.CHEST);
|
||||
;
|
||||
plugin.getBukkitScheduler().runTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new VoteShopConfirm(plugin, player, user, identifier)
|
||||
.open(GUIMethod.CHEST);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
} else {
|
||||
user.sendMessage(plugin.getGui().getChestVoteShopLimitReached());
|
||||
}
|
||||
plugin.getCommandLoader().processSlotClick(player, user, identifier);
|
||||
if (plugin.getGui().isChestVoteShopReopenGUIOnPurchase()) {
|
||||
plugin.getCommandLoader().processSlotClick(player, user, "shop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,15 +176,28 @@ public class VoteShop extends GUIHandler {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
user.sendMessage(plugin.getConfigFile().getFormatShopNotPurchasable());
|
||||
}
|
||||
|
||||
}.dontClose().addData("identifier", identifier).addData("Limit", limit));
|
||||
}.addData("identifier", identifier).addData("Limit", limit));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteShopBackButton()) {
|
||||
for (final String str : plugin.getGui().getChestGUIVoteShopExtraItems()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIVoteShopExtraItems(str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
plugin.getCommandLoader().processSlotClick(player, user, str);
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST.VoteShopExtraItems." + str + "." + clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteShopBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
|
||||
|
||||
+12
-6
@@ -14,7 +14,6 @@ import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.PlayerUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardOptions;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
@@ -26,7 +25,7 @@ public class VoteShopConfirm extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteShopConfirm(VotingPluginMain plugin, CommandSender player, VotingPluginUser user, String identifier) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
this.identifier = identifier;
|
||||
@@ -49,19 +48,26 @@ public class VoteShopConfirm extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
PlayerUtils.getInstance().setPlayerMeta(player, "ident", identifier);
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestShopConfirmPurchaseTitle());
|
||||
inv.dontClose();
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(plugin.getGui().getChestShopConfirmPurchaseYesItem())) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
user.cache();
|
||||
int points = plugin.getGui().getChestShopIdentifierCost(identifier);
|
||||
int limit = plugin.getGui().getChestShopIdentifierLimit(identifier);
|
||||
HashMap<String, String> placeholders = new HashMap<String, String>();
|
||||
placeholders.put("identifier", identifier);
|
||||
placeholders.put("points", "" + points);
|
||||
placeholders.put("limit", "" + limit);
|
||||
if (user.removePoints(points)) {
|
||||
if (user.removePoints(points, true)) {
|
||||
plugin.getLogger().info("VoteShop: " + user.getPlayerName() + "/" + user.getUUID() + " bought "
|
||||
+ identifier + " for " + points);
|
||||
if (plugin.getConfigFile().isTrackShopPurchases()) {
|
||||
plugin.getServerData().addVoteShopPurchase(identifier);
|
||||
}
|
||||
|
||||
RewardHandler.getInstance().giveReward(user, plugin.getGui().getData(),
|
||||
plugin.getRewardHandler().giveReward(user, plugin.getGui().getData(),
|
||||
plugin.getGui().getChestShopIdentifierRewardsPath(identifier),
|
||||
new RewardOptions().setPlaceholders(placeholders));
|
||||
|
||||
@@ -77,7 +83,7 @@ public class VoteShopConfirm extends GUIHandler {
|
||||
if (plugin.getGui().getChestVoteShopCloseGUI(identifier)) {
|
||||
event.getButton().getInv().closeInv(player, null);
|
||||
} else {
|
||||
new VoteShop(plugin, event.getPlayer(), user);
|
||||
new VoteShop(plugin, event.getPlayer(), user).open();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -89,7 +95,7 @@ public class VoteShopConfirm extends GUIHandler {
|
||||
if (plugin.getGui().getChestVoteShopCloseGUI(identifier)) {
|
||||
event.getButton().getInv().closeInv(player, null);
|
||||
} else {
|
||||
new VoteShop(plugin, event.getPlayer(), user);
|
||||
new VoteShop(plugin, event.getPlayer(), user).open();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class VoteStreak extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteStreak(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -119,7 +120,23 @@ public class VoteStreak extends GUIHandler {
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin.getGui().getChestVoteStreakBackButton()) {
|
||||
String guiPath = "VoteStreak";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteStreakBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -17,11 +18,11 @@ import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.user.UUID;
|
||||
import com.bencodez.advancedcore.nms.NMSManager;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.simpleapi.nms.NMSManager;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoterPlayer;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteToday extends GUIHandler {
|
||||
@@ -31,7 +32,7 @@ public class VoteToday extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteToday(VotingPluginMain plugin, CommandSender player, VotingPluginUser user, int page) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
this.page = page;
|
||||
@@ -54,11 +55,11 @@ public class VoteToday extends GUIHandler {
|
||||
HashMap<String, String> placeholders = new HashMap<String, String>();
|
||||
placeholders.put("page", "" + page);
|
||||
placeholders.put("maxpage", "" + maxPage);
|
||||
|
||||
|
||||
for (String m : plugin.getConfigFile().getFormatCommandsVoteTodayTitle()) {
|
||||
msg.add(m);
|
||||
}
|
||||
|
||||
|
||||
page--;
|
||||
|
||||
for (int i = pagesize * page; (i < voteToday.length) && (i < ((page + 1) * pagesize)); i++) {
|
||||
@@ -84,7 +85,7 @@ public class VoteToday extends GUIHandler {
|
||||
if (!plugin.getConfigFile().isAlwaysCloseInventory()) {
|
||||
inv.dontClose();
|
||||
}
|
||||
for (VotingPluginUser user : plugin.getVoteToday().keySet()) {
|
||||
for (TopVoterPlayer user : plugin.getVoteToday().keySet()) {
|
||||
|
||||
for (VoteSite voteSite : plugin.getVoteToday().get(user).keySet()) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(plugin.getConfigFile().getFormatTimeFormat());
|
||||
@@ -103,25 +104,36 @@ public class VoteToday extends GUIHandler {
|
||||
item.setName(StringParser.getInstance().replacePlaceHolder(plugin.getGui().getChestVoteTodayIconTitle(),
|
||||
"player", user.getPlayerName()));
|
||||
item.setLore(msg);
|
||||
final String uuid = user.getUUID();
|
||||
final UUID uuid = user.getUuid();
|
||||
inv.addButton(inv.getNextSlot(), new BInventoryButton(item) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid);
|
||||
new VoteGUI(plugin, player, user)
|
||||
.open(GUIMethod.valueOf(plugin.getGui().getGuiMethodGUI().toUpperCase()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
String guiPath = "VoteToday";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "." + clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
if (plugin.getGui().getChestVoteTodayBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
});}
|
||||
|
||||
if(plugin.getGui().isChestVoteTodayBackButton()){inv.addButton(plugin.getCommandLoader().getBackButton(user));}inv.openInventory(player);}
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
open(GUIMethod.valueOf(plugin.getGui().getGuiMethodToday().toUpperCase()));
|
||||
@@ -129,7 +141,7 @@ public class VoteToday extends GUIHandler {
|
||||
|
||||
public String[] voteToday() {
|
||||
ArrayList<String> msg = new ArrayList<String>();
|
||||
for (VotingPluginUser user : plugin.getVoteToday().keySet()) {
|
||||
for (TopVoterPlayer user : plugin.getVoteToday().keySet()) {
|
||||
|
||||
for (VoteSite voteSite : plugin.getVoteToday().get(user).keySet()) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(plugin.getConfigFile().getFormatTimeFormat());
|
||||
@@ -150,7 +162,7 @@ public class VoteToday extends GUIHandler {
|
||||
|
||||
public String[] voteTodayGUI() {
|
||||
ArrayList<String> msg = new ArrayList<String>();
|
||||
for (VotingPluginUser user : plugin.getVoteToday().keySet()) {
|
||||
for (TopVoterPlayer user : plugin.getVoteToday().keySet()) {
|
||||
|
||||
LocalDateTime mostRecent = null;
|
||||
VoteSite mostRecentSite = null;
|
||||
|
||||
@@ -2,11 +2,15 @@ package com.bencodez.votingplugin.commands.gui.player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@@ -17,8 +21,10 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoterPlayer;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteTopVoter extends GUIHandler {
|
||||
@@ -29,7 +35,7 @@ public class VoteTopVoter extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteTopVoter(VotingPluginMain plugin, CommandSender player, VotingPluginUser user, TopVoter top, int page) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
this.top = top;
|
||||
@@ -69,14 +75,23 @@ public class VoteTopVoter extends GUIHandler {
|
||||
if (top == null) {
|
||||
top = TopVoter.getDefault();
|
||||
}
|
||||
Set<Entry<VotingPluginUser, Integer>> users = null;
|
||||
Set<Entry<TopVoterPlayer, Integer>> users = null;
|
||||
|
||||
String topVoter = top.getName();
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedHashMap<VotingPluginUser, Integer> topVotes = (LinkedHashMap<VotingPluginUser, Integer>) plugin
|
||||
LinkedHashMap<TopVoterPlayer, Integer> topVotes = (LinkedHashMap<TopVoterPlayer, Integer>) plugin
|
||||
.getTopVoter(top).clone();
|
||||
users = topVotes.entrySet();
|
||||
|
||||
ConfigurationSection customization = plugin.getGui().getChestVoteTopCustomization();
|
||||
boolean customzationEnabled = false;
|
||||
Queue<Integer> playerSlots = new ConcurrentLinkedQueue<Integer>();
|
||||
if (customization != null) {
|
||||
customzationEnabled = customization.getBoolean("Enabled");
|
||||
List<Integer> customizationPlayerSlots = customization.getIntegerList("PlayerSlots");
|
||||
playerSlots.addAll(customizationPlayerSlots);
|
||||
}
|
||||
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteTopName());
|
||||
inv.addPlaceholder("topvoter", topVoter);
|
||||
if (!plugin.getConfigFile().isAlwaysCloseInventory()) {
|
||||
@@ -84,8 +99,9 @@ public class VoteTopVoter extends GUIHandler {
|
||||
}
|
||||
|
||||
int pos = 1;
|
||||
for (Entry<VotingPluginUser, Integer> entry : users) {
|
||||
ItemBuilder playerItem;
|
||||
for (Entry<TopVoterPlayer, Integer> entry : users) {
|
||||
|
||||
ItemBuilder playerItem = new ItemBuilder(Material.PAPER);
|
||||
|
||||
if (plugin.getGui().isChestVoteTopUseSkull()) {
|
||||
playerItem = new ItemBuilder(entry.getKey().getPlayerHead());
|
||||
@@ -95,44 +111,97 @@ public class VoteTopVoter extends GUIHandler {
|
||||
|
||||
playerItem.setLore(new ArrayList<String>());
|
||||
|
||||
inv.addButton(new BInventoryButton(playerItem.setName(plugin.getGui().getChestVoteTopItemName())
|
||||
BInventoryButton button = new BInventoryButton(playerItem
|
||||
.setName(plugin.getGui().getChestVoteTopItemName())
|
||||
.addLoreLine(plugin.getGui().getChestVoteTopItemLore()).addPlaceholder("position", "" + pos)
|
||||
.addPlaceholder("player", entry.getKey().getPlayerName())
|
||||
.addPlaceholder("votes", "" + entry.getValue())) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
if (plugin.getGui().getChestVoteTopOpenMainGUIOnClick()) {
|
||||
VotingPluginUser user = (VotingPluginUser) getData("User");
|
||||
new VoteGUI(plugin, player, user)
|
||||
if (plugin.getGui().isChestVoteTopOpenMainGUIOnClick()) {
|
||||
TopVoterPlayer user = (TopVoterPlayer) getData("User");
|
||||
new VoteGUI(plugin, player, user.getUser())
|
||||
.open(GUIMethod.valueOf(plugin.getGui().getGuiMethodGUI().toUpperCase()));
|
||||
} else {
|
||||
getInv().forceClose(clickEvent.getPlayer());
|
||||
}
|
||||
}
|
||||
}.addData("player", entry.getKey().getPlayerName()).addData("User", entry.getKey()));
|
||||
}.addData("player", entry.getKey().getPlayerName()).addData("User", entry.getKey());
|
||||
|
||||
if (customzationEnabled && !playerSlots.isEmpty()) {
|
||||
button.setSlot(playerSlots.remove());
|
||||
}
|
||||
|
||||
inv.setCloseInv(plugin.getGui().isChestVoteTopCloseGUIOnClick());
|
||||
|
||||
inv.addButton(button);
|
||||
pos++;
|
||||
}
|
||||
|
||||
final TopVoter cur = top;
|
||||
inv.getPageButtons().add(new BInventoryButton(
|
||||
new ItemBuilder(plugin.getGui().getChestVoteTopSwitchItem()).addPlaceholder("Top", topVoter)) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
if (!clickEvent.getClick().equals(ClickType.RIGHT)) {
|
||||
new VoteTopVoter(plugin, player, user, cur.next(), 0).open(GUIMethod.CHEST);
|
||||
} else {
|
||||
new VoteTopVoter(plugin, player, user, cur.prev(), 0).open(GUIMethod.CHEST);
|
||||
}
|
||||
TopVoter newTops = top;
|
||||
ArrayList<String> tops = plugin.getGui().getChestVoteTopSwitchItemTopVoters();
|
||||
if (!tops.isEmpty()) {
|
||||
for (String name : tops) {
|
||||
newTops.getSwitchItems().add(TopVoter.getTopVoter(name));
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin.getGui().getChestVoteTopBackButton()) {
|
||||
inv.getPageButtons().add(plugin.getCommandLoader().getBackButton(user).setSlot(1));
|
||||
}
|
||||
|
||||
inv.setPages(true);
|
||||
final TopVoter cur = newTops;
|
||||
if (!customzationEnabled) {
|
||||
inv.getPageButtons().add(new BInventoryButton(
|
||||
new ItemBuilder(plugin.getGui().getChestVoteTopSwitchItem()).addPlaceholder("Top", topVoter)) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
if (!clickEvent.getClick().equals(ClickType.RIGHT)) {
|
||||
new VoteTopVoter(plugin, player, user, cur.next(), 0).open(GUIMethod.CHEST);
|
||||
} else {
|
||||
new VoteTopVoter(plugin, player, user, cur.prev(), 0).open(GUIMethod.CHEST);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
inv.addButton(new BInventoryButton(
|
||||
new ItemBuilder(plugin.getGui().getChestVoteTopSwitchItem()).addPlaceholder("Top", topVoter)) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
if (!clickEvent.getClick().equals(ClickType.RIGHT)) {
|
||||
new VoteTopVoter(plugin, player, user, cur.next(), 0).open(GUIMethod.CHEST);
|
||||
} else {
|
||||
new VoteTopVoter(plugin, player, user, cur.prev(), 0).open(GUIMethod.CHEST);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteTopBackButton()) {
|
||||
if (customzationEnabled) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user)
|
||||
.setSlot(customization.getInt("BackButtonSlot", 0)));
|
||||
} else {
|
||||
inv.getPageButtons().add(plugin.getCommandLoader().getBackButton(user).setSlot(1));
|
||||
}
|
||||
}
|
||||
|
||||
String guiPath = "VoteTop.Customization";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
plugin.getCommandLoader().processSlotClick(player, user, str);
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + ".Rewards").setGiveOffline(false)
|
||||
.send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (customization == null || !customzationEnabled || !customization.getBoolean("RemoveBottomBar")) {
|
||||
inv.setPages(true);
|
||||
}
|
||||
inv.setMaxInvSize(plugin.getGui().getChestVoteTopSize());
|
||||
inv.openInventory(player);
|
||||
} catch (Exception e) {
|
||||
|
||||
+7
-6
@@ -15,6 +15,7 @@ import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoterPlayer;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteTopVoterLastMonth extends GUIHandler {
|
||||
@@ -23,7 +24,7 @@ public class VoteTopVoterLastMonth extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteTopVoterLastMonth(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -44,7 +45,7 @@ public class VoteTopVoterLastMonth extends GUIHandler {
|
||||
|
||||
@Override
|
||||
public void onChest(Player player) {
|
||||
Set<Entry<VotingPluginUser, Integer>> users = null;
|
||||
Set<Entry<TopVoterPlayer, Integer>> users = null;
|
||||
|
||||
users = plugin.getLastMonthTopVoter().entrySet();
|
||||
|
||||
@@ -55,7 +56,7 @@ public class VoteTopVoterLastMonth extends GUIHandler {
|
||||
}
|
||||
|
||||
int pos = 1;
|
||||
for (Entry<VotingPluginUser, Integer> entry : users) {
|
||||
for (Entry<TopVoterPlayer, Integer> entry : users) {
|
||||
ItemBuilder playerItem;
|
||||
|
||||
if (plugin.getGui().isChestVoteTopUseSkull()) {
|
||||
@@ -73,15 +74,15 @@ public class VoteTopVoterLastMonth extends GUIHandler {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
VotingPluginUser user = (VotingPluginUser) getData("User");
|
||||
new VoteGUI(plugin, player, user)
|
||||
TopVoterPlayer user = (TopVoterPlayer) getData("User");
|
||||
new VoteGUI(plugin, player, user.getUser())
|
||||
.open(GUIMethod.valueOf(plugin.getGui().getGuiMethodGUI().toUpperCase()));
|
||||
}
|
||||
}.addData("player", entry.getKey().getPlayerName()).addData("User", entry.getKey()));
|
||||
pos++;
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteTopBackButton()) {
|
||||
if (plugin.getGui().isChestVoteTopBackButton()) {
|
||||
inv.getPageButtons().add(plugin.getCommandLoader().getBackButton(user).setSlot(1));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,23 +8,24 @@ import org.bukkit.entity.Player;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
public class VoteTotal extends GUIHandler {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private VotingPluginMain plugin;
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteTotal(VotingPluginMain plugin, CommandSender player, VotingPluginUser user) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
}
|
||||
@@ -66,7 +67,7 @@ public class VoteTotal extends GUIHandler {
|
||||
inv.addPlaceholder("player", user.getPlayerName());
|
||||
|
||||
for (final TopVoter top : TopVoter.values()) {
|
||||
inv.addButton(new UpdatingBInventoryButton(
|
||||
inv.addButton(new UpdatingBInventoryButton(plugin,
|
||||
new ItemBuilder(plugin.getGui().getChestVoteTotalItem(top))
|
||||
.addPlaceholder("Total", "" + user.getTotal(top)).addPlaceholder("topvoter", top.getName()),
|
||||
1000, 1000) {
|
||||
@@ -85,7 +86,23 @@ public class VoteTotal extends GUIHandler {
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteTotalBackButton()) {
|
||||
String guiPath = "VoteTotal";
|
||||
for (final String str : plugin.getGui().getChestGUIExtraItems(guiPath)) {
|
||||
inv.addButton(
|
||||
new BInventoryButton(new ItemBuilder(plugin.getGui().getChestGUIExtraItemsItem(guiPath, str))) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST." + guiPath + ".ExtraItems." + str + "."
|
||||
+ clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().isChestVoteTotalBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
inv.openInventory(player);
|
||||
|
||||
@@ -13,8 +13,8 @@ import com.bencodez.advancedcore.api.bookgui.Layout;
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventory.ClickEvent;
|
||||
import com.bencodez.advancedcore.api.inventory.BInventoryButton;
|
||||
import com.bencodez.advancedcore.api.inventory.UpdatingBInventoryButton;
|
||||
import com.bencodez.advancedcore.api.item.ItemBuilder;
|
||||
import com.bencodez.advancedcore.api.messages.MessageBuilder;
|
||||
@@ -24,7 +24,6 @@ import com.bencodez.advancedcore.api.rewards.RewardBuilder;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
import xyz.upperlevel.spigot.book.BookUtil;
|
||||
@@ -36,16 +35,16 @@ public class VoteURL extends GUIHandler {
|
||||
private VotingPluginUser user;
|
||||
|
||||
public VoteURL(VotingPluginMain plugin, CommandSender player, VotingPluginUser user, boolean json) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
this.json = json;
|
||||
if (user == null && player instanceof Player) {
|
||||
this.user = UserManager.getInstance().getVotingPluginUser((Player) player);
|
||||
this.user = plugin.getVotingPluginUserManager().getVotingPluginUser((Player) player);
|
||||
}
|
||||
if (player != null && user != null && player.getName().equals(user.getPlayerName())) {
|
||||
if (plugin.getConfigFile().isUsePrimaryAccountForPlaceholders() && user.hasPrimaryAccount()) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(user.getPrimaryAccount());
|
||||
user = plugin.getVotingPluginUserManager().getVotingPluginUser(user.getPrimaryAccount());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,9 +57,9 @@ public class VoteURL extends GUIHandler {
|
||||
if (title != null) {
|
||||
sites.addAll(title);
|
||||
}
|
||||
if (plugin.getConfigFile().getFormatCommandsVoteAutoInputSites()) {
|
||||
if (plugin.getConfigFile().isFormatCommandsVoteAutoInputSites()) {
|
||||
int counter = 0;
|
||||
for (VoteSite voteSite : plugin.getVoteSites()) {
|
||||
for (VoteSite voteSite : plugin.getVoteSitesEnabled()) {
|
||||
if (!voteSite.isHidden()) {
|
||||
counter++;
|
||||
String voteURL = voteSite.getVoteURL(json);
|
||||
@@ -115,17 +114,20 @@ public class VoteURL extends GUIHandler {
|
||||
|
||||
private ItemBuilder getItemVoteSite(VoteSite voteSite) {
|
||||
ItemBuilder builder = new ItemBuilder(plugin.getGui().getChestVoteURLAlreadyVotedItemSection());
|
||||
|
||||
|
||||
if (user.canVoteSite(voteSite)) {
|
||||
builder = new ItemBuilder(plugin.getGui().getChestVoteURLCanVoteItemSection());
|
||||
builder.setName(plugin.getGui().getChestVoteURLGUISiteNameCanVote().replace("%Name%", voteSite.getDisplayName()));
|
||||
builder.setName(plugin.getGui().getChestVoteURLGUISiteNameCanVote());
|
||||
} else {
|
||||
builder.setName(plugin.getGui().getChestVoteURLGUISiteName().replace("%Name%", voteSite.getDisplayName()));
|
||||
builder.addLoreLine(
|
||||
plugin.getGui().getChestVoteURLNextVote().replace("%Info%", user.voteCommandNextInfo(voteSite)));
|
||||
builder.setName(plugin.getGui().getChestVoteURLGUISiteName());
|
||||
builder.addLoreLine(plugin.getGui().getChestVoteURLNextVote());
|
||||
}
|
||||
builder.addPlaceholder("ServiceSite", voteSite.getServiceSite());
|
||||
builder.addPlaceholder("Name", voteSite.getDisplayName());
|
||||
builder.addPlaceholder("VoteDelay", "" + voteSite.getVoteDelay());
|
||||
builder.addPlaceholder("VoteHour", "" + voteSite.getVoteDelayDailyHour());
|
||||
builder.addPlaceholder("Info", user.voteCommandNextInfo(voteSite));
|
||||
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@@ -133,7 +135,12 @@ public class VoteURL extends GUIHandler {
|
||||
public void onBook(Player player) {
|
||||
BookWrapper book = new BookWrapper(plugin.getGui().getBookVoteURLBookGUITitle());
|
||||
|
||||
for (VoteSite site : plugin.getVoteSites()) {
|
||||
if (plugin.getGui().isBookVoteURLBookGUIManual()) {
|
||||
Layout layout = new Layout(plugin.getGui().getBookVoteURLBookGUITopLayout());
|
||||
book.addLayout(layout);
|
||||
}
|
||||
int i = 1;
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
Layout layout = new Layout(plugin.getGui().getBookVoteURLBookGUILayout()).addPlaceholder("sitename",
|
||||
site.getDisplayName());
|
||||
String text = plugin.getGui().getBookVoteURLBookGUIAlreadyVotedText();
|
||||
@@ -142,12 +149,12 @@ public class VoteURL extends GUIHandler {
|
||||
color = ChatColor.valueOf(plugin.getGui().getBookVoteURLBookGUICanVoteColor());
|
||||
text = plugin.getGui().getBookVoteURLBookGUICanVoteText();
|
||||
}
|
||||
String url = StringParser.getInstance().replacePlaceHolder(site.getVoteURLJsonStrip(), "player",
|
||||
user.getPlayerName());
|
||||
String url = StringParser.getInstance().replacePlaceHolder(StringParser.getInstance()
|
||||
.replacePlaceHolder(site.getVoteURLJsonStrip(), "player", user.getPlayerName()), "num", "" + i);
|
||||
layout.replaceTextComponent("[UrlText]", BookUtil.TextBuilder.of(text).color(color)
|
||||
.onClick(BookUtil.ClickAction.openUrl(url)).onHover(BookUtil.HoverAction.showText(url)).build());
|
||||
book.addLayout(layout);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
book.open(player);
|
||||
@@ -162,14 +169,14 @@ public class VoteURL extends GUIHandler {
|
||||
public void onChest(Player player) {
|
||||
// normal GUI
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteURLName());
|
||||
if (plugin.getGui().getChestVoteURLViewAllUrlsButtonEnabled()) {
|
||||
if (plugin.getGui().isChestVoteURLViewAllUrlsButtonEnabled()) {
|
||||
ItemBuilder builderAll = getItemAll();
|
||||
|
||||
inv.addButton(new UpdatingBInventoryButton(builderAll, 1000, 1000) {
|
||||
inv.addButton(new UpdatingBInventoryButton(plugin, builderAll, 5000, 5000) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(event.getPlayer());
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(event.getPlayer());
|
||||
json = true;
|
||||
user.sendMessage(getChat(player));
|
||||
}
|
||||
@@ -182,7 +189,7 @@ public class VoteURL extends GUIHandler {
|
||||
}
|
||||
|
||||
int startSlot = plugin.getGui().getChestVoteURLAllUrlsButtonStartSlot();
|
||||
for (final VoteSite voteSite : plugin.getVoteSites()) {
|
||||
for (final VoteSite voteSite : plugin.getVoteSitesEnabled()) {
|
||||
if (!voteSite.isHidden()) {
|
||||
ItemBuilder builder = getItemVoteSite(voteSite);
|
||||
if (startSlot >= 0) {
|
||||
@@ -190,18 +197,21 @@ public class VoteURL extends GUIHandler {
|
||||
startSlot++;
|
||||
}
|
||||
|
||||
inv.addButton(new UpdatingBInventoryButton(builder, 1000, 1000) {
|
||||
inv.addButton(new UpdatingBInventoryButton(plugin, builder, 5000, 5000) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (player != null) {
|
||||
VotingPluginUser user = UserManager.getInstance().getVotingPluginUser(player);
|
||||
user.sendMessage(StringParser.getInstance().replacePlaceHolder(StringParser.getInstance()
|
||||
.replacePlaceHolder(StringParser.getInstance().replacePlaceHolder(
|
||||
plugin.getGui().getChestVoteURLURLText(), "voteurl", voteSite.getVoteURL()),
|
||||
"sitename", voteSite.getDisplayName()),
|
||||
"player", player.getName()));
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(player);
|
||||
HashMap<String, String> placeholders = new HashMap<String, String>();
|
||||
placeholders.put("voteurl", voteSite.getVoteURL());
|
||||
placeholders.put("sitename", voteSite.getDisplayName());
|
||||
placeholders.put("player", player.getName());
|
||||
placeholders.put("servicesite", voteSite.getServiceSite());
|
||||
placeholders.put("VoteDelay", "" + voteSite.getVoteDelay());
|
||||
placeholders.put("VoteHour", "" + voteSite.getVoteDelayDailyHour());
|
||||
user.sendMessage(plugin.getGui().getChestVoteURLURLText(), placeholders);
|
||||
|
||||
}
|
||||
|
||||
@@ -221,14 +231,15 @@ public class VoteURL extends GUIHandler {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
new RewardBuilder(plugin.getGui().getData(), "CHEST.VoteURL.ExtraItems." + str + ".Rewards")
|
||||
new RewardBuilder(plugin.getGui().getData(),
|
||||
"CHEST.VoteURL.ExtraItems." + str + "." + clickEvent.getButton().getLastRewardsPath(player))
|
||||
.setGiveOffline(false).send(clickEvent.getPlayer());
|
||||
;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.getGui().getChestVoteURLBackButton()) {
|
||||
if (plugin.getGui().isChestVoteURLBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class VoteURLVoteSite extends GUIHandler {
|
||||
private String voteSite;
|
||||
|
||||
public VoteURLVoteSite(VotingPluginMain plugin, CommandSender player, VotingPluginUser user, String voteSite) {
|
||||
super(player);
|
||||
super(plugin, player);
|
||||
this.plugin = plugin;
|
||||
this.user = user;
|
||||
this.voteSite = voteSite;
|
||||
@@ -51,7 +51,7 @@ public class VoteURLVoteSite extends GUIHandler {
|
||||
player.sendMessage("Not a valid votesite");
|
||||
return;
|
||||
}
|
||||
VoteSite site = plugin.getVoteSite(voteSite);
|
||||
VoteSite site = plugin.getVoteSite(voteSite, true);
|
||||
BInventory inv = new BInventory(plugin.getGui().getChestVoteURLSiteName());
|
||||
inv.addPlaceholder("site", site.getDisplayName());
|
||||
inv.setMeta(player, "VoteSite", site);
|
||||
@@ -69,7 +69,7 @@ public class VoteURLVoteSite extends GUIHandler {
|
||||
}
|
||||
});
|
||||
|
||||
inv.addButton(new UpdatingBInventoryButton(
|
||||
inv.addButton(new UpdatingBInventoryButton(plugin,
|
||||
new ItemBuilder(Material.COMPASS).setName("&4Next Vote").addLoreLine(user.voteCommandNextInfo(site)),
|
||||
1000, 1000) {
|
||||
|
||||
@@ -94,7 +94,7 @@ public class VoteURLVoteSite extends GUIHandler {
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin.getGui().getChestVoteURLBackButton()) {
|
||||
if (plugin.getGui().isChestVoteURLBackButton()) {
|
||||
inv.addButton(plugin.getCommandLoader().getBackButton(user));
|
||||
}
|
||||
inv.openInventory(player);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.bencodez.votingplugin.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.bencodez.advancedcore.api.yml.YMLFile;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.AnnotationHandler;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataBoolean;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataInt;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataListString;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataString;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
|
||||
@@ -25,14 +27,30 @@ public class BungeeSettings extends YMLFile {
|
||||
@Getter
|
||||
private boolean bungeeDebug = false;
|
||||
|
||||
@ConfigDataBoolean(path = "VotifierBypass")
|
||||
@Getter
|
||||
private boolean votifierBypass = false;
|
||||
|
||||
@ConfigDataString(path = "BungeeMethod")
|
||||
@Getter
|
||||
private String bungeeMethod = "PLUGINMESSAGING";
|
||||
|
||||
@ConfigDataString(path = "Redis.Host")
|
||||
@Getter
|
||||
private String RedisHost = "";
|
||||
|
||||
@ConfigDataString(path = "Redis.Username")
|
||||
@Getter
|
||||
private String RedisUsername = "";
|
||||
|
||||
@ConfigDataString(path = "Redis.Prefix")
|
||||
@Getter
|
||||
private String RedisPrefix = "";
|
||||
|
||||
@ConfigDataString(path = "Redis.Password")
|
||||
@Getter
|
||||
private String RedisPassword = "";
|
||||
|
||||
@ConfigDataInt(path = "Redis.Port")
|
||||
@Getter
|
||||
private int RedisPort = 6379;
|
||||
|
||||
@ConfigDataString(path = "BungeeServer.Host")
|
||||
@Getter
|
||||
private String bungeeServerHost = "";
|
||||
@@ -41,14 +59,26 @@ public class BungeeSettings extends YMLFile {
|
||||
@Getter
|
||||
private int bungeeServerPort = 1297;
|
||||
|
||||
@ConfigDataBoolean(path = "RemoveInvalidUsers")
|
||||
@ConfigDataBoolean(path = "PerServerPoints")
|
||||
@Getter
|
||||
private boolean removeInvalidUsers = false;
|
||||
private boolean perServerPoints = false;
|
||||
|
||||
@ConfigDataBoolean(path = "PerServerMilestones")
|
||||
@Getter
|
||||
private boolean perServerMilestones = false;
|
||||
|
||||
@ConfigDataBoolean(path = "GiveExtraAllSitesRewards")
|
||||
@Getter
|
||||
private boolean giveExtraAllSitesRewards = false;
|
||||
|
||||
@ConfigDataBoolean(path = "PerServerRewards")
|
||||
@Getter
|
||||
private boolean perServerRewards = false;
|
||||
|
||||
@ConfigDataBoolean(path = "RemoveInvalidUsers")
|
||||
@Getter
|
||||
private boolean removeInvalidUsers = false;
|
||||
|
||||
@ConfigDataString(path = "Server")
|
||||
@Getter
|
||||
private String server = "PleaseSet";
|
||||
@@ -61,14 +91,42 @@ public class BungeeSettings extends YMLFile {
|
||||
@Getter
|
||||
private int spigotServerPort = 1298;
|
||||
|
||||
@ConfigDataBoolean(path = "TriggerVotifierEvent")
|
||||
@Getter
|
||||
private boolean triggerVotifierEvent = false;
|
||||
|
||||
@ConfigDataBoolean(path = "UseBungeecord", secondPath = "UseBungeecoord")
|
||||
@Getter
|
||||
private boolean useBungeecoord = false;
|
||||
|
||||
@ConfigDataBoolean(path = "VotifierBypass")
|
||||
@Getter
|
||||
private boolean votifierBypass = false;
|
||||
|
||||
@ConfigDataBoolean(path = "DisableBroadcast")
|
||||
@Getter
|
||||
private boolean disableBroadcast = false;
|
||||
|
||||
@ConfigDataBoolean(path = "GlobalData.UseMainMySQL")
|
||||
@Getter
|
||||
private boolean globlalDataUseMainMySQL = true;
|
||||
|
||||
@ConfigDataBoolean(path = "GlobalData.Enabled")
|
||||
@Getter
|
||||
private boolean globlalDataEnabled = false;
|
||||
|
||||
@ConfigDataListString(path = "BungeeVotePartyGlobalCommands")
|
||||
@Getter
|
||||
private ArrayList<String> bungeeVotePartyGlobalCommands = new ArrayList<String>();
|
||||
|
||||
public BungeeSettings(VotingPluginMain plugin) {
|
||||
super(plugin, new File(plugin.getDataFolder(), "BungeeSettings.yml"));
|
||||
}
|
||||
|
||||
public String getServerNameStorage() {
|
||||
return getServer().replace("-", "_");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadValues() {
|
||||
new AnnotationHandler().load(getData(), this);
|
||||
|
||||
@@ -12,9 +12,11 @@ import com.bencodez.advancedcore.api.yml.YMLFile;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.AnnotationHandler;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataBoolean;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataInt;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataKeys;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataListString;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataString;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.placeholders.PlaceholderCacheLevel;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
|
||||
import lombok.Getter;
|
||||
@@ -33,17 +35,29 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean addTotals = true;
|
||||
|
||||
@ConfigDataBoolean(path = "AddTotalsOffline")
|
||||
@Getter
|
||||
private boolean addTotalsOffline = true;
|
||||
|
||||
@ConfigDataBoolean(path = "PerSiteCoolDownEvents")
|
||||
@Getter
|
||||
private boolean perSiteCoolDownEvents = false;
|
||||
|
||||
@ConfigDataBoolean(path = "QueueVotesDuringTimeChange")
|
||||
@Getter
|
||||
private boolean queueVotesDuringTimeChange = false;
|
||||
|
||||
@ConfigDataBoolean(path = "AdvancedServiceSiteHandling")
|
||||
@Getter
|
||||
private boolean advancedServiceSiteHandling = false;
|
||||
|
||||
@ConfigDataBoolean(path = "AllowUnjoined")
|
||||
@Getter
|
||||
private boolean allowUnjoined = false;
|
||||
|
||||
@ConfigDataBoolean(path = "UseVoteGUIMainCommand")
|
||||
@ConfigDataBoolean(path = "PreloadSkulls")
|
||||
@Getter
|
||||
private boolean useVoteGUIMainCommand = false;
|
||||
|
||||
@ConfigDataBoolean(path = "ExtraAllSitesCheck")
|
||||
@Getter
|
||||
private boolean extraAllSitesCheck = false;
|
||||
private boolean preloadSkulls = false;
|
||||
|
||||
@ConfigDataBoolean(path = "AllowUnJoinedCheckServer")
|
||||
@Getter
|
||||
@@ -53,10 +67,6 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean allowVotePointTransfers = false;
|
||||
|
||||
@ConfigDataBoolean(path = "AlterColumns")
|
||||
@Getter
|
||||
private boolean alterColumns = true;
|
||||
|
||||
@ConfigDataBoolean(path = "AlternateUUIDLookup")
|
||||
@Getter
|
||||
private boolean alternateUUIDLookup = false;
|
||||
@@ -65,6 +75,14 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean alwaysCloseInventory = false;
|
||||
|
||||
@ConfigDataBoolean(path = "ExtraVoteShopCheck")
|
||||
@Getter
|
||||
private boolean extraVoteShopCheck = true;
|
||||
|
||||
@ConfigDataBoolean(path = "TrackShopPurchases")
|
||||
@Getter
|
||||
private boolean trackShopPurchases = false;
|
||||
|
||||
@ConfigDataBoolean(path = "AlwaysUpdate")
|
||||
@Getter
|
||||
private boolean alwaysUpdate = false;
|
||||
@@ -77,26 +95,6 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean broadcastVotesEnabled = true;
|
||||
|
||||
@ConfigDataBoolean(path = "clearCacheOnUpdate")
|
||||
@Getter
|
||||
private boolean clearCacheOnUpdate = false;
|
||||
|
||||
@ConfigDataBoolean(path = "ClearCacheOnVote")
|
||||
@Getter
|
||||
private boolean clearCacheOnVote = false;
|
||||
|
||||
@ConfigDataBoolean(path = "ClearCacheOnVoteShopPurchase")
|
||||
@Getter
|
||||
private boolean clearCacheOnVoteShopPurchase = true;
|
||||
|
||||
@ConfigDataInt(path = "ConvertAmount")
|
||||
@Getter
|
||||
private int convertAmount = 250;
|
||||
|
||||
@ConfigDataInt(path = "ConvertDelay", defaultValue = 30000)
|
||||
@Getter
|
||||
private int convertDelay;
|
||||
|
||||
@ConfigDataBoolean(path = "CountFakeVotes")
|
||||
@Getter
|
||||
private boolean countFakeVotes = true;
|
||||
@@ -109,6 +107,10 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean disableAdvancedTab = false;
|
||||
|
||||
@ConfigDataBoolean(path = "DisableCoolDownCheck")
|
||||
@Getter
|
||||
private boolean disableCoolDownCheck = false;
|
||||
|
||||
@ConfigDataListString(path = "DisabledCommands")
|
||||
@Getter
|
||||
private ArrayList<String> disabledCommands = new ArrayList<String>();
|
||||
@@ -117,6 +119,14 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private ArrayList<String> disabledDefaultPermissions = new ArrayList<String>();
|
||||
|
||||
@ConfigDataListString(path = "CachedPlaceholders")
|
||||
@Getter
|
||||
private ArrayList<String> cachedPlaceholders = new ArrayList<String>();
|
||||
|
||||
@ConfigDataBoolean(path = "DisableInteractEvent")
|
||||
@Getter
|
||||
private boolean disableInteractEvent = false;
|
||||
|
||||
@ConfigDataBoolean(path = "DisableNoServiceSiteMessage")
|
||||
@Getter
|
||||
private boolean disableNoServiceSiteMessage = false;
|
||||
@@ -125,10 +135,38 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean disableUpdateChecking = false;
|
||||
|
||||
@ConfigDataBoolean(path = "ExtraAllSitesCheck")
|
||||
@Getter
|
||||
private boolean extraAllSitesCheck = false;
|
||||
|
||||
@ConfigDataBoolean(path = "CloseInventoryOnVote")
|
||||
@Getter
|
||||
private boolean closeInventoryOnVote = true;
|
||||
|
||||
@ConfigDataBoolean(path = "ExtraBackgroundUpdate")
|
||||
@Getter
|
||||
private boolean extraBackgroundUpdate = false;
|
||||
|
||||
@ConfigDataString(path = "Format.AlternateBroadcast.Broadcast")
|
||||
@Getter
|
||||
private String formatAlternateBroadcastBroadcast = "&6[&4Broadcast&6] &2%numberofplayers% voted in the last half hour! /vote";
|
||||
|
||||
@ConfigDataInt(path = "Format.AlternateBroadcast.Delay")
|
||||
@Getter
|
||||
private int formatAlternateBroadcastDelay = 30;
|
||||
|
||||
@ConfigDataBoolean(path = "Format.AlternateBroadcast.Enabled")
|
||||
@Getter
|
||||
private boolean formatAlternateBroadcastEnabled = false;
|
||||
|
||||
@ConfigDataBoolean(path = "Format.OnlyOneOfflineBroadcast")
|
||||
@Getter
|
||||
private boolean formatOnlyOneOfflineBroadcast = false;
|
||||
|
||||
@ConfigDataString(path = "Format.OfflineBroadcast")
|
||||
@Getter
|
||||
private String formatOfflineBroadcast = "&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %numberofvotes% times!";
|
||||
|
||||
@ConfigDataBoolean(path = "Format.Commands.Vote.ForceLinks")
|
||||
@Getter
|
||||
private boolean formatCommandsVoteForceLinks = true;
|
||||
@@ -137,6 +175,26 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private String formatCommandsVoteLastLastVoted = "%times% ago";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.GivePoints.NotEnoughPoints")
|
||||
@Getter
|
||||
private String formatCommandsVoteGivePointsNotEnoughPoints = "&cNot enough points";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.GivePoints.NotJoinedServer")
|
||||
@Getter
|
||||
private String formatCommandsVoteGivePointsNotJoinedServer = "&c%player% has not joined the server";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.GivePoints.NumberLowerThanZero")
|
||||
@Getter
|
||||
private String formatCommandsVoteGivePointsNumberLowerThanZero = "&cNumber of points needs to be greater than 0";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.GivePoints.TransferFrom")
|
||||
@Getter
|
||||
private String formatCommandsVoteGivePointsTransferFrom = "&c%transfer% points given to %touser%";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.GivePoints.TransferTo")
|
||||
@Getter
|
||||
private String formatCommandsVoteGivePointsTransferTo = "&cYou received %transfer points from %fromuser%";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Last.Line", defaultValue = "&3%SiteName%: &6%timeSince% ago")
|
||||
@Getter
|
||||
private String formatCommandsVoteLastLine;
|
||||
@@ -145,6 +203,10 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private String formatCommandsVoteLastNeverVoted;
|
||||
|
||||
@ConfigDataBoolean(path = "Format.Commands.Vote.Last.IncludeSeconds")
|
||||
@Getter
|
||||
private boolean formatCommandsVoteLastIncludeSeconds = true;
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Last.TimeFormat", defaultValue = "%amount% %TimeType%")
|
||||
@Getter
|
||||
private String formatCommandsVoteLastTimeFormat;
|
||||
@@ -166,6 +228,14 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private String formatCommandsVoteToggleBroadcastEnabled = "&cYou will now see vote broadcasts";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.ToggleReminders.Disabled")
|
||||
@Getter
|
||||
private String formatCommandsVoteToggleRemindersDisabled = "&cVote reminders disabled";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.ToggleReminders.Enabled")
|
||||
@Getter
|
||||
private String formatCommandsVoteToggleRemindersEnabled = "&cVote reminders enabled";
|
||||
|
||||
@Getter
|
||||
private int formatPageSize = 10;
|
||||
|
||||
@@ -215,11 +285,7 @@ public class Config extends YMLFile {
|
||||
|
||||
@ConfigDataInt(path = "MaxiumNumberOfTopVotersToLoad")
|
||||
@Getter
|
||||
private int MaxiumNumberOfTopVotersToLoad = -1;
|
||||
|
||||
@ConfigDataInt(path = "DelayLoginEvent")
|
||||
@Getter
|
||||
private int delayLoginEvent = 0;
|
||||
private int MaxiumNumberOfTopVotersToLoad = 1000;
|
||||
|
||||
@ConfigDataBoolean(path = "OverrideVersionDisable")
|
||||
@Getter
|
||||
@@ -229,10 +295,22 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean preventRepeatMilestones = false;
|
||||
|
||||
@ConfigDataBoolean(path = "OfflineVotesLimit.Enabled")
|
||||
@Getter
|
||||
private boolean offlineVotesLimitEnabled = false;
|
||||
|
||||
@ConfigDataInt(path = "OfflineVotesLimit.Amount")
|
||||
@Getter
|
||||
private int offlineVotesLimitAmount = 5;
|
||||
|
||||
@ConfigDataBoolean(path = "UpdateWithPlayersOnlineOnly")
|
||||
@Getter
|
||||
private boolean updateWithPlayersOnlineOnly = false;
|
||||
|
||||
@ConfigDataBoolean(path = "UseHighestTotals")
|
||||
@Getter
|
||||
private boolean useHighestTotals = true;
|
||||
|
||||
@ConfigDataBoolean(path = "UseJavascriptPlaceholders")
|
||||
@Getter
|
||||
private boolean useJavascriptPlaceholders = false;
|
||||
@@ -241,9 +319,13 @@ public class Config extends YMLFile {
|
||||
@Getter
|
||||
private boolean usePrimaryAccountForPlaceholders = false;
|
||||
|
||||
@ConfigDataBoolean(path = "DisableCoolDownCheck")
|
||||
@ConfigDataBoolean(path = "UseVoteGUIMainCommand")
|
||||
@Getter
|
||||
private boolean disableCoolDownCheck = false;
|
||||
private boolean useVoteGUIMainCommand = false;
|
||||
|
||||
@ConfigDataBoolean(path = "UseVoteStreaks")
|
||||
@Getter
|
||||
private boolean useVoteStreaks = true;
|
||||
|
||||
@ConfigDataListString(path = "VotingBroadcastBlacklist")
|
||||
@Getter
|
||||
@@ -263,145 +345,101 @@ public class Config extends YMLFile {
|
||||
return (ArrayList<String>) getData().getList("BlackList", new ArrayList<String>());
|
||||
}
|
||||
|
||||
public Set<String> getCustomCommands() {
|
||||
Set<String> str = getData().getConfigurationSection("CustomCommands").getKeys(false);
|
||||
@ConfigDataKeys(path = "CustomCommands")
|
||||
@Getter
|
||||
private Set<String> customCommands = new HashSet<String>();
|
||||
|
||||
@ConfigDataKeys(path = "CustomPlaceholderReturns")
|
||||
@Getter
|
||||
private Set<String> customPlaceholderReturns = new HashSet<String>();
|
||||
|
||||
public Set<String> getCustomPlaceholderReturns(String placeholder) {
|
||||
Set<String> str = getData().getConfigurationSection("CustomPlaceholderReturns." + placeholder).getKeys(false);
|
||||
if (str == null) {
|
||||
str = new HashSet<String>();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public String getCustomPlaceholderReturns(String placeholder, String returnString) {
|
||||
return getData().getString("CustomPlaceholderReturns." + placeholder + "." + returnString, "");
|
||||
}
|
||||
|
||||
public ConfigurationSection getCustomCommands(String ident) {
|
||||
return getData().getConfigurationSection("CustomCommands." + ident);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the broad cast msg.
|
||||
*
|
||||
* @return the broad cast msg
|
||||
*/
|
||||
public String getFormatBroadCastMsg() {
|
||||
return getData().getString("Format.BroadcastMsg",
|
||||
"&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%");
|
||||
@ConfigDataString(path = "Format.BroadcastMsg")
|
||||
@Getter
|
||||
private String formatBroadCastMsg = "&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%";
|
||||
|
||||
@ConfigDataBoolean(path = "Format.BroadcastWhenOnline")
|
||||
@Getter
|
||||
private boolean formatBroadcastWhenOnline = false;
|
||||
|
||||
@ConfigDataBoolean(path = "Format.Commands.Vote.AutoInputSites")
|
||||
@Getter
|
||||
private boolean formatCommandsVoteAutoInputSites = true;
|
||||
|
||||
@ConfigDataListString(path = "Format.Commands.Vote.Best.Lines")
|
||||
@Getter
|
||||
private ArrayList<String> formatCommandsVoteBestLines = new ArrayList<String>();
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Best.Title")
|
||||
@Getter
|
||||
private String formatCommandsVoteBestTitle = "&3&l%player% Best Votes";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Help.HoverColor")
|
||||
@Getter
|
||||
private String formatCommandsVoteHelpHoverColor = "AQUA";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Help.Line")
|
||||
@Getter
|
||||
private String formatCommandsVoteHelpLine = "&6%Command% - &6%HelpMessage%";
|
||||
|
||||
@ConfigDataBoolean(path = "Format.Commands.Vote.Help.RequirePermission")
|
||||
@Getter
|
||||
private boolean formatCommandsVoteHelpRequirePermission = false;
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Help.Title")
|
||||
@Getter
|
||||
private String formatCommandsVoteHelpTitle = "&6Voting Player Help";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Last.Title")
|
||||
@Getter
|
||||
private String formatCommandsVoteLastTitle = "&3&l%player% Last Vote Times:";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Info.CanVote")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextInfoCanVote = "Go Vote!";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Info.Error")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextInfoError = "";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Info.TimeUntilVote")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextInfoTime = "&cCould not caculate time until next vote!";
|
||||
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Info.VoteDelayDaily")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextInfoVoteDelayDaily = "%hours% Hours and %minutes% Minutes";
|
||||
|
||||
@ConfigDataString(path = "PlaceholderCacheLevel", options = { "AUTO", "SPECIFIC", "NONE" })
|
||||
@Getter
|
||||
private String placeholderCacheLevelString = "AUTO";
|
||||
|
||||
public PlaceholderCacheLevel getPlaceholderCacheLevel() {
|
||||
return PlaceholderCacheLevel.getCache(getPlaceholderCacheLevelString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the broadcast when online.
|
||||
*
|
||||
* @return the broadcast when online
|
||||
*/
|
||||
public boolean getFormatBroadcastWhenOnline() {
|
||||
return getData().getBoolean("Format.BroadcastWhenOnline");
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Layout")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextLayout = "&3%SiteName%: &6%info%";
|
||||
|
||||
/**
|
||||
* Gets the commands vote auto input sites.
|
||||
*
|
||||
* @return the commands vote auto input sites
|
||||
*/
|
||||
public boolean getFormatCommandsVoteAutoInputSites() {
|
||||
return getData().getBoolean("Format.Commands.Vote.AutoInputSites");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayList<String> getFormatCommandsVoteBestLines() {
|
||||
return (ArrayList<String>) getData().getList("Format.Commands.Vote.Best.Lines", new ArrayList<String>());
|
||||
}
|
||||
|
||||
public String getFormatCommandsVoteBestTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Best.Title", "&3&l%player% Best Votes");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote help line.
|
||||
*
|
||||
* @return the commands vote help line
|
||||
*/
|
||||
public String getFormatCommandsVoteHelpLine() {
|
||||
return getData().getString("Format.Commands.Vote.Help.Line", "&6%Command% - &6%HelpMessage%");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote help require permission.
|
||||
*
|
||||
* @return the commands vote help require permission
|
||||
*/
|
||||
public boolean getFormatCommandsVoteHelpRequirePermission() {
|
||||
return getData().getBoolean("Format.Commands.Vote.Help.RequirePermission");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote help title.
|
||||
*
|
||||
* @return the commands vote help title
|
||||
*/
|
||||
public String getFormatCommandsVoteHelpTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Help.Title", "&6Voting Player Help");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote last title.
|
||||
*
|
||||
* @return the commands vote last title
|
||||
*/
|
||||
public String getFormatCommandsVoteLastTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Last.Title", "&3&l%player% Last Vote Times:");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote next info can vote.
|
||||
*
|
||||
* @return the commands vote next info can vote
|
||||
*/
|
||||
public String getFormatCommandsVoteNextInfoCanVote() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Info.CanVote", "Go Vote!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote next info error.
|
||||
*
|
||||
* @return the commands vote next info error
|
||||
*/
|
||||
public String getFormatCommandsVoteNextInfoError() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Info.Error", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote next info time.
|
||||
*
|
||||
* @return the commands vote next info time
|
||||
*/
|
||||
public String getFormatCommandsVoteNextInfoTime() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Info.TimeUntilVote",
|
||||
"&cCould not caculate time until next vote!");
|
||||
}
|
||||
|
||||
public String getFormatCommandsVoteNextInfoVoteDelayDaily() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Info.VoteDelayDaily",
|
||||
"%hours% Hours and %minutes% Minutes");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote next layout.
|
||||
*
|
||||
* @return the commands vote next layout
|
||||
*/
|
||||
public String getFormatCommandsVoteNextLayout() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Layout", "&3%SiteName%: &6%info%");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote next title.
|
||||
*
|
||||
* @return the commands vote next title
|
||||
*/
|
||||
public String getFormatCommandsVoteNextTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Next.Title", "&3&l%player% Next Votes:");
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Next.Title")
|
||||
@Getter
|
||||
private String formatCommandsVoteNextTitle = "&3&l%player% Next Votes:";
|
||||
|
||||
/**
|
||||
* Gets the commands vote party.
|
||||
@@ -421,9 +459,9 @@ public class Config extends YMLFile {
|
||||
return (ArrayList<String>) getData().getList("Format.Commands.Vote.Streak.Lines", new ArrayList<String>());
|
||||
}
|
||||
|
||||
public String getFormatCommandsVoteStreakTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Streak.Title", "&3&l%player% Vote Streak");
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Streak.Title")
|
||||
@Getter
|
||||
private String formatCommandsVoteStreakTitle = "&3&l%player% Vote Streak";
|
||||
|
||||
/**
|
||||
* Gets the commands vote text.
|
||||
@@ -466,167 +504,103 @@ public class Config extends YMLFile {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commands vote URLS.
|
||||
*
|
||||
* @return the commands vote URLS
|
||||
*/
|
||||
public String getFormatCommandsVoteURLS() {
|
||||
return getData().getString("Format.Commands.Vote.Sites", "&4%num%: &c&l%SiteName% - &c%url%");
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Sites")
|
||||
@Getter
|
||||
private String formatCommandsVoteURLS = "&4%num%: &c&l%SiteName% - &c%url%";
|
||||
|
||||
/**
|
||||
* Gets the command vote points.
|
||||
*
|
||||
* @return the command vote points
|
||||
*/
|
||||
public String getFormatCommandVotePoints() {
|
||||
return getData().getString("Format.Commands.Vote.Points", "&a%Player% currently has &a&l%Points%&a Points!");
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Points")
|
||||
@Getter
|
||||
private String formatCommandsVotePoints = "&a%Player% currently has &a&l%Points%&a Points!";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Top.Line")
|
||||
@Getter
|
||||
private String formatCommandsVoteTopLine = "&c%num%: &6%player%, %votes%";
|
||||
|
||||
/**
|
||||
* Gets the command vote top line.
|
||||
*
|
||||
* @return the command vote top line
|
||||
*/
|
||||
public String getFormatCommandVoteTopLine() {
|
||||
return getData().getString("Format.Commands.Vote.Top.Line", "&c%num%: &6%player%, %votes%");
|
||||
}
|
||||
@ConfigDataString(path = "Format.Commands.Vote.Top.Title")
|
||||
@Getter
|
||||
private String formatCommandVoteTopTitle = "&3Top %Top% Voters %page%/%maxpages%";
|
||||
|
||||
/**
|
||||
* Gets the command vote top title.
|
||||
*
|
||||
* @return the command vote top title
|
||||
*/
|
||||
public String getFormatCommandVoteTopTitle() {
|
||||
return getData().getString("Format.Commands.Vote.Top.Title", "&3Top %Top% Voters %page%/%maxpages%");
|
||||
@ConfigDataString(path = "Format.NextPage")
|
||||
@Getter
|
||||
private String formatNextPage = "&aNext Page";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.NoPerms")
|
||||
@Getter
|
||||
private String formatNoPerms = "&cYou do not have enough permission!";
|
||||
|
||||
public String getFormatNextPage() {
|
||||
return getData().getString("Format.NextPage", "&aNext Page");
|
||||
}
|
||||
@ConfigDataString(path = "Format.NotNumber")
|
||||
@Getter
|
||||
private String formatNotNumber = "&cError on &6%arg%&c, number expected!";
|
||||
|
||||
/**
|
||||
* Gets the format no perms.
|
||||
*
|
||||
* @return the format no perms
|
||||
*/
|
||||
public String getFormatNoPerms() {
|
||||
return getData().getString("Format.NoPerms", "&cYou do not have enough permission!");
|
||||
}
|
||||
@ConfigDataString(path = "Format.PrevPage")
|
||||
@Getter
|
||||
private String formatPrevPage = "&aPrevious Page";
|
||||
|
||||
public String getFormatNotNumber() {
|
||||
return getData().getString("Format.NotNumber", "&cError on &6%arg%&c, number expected!");
|
||||
}
|
||||
@ConfigDataString(path = "Format.ShopFailed")
|
||||
@Getter
|
||||
private String formatShopFailedMsg = "&cYou do not have %Points% points to purhcase this!";
|
||||
|
||||
public String getFormatPrevPage() {
|
||||
return getData().getString("Format.PrevPage", "&aPrevious Page");
|
||||
}
|
||||
@ConfigDataString(path = "Format.ShopNotPurchasable")
|
||||
@Getter
|
||||
private String formatShopNotPurchasable = "&cThis item is not buyable!";
|
||||
|
||||
public String getFormatShopFailedMsg() {
|
||||
String msg = getData().getString("Format.ShopFailed", "&cYou do not have %Points% points to purhcase this!");
|
||||
@ConfigDataString(path = "Format.ShopPurchase")
|
||||
@Getter
|
||||
private String formatShopPurchaseMsg = "&aYou bought the %Identifier% for %Points% Points!";
|
||||
|
||||
return msg;
|
||||
@ConfigDataString(path = "Format.Signs.TopVoterSign.Line1")
|
||||
@Getter
|
||||
private String formatSignTopVoterSignLine1 = "TopVoter: %SiteName%";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.Signs.TopVoterSign.Line2")
|
||||
@Getter
|
||||
private String formatSignTopVoterSignLine2 = "#%position%";
|
||||
@ConfigDataString(path = "Format.Signs.TopVoterSign.Line3")
|
||||
@Getter
|
||||
private String formatSignTopVoterSignLine3 = "%player%";
|
||||
@ConfigDataString(path = "Format.Signs.TopVoterSign.Line4")
|
||||
@Getter
|
||||
private String formatSignTopVoterSignLine4 = "%votes% Votes";
|
||||
|
||||
public String getFormatShopPurchaseMsg() {
|
||||
return getData().getString("Format.ShopPurchase", "&aYou bought the %Identifier% for %Points% Points!");
|
||||
@ConfigDataString(path = "Format.Signs.RightClickMessage")
|
||||
@Getter
|
||||
private String formatSignTopVoterSignRightClickMessage = "&c&l%player% &cis &c&l%position% &cwith &c&l%votes% &cin &c&l%SiteName%";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.TimeFormat")
|
||||
@Getter
|
||||
private String formatTimeFormat = "EEE, d MMM yyyy HH:mm";
|
||||
|
||||
/**
|
||||
* Gets the sign top voter sign line 1.
|
||||
*
|
||||
* @return the sign top voter sign line 1
|
||||
*/
|
||||
public String getFormatSignTopVoterSignLine1() {
|
||||
return getData().getString("Format.Signs.TopVoterSign.Line1", "TopVoter: %SiteName%");
|
||||
@ConfigDataString(path = "Format.TopVoter.AllTime")
|
||||
@Getter
|
||||
private String formatTopVoterAllTime = "AllTime";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.TopVoter.Daily")
|
||||
@Getter
|
||||
private String formatTopVoterDaily = "Daily";
|
||||
|
||||
/**
|
||||
* Gets the sign top voter sign line 2.
|
||||
*
|
||||
* @return the sign top voter sign line 2
|
||||
*/
|
||||
public String getFormatSignTopVoterSignLine2() {
|
||||
return getData().getString("Format.Signs.TopVoterSign.Line2", "#%position%");
|
||||
}
|
||||
@ConfigDataString(path = "Format.TopVoter.Monthly")
|
||||
@Getter
|
||||
private String formatTopVoterMonthly = "Monthly";
|
||||
|
||||
/**
|
||||
* Gets the sign top voter sign line 3.
|
||||
*
|
||||
* @return the sign top voter sign line 3
|
||||
*/
|
||||
public String getFormatSignTopVoterSignLine3() {
|
||||
return getData().getString("Format.Signs.TopVoterSign.Line3", "%player%");
|
||||
@ConfigDataString(path = "Format.TopVoterAwardMsg")
|
||||
@Getter
|
||||
private String formatTopVoterRewardMsg = "&aYou came in %place% in top voters of the month! Here is an award!";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.TopVoter.Weekly")
|
||||
@Getter
|
||||
private String formatTopVoterWeekly = "Weekly";
|
||||
|
||||
/**
|
||||
* Gets the sign top voter sign line 4.
|
||||
*
|
||||
* @return the sign top voter sign line 4
|
||||
*/
|
||||
public String getFormatSignTopVoterSignLine4() {
|
||||
return getData().getString("Format.Signs.TopVoterSign.Line4", "%votes% Votes");
|
||||
@ConfigDataString(path = "Format.UserNotExist")
|
||||
@Getter
|
||||
private String formatUserNotExist = "&cUser does not exist: %player%";
|
||||
|
||||
}
|
||||
@ConfigDataString(path = "Format.InvalidCommand.Vote")
|
||||
@Getter
|
||||
private String formatInvalidCommandVote = "&4No valid arguments, see /vote help!";
|
||||
|
||||
/**
|
||||
* Gets the sign top voter sign right click message.
|
||||
*
|
||||
* @return the sign top voter sign right click message
|
||||
*/
|
||||
public String getFormatSignTopVoterSignRightClickMessage() {
|
||||
return getData().getString("Format.Signs.RightClickMessage",
|
||||
"&c&l%player% &cis &c&l%position% &cwith &c&l%votes% &cin &c&l%SiteName%");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the time format.
|
||||
*
|
||||
* @return the time format
|
||||
*/
|
||||
public String getFormatTimeFormat() {
|
||||
return getData().getString("Format.TimeFormat", "EEE, d MMM yyyy HH:mm");
|
||||
|
||||
}
|
||||
|
||||
public String getFormatTopVoterAllTime() {
|
||||
return getData().getString("Format.TopVoter.AllTime", "AllTime");
|
||||
}
|
||||
|
||||
public String getFormatTopVoterDaily() {
|
||||
return getData().getString("Format.TopVoter.Daily", "Daily");
|
||||
}
|
||||
|
||||
public String getFormatTopVoterMonthly() {
|
||||
return getData().getString("Format.TopVoter.Monthly", "Monthly");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the top voter reward msg.
|
||||
*
|
||||
* @return the top voter reward msg
|
||||
*/
|
||||
public String getFormatTopVoterRewardMsg() {
|
||||
return getData().getString("Format.TopVoterAwardMsg",
|
||||
"&aYou came in %place% in top voters of the month! Here is an award!");
|
||||
|
||||
}
|
||||
|
||||
public String getFormatTopVoterWeekly() {
|
||||
return getData().getString("Format.TopVoter.Weekly", "Weekly");
|
||||
}
|
||||
|
||||
public String getFormatUserNotExist() {
|
||||
return getData().getString("Format.UserNotExist", "&cUser does not exist: %player%");
|
||||
}
|
||||
@ConfigDataString(path = "Format.InvalidCommand.AdminVote")
|
||||
@Getter
|
||||
private String formatInvalidCommandAdminVote = "&4No valid arguments, see /adminvote help!";
|
||||
|
||||
/**
|
||||
* Gets the vote help.
|
||||
@@ -638,141 +612,92 @@ public class Config extends YMLFile {
|
||||
return (ArrayList<String>) getData().getList("Format.Commands.Vote.Help.Lines", new ArrayList<String>());
|
||||
}
|
||||
|
||||
public boolean getGiveDefaultPermission() {
|
||||
return getData().getBoolean("GiveDefaultPermission", true);
|
||||
}
|
||||
@ConfigDataBoolean(path = "GiveDefaultPermission")
|
||||
@Getter
|
||||
private boolean giveDefaultPermission = true;
|
||||
|
||||
public boolean getLoadTopVoter(TopVoter top) {
|
||||
switch (top) {
|
||||
case AllTime:
|
||||
return getLoadTopVoterAllTime();
|
||||
return isLoadTopVoterAllTime();
|
||||
case Daily:
|
||||
return getLoadTopVoterDaily();
|
||||
return isLoadTopVoterDaily();
|
||||
case Monthly:
|
||||
return getLoadTopVoterMonthly();
|
||||
return isLoadTopVoterMonthly();
|
||||
case Weekly:
|
||||
return getLoadTopVoterWeekly();
|
||||
return isLoadTopVoterWeekly();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getLoadTopVoterAllTime() {
|
||||
return getData().getBoolean("LoadTopVoter.AllTime", true);
|
||||
}
|
||||
|
||||
@ConfigDataBoolean(path = "UseVoteStreaks")
|
||||
@ConfigDataBoolean(path = "LoadTopVoter.AllTime")
|
||||
@Getter
|
||||
private boolean useVoteStreaks = true;
|
||||
private boolean loadTopVoterAllTime = true;
|
||||
|
||||
@ConfigDataBoolean(path = "UseHighestTotals")
|
||||
@ConfigDataBoolean(path = "LoadTopVoter.Monthly")
|
||||
@Getter
|
||||
private boolean useHighestTotals = true;
|
||||
private boolean loadTopVoterMonthly = true;
|
||||
|
||||
public boolean getLoadTopVoterDaily() {
|
||||
return getData().getBoolean("LoadTopVoter.Daily", false);
|
||||
}
|
||||
@ConfigDataBoolean(path = "LoadTopVoter.Daily")
|
||||
@Getter
|
||||
private boolean loadTopVoterDaily = false;
|
||||
|
||||
public boolean getLoadTopVoterMonthly() {
|
||||
return getData().getBoolean("LoadTopVoter.Monthly", true);
|
||||
}
|
||||
@ConfigDataBoolean(path = "LoadTopVoter.Weekly")
|
||||
@Getter
|
||||
private boolean loadTopVoterWeekly = false;
|
||||
|
||||
public boolean getLoadTopVoterWeekly() {
|
||||
return getData().getBoolean("LoadTopVoter.Weekly", false);
|
||||
}
|
||||
@ConfigDataInt(path = "PointsOnVote")
|
||||
@Getter
|
||||
private int pointsOnVote = 1;
|
||||
|
||||
public int getPointsOnVote() {
|
||||
return getData().getInt("PointsOnVote", 1);
|
||||
}
|
||||
@ConfigDataInt(path = "PurgeMin")
|
||||
@Getter
|
||||
private int purgeMin = 90;
|
||||
|
||||
public int getPurgeMin() {
|
||||
return getData().getInt("PurgeMin", 90);
|
||||
}
|
||||
@ConfigDataBoolean(path = "PurgeOldData")
|
||||
@Getter
|
||||
private boolean purgeOldData = false;
|
||||
|
||||
public boolean getPurgeOldData() {
|
||||
return getData().getBoolean("PurgeOldData");
|
||||
}
|
||||
@ConfigDataString(path = "RequestAPI.DefaultMethod")
|
||||
@Getter
|
||||
private String requestAPIDefaultMethod = "ANVIL";
|
||||
|
||||
/**
|
||||
* Gets the request API default method.
|
||||
*
|
||||
* @return the request API default method
|
||||
*/
|
||||
public String getRequestAPIDefaultMethod() {
|
||||
return getData().getString("RequestAPI.DefaultMethod", "Anvil");
|
||||
}
|
||||
@ConfigDataListString(path = "RequestAPI.DisabledMethods")
|
||||
@Getter
|
||||
private ArrayList<String> requestAPIDisabledMethods = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* Gets the request API disabled methods.
|
||||
*
|
||||
* @return the request API disabled methods
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayList<String> getRequestAPIDisabledMethods() {
|
||||
return (ArrayList<String>) getData().getList("RequestAPI.DisabledMethods", new ArrayList<String>());
|
||||
}
|
||||
@ConfigDataBoolean(path = "StoreTopVoters.Daily")
|
||||
@Getter
|
||||
private boolean storeTopVotersDaily = false;
|
||||
|
||||
/**
|
||||
* Gets the store top voters daily.
|
||||
*
|
||||
* @return the store top voters daily
|
||||
*/
|
||||
public boolean getStoreTopVotersDaily() {
|
||||
return getData().getBoolean("StoreTopVoters.Daily");
|
||||
}
|
||||
@ConfigDataBoolean(path = "StoreTopVoters.Weekly")
|
||||
@Getter
|
||||
private boolean storeTopVotersWeekly = false;
|
||||
|
||||
/**
|
||||
* Gets the store top voters weekly.
|
||||
*
|
||||
* @return the store top voters weekly
|
||||
*/
|
||||
public boolean getStoreTopVotersWeekly() {
|
||||
return getData().getBoolean("StoreTopVoters.Weekly");
|
||||
}
|
||||
@ConfigDataBoolean(path = "TopVoterAwardsTies")
|
||||
@Getter
|
||||
private boolean topVoterAwardsTies = true;
|
||||
|
||||
public boolean getTopVoterAwardsTies() {
|
||||
return getData().getBoolean("TopVoterAwardsTies", true);
|
||||
}
|
||||
@ConfigDataBoolean(path = "TopVoterIgnorePermission")
|
||||
@Getter
|
||||
private boolean topVoterIgnorePermission = false;
|
||||
|
||||
public boolean getTopVoterIgnorePermission() {
|
||||
return getData().getBoolean("TopVoterIgnorePermission");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteReminding.Enabled")
|
||||
@Getter
|
||||
private boolean voteRemindingEnabled = true;
|
||||
|
||||
/**
|
||||
* Gets the enabled.
|
||||
*
|
||||
* @return the enabled
|
||||
*/
|
||||
public boolean getVoteRemindingEnabled() {
|
||||
return getData().getBoolean("VoteReminding.Enabled");
|
||||
}
|
||||
@ConfigDataInt(path = "VoteReminding.RemindDelay")
|
||||
@Getter
|
||||
private int voteRemindingRemindDelay = 30;
|
||||
|
||||
/**
|
||||
* Gets the remind delay.
|
||||
*
|
||||
* @return the remind delay
|
||||
*/
|
||||
public int getVoteRemindingRemindDelay() {
|
||||
return getData().getInt("VoteReminding.RemindDelay", 30);
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteReminding.RemindOnLogin")
|
||||
@Getter
|
||||
private boolean voteRemindingRemindOnLogin = false;
|
||||
|
||||
/**
|
||||
* Gets the remind on login.
|
||||
*
|
||||
* @return the remind on login
|
||||
*/
|
||||
public boolean getVoteRemindingRemindOnLogin() {
|
||||
return getData().getBoolean("VoteReminding.RemindOnLogin");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the remind only once.
|
||||
*
|
||||
* @return the remind only once
|
||||
*/
|
||||
public boolean getVoteRemindingRemindOnlyOnce() {
|
||||
return getData().getBoolean("VoteReminding.RemindOnlyOnce");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteReminding.RemindOnlyOnce")
|
||||
@Getter
|
||||
private boolean voteRemindingRemindOnlyOnce = false;
|
||||
|
||||
/**
|
||||
* Gets the rewards.
|
||||
@@ -783,9 +708,9 @@ public class Config extends YMLFile {
|
||||
return "VoteReminding.Rewards";
|
||||
}
|
||||
|
||||
public String getVoteTopDefault() {
|
||||
return getData().getString("VoteTopDefault", "Monthly");
|
||||
}
|
||||
@ConfigDataString(path = "VoteTopDefault")
|
||||
@Getter
|
||||
private String voteTopDefault = "Monthly";
|
||||
|
||||
@Override
|
||||
public void loadValues() {
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.advancedcore.api.messages.StringParser;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.advancedcore.api.rewards.DirectlyDefinedReward;
|
||||
import com.bencodez.advancedcore.api.yml.YMLFile;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
@@ -41,18 +42,65 @@ public class ConfigVoteSites extends YMLFile {
|
||||
if (plugin.getConfigFile().isAutoCreateVoteSites()) {
|
||||
String org = siteName;
|
||||
siteName = siteName.replace(".", "_");
|
||||
plugin.getLogger().warning("VoteSite " + siteName
|
||||
+ " does not exist, creating one, set AutoCreateVoteSites to false to prevent this");
|
||||
plugin.getLogger().warning("VoteSite " + siteName + " does not exist with the servicesite '" + org
|
||||
+ "', creating one, set AutoCreateVoteSites to false to prevent this");
|
||||
setEnabled(siteName, true);
|
||||
setServiceSite(siteName, org);
|
||||
setVoteURL(siteName, "VoteURL");
|
||||
setVoteDelay(siteName, 24);
|
||||
set(siteName, "DisplayItem.Material", "GRASS");
|
||||
set(siteName, "DisplayItem.Material", "STONE");
|
||||
set(siteName, "DisplayItem.Amount", 1);
|
||||
set(siteName, "Rewards.Messages.Player", "&aThanks for voting on %ServiceSite%!");
|
||||
|
||||
plugin.loadVoteSites();
|
||||
|
||||
plugin.addDirectlyDefinedRewards(new DirectlyDefinedReward("VoteSites." + siteName + ".Rewards") {
|
||||
|
||||
@Override
|
||||
public void createSection(String key) {
|
||||
plugin.getConfigVoteSites().createSection(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationSection getFileData() {
|
||||
return plugin.getConfigVoteSites().getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
plugin.getConfigVoteSites().saveData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(String path, Object value) {
|
||||
plugin.getConfigVoteSites().setValue(path, value);
|
||||
}
|
||||
});
|
||||
|
||||
plugin.addDirectlyDefinedRewards(
|
||||
new DirectlyDefinedReward("VoteSites." + siteName + ".CoolDownEndRewards") {
|
||||
|
||||
@Override
|
||||
public void createSection(String key) {
|
||||
plugin.getConfigVoteSites().createSection(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationSection getFileData() {
|
||||
return plugin.getConfigVoteSites().getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
plugin.getConfigVoteSites().saveData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(String path, Object value) {
|
||||
plugin.getConfigVoteSites().setValue(path, value);
|
||||
}
|
||||
});
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (p.hasPermission("VotingPlugin.Admin.GenerateServiceSite") || p.isOp()) {
|
||||
p.sendMessage(StringParser.getInstance().colorize("&cGenerating votesite for service site "
|
||||
@@ -69,6 +117,9 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @return the data
|
||||
*/
|
||||
public ConfigurationSection getData(String siteName) {
|
||||
if (!getData().isConfigurationSection("VoteSites." + siteName)) {
|
||||
plugin.getLogger().warning("VoteSites." + siteName + " is not a configuration section");
|
||||
}
|
||||
return getData().getConfigurationSection("VoteSites." + siteName);
|
||||
}
|
||||
|
||||
@@ -117,8 +168,8 @@ public class ConfigVoteSites extends YMLFile {
|
||||
return getData(siteName).getString("ServiceSite");
|
||||
}
|
||||
|
||||
public int getTimeOffSet(String siteName) {
|
||||
return getData(siteName).getInt("TimeOffSet", 0);
|
||||
public int getVoteDelayDailyHour(String siteName) {
|
||||
return getData(siteName).getInt("VoteDelayDailyHour", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,12 +178,12 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @param siteName the site name
|
||||
* @return the vote delay
|
||||
*/
|
||||
public int getVoteDelay(String siteName) {
|
||||
return getData(siteName).getInt("VoteDelay", 24);
|
||||
public double getVoteDelay(String siteName) {
|
||||
return getData(siteName).getDouble("VoteDelay", 24);
|
||||
}
|
||||
|
||||
public int getVoteDelayMin(String siteName) {
|
||||
return getData(siteName).getInt("VoteDelayMin", 0);
|
||||
public double getVoteDelayMin(String siteName) {
|
||||
return getData(siteName).getDouble("VoteDelayMin", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,10 +195,6 @@ public class ConfigVoteSites extends YMLFile {
|
||||
public boolean getVoteSiteEnabled(String siteName) {
|
||||
return getData(siteName).getBoolean("Enabled");
|
||||
}
|
||||
|
||||
public boolean getVoteSiteHidden(String siteName) {
|
||||
return getData(siteName).getBoolean("Hidden");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote site file.
|
||||
@@ -174,6 +221,14 @@ public class ConfigVoteSites extends YMLFile {
|
||||
return getData(site).getBoolean("ForceOffline", getData(site).getBoolean("GiveOffline"));
|
||||
}
|
||||
|
||||
public boolean getVoteSiteHidden(String siteName) {
|
||||
return getData(siteName).getBoolean("Hidden");
|
||||
}
|
||||
|
||||
public boolean getVoteSiteIgnoreCanVote(String siteName) {
|
||||
return getData(siteName).getBoolean("IgnoreCanVote");
|
||||
}
|
||||
|
||||
public boolean getVoteSiteResetVoteDelayDaily(String siteName) {
|
||||
return getData(siteName).getBoolean("VoteDelayDaily");
|
||||
}
|
||||
@@ -185,14 +240,16 @@ public class ConfigVoteSites extends YMLFile {
|
||||
*/
|
||||
public ArrayList<VoteSite> getVoteSitesLoad() {
|
||||
ArrayList<VoteSite> voteSites = new ArrayList<VoteSite>();
|
||||
ArrayList<String> voteSiteNames = getVoteSitesNames();
|
||||
ArrayList<String> voteSiteNames = getVoteSitesNames(true);
|
||||
if (voteSiteNames != null) {
|
||||
for (String site : voteSiteNames) {
|
||||
if (getVoteSiteEnabled(site) && !site.equalsIgnoreCase("null")) {
|
||||
if (!siteCheck(site)) {
|
||||
plugin.getLogger().warning("Failed to load site " + site + ", see above");
|
||||
} else {
|
||||
voteSites.add(new VoteSite(plugin, site));
|
||||
VoteSite voteSite = new VoteSite(plugin, site);
|
||||
plugin.debug(voteSite.loadingDebug());
|
||||
voteSites.add(voteSite);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,12 +275,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
return voteSites;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote sites names.
|
||||
*
|
||||
* @return the vote sites names
|
||||
*/
|
||||
public ArrayList<String> getVoteSitesNames() {
|
||||
public ArrayList<String> getVoteSitesNames(boolean checkEnabled) {
|
||||
ArrayList<String> siteNames = new ArrayList<String>();
|
||||
if (getData().isConfigurationSection("VoteSites")) {
|
||||
siteNames = ArrayUtils.getInstance().convert(getData().getConfigurationSection("VoteSites").getKeys(false));
|
||||
@@ -231,11 +283,14 @@ public class ConfigVoteSites extends YMLFile {
|
||||
|
||||
for (int i = siteNames.size() - 1; i >= 0; i--) {
|
||||
// plugin.getLogger().info(siteNames.get(i));
|
||||
if (!getVoteSiteEnabled(siteNames.get(i)) || siteNames.get(i).equalsIgnoreCase("null")
|
||||
|| !siteCheck(siteNames.get(i))) {
|
||||
if (!getData().isConfigurationSection("VoteSites." + siteNames.get(i))) {
|
||||
plugin.getLogger()
|
||||
.warning("VoteSites." + siteNames.get(i) + " is not a configuration section, please remove");
|
||||
siteNames.remove(i);
|
||||
} else if (siteNames.get(i).equalsIgnoreCase("null")
|
||||
|| (!getVoteSiteEnabled(siteNames.get(i)) && checkEnabled) || !siteCheck(siteNames.get(i))) {
|
||||
// plugin.getLogger().info("Removed: " + siteNames.get(i));
|
||||
siteNames.remove(i);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -388,7 +443,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @param siteName the site name
|
||||
* @param voteDelay the vote delay
|
||||
*/
|
||||
public void setVoteDelay(String siteName, int voteDelay) {
|
||||
public void setVoteDelay(String siteName, double voteDelay) {
|
||||
set(siteName, "VoteDelay", voteDelay);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.bencodez.advancedcore.api.yml.YMLFile;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.AnnotationHandler;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataBoolean;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataConfigurationSection;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataInt;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataKeys;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataListString;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataString;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
@@ -33,6 +35,10 @@ public class GUI extends YMLFile {
|
||||
@Getter
|
||||
private String bookVoteURLBookGUICanVoteColor = "GREEN";
|
||||
|
||||
@ConfigDataBoolean(path = "BOOK.VoteURLBookGUI.Manual")
|
||||
@Getter
|
||||
private boolean bookVoteURLBookGUIManual = false;
|
||||
|
||||
@ConfigDataString(path = "BOOK.VoteURLBookGUI.CanVoteText")
|
||||
@Getter
|
||||
private String bookVoteURLBookGUICanVoteText = "Click me";
|
||||
@@ -42,6 +48,10 @@ public class GUI extends YMLFile {
|
||||
private ArrayList<String> bookVoteURLBookGUILayout = ArrayUtils.getInstance()
|
||||
.convert(new String[] { "&c%Sitename%", "[UrlText]" });
|
||||
|
||||
@ConfigDataListString(path = "BOOK.VoteURLBookGUI.TopLayout")
|
||||
@Getter
|
||||
private ArrayList<String> bookVoteURLBookGUITopLayout = new ArrayList<String>();
|
||||
|
||||
@ConfigDataString(path = "BOOK.VoteURLBookGUI.Title")
|
||||
@Getter
|
||||
private String bookVoteURLBookGUITitle = "&cVoteURL";
|
||||
@@ -74,6 +84,10 @@ public class GUI extends YMLFile {
|
||||
@Getter
|
||||
private boolean chestVoteShopRequireConfirmation = false;
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteBest.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteBestBackButton = true;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteToday.IconTitle")
|
||||
@Getter
|
||||
private String chestVoteTodayIconTitle = "%player%";
|
||||
@@ -142,403 +156,17 @@ public class GUI extends YMLFile {
|
||||
@Getter
|
||||
private boolean lastMonthGUI = false;
|
||||
|
||||
private VotingPluginMain plugin;
|
||||
@ConfigDataBoolean(path = "CHEST.VoteLast.ClickableLinks")
|
||||
@Getter
|
||||
private boolean chestVoteLastClickableLinks = true;
|
||||
|
||||
public String getCHESTVoteShopPurchase(String identifier) {
|
||||
return getData().getString("CHEST.Shop." + identifier + ".PurchaseMessage",
|
||||
plugin.getConfigFile().getFormatShopPurchaseMsg());
|
||||
}
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public GUI(VotingPluginMain plugin) {
|
||||
super(plugin, new File(plugin.getDataFolder(), "GUI.yml"));
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public ConfigurationSection getCHESTBackButton() {
|
||||
return getData().getConfigurationSection("CHEST.BackButton");
|
||||
}
|
||||
|
||||
public int getChestShopIdentifierCost(String identifier) {
|
||||
return getData().getInt("CHEST.Shop." + identifier + ".Cost");
|
||||
}
|
||||
|
||||
public String getChestShopIdentifierIdentifierName(String identifier) {
|
||||
return getData().getString("CHEST.Shop." + identifier + ".Identifier_Name", identifier);
|
||||
}
|
||||
|
||||
public int getChestShopIdentifierLimit(String identifier) {
|
||||
return getData().getInt("CHEST.Shop." + identifier + ".Limit", -1);
|
||||
}
|
||||
|
||||
public String getChestShopIdentifierRewardsPath(String identifier) {
|
||||
return "CHEST.Shop." + identifier + ".Rewards";
|
||||
|
||||
}
|
||||
|
||||
public Set<String> getChestShopIdentifiers() {
|
||||
ConfigurationSection shop = getData().getConfigurationSection("CHEST.Shop");
|
||||
if (shop != null) {
|
||||
return shop.getKeys(false);
|
||||
}
|
||||
return new HashSet<String>();
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestShopIdentifierSection(String identifier) {
|
||||
return getData().getConfigurationSection("CHEST.Shop." + identifier);
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteBestDayBestItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteBest.DayBest.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteBestMonthBestItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteBest.MonthBest.Item");
|
||||
}
|
||||
|
||||
public String getChestVoteBestName() {
|
||||
return getData().getString("CHEST.VoteBest.Name", "VoteBest: %player%");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteBestWeekBestItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteBest.WeekBest.Item");
|
||||
}
|
||||
|
||||
public String getChestVoteGUIName() {
|
||||
return getData().getString("CHEST.VoteGUIName", "&cVoteGUI: &c&l%player%");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot command.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot command
|
||||
*/
|
||||
|
||||
public String getChestVoteGUISlotCommand(String slot) {
|
||||
return getData().getString("CHEST.VoteGUI." + slot + ".Command", "");
|
||||
}
|
||||
|
||||
public String getChestVoteGUISlotRewardsPath(String slot) {
|
||||
return "CHEST.VoteGUI." + slot + ".Rewards";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot lore.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot lore
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayList<String> getChestVoteGUISlotLore(String slot) {
|
||||
return (ArrayList<String>) getData().getList("CHEST.VoteGUI." + slot + ".Item.Lore", new ArrayList<String>());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slots.
|
||||
*
|
||||
* @return the vote GUI slots
|
||||
*/
|
||||
public Set<String> getChestVoteGUISlots() {
|
||||
try {
|
||||
return getData().getConfigurationSection("CHEST.VoteGUI").getKeys(false);
|
||||
} catch (Exception ex) {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteGUISlotSection(String slot) {
|
||||
return getData().getConfigurationSection("CHEST.VoteGUI." + slot + ".Item");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot slot.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot slot
|
||||
*/
|
||||
public int getChestVoteGUISlotSlot(String slot) {
|
||||
return getData().getInt("CHEST.VoteGUI." + slot + ".Slot", -1);
|
||||
}
|
||||
|
||||
public boolean getChestVoteLastBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteLast.BackButton");
|
||||
}
|
||||
|
||||
public String getChestVoteLastName() {
|
||||
return getData().getString("CHEST.VoteLast.Name", "VoteLast: %player%");
|
||||
}
|
||||
|
||||
public boolean getChestVoteNextBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteNext.BackButton");
|
||||
}
|
||||
|
||||
public String getChestVoteNextName() {
|
||||
return getData().getString("CHEST.VoteNext.Name", "VoteNext: %player%");
|
||||
}
|
||||
|
||||
public String getChestVoteRewardName() {
|
||||
return getData().getString("CHEST.VoteRewardName", "VoteReward");
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteShopBackButton", true);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopCloseGUI(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".CloseGUI", true);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopEnabled() {
|
||||
return getData().getBoolean("CHEST.VoteShopEnabled", true);
|
||||
}
|
||||
|
||||
public String getChestVoteShopName() {
|
||||
return getData().getString("CHEST.VoteShopName", "VoteShop");
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopNotBuyable(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".NotBuyable", false);
|
||||
}
|
||||
|
||||
public String getChestVoteShopPermission(String ident) {
|
||||
return getData().getString("CHEST.Shop." + ident + ".Permission", "");
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetDaily(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Daily", false);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetMonthly(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Monthly", false);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetWeekly(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Weekly", false);
|
||||
}
|
||||
|
||||
public boolean getChestVoteStreakBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteStreak.BackButton");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakCurrentDayStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.CurrentDayStreak.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakCurrentMonthStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.CurrentMonthStreak.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakCurrentWeekStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.CurrentWeekStreak.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakHighestDayStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.HighestDayStreak.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakHighestMonthStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.HighestMonthStreak.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteStreakHighestWeekStreakItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteStreak.HighestWeekStreak.Item");
|
||||
}
|
||||
|
||||
public String getChestVoteStreakName() {
|
||||
return getData().getString("CHEST.VoteStreak.Name", "VoteStreak");
|
||||
}
|
||||
|
||||
public boolean getChestVoteTodayBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteToday.BackButton");
|
||||
}
|
||||
|
||||
public String getChestVoteTodayName() {
|
||||
return getData().getString("CHEST.VoteToday.Name", "VoteToday");
|
||||
}
|
||||
|
||||
public boolean getChestVoteTopBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteToday.BackButton");
|
||||
}
|
||||
|
||||
public String getChestVoteTopItemLore() {
|
||||
return getData().getString("CHEST.VoteTop.Item.Lore", "&3&lVotes: &3%votes%");
|
||||
}
|
||||
|
||||
public String getChestVoteTopItemName() {
|
||||
return getData().getString("CHEST.VoteTop.Item.Name", "&3&l%position%: &3%player%");
|
||||
}
|
||||
|
||||
public boolean getChestVoteTopOpenMainGUIOnClick() {
|
||||
return getData().getBoolean("CHEST.VoteTop.OpenMainGUIOnClick", true);
|
||||
}
|
||||
|
||||
public String getChestVoteTopName() {
|
||||
return getData().getString("CHEST.VoteTop.Name", "VoteTop %topvoter%");
|
||||
}
|
||||
|
||||
public int getChestVoteTopSize() {
|
||||
return getData().getInt("CHEST.VoteTop.Size", 27);
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTopSwitchItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteTop.SwitchItem");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTotalAllTimeTotalItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteTotal.AllTimeTotal.Item");
|
||||
}
|
||||
|
||||
public boolean getChestVoteTotalBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteTotal.BackButton");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTotalDayTotalItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteTotal.DayTotal.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTotalItem(TopVoter top) {
|
||||
switch (top) {
|
||||
case AllTime:
|
||||
return getChestVoteTotalAllTimeTotalItem();
|
||||
case Daily:
|
||||
return getChestVoteTotalDayTotalItem();
|
||||
case Monthly:
|
||||
return getChestVoteTotalMonthTotalItem();
|
||||
case Weekly:
|
||||
return getChestVoteTotalWeekTotalItem();
|
||||
default:
|
||||
return getChestVoteTotalAllTimeTotalItem();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTotalMonthTotalItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteTotal.MonthTotal.Item");
|
||||
}
|
||||
|
||||
public String getChestVoteTotalName() {
|
||||
return getData().getString("CHEST.VoteTotal.Name", "VoteTotal: %player%");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteTotalWeekTotalItem() {
|
||||
return getData().getConfigurationSection("CHEST.VoteTotal.WeekTotal.Item");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteURLAlreadyVotedAllUrlsButtonItemSection() {
|
||||
if (getData().isConfigurationSection("CHEST.VoteURL.AllUrlsButton.AlreadyVotedItem")) {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.AllUrlsButton.AlreadyVotedItem");
|
||||
} else {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.AlreadyVotedItem");
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteURLAlreadyVotedItemSection() {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.AlreadyVotedItem");
|
||||
}
|
||||
|
||||
public int getChestVoteURLAllUrlsButtonSlot() {
|
||||
return getData().getInt("CHEST.VoteURL.AllUrlsButton.Slot", -1);
|
||||
}
|
||||
|
||||
public int getChestVoteURLAllUrlsButtonStartSlot() {
|
||||
return getData().getInt("CHEST.VoteURL.StartSlot", -1);
|
||||
}
|
||||
|
||||
public Set<String> getChestVoteURLExtraItems() {
|
||||
if (getData().isConfigurationSection("CHEST.VoteURL.ExtraItems")) {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.ExtraItems").getKeys(false);
|
||||
}
|
||||
return new HashSet<String>();
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteURLExtraItemsItem(String item) {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.ExtraItems." + item);
|
||||
}
|
||||
|
||||
public boolean getChestVoteURLBackButton() {
|
||||
return getData().getBoolean("CHEST.VoteURL.BackButton");
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteURLCanVoteAllUrlsButtonItemSection() {
|
||||
if (getData().isConfigurationSection("CHEST.VoteURL.AllUrlsButton.CanVoteItem")) {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.AllUrlsButton.CanVoteItem");
|
||||
} else {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.CanVoteItem");
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestVoteURLCanVoteItemSection() {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.CanVoteItem");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote URL site name.
|
||||
*
|
||||
* @return the vote URL site name
|
||||
*/
|
||||
public String getChestVoteURLGUISiteName() {
|
||||
return getData().getString("CHEST.VoteURL.SiteName", "&c%Name%");
|
||||
}
|
||||
|
||||
public String getChestVoteURLGUISiteNameCanVote() {
|
||||
return getData().getString("CHEST.VoteURL.SiteNameCanVote", "&a%Name%");
|
||||
}
|
||||
|
||||
public String getChestVoteURLName() {
|
||||
return getData().getString("CHEST.VoteURL.Name", "&cVoteURL");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote URL next vote.
|
||||
*
|
||||
* @return the vote URL next vote
|
||||
*/
|
||||
public String getChestVoteURLNextVote() {
|
||||
return getData().getString("CHEST.VoteURL.NextVote", "&cCan Vote In: %Info%");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote URL see URL.
|
||||
*
|
||||
* @return the vote URL see URL
|
||||
*/
|
||||
public String getChestVoteURLSeeURL() {
|
||||
return getData().getString("CHEST.VoteURL.SeeURL", "&cClick to see URL");
|
||||
}
|
||||
|
||||
public String getChestVoteURLSiteName() {
|
||||
return getData().getString("CHEST.VoteURLSite.Name", "VoteSite %site%");
|
||||
}
|
||||
|
||||
public String getChestVoteURLURLText() {
|
||||
return getData().getString("CHEST.VoteURL.URLText", "%VoteUrl%");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote URL view all urls button enabled.
|
||||
*
|
||||
* @return the vote URL view all urls button enabled
|
||||
*/
|
||||
public boolean getChestVoteURLViewAllUrlsButtonEnabled() {
|
||||
return getData().getBoolean("CHEST.VoteURL.ViewAllUrlsButtonEnabled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadValues() {
|
||||
new AnnotationHandler().load(getData(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFileCreation() {
|
||||
plugin.saveResource("GUI.yml", true);
|
||||
}
|
||||
|
||||
public boolean isChestVoteShopRequireConfirmation(String identifier) {
|
||||
return getData().getBoolean("CHEST.Shop." + identifier + ".RequireConfirmation",
|
||||
isChestVoteShopRequireConfirmation());
|
||||
}
|
||||
|
||||
public void createShop(String value) {
|
||||
ConfigurationSection shopData = getData().createSection("CHEST.Shop." + value);
|
||||
shopData.set("Identifier_Name", value);
|
||||
@@ -555,6 +183,405 @@ public class GUI extends YMLFile {
|
||||
saveData();
|
||||
}
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.BackButton")
|
||||
@Getter
|
||||
private ConfigurationSection CHESTBackButton;
|
||||
|
||||
public int getChestShopIdentifierCost(String identifier) {
|
||||
return getData().getInt("CHEST.Shop." + identifier + ".Cost");
|
||||
}
|
||||
|
||||
public String getChestShopIdentifierIdentifierName(String identifier) {
|
||||
return getData().getString("CHEST.Shop." + identifier + ".Identifier_Name", identifier);
|
||||
}
|
||||
|
||||
public int getChestShopIdentifierLimit(String identifier) {
|
||||
return getData().getInt("CHEST.Shop." + identifier + ".Limit", -1);
|
||||
}
|
||||
|
||||
public String getChestShopIdentifierRewardsPath(String identifier) {
|
||||
return "CHEST.Shop." + identifier + ".Rewards";
|
||||
}
|
||||
|
||||
public Set<String> getChestShopIdentifiers() {
|
||||
ConfigurationSection shop = getData().getConfigurationSection("CHEST.Shop");
|
||||
if (shop != null) {
|
||||
return shop.getKeys(false);
|
||||
}
|
||||
return new HashSet<String>();
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestShopIdentifierSection(String identifier) {
|
||||
return getData().getConfigurationSection("CHEST.Shop." + identifier);
|
||||
}
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteBest.DayBest.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteBestDayBestItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteBest.MonthBest.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteBestMonthBestItem;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteBest.Name")
|
||||
@Getter
|
||||
private String chestVoteBestName = "VoteBest: %player%";
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteBest.WeekBest.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteBestWeekBestItem;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteGUIName")
|
||||
@Getter
|
||||
private String chestVoteGUIName = "&cVoteGUI: &c&l%player%";
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot command.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot command
|
||||
*/
|
||||
|
||||
public String getChestVoteGUISlotCommand(String slot) {
|
||||
return getData().getString("CHEST.VoteGUI." + slot + ".Command", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot lore.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot lore
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayList<String> getChestVoteGUISlotLore(String slot) {
|
||||
return (ArrayList<String>) getData().getList("CHEST.VoteGUI." + slot + ".Item.Lore", new ArrayList<String>());
|
||||
}
|
||||
|
||||
public String getChestVoteGUISlotRewardsPath(String slot, String lastPath) {
|
||||
return "CHEST.VoteGUI." + slot + "." + lastPath;
|
||||
}
|
||||
|
||||
@ConfigDataKeys(path = "CHEST.VoteGUI")
|
||||
@Getter
|
||||
private Set<String> chestVoteGUISlots = new HashSet<String>();
|
||||
|
||||
public ConfigurationSection getChestVoteGUISlotSection(String slot) {
|
||||
return getData().getConfigurationSection("CHEST.VoteGUI." + slot + ".Item");
|
||||
}
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTop.Customization")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTopCustomization;
|
||||
|
||||
/**
|
||||
* Gets the vote GUI slot slot.
|
||||
*
|
||||
* @param slot the slot
|
||||
* @return the vote GUI slot slot
|
||||
*/
|
||||
public int getChestVoteGUISlotSlot(String slot) {
|
||||
return getData().getInt("CHEST.VoteGUI." + slot + ".Slot", -1);
|
||||
}
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteLast.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteLastBackButton = false;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteLast.Line")
|
||||
@Getter
|
||||
private String chestVoteLastLine = "&6%timeSince%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteLast.Name")
|
||||
@Getter
|
||||
private String chestVoteLastName = "VoteLast: %player%";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteNext.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteNextBackButton = false;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteNext.Name")
|
||||
@Getter
|
||||
private String chestVoteNextName = "VoteNext: %player%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteNext.Line")
|
||||
@Getter
|
||||
private String chestVoteNextLine = "%time%";
|
||||
|
||||
public String getChestVoteNextCustomSiteNamesDisplays(String site) {
|
||||
return getData().getString("CHEST.VoteNext.CustomSiteNamesDisplays." + site, "");
|
||||
}
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteRewardName")
|
||||
@Getter
|
||||
private String chestVoteRewardName = "VoteReward";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteShopBackButton")
|
||||
@Getter
|
||||
private boolean chestVoteShopBackButton = true;
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteShopReopenGUIOnPurchase")
|
||||
@Getter
|
||||
private boolean chestVoteShopReopenGUIOnPurchase = true;
|
||||
|
||||
public boolean getChestVoteShopCloseGUI(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".CloseGUI", true);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopHideOnNoPermission(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".HideOnNoPermission", true);
|
||||
}
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteShopEnabled")
|
||||
@Getter
|
||||
private boolean chestVoteShopEnabled = true;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteShopName")
|
||||
@Getter
|
||||
private String chestVoteShopName = "VoteShop";
|
||||
|
||||
public boolean getChestVoteShopNotBuyable(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".NotBuyable", false);
|
||||
}
|
||||
|
||||
public String getChestVoteShopPermission(String ident) {
|
||||
return getData().getString("CHEST.Shop." + ident + ".Permission", "");
|
||||
}
|
||||
|
||||
public String getCHESTVoteShopPurchase(String identifier) {
|
||||
return getData().getString("CHEST.Shop." + identifier + ".PurchaseMessage",
|
||||
plugin.getConfigFile().getFormatShopPurchaseMsg());
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetDaily(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Daily", false);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetMonthly(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Monthly", false);
|
||||
}
|
||||
|
||||
public boolean getChestVoteShopResetWeekly(String shop) {
|
||||
return getData().getBoolean("CHEST.Shop." + shop + ".Reset.Weekly", false);
|
||||
}
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteStreak.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteStreakBackButton = false;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.CurrentDayStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakCurrentDayStreakItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.CurrentMonthStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakCurrentMonthStreakItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.CurrentWeekStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakCurrentWeekStreakItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.HighestDayStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakHighestDayStreakItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.HighestMonthStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakHighestMonthStreakItem;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteStreak.HighestWeekStreak.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteStreakHighestWeekStreakItem;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteStreak.Name")
|
||||
@Getter
|
||||
private String chestVoteStreakName = "VoteStreak";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteToday.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteTodayBackButton = false;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteToday.Name")
|
||||
@Getter
|
||||
private String chestVoteTodayName = "VoteToday";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteTop.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteTopBackButton = false;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteTop.Item.Lore")
|
||||
@Getter
|
||||
private String chestVoteTopItemLore = "&3&lVotes: &3%votes%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteTop.Item.Name")
|
||||
@Getter
|
||||
private String chestVoteTopItemName = "&3&l%position%: &3%player%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteTop.Name")
|
||||
@Getter
|
||||
private String chestVoteTopName = "VoteTop %topvoter%";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteTop.OpenMainGUIOnClick")
|
||||
@Getter
|
||||
private boolean chestVoteTopOpenMainGUIOnClick = true;
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteTop.CloseGUIOnClick")
|
||||
@Getter
|
||||
private boolean chestVoteTopCloseGUIOnClick = true;
|
||||
|
||||
@ConfigDataInt(path = "CHEST.VoteTop.Size")
|
||||
@Getter
|
||||
private int chestVoteTopSize = 27;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTop.SwitchItem")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTopSwitchItem;
|
||||
|
||||
@ConfigDataListString(path = "CHEST.VoteTop.SwitchItem.TopVoters")
|
||||
@Getter
|
||||
private ArrayList<String> chestVoteTopSwitchItemTopVoters = new ArrayList<String>();
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTotal.AllTimeTotal.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTotalAllTimeTotalItem;
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteTotal.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteTotalBackButton = false;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTotal.DayTotal.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTotalDayTotalItem;
|
||||
|
||||
public ConfigurationSection getChestVoteTotalItem(TopVoter top) {
|
||||
switch (top) {
|
||||
case AllTime:
|
||||
return getChestVoteTotalAllTimeTotalItem();
|
||||
case Daily:
|
||||
return getChestVoteTotalDayTotalItem();
|
||||
case Monthly:
|
||||
return getChestVoteTotalMonthTotalItem();
|
||||
case Weekly:
|
||||
return getChestVoteTotalWeekTotalItem();
|
||||
default:
|
||||
return getChestVoteTotalAllTimeTotalItem();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTotal.MonthTotal.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTotalMonthTotalItem;
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteTotal.Name")
|
||||
@Getter
|
||||
private String chestVoteTotalName = "VoteTotal: %player%";
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteTotal.WeekTotal.Item")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteTotalWeekTotalItem;
|
||||
|
||||
@ConfigDataInt(path = "CHEST.VoteURL.AllUrlsButton.Slot")
|
||||
@Getter
|
||||
private int chestVoteURLAllUrlsButtonSlot = -1;
|
||||
|
||||
@ConfigDataInt(path = "CHEST.VoteURL.StartSlot")
|
||||
@Getter
|
||||
private int chestVoteURLAllUrlsButtonStartSlot = -1;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteURL.AllUrlsButton.AlreadyVotedItem", secondPath = "CHEST.VoteURL.AlreadyVotedItem")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteURLAlreadyVotedAllUrlsButtonItemSection;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteURL.AlreadyVotedItem")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteURLAlreadyVotedItemSection;
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteURL.BackButton")
|
||||
@Getter
|
||||
private boolean chestVoteURLBackButton = false;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteURL.AllUrlsButton.CanVoteItem", secondPath = "CHEST.VoteURL.CanVoteItem")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteURLCanVoteAllUrlsButtonItemSection;
|
||||
|
||||
@ConfigDataConfigurationSection(path = "CHEST.VoteURL.CanVoteItem")
|
||||
@Getter
|
||||
private ConfigurationSection chestVoteURLCanVoteItemSection;
|
||||
|
||||
@ConfigDataKeys(path = "CHEST.VoteURL.ExtraItems")
|
||||
@Getter
|
||||
private Set<String> chestVoteURLExtraItems = new HashSet<String>();
|
||||
|
||||
public ConfigurationSection getChestVoteURLExtraItemsItem(String item) {
|
||||
return getData().getConfigurationSection("CHEST.VoteURL.ExtraItems." + item);
|
||||
}
|
||||
|
||||
public Set<String> getChestGUIExtraItems(String gui) {
|
||||
if (getData().isConfigurationSection("CHEST." + gui + ".ExtraItems")) {
|
||||
return getData().getConfigurationSection("CHEST." + gui + ".ExtraItems").getKeys(false);
|
||||
}
|
||||
return new HashSet<String>();
|
||||
}
|
||||
|
||||
public ConfigurationSection getChestGUIVoteShopExtraItems(String item) {
|
||||
return getData().getConfigurationSection("CHEST.VoteShopExtraItems." + item);
|
||||
}
|
||||
|
||||
@ConfigDataKeys(path = "CHEST.VoteShopExtraItems")
|
||||
@Getter
|
||||
private Set<String> chestGUIVoteShopExtraItems = new HashSet<String>();
|
||||
|
||||
public ConfigurationSection getChestGUIExtraItemsItem(String gui, String item) {
|
||||
return getData().getConfigurationSection("CHEST." + gui + ".ExtraItems." + item);
|
||||
}
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.SiteName")
|
||||
@Getter
|
||||
private String chestVoteURLGUISiteName = "&c%Name%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.SiteNameCanVote")
|
||||
@Getter
|
||||
private String chestVoteURLGUISiteNameCanVote = "&a%Name%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.Name")
|
||||
@Getter
|
||||
private String chestVoteURLName = "&cVoteURL";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.NextVote")
|
||||
@Getter
|
||||
private String chestVoteURLNextVote = "&cCan Vote In: %Info%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.SeeURL")
|
||||
@Getter
|
||||
private String chestVoteURLSeeURL = "&cClick to see URL";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURLSite.Name")
|
||||
@Getter
|
||||
private String chestVoteURLSiteName = "VoteSite %site%";
|
||||
|
||||
@ConfigDataString(path = "CHEST.VoteURL.URLText")
|
||||
@Getter
|
||||
private String chestVoteURLURLText = "%VoteUrl%";
|
||||
|
||||
@ConfigDataBoolean(path = "CHEST.VoteURL.ViewAllUrlsButtonEnabled")
|
||||
@Getter
|
||||
private boolean chestVoteURLViewAllUrlsButtonEnabled = false;
|
||||
|
||||
public boolean isChestVoteShopRequireConfirmation(String identifier) {
|
||||
return getData().getBoolean("CHEST.Shop." + identifier + ".RequireConfirmation",
|
||||
isChestVoteShopRequireConfirmation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadValues() {
|
||||
new AnnotationHandler().load(getData(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFileCreation() {
|
||||
plugin.saveResource("GUI.yml", true);
|
||||
}
|
||||
|
||||
public void removeShop(String value) {
|
||||
getData().set("CHEST.Shop." + value, null);
|
||||
saveData();
|
||||
|
||||
@@ -3,13 +3,19 @@ package com.bencodez.votingplugin.config;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.bencodez.advancedcore.api.yml.YMLFile;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.AnnotationHandler;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataBoolean;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataDouble;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataInt;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataKeys;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataListString;
|
||||
import com.bencodez.advancedcore.api.yml.annotation.ConfigDataString;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.topvoter.TopVoter;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -18,6 +24,9 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
@Getter
|
||||
private String allSitesRewardPath = "AllSites";
|
||||
|
||||
@Getter
|
||||
private String almostAllSitesRewardPath = "AlmostAllSites";
|
||||
|
||||
@Getter
|
||||
private String anySiteRewardsPath = "AnySiteRewards";
|
||||
|
||||
@@ -33,20 +42,47 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
@Getter
|
||||
private boolean enableWeeklyAwards = false;
|
||||
|
||||
@ConfigDataBoolean(path = "OnlyOneCumulative")
|
||||
@Getter
|
||||
private boolean onlyOneCumulative = false;
|
||||
|
||||
@Getter
|
||||
private String firstVoteRewardsPath = "FirstVote";
|
||||
|
||||
@Getter
|
||||
private String firstVoteTodayRewardsPath = "FirstVoteToday";
|
||||
|
||||
/** The plugin. */
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetExtraVotesMonthly")
|
||||
@ConfigDataBoolean(path = "VoteParty.GiveOnlinePlayersOnly")
|
||||
@Getter
|
||||
private boolean votePartyResetExtraVotesMonthly = false;
|
||||
private boolean votePartyGiveOnlinePlayersOnly = false;
|
||||
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetCount")
|
||||
@Getter
|
||||
private boolean votePartyResetCount = true;
|
||||
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetExtraVotesMonthly")
|
||||
@Getter
|
||||
private boolean votePartyResetExtraVotesMonthly = false;
|
||||
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetExtraVotesWeekly")
|
||||
@Getter
|
||||
private boolean votePartyResetExtraVotesWeekly = false;
|
||||
|
||||
@ConfigDataString(path = "VoteParty.VoteReminderBroadcast")
|
||||
@Getter
|
||||
private String votePartyVoteReminderBroadcast = "%votesrequired% left to go, go vote!";
|
||||
|
||||
@ConfigDataListString(path = "VoteParty.VoteReminderAtVotes")
|
||||
@Getter
|
||||
private ArrayList<String> votePartyVoteReminderAtVotes = new ArrayList<String>();
|
||||
|
||||
@ConfigDataListString(path = "VoteParty.GlobalRandomCommand")
|
||||
@Getter
|
||||
private ArrayList<String> votePartyGlobalRandomCommand = new ArrayList<String>();
|
||||
|
||||
@Getter
|
||||
private String votePartyRewardsPath = "VoteParty.Rewards";
|
||||
|
||||
@@ -79,58 +115,54 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
return "Cumulative." + cumulative + ".Rewards";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cumulative votes.
|
||||
*
|
||||
* @return the cumulative votes
|
||||
*/
|
||||
public Set<String> getCumulativeVotes() {
|
||||
try {
|
||||
Set<String> set = getData().getConfigurationSection("Cumulative").getKeys(false);
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
return new HashSet<String>();
|
||||
} catch (Exception ex) {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
public List<Integer> getCumulativeBlackList(int cumulative) {
|
||||
return getData().getIntegerList("Cumulative." + cumulative + ".BlackList");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cumulative votes in same day.
|
||||
*
|
||||
* @param cumulative the cumulative
|
||||
* @return the cumulative votes in same day
|
||||
*/
|
||||
public boolean getCumulativeRecurring(int cumulative) {
|
||||
return getData().getBoolean("Cumulative." + cumulative + ".Recurring", true);
|
||||
}
|
||||
|
||||
@ConfigDataKeys(path = "Cumulative")
|
||||
@Getter
|
||||
private Set<String> cumulativeVotes = new HashSet<String>();
|
||||
|
||||
@Deprecated
|
||||
public boolean getCumulativeVotesInSameDay(int cumulative) {
|
||||
return getData().getBoolean("Cumulative." + cumulative + ".VotesInSameDay");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean getCumulativeVotesInSameMonth(int cumulative) {
|
||||
return getData().getBoolean("Cumulative." + cumulative + ".VotesInSameMonth");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean getCumulativeVotesInSameWeek(int cumulative) {
|
||||
return getData().getBoolean("Cumulative." + cumulative + ".VotesInSameWeek");
|
||||
}
|
||||
|
||||
public String getCumulativeVotesTotal(int cumulative) {
|
||||
String str = getData().getString("Cumulative." + cumulative + ".TotalToUse", "");
|
||||
if (str.isEmpty()) {
|
||||
if (getCumulativeVotesInSameMonth(cumulative)) {
|
||||
return TopVoter.Monthly.toString();
|
||||
} else if (getCumulativeVotesInSameWeek(cumulative)) {
|
||||
return TopVoter.Weekly.toString();
|
||||
} else if (getCumulativeVotesInSameDay(cumulative)) {
|
||||
return TopVoter.Daily.toString();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public String getDailyAwardRewardsPath(String path) {
|
||||
return "DailyAwards." + path + ".Rewards";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the daily possible reward places.
|
||||
*
|
||||
* @return the daily possible reward places
|
||||
*/
|
||||
public Set<String> getDailyPossibleRewardPlaces() {
|
||||
try {
|
||||
return getData().getConfigurationSection("DailyAwards").getKeys(false);
|
||||
} catch (Exception ex) {
|
||||
return new HashSet<String>();
|
||||
|
||||
}
|
||||
}
|
||||
@ConfigDataKeys(path = "DailyAwards")
|
||||
@Getter
|
||||
private Set<String> dailyPossibleRewardPlaces = new HashSet<String>();
|
||||
|
||||
/**
|
||||
* Gets the milestone reward enabled.
|
||||
@@ -152,22 +184,9 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
return "MileStones." + milestones + ".Rewards";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the milestone votes.
|
||||
*
|
||||
* @return the milestone votes
|
||||
*/
|
||||
public Set<String> getMilestoneVotes() {
|
||||
try {
|
||||
Set<String> set = getData().getConfigurationSection("MileStones").getKeys(false);
|
||||
if (set != null) {
|
||||
return set;
|
||||
}
|
||||
return new HashSet<String>();
|
||||
} catch (Exception ex) {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
}
|
||||
@ConfigDataKeys(path = "MileStones")
|
||||
@Getter
|
||||
private Set<String> milestoneVotes = new HashSet<String>();
|
||||
|
||||
public String getMonthlyAwardRewardsPath(String path) {
|
||||
return "MonthlyAwards." + path + ".Rewards";
|
||||
@@ -186,77 +205,64 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getResetMilestonesMonthly() {
|
||||
return getData().getBoolean("ResetMilestonesMonthly");
|
||||
}
|
||||
@ConfigDataBoolean(path = "ResetMilestonesMonthly")
|
||||
@Getter
|
||||
private boolean resetMilestonesMonthly = false;
|
||||
@ConfigDataString(path = "VoteParty.Broadcast")
|
||||
@Getter
|
||||
private String votePartyBroadcast = "";
|
||||
|
||||
public String getVotePartyBroadcast() {
|
||||
return getData().getString("VoteParty.Broadcast", "");
|
||||
}
|
||||
@ConfigDataListString(path = "VoteParty.GlobalCommands", secondPath = "VoteParty.Commands")
|
||||
@Getter
|
||||
private ArrayList<String> votePartyGlobalCommands = new ArrayList<String>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayList<String> getVotePartyCommands() {
|
||||
return (ArrayList<String>) getData().getList("VoteParty.Commands", new ArrayList<String>());
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.CountFakeVotes")
|
||||
@Getter
|
||||
private boolean votePartyCountFakeVotes = true;
|
||||
|
||||
public boolean getVotePartyCountFakeVotes() {
|
||||
return getData().getBoolean("VoteParty.CountFakeVotes", true);
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.CountOfflineVotes")
|
||||
@Getter
|
||||
private boolean votePartyCountOfflineVotes = true;
|
||||
|
||||
public boolean getVotePartyCountOfflineVotes() {
|
||||
return getData().getBoolean("VoteParty.CountOfflineVotes", true);
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.Enabled")
|
||||
@Getter
|
||||
private boolean votePartyEnabled = false;
|
||||
|
||||
/**
|
||||
* Gets the vote party enabled.
|
||||
*
|
||||
* @return the vote party enabled
|
||||
*/
|
||||
public boolean getVotePartyEnabled() {
|
||||
return getData().getBoolean("VoteParty.Enabled");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.GiveAllPlayers")
|
||||
@Getter
|
||||
private boolean votePartyGiveAllPlayers = false;
|
||||
|
||||
/**
|
||||
* Gets the vote party give all players.
|
||||
*
|
||||
* @return the vote party give all players
|
||||
*/
|
||||
public boolean getVotePartyGiveAllPlayers() {
|
||||
return getData().getBoolean("VoteParty.GiveAllPlayers");
|
||||
}
|
||||
@ConfigDataInt(path = "VoteParty.IncreaseVotesRquired")
|
||||
@Getter
|
||||
private int votePartyIncreaseVotesRequired = 0;
|
||||
|
||||
public int getVotePartyIncreaseVotesRquired() {
|
||||
return getData().getInt("VoteParty.IncreaseVotesRquired", 0);
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.OnlyOncePerDay")
|
||||
@Getter
|
||||
private boolean votePartyOnlyOncePerDay = false;
|
||||
|
||||
public boolean getVotePartyResetEachDay() {
|
||||
return getData().getBoolean("VoteParty.ResetEachDay");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.OnlyOncePerWeek")
|
||||
@Getter
|
||||
private boolean votePartyOnlyOncePerWeek = false;
|
||||
|
||||
public boolean getVotePartyOnlyOncePerDay() {
|
||||
return getData().getBoolean("VoteParty.OnlyOncePerDay");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetEachDay")
|
||||
@Getter
|
||||
private boolean votePartyResetEachDay = false;
|
||||
|
||||
public boolean getVotePartyResetMontly() {
|
||||
return getData().getBoolean("VoteParty.ResetMonthly");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetMonthly")
|
||||
@Getter
|
||||
private boolean votePartyResetMonthly = false;
|
||||
|
||||
public boolean getVotePartyResetWeekly() {
|
||||
return getData().getBoolean("VoteParty.ResetWeekly");
|
||||
}
|
||||
@ConfigDataBoolean(path = "VoteParty.ResetWeekly")
|
||||
@Getter
|
||||
private boolean votePartyResetWeekly = false;
|
||||
|
||||
public int getVotePartyUserVotesRequired() {
|
||||
return getData().getInt("VoteParty.UserVotesRequired");
|
||||
}
|
||||
@ConfigDataInt(path = "VoteParty.UserVotesRequired")
|
||||
@Getter
|
||||
private int votePartyUserVotesRequired = 0;
|
||||
|
||||
/**
|
||||
* Gets the vote party votes required.
|
||||
*
|
||||
* @return the vote party votes required
|
||||
*/
|
||||
public int getVotePartyVotesRequired() {
|
||||
return getData().getInt("VoteParty.VotesRequired");
|
||||
}
|
||||
@ConfigDataInt(path = "VoteParty.VotesRequired")
|
||||
@Getter
|
||||
private int votePartyVotesRequired = 0;
|
||||
|
||||
public boolean getVoteStreakRewardEnabled(String type, String s) {
|
||||
return getData().getBoolean("VoteStreak." + type + "." + s + ".Enabled");
|
||||
@@ -282,18 +288,9 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
return "WeeklyAwards." + path + ".Rewards";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the weekly possible reward places.
|
||||
*
|
||||
* @return the weekly possible reward places
|
||||
*/
|
||||
public Set<String> getWeeklyPossibleRewardPlaces() {
|
||||
try {
|
||||
return getData().getConfigurationSection("WeeklyAwards").getKeys(false);
|
||||
} catch (Exception ex) {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
}
|
||||
@ConfigDataKeys(path = "WeeklyAwards")
|
||||
@Getter
|
||||
private Set<String> weeklyPossibleRewardPlaces = new HashSet<String>();
|
||||
|
||||
@Override
|
||||
public void loadValues() {
|
||||
@@ -305,9 +302,8 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
plugin.saveResource("SpecialRewards.yml", true);
|
||||
}
|
||||
|
||||
public void setMilestone(int intValue) {
|
||||
getData().set("Milestones." + intValue + ".Enabled", true);
|
||||
getData().set("Milestones." + intValue + ".Rewards.Messages.Player", "&aYou got %milestone% milestone votes!");
|
||||
public void removeCumulative(String votes) {
|
||||
getData().set("Cumulative." + votes, null);
|
||||
saveData();
|
||||
}
|
||||
|
||||
@@ -316,14 +312,17 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void removeCumulative(String votes) {
|
||||
getData().set("Cumulative." + votes, null);
|
||||
public void setCumulative(int intValue) {
|
||||
getData().set("Cumulative." + intValue + ".Enabled", true);
|
||||
getData().set("Cumulative." + intValue + ".TotalToUse", "AllTime");
|
||||
getData().set("Cumulative." + intValue + ".Rewards.Messages.Player",
|
||||
"&aYou got %cumulative% cumulative votes!");
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void setCumulative(int intValue) {
|
||||
getData().set("Cumulative." + intValue + ".Enabled", true);
|
||||
getData().set("Cumulative." + intValue + ".Rewards.Messages.Player", "&aYou got %cumulative% cumulative votes!");
|
||||
public void setMilestone(int intValue) {
|
||||
getData().set("MileStones." + intValue + ".Enabled", true);
|
||||
getData().set("MileStones." + intValue + ".Rewards.Messages.Player", "&aYou got %milestone% milestone votes!");
|
||||
saveData();
|
||||
}
|
||||
}
|
||||
@@ -1,86 +1,239 @@
|
||||
package com.bencodez.votingplugin.cooldown;
|
||||
|
||||
import java.util.TimerTask;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.bencodez.advancedcore.api.rewards.RewardHandler;
|
||||
import com.bencodez.advancedcore.api.rewards.RewardOptions;
|
||||
import com.bencodez.advancedcore.api.time.events.DateChangedEvent;
|
||||
import com.bencodez.advancedcore.api.user.UUID;
|
||||
import com.bencodez.advancedcore.api.user.AdvancedCoreUser;
|
||||
import com.bencodez.advancedcore.api.user.UserStartup;
|
||||
import com.bencodez.advancedcore.api.user.userstorage.Column;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.events.PlayerVoteCoolDownEndEvent;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.events.PlayerVoteSiteCoolDownEndEvent;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class VoteReminding.
|
||||
*/
|
||||
import lombok.Getter;
|
||||
|
||||
public class CoolDownCheck implements Listener {
|
||||
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
/**
|
||||
* Instantiates a new vote reminding.
|
||||
*
|
||||
* @param plugin the plugin
|
||||
*/
|
||||
private HashMap<UUID, ScheduledFuture<?>> perSiteTasks = new HashMap<UUID, ScheduledFuture<?>>();
|
||||
|
||||
private HashMap<UUID, ScheduledFuture<?>> allSiteTasks = new HashMap<UUID, ScheduledFuture<?>>();
|
||||
|
||||
public CoolDownCheck(VotingPluginMain plugin) {
|
||||
this.plugin = plugin;
|
||||
this.timer = Executors.newScheduledThreadPool(1);
|
||||
}
|
||||
|
||||
public void load() {
|
||||
checkAll();
|
||||
}
|
||||
@Getter
|
||||
private ScheduledExecutorService timer;
|
||||
|
||||
public void checkAll() {
|
||||
if (!plugin.getConfigFile().isDisableCoolDownCheck() && RewardHandler.getInstance()
|
||||
private boolean cooldownCheckEnabled = false;
|
||||
|
||||
public void checkEnabled() {
|
||||
if (!plugin.getConfigFile().isDisableCoolDownCheck() && plugin.getRewardHandler()
|
||||
.hasRewards(plugin.getSpecialRewardsConfig().getData(), "VoteCoolDownEndedReward")) {
|
||||
plugin.getTimer().schedule(new TimerTask() {
|
||||
cooldownCheckEnabled = true;
|
||||
} else {
|
||||
cooldownCheckEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (VotingPluginMain.plugin != null) {
|
||||
if (!plugin.getConfigFile().isDisableCoolDownCheck() && RewardHandler.getInstance()
|
||||
.hasRewards(plugin.getSpecialRewardsConfig().getData(), "VoteCoolDownEndedReward")) {
|
||||
for (String uuid : UserManager.getInstance().getAllUUIDs()) {
|
||||
if (VotingPluginMain.plugin != null) {
|
||||
VotingPluginUser user = UserManager.getInstance()
|
||||
.getVotingPluginUser(new UUID(uuid));
|
||||
if (user.getUserData().hasData() && user.hasLoggedOnBefore()) {
|
||||
user.checkCoolDownEvents();
|
||||
}
|
||||
} else {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.debug("Not enabling cooldown check reward");
|
||||
cancel();
|
||||
}
|
||||
} else {
|
||||
cancel();
|
||||
public void check(UUID uuid) {
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid);
|
||||
if (!user.isOnline()) {
|
||||
user.dontCache();
|
||||
}
|
||||
check(user);
|
||||
}
|
||||
|
||||
public void checkPerSite(UUID uuid) {
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid);
|
||||
if (!user.isOnline()) {
|
||||
user.dontCache();
|
||||
}
|
||||
checkPerSite(user);
|
||||
}
|
||||
|
||||
public void vote(VotingPluginUser user, VoteSite site) {
|
||||
if (cooldownCheckEnabled) {
|
||||
schedule(user, true);
|
||||
}
|
||||
|
||||
if (plugin.getConfigFile().isPerSiteCoolDownEvents()) {
|
||||
user.setCoolDownCheckSite(site, Boolean.FALSE);
|
||||
schedulePerSite(user, true);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void check(VotingPluginUser user) {
|
||||
boolean coolDownCheck = user.getCoolDownCheck();
|
||||
if (coolDownCheck) {
|
||||
if (user.canVoteAll()) {
|
||||
user.setCoolDownCheck(false);
|
||||
PlayerVoteCoolDownEndEvent event = new PlayerVoteCoolDownEndEvent(user);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
allSiteTasks.remove(user.getJavaUUID());
|
||||
} else {
|
||||
schedulePerSite(user, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void checkPerSite(VotingPluginUser user) {
|
||||
if (plugin.getConfigFile().isPerSiteCoolDownEvents()) {
|
||||
HashMap<String, Boolean> coolDownChecks = user.getCoolDownCheckSiteList();
|
||||
boolean changed = false;
|
||||
for (VoteSite site : plugin.getVoteSitesEnabled()) {
|
||||
if (!coolDownChecks.containsKey(site.getKey()) || !coolDownChecks.get(site.getKey()).booleanValue()) {
|
||||
if (user.canVoteSite(site)) {
|
||||
coolDownChecks.put(site.getKey(), Boolean.TRUE);
|
||||
changed = true;
|
||||
plugin.extraDebug("Triggering votesitecooldownend event for " + user.getUUID());
|
||||
PlayerVoteSiteCoolDownEndEvent event = new PlayerVoteSiteCoolDownEndEvent(user, site);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
}
|
||||
}, 1000 * 60 * 5, 1000 * 60 * 30);
|
||||
} else {
|
||||
plugin.debug("Not enabling cooldown check reward");
|
||||
}
|
||||
if (changed) {
|
||||
user.setCoolDownCheckSite(coolDownChecks);
|
||||
}
|
||||
|
||||
schedulePerSite(user, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onCoolDownEnd(PlayerVoteCoolDownEndEvent event) {
|
||||
RewardHandler.getInstance().giveReward(event.getPlayer(), plugin.getSpecialRewardsConfig().getData(),
|
||||
"VoteCoolDownEndedReward",
|
||||
new RewardOptions().addPlaceholder("Votesite", event.getVoteSite().getDisplayName()));
|
||||
public void schedulePerSite(VotingPluginUser user, boolean force) {
|
||||
if (user.getSitesVotedOn() > 0 || force) {
|
||||
final UUID uuid = UUID.fromString(user.getUUID());
|
||||
long time = user.getNextTimeFirstSiteAvailable();
|
||||
if (perSiteTasks.containsKey(uuid)) {
|
||||
perSiteTasks.get(uuid).cancel(false);
|
||||
perSiteTasks.remove(uuid);
|
||||
}
|
||||
if (time > 0) {
|
||||
plugin.devDebug("PerSiteCoolDownEvent schedule time: " + time + " seconds");
|
||||
ScheduledFuture<?> scheduledFuture = timer.schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin != null && plugin.isEnabled()) {
|
||||
checkPerSite(uuid);
|
||||
}
|
||||
}
|
||||
}, time + 2, TimeUnit.SECONDS);
|
||||
perSiteTasks.put(uuid, scheduledFuture);
|
||||
} else {
|
||||
plugin.extraDebug(user.getUUID() + "/" + user.getPlayerName() + " not scheduling cooldown check");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void schedule(VotingPluginUser user, boolean force) {
|
||||
if (user.getSitesVotedOn() > 0 || force) {
|
||||
final UUID uuid = UUID.fromString(user.getUUID());
|
||||
long time = user.getNextTimeAllSitesAvailable();
|
||||
if (allSiteTasks.containsKey(uuid)) {
|
||||
allSiteTasks.get(uuid).cancel(false);
|
||||
allSiteTasks.remove(uuid);
|
||||
}
|
||||
if (time > 0) {
|
||||
user.setCoolDownCheck(true);
|
||||
ScheduledFuture<?> scheduledFuture = timer.schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin != null && plugin.isEnabled()) {
|
||||
check(uuid);
|
||||
}
|
||||
}
|
||||
}, time + 2, TimeUnit.SECONDS);
|
||||
allSiteTasks.put(uuid, scheduledFuture);
|
||||
} else {
|
||||
plugin.extraDebug(user.getUUID() + "/" + user.getPlayerName() + " not scheduling cooldown check");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void load() {
|
||||
plugin.addUserStartup(new UserStartup() {
|
||||
|
||||
@Override
|
||||
public void onStartUp(AdvancedCoreUser advancedcoreUser) {
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(advancedcoreUser);
|
||||
user.dontCache();
|
||||
if (cooldownCheckEnabled) {
|
||||
check(user);
|
||||
}
|
||||
if (plugin.getConfigFile().isPerSiteCoolDownEvents()) {
|
||||
checkPerSite(user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void checkAllVoteSite(VoteSite site) {
|
||||
plugin.getLogger().info("Checking vote cooldown rewards for all players: " + site.getKey());
|
||||
HashMap<UUID, ArrayList<Column>> cols = plugin.getUserManager().getAllKeys();
|
||||
for (Entry<UUID, ArrayList<Column>> playerData : cols.entrySet()) {
|
||||
|
||||
String uuid = playerData.getKey().toString();
|
||||
if (plugin != null && plugin.isEnabled()) {
|
||||
if (uuid != null && !uuid.isEmpty()) {
|
||||
VotingPluginUser user = plugin.getVotingPluginUserManager()
|
||||
.getVotingPluginUser(UUID.fromString(uuid), false);
|
||||
user.dontCache();
|
||||
user.updateTempCacheWithColumns(playerData.getValue());
|
||||
cols.put(playerData.getKey(), null);
|
||||
checkPerSite(user);
|
||||
user.clearTempCache();
|
||||
user = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
cols.clear();
|
||||
cols = null;
|
||||
|
||||
plugin.getLogger().info("Finished checking vote cooldown rewards for all players: " + site.getKey());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onDayChangeEnd(DateChangedEvent event) {
|
||||
checkAll();
|
||||
public void onCoolDownEnd(PlayerVoteCoolDownEndEvent event) {
|
||||
plugin.getRewardHandler().giveReward(event.getPlayer(), plugin.getSpecialRewardsConfig().getData(),
|
||||
"VoteCoolDownEndedReward", new RewardOptions());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onCoolDownEnd(PlayerVoteSiteCoolDownEndEvent event) {
|
||||
plugin.getRewardHandler().giveReward(event.getPlayer(), event.getSite().getSiteData(), "CoolDownEndRewards",
|
||||
new RewardOptions().addPlaceholder("sitename", event.getSite().getDisplayName()).addPlaceholder("url",
|
||||
event.getSite().getVoteURL(false)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.bencodez.votingplugin.data;
|
||||
|
||||
import java.time.temporal.WeekFields;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@@ -11,6 +15,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import com.bencodez.advancedcore.api.misc.ArrayUtils;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.signs.SignHandler;
|
||||
import com.bencodez.votingplugin.timequeue.VoteTimeQueue;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
@@ -24,6 +29,54 @@ public class ServerData {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void addAutoCachedPlaceholder(String placeholder) {
|
||||
List<String> p = getAutoCachedPlaceholder();
|
||||
|
||||
if (!ArrayUtils.getInstance().containsIgnoreCase(p, placeholder)) {
|
||||
p.add(placeholder);
|
||||
setAutoCachedPlaceholder(p);
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePlaceholders() {
|
||||
boolean data = getData().getBoolean("AutoCacheUpdated", false);
|
||||
if (!data) {
|
||||
List<String> placeholders = getAutoCachedPlaceholder();
|
||||
for (int i = 0; i < placeholders.size(); i++) {
|
||||
placeholders.set(i, placeholders.get(i).toLowerCase());
|
||||
}
|
||||
setAutoCachedPlaceholder(placeholders);
|
||||
getData().set("AutoCacheUpdated", true);
|
||||
saveData();
|
||||
}
|
||||
}
|
||||
|
||||
public void addVoteShopPurchase(String ident) {
|
||||
setVoteShopPurchases(ident, (getVoteShopPurchases(ident) + 1));
|
||||
}
|
||||
|
||||
public void setVoteShopPurchases(String ident, int amount) {
|
||||
getData().set("VoteShopPurchases." + ident, amount);
|
||||
saveData();
|
||||
}
|
||||
|
||||
public int getVoteShopPurchases(String ident) {
|
||||
return getData().getInt("VoteShopPurchases." + ident);
|
||||
}
|
||||
|
||||
public void setAutoCachedPlaceholder(List<String> placeholders) {
|
||||
getData().set("AutoCachePlaceholders", placeholders);
|
||||
saveData();
|
||||
}
|
||||
|
||||
public List<String> getAutoCachedPlaceholder() {
|
||||
return getData().getStringList("AutoCachePlaceholders");
|
||||
}
|
||||
|
||||
public List<String> getDisabledReminders() {
|
||||
return getData().getStringList("DisabledReminders");
|
||||
}
|
||||
|
||||
public synchronized void addServiceSite(String site) {
|
||||
ArrayList<String> l = getServiceSites();
|
||||
if (!getServiceSites().contains(site)) {
|
||||
@@ -137,6 +190,23 @@ public class ServerData {
|
||||
return getData().getInt("VotePartyExtraRequired", 0);
|
||||
}
|
||||
|
||||
public boolean isLastVotePartySameDay() {
|
||||
int num = getData().getInt("LastVoteParty", 0);
|
||||
if (num == plugin.getTimeChecker().getTime().getDayOfYear()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLastVotePartySameWeek() {
|
||||
int num = getData().getInt("LastVotePartyWeek", -1);
|
||||
if (num == plugin.getTimeChecker().getTime().get(WeekFields.of(Locale.getDefault()).weekOfYear())
|
||||
&& num != -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Next sign number.
|
||||
*
|
||||
@@ -233,6 +303,44 @@ public class ServerData {
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void updateLastVoteParty() {
|
||||
getData().set("LastVoteParty", plugin.getTimeChecker().getTime().getDayOfYear());
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void updateLastVotePartyWeek() {
|
||||
getData().set("LastVotePartyWeek",
|
||||
plugin.getTimeChecker().getTime().get(WeekFields.of(Locale.getDefault()).weekOfYear()));
|
||||
saveData();
|
||||
}
|
||||
|
||||
public int getBungeeVotePartyCurrent() {
|
||||
return getData().getInt("BungeeVotePartyCurrent");
|
||||
}
|
||||
|
||||
public int getBungeeVotePartyRequired() {
|
||||
return getData().getInt("BungeeVotePartyRequired");
|
||||
}
|
||||
|
||||
public void setBungeeVotePartyCurrent(int current) {
|
||||
getData().set("BungeeVotePartyCurrent", current);
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void setBungeeVotePartyRequired(int required) {
|
||||
getData().set("BungeeVotePartyRequired", required);
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void saveDisabledReminders(ArrayList<UUID> disabledReminders) {
|
||||
ArrayList<String> uuids = new ArrayList<String>();
|
||||
for (UUID uuid : disabledReminders) {
|
||||
uuids.add(uuid.toString());
|
||||
}
|
||||
getData().set("DisabledReminders", uuids);
|
||||
saveData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update values.
|
||||
*/
|
||||
@@ -240,16 +348,27 @@ public class ServerData {
|
||||
setVersion();
|
||||
}
|
||||
|
||||
public boolean isLastVotePartySameDay() {
|
||||
int num = getData().getInt("LastVoteParty", 0);
|
||||
if (num != plugin.getTimeChecker().getTime().getDayOfYear()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
public void addTimeVoted(int num, VoteTimeQueue vote) {
|
||||
getData().set("TimedVoteCache." + num + ".Name", vote.getName());
|
||||
getData().set("TimedVoteCache." + num + ".Service", vote.getService());
|
||||
getData().set("TimedVoteCache." + num + ".Time", vote.getTime());
|
||||
saveData();
|
||||
}
|
||||
|
||||
public void updateLastVoteParty() {
|
||||
getData().set("LastVoteParty", plugin.getTimeChecker().getTime().getDayOfYear());
|
||||
public Set<String> getTimedVoteCacheKeys() {
|
||||
if (getData().isConfigurationSection("TimedVoteCache")) {
|
||||
return getData().getConfigurationSection("TimedVoteCache").getKeys(false);
|
||||
} else {
|
||||
return new HashSet<String>();
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getTimedVoteCacheSection(String num) {
|
||||
return getData().getConfigurationSection("TimedVoteCache." + num);
|
||||
}
|
||||
|
||||
public void clearTimedVoteCache() {
|
||||
getData().set("TimedVoteCache", null);
|
||||
saveData();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.bencodez.votingplugin.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.bencodez.votingplugin.bungee.BungeeMessageData;
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class PlayerVoteEvent.
|
||||
*/
|
||||
public class PlayerPostVoteEvent extends Event {
|
||||
|
||||
/** The Constant handlers. */
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
/**
|
||||
* Gets the handler list.
|
||||
*
|
||||
* @return the handler list
|
||||
*/
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean bungee = false;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private BungeeMessageData bungeeTextTotals;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean cancelled;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean forceBungee = false;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private VotingPluginUser user;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean realVote = true;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private VoteSite voteSite;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private long voteTime = 0;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private VotingPluginUser votingPluginUser;
|
||||
|
||||
public PlayerPostVoteEvent(VoteSite voteSite, VotingPluginUser user, boolean realVote, boolean forceBungee, long voteTime) {
|
||||
super(true);
|
||||
this.user = user;
|
||||
this.voteSite = voteSite;
|
||||
this.realVote = realVote;
|
||||
this.forceBungee = forceBungee;
|
||||
this.voteTime = voteTime;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.bukkit.event.Event#getHandlers()
|
||||
*/
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.bencodez.votingplugin.events;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.bencodez.votingplugin.objects.VoteSite;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
import lombok.Getter;
|
||||
@@ -35,14 +34,9 @@ public class PlayerVoteCoolDownEndEvent extends Event {
|
||||
@Setter
|
||||
private VotingPluginUser player;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private VoteSite voteSite;
|
||||
|
||||
public PlayerVoteCoolDownEndEvent(VotingPluginUser user, VoteSite site) {
|
||||
public PlayerVoteCoolDownEndEvent(VotingPluginUser user) {
|
||||
super(true);
|
||||
player = user;
|
||||
voteSite = site;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user