mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-18 17:53:00 +01:00
Compare commits
2071 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dcdacee07 | ||
|
|
925ef21a8e | ||
|
|
cb01515451 | ||
|
|
a9e81602b4 | ||
|
|
8645ce641d | ||
|
|
3a765e1164 | ||
|
|
a5a613e200 | ||
|
|
4e8e95e3cb | ||
|
|
f9fb9a17a9 | ||
|
|
4ea9037dd4 | ||
|
|
1d9a7cc720 | ||
|
|
f6a3084a47 | ||
|
|
41b484b1c3 | ||
|
|
df101e54b1 | ||
|
|
9a65621f68 | ||
|
|
9a91daf910 | ||
|
|
3a7b6fef7d | ||
|
|
9383b1c65c | ||
|
|
261d571be1 | ||
|
|
4461cfacd2 | ||
|
|
84353de71d | ||
|
|
1ab4645223 | ||
|
|
b6a56d6865 | ||
|
|
67cc162e07 | ||
|
|
401cc3e35b | ||
|
|
d45aac713f | ||
|
|
83c1dab963 | ||
|
|
bbcc1ee7da | ||
|
|
e749d5eb7f | ||
|
|
4d4dad0ccb | ||
|
|
380d4be9c9 | ||
|
|
b40b206bf5 | ||
|
|
a2c0a02d30 | ||
|
|
196ace4b81 | ||
|
|
b14871d499 | ||
|
|
e80c183894 | ||
|
|
fe40748929 | ||
|
|
49a6ce7b8f | ||
|
|
6127a7fe11 | ||
|
|
f1ac4ff265 | ||
|
|
d98b077be3 | ||
|
|
bbbf6777f9 | ||
|
|
c0a3d63213 | ||
|
|
5e8a840418 | ||
|
|
dbf32b4715 | ||
|
|
017e32c30a | ||
|
|
8e048300e8 | ||
|
|
2569ed0565 | ||
|
|
45b4f4a314 | ||
|
|
98e6400dd8 | ||
|
|
63d3a328c4 | ||
|
|
06a4f964e8 | ||
|
|
9aef304fd4 | ||
|
|
f32834411d | ||
|
|
577e3339f1 | ||
|
|
36f75457e3 | ||
|
|
b67b0a5b94 | ||
|
|
e389c4b8f1 | ||
|
|
303a922165 | ||
|
|
4ea5432561 | ||
|
|
9a428332a9 | ||
|
|
c43fd9bc69 | ||
|
|
77e6e79eb6 | ||
|
|
1568f71d83 | ||
|
|
f274450376 | ||
|
|
0b3a642c95 | ||
|
|
025183d434 | ||
|
|
371a3ceec7 | ||
|
|
84b3cfc309 | ||
|
|
14e5998aa0 | ||
|
|
c839837d7a | ||
|
|
e65e6ad14e | ||
|
|
fc6c804caf | ||
|
|
8228ae248f | ||
|
|
c6a4cbd715 | ||
|
|
90520cd50b | ||
|
|
8262711e7e | ||
|
|
8aa92322d1 | ||
|
|
bdfac28b44 | ||
|
|
cb89a80fd8 | ||
|
|
a2f9ab70aa | ||
|
|
5d010594dd | ||
|
|
d609b45e68 | ||
|
|
4c63eee6d5 | ||
|
|
f3aff37b46 | ||
|
|
f2c32f07da | ||
|
|
bff72486d0 | ||
|
|
0193b53988 | ||
|
|
039542f125 | ||
|
|
99b50319a3 | ||
|
|
7e5a8bc659 | ||
|
|
e66ed3f3f1 | ||
|
|
cef9fad49f | ||
|
|
8ad9419240 | ||
|
|
1871c1ec63 | ||
|
|
7a721c3229 | ||
|
|
370af987d6 | ||
|
|
a22636b2d9 | ||
|
|
399a1529f4 | ||
|
|
3734300e59 | ||
|
|
fc7b4a6790 | ||
|
|
00f5491718 | ||
|
|
67ed9d324e | ||
|
|
ddf953b3b7 | ||
|
|
f89b7ccc9f | ||
|
|
154b10209d | ||
|
|
fbc7cbf389 | ||
|
|
6f81cf7384 | ||
|
|
4f832edada | ||
|
|
85a04c71f4 | ||
|
|
c7ed3ee2a0 | ||
|
|
7e34e87bc0 | ||
|
|
b2b623505d | ||
|
|
67a57f7472 | ||
|
|
d7fe01579b | ||
|
|
e969598f58 | ||
|
|
be9aeacd70 | ||
|
|
5f39a7cb80 | ||
|
|
7b38658310 | ||
|
|
d81c3d06c5 | ||
|
|
a504bc407a | ||
|
|
67bcb8da11 | ||
|
|
55821f7703 | ||
|
|
a601360cbb | ||
|
|
444feb1c2c | ||
|
|
6592562c56 | ||
|
|
9aae4825cc | ||
|
|
22c5280d4e | ||
|
|
49a91617f0 | ||
|
|
b5bc324f97 | ||
|
|
a120981e52 | ||
|
|
1df4f74f8c | ||
|
|
d4d5d9bac1 | ||
|
|
28e963f1eb | ||
|
|
9626c06b58 | ||
|
|
baf1796b08 | ||
|
|
b39340227f | ||
|
|
105a81aede | ||
|
|
9ff8692625 | ||
|
|
280971042a | ||
|
|
6ac1c4fa2c | ||
|
|
d84d487435 | ||
|
|
43d8e08e83 | ||
|
|
859063e406 | ||
|
|
ad990dbb28 | ||
|
|
1c58bd392d | ||
|
|
cf9117097d | ||
|
|
71d1574a7d | ||
|
|
f1fc095876 | ||
|
|
3a367d71fa | ||
|
|
f4cab35a46 | ||
|
|
c22a1a0dd2 | ||
|
|
a421bd7e4c | ||
|
|
ef9b3d40e9 | ||
|
|
24458879a4 | ||
|
|
1d6a142b12 | ||
|
|
b7fc3f05e9 | ||
|
|
3cfd3b0109 | ||
|
|
bb64221c6b | ||
|
|
96b46d31cf | ||
|
|
4031674626 | ||
|
|
f028d91eb0 | ||
|
|
c46b7ed3bc | ||
|
|
71a3eb6a93 | ||
|
|
6ff13077be | ||
|
|
c51be84b50 | ||
|
|
3e5c4bc617 | ||
|
|
e5e86246f3 | ||
|
|
8f906af99c | ||
|
|
6c0da22d5e | ||
|
|
6e5feced2f | ||
|
|
6be1319927 | ||
|
|
cfeadb54be | ||
|
|
fd1a0db696 | ||
|
|
bf38f55f23 | ||
|
|
c467f79d32 | ||
|
|
9b0023d2d7 | ||
|
|
9be7c2af3c | ||
|
|
c146384227 | ||
|
|
f68ecd3214 | ||
|
|
58e506b041 | ||
|
|
40a13c4c81 | ||
|
|
02781f7458 | ||
|
|
0cd23c1b65 | ||
|
|
c758346c3f | ||
|
|
a381b6379a | ||
|
|
6241b6dfe9 | ||
|
|
061a6c2a3a | ||
|
|
ebf48e1870 | ||
|
|
92de75e002 | ||
|
|
c6e1edee91 | ||
|
|
6428c65720 | ||
|
|
3edc0bf63f | ||
|
|
fb5fd6cc39 | ||
|
|
f9b2776cb9 | ||
|
|
25c8dad1ea | ||
|
|
ad86db241c | ||
|
|
3d0ba7ce52 | ||
|
|
9a8ced7aa7 | ||
|
|
cf0b60d165 | ||
|
|
cbb726e020 | ||
|
|
0ad1530505 | ||
|
|
c0dde01f3e | ||
|
|
db3d14fa9f | ||
|
|
726b04f586 | ||
|
|
76ddcc4cf0 | ||
|
|
11c8374f6c | ||
|
|
848cee18a9 | ||
|
|
42d286e265 | ||
|
|
ebbfe72259 | ||
|
|
6d720e6ab1 | ||
|
|
661cf15be1 | ||
|
|
f30875ac4c | ||
|
|
ea0ad38fec | ||
|
|
e1f11b4059 | ||
|
|
42312349e1 | ||
|
|
c86012027e | ||
|
|
0a900d9c65 | ||
|
|
038265b033 | ||
|
|
ba34442ebb | ||
|
|
f9ce70e310 | ||
|
|
c728b233e6 | ||
|
|
e8c8f8b6a1 | ||
|
|
d3765effe0 | ||
|
|
6c77017658 | ||
|
|
f8b7d5e10d | ||
|
|
b42b4cadbe | ||
|
|
11461cc220 | ||
|
|
4f3174c68b | ||
|
|
657e66f3c5 | ||
|
|
97670f14d1 | ||
|
|
fb8213d87c | ||
|
|
7c5ebb9902 | ||
|
|
4e9f5b99b8 | ||
|
|
b48fa2d8e5 | ||
|
|
71fc9930ef | ||
|
|
ec1e7b044c | ||
|
|
ba4e9e73c3 | ||
|
|
ac4b8068b0 | ||
|
|
b1be43154a | ||
|
|
87f84a5f66 | ||
|
|
e962f645b6 | ||
|
|
6ad9c8e664 | ||
|
|
b8a146f8bd | ||
|
|
b7b0ff13e7 | ||
|
|
96742e6c42 | ||
|
|
255ae6c426 | ||
|
|
8c5ea484eb | ||
|
|
eb1f097d18 | ||
|
|
a073984621 | ||
|
|
34fc9725b9 | ||
|
|
1e1212cd7c | ||
|
|
df8f050cf1 | ||
|
|
e74bc9fd95 | ||
|
|
66878d72bf | ||
|
|
29befac27e | ||
|
|
f5590ce334 | ||
|
|
43da10a855 | ||
|
|
9ae58fd2f7 | ||
|
|
cf6d95b575 | ||
|
|
92b8d13c71 | ||
|
|
a9ed63d3d0 | ||
|
|
7889fe5249 | ||
|
|
6888a082fc | ||
|
|
1585d8157e | ||
|
|
292fc8eff2 | ||
|
|
126e1c5942 | ||
|
|
a59907fcec | ||
|
|
f1feeed670 | ||
|
|
12af9af902 | ||
|
|
6ce44b7ce8 | ||
|
|
52355b2757 | ||
|
|
13a3e9a790 | ||
|
|
4137cc0d3d | ||
|
|
8a57bbb5d9 | ||
|
|
f09fed465a | ||
|
|
4e1f535fe2 | ||
|
|
f15f25a3df | ||
|
|
384804fefa | ||
|
|
5e3a72b30d | ||
|
|
f5b3cf4350 | ||
|
|
008e29117f | ||
|
|
d48295bd72 | ||
|
|
e9987a19ed | ||
|
|
1aa4df01f9 | ||
|
|
427d8c3b21 | ||
|
|
61d87eff10 | ||
|
|
086e29c4ac | ||
|
|
6cc6de6e82 | ||
|
|
4a30fcc2de | ||
|
|
0acde4a8af | ||
|
|
d6fea9a2df | ||
|
|
5114bbc40d | ||
|
|
4fcf0b0519 | ||
|
|
da6b6841b7 | ||
|
|
95d60e646d | ||
|
|
9f8c9db4bc | ||
|
|
918b94b1ff | ||
|
|
d9dd4ea016 | ||
|
|
43aad43bf3 | ||
|
|
ed2c3975d8 | ||
|
|
ee04bebcd9 | ||
|
|
1769df98dc | ||
|
|
ca2eebf022 | ||
|
|
4101f16580 | ||
|
|
655a31d556 | ||
|
|
e1576e8d1c | ||
|
|
2605235f2a | ||
|
|
6bba647250 | ||
|
|
79ae49a6d1 | ||
|
|
f007114753 | ||
|
|
dad3e76c7c | ||
|
|
ba5428ff12 | ||
|
|
1cf1c6fab8 | ||
|
|
14ca84fa97 | ||
|
|
4a00758b6b | ||
|
|
e817dbe081 | ||
|
|
c3bacd8de6 | ||
|
|
351abae475 | ||
|
|
c1c249372a | ||
|
|
6f77bb206d | ||
|
|
0beabbf1ec | ||
|
|
51ab8d4b25 | ||
|
|
a21b4585c5 | ||
|
|
cde11b64ed | ||
|
|
d3c47935d4 | ||
|
|
c8ee5099e0 | ||
|
|
85fd0a79bc | ||
|
|
6927712a9d | ||
|
|
4cfb7a5f4b | ||
|
|
1f2e6cd5f5 | ||
|
|
b38c589125 | ||
|
|
7f40b4294f | ||
|
|
bfc26dc892 | ||
|
|
b572c0aea9 | ||
|
|
1d62f8b177 | ||
|
|
d141a28747 | ||
|
|
19c38f0cb1 | ||
|
|
c7a49dd283 | ||
|
|
f11b98c29d | ||
|
|
adc83d29a7 | ||
|
|
1e8d950767 | ||
|
|
3dca32a226 | ||
|
|
7c024314b7 | ||
|
|
f828084246 | ||
|
|
626890ed95 | ||
|
|
00a14ccb17 | ||
|
|
400e15b559 | ||
|
|
d5a4103858 | ||
|
|
0cb9bbb530 | ||
|
|
fc2a8eec7b | ||
|
|
362d036b16 | ||
|
|
ee765a0d30 | ||
|
|
8aa919f834 | ||
|
|
77c12dcc20 | ||
|
|
7581425f87 | ||
|
|
fce77b427f | ||
|
|
01a7aa4d12 | ||
|
|
6dc75760d0 | ||
|
|
fe90f1e7eb | ||
|
|
54cf356b71 | ||
|
|
4669e3e54d | ||
|
|
f4ead570d4 | ||
|
|
b34f3a1779 | ||
|
|
85e1f2eb7e | ||
|
|
6136e82ec6 | ||
|
|
ebec5d6f70 | ||
|
|
336e41b40c | ||
|
|
bec088c969 | ||
|
|
17f1062e96 | ||
|
|
92495ae9df | ||
|
|
b9c8743ee3 | ||
|
|
0d260a74c9 | ||
|
|
35368db05d | ||
|
|
5e6e8d7248 | ||
|
|
d50238caf1 | ||
|
|
164d429acc | ||
|
|
a316bb7bd2 | ||
|
|
55a4238030 | ||
|
|
f9f2a0d691 | ||
|
|
3831ca6b0f | ||
|
|
7a6b8e3156 | ||
|
|
93d10c0739 | ||
|
|
24e4c28355 | ||
|
|
6ec61ecb76 | ||
|
|
55a69006bf | ||
|
|
8a02230fd2 | ||
|
|
2a26b016d9 | ||
|
|
7be5b4ecbd | ||
|
|
565fb35217 | ||
|
|
d2b8c527ad | ||
|
|
2cdb17d64f | ||
|
|
96f06ca812 | ||
|
|
685f6d76a8 | ||
|
|
840cfbe94d | ||
|
|
605535ed60 | ||
|
|
71c72045b9 | ||
|
|
eb930883fa | ||
|
|
30ed18eb95 | ||
|
|
8508f5b8b8 | ||
|
|
dfab223eb2 | ||
|
|
dd82fa0791 | ||
|
|
af8d2dc2c7 | ||
|
|
9f9529debf | ||
|
|
495c4a33e5 | ||
|
|
203d3749ee | ||
|
|
1fcecbd3e7 | ||
|
|
d778616b2c | ||
|
|
4bdd97a302 | ||
|
|
ab2a031ee0 | ||
|
|
5663b71387 | ||
|
|
2a43bce849 | ||
|
|
592c3a2142 | ||
|
|
e9ca341476 | ||
|
|
76617c8a61 | ||
|
|
10ff097232 | ||
|
|
1e043d481a | ||
|
|
7f8c670dc1 | ||
|
|
0e536a2cb3 | ||
|
|
090cf82a39 | ||
|
|
6e60f39f82 | ||
|
|
b8078e4730 | ||
|
|
e08fe64db2 | ||
|
|
2b576568a7 | ||
|
|
e2edbaad34 | ||
|
|
184b98bbdc | ||
|
|
7cc604dbdb | ||
|
|
44ed35825f | ||
|
|
22833eea6c | ||
|
|
64dfc1e3d3 | ||
|
|
6619ca1d22 | ||
|
|
2f2a80e1ce | ||
|
|
fa1bbd2031 | ||
|
|
a39a77f89e | ||
|
|
7800e48f61 | ||
|
|
63378ae4c1 | ||
|
|
fecf83c79c | ||
|
|
f287b6d8a7 | ||
|
|
9082658357 | ||
|
|
4bda175328 | ||
|
|
ee324c77a9 | ||
|
|
210b418e44 | ||
|
|
b73eced36f | ||
|
|
6296a6adde | ||
|
|
99f6192965 | ||
|
|
bff454f397 | ||
|
|
8216dbe355 | ||
|
|
fbe26af2d7 | ||
|
|
0a1559511a | ||
|
|
aee60f2c09 | ||
|
|
9ce850f84f | ||
|
|
cbff8482ce | ||
|
|
0035762a71 | ||
|
|
3d515aab23 | ||
|
|
e77801f3c1 | ||
|
|
c83d011faa | ||
|
|
5aa4949baa | ||
|
|
906ead53dd | ||
|
|
cbcdedc67a | ||
|
|
c87b410823 | ||
|
|
0a447f68c6 | ||
|
|
e98d241452 | ||
|
|
421455224f | ||
|
|
29c55312a5 | ||
|
|
6c474c8838 | ||
|
|
03182ea24c | ||
|
|
2c6543da9e | ||
|
|
20bbdfc4ab | ||
|
|
5b2ebf4aa8 | ||
|
|
2b159adefd | ||
|
|
be2de1d487 | ||
|
|
6876f192de | ||
|
|
875db44afd | ||
|
|
2e120abe3a | ||
|
|
feeb17d6f0 | ||
|
|
6d2003d577 | ||
|
|
40b609ccd8 | ||
|
|
d64399df49 | ||
|
|
d4f2f0e11b | ||
|
|
916d9a7c8a | ||
|
|
6d5ab0edda | ||
|
|
307d483323 | ||
|
|
eb4960f307 | ||
|
|
9df72e61a2 | ||
|
|
fcb6391ba3 | ||
|
|
16a77f281e | ||
|
|
87ebf7023f | ||
|
|
028f87653a | ||
|
|
0e51983819 | ||
|
|
c174f2b829 | ||
|
|
8e9d393eb2 | ||
|
|
f1f02fd005 | ||
|
|
f279a979e3 | ||
|
|
e0bbe9cea4 | ||
|
|
d3cc23f6a0 | ||
|
|
4c3f3ee4e2 | ||
|
|
2d7c5d7fd6 | ||
|
|
8be68aa6df | ||
|
|
a731ad14ec | ||
|
|
05ca96aa7f | ||
|
|
60aa32d003 | ||
|
|
0e7ee41444 | ||
|
|
b5f6b1d97f | ||
|
|
f1ac5739e4 | ||
|
|
8cbb57df97 | ||
|
|
2c8d2998bb | ||
|
|
44684fcfd0 | ||
|
|
7081e03c23 | ||
|
|
246db98519 | ||
|
|
ee245d348f | ||
|
|
f718741044 | ||
|
|
c054ff851a | ||
|
|
755787f9ee | ||
|
|
24f8b2fbd5 | ||
|
|
ee02a19e9a | ||
|
|
cb5d38c11f | ||
|
|
15436b44da | ||
|
|
5c267663a2 | ||
|
|
fda625b235 | ||
|
|
2cbd8789d8 | ||
|
|
95167f44f1 | ||
|
|
789b51fd05 | ||
|
|
0911c86422 | ||
|
|
7d05c9d8e6 | ||
|
|
a43ae4178a | ||
|
|
c9c2c483fa | ||
|
|
133281faaa | ||
|
|
ef8987917d | ||
|
|
d6a00eaf00 | ||
|
|
69151f0855 | ||
|
|
bb27d753b1 | ||
|
|
37ce29a5e8 | ||
|
|
6297e1c79b | ||
|
|
4e2903e65c | ||
|
|
2e7f56eeb5 | ||
|
|
7e46d5ca08 | ||
|
|
a2bcce9ab1 | ||
|
|
2f7b1c38e1 | ||
|
|
789aaec186 | ||
|
|
f3d6c1727b | ||
|
|
c029b51c97 | ||
|
|
6c5fb5f398 | ||
|
|
4b20db47b2 | ||
|
|
e238ec8fc6 | ||
|
|
9689f55e5c | ||
|
|
ec0c7da494 | ||
|
|
5f9f3e8167 | ||
|
|
6388246418 | ||
|
|
86432eb426 | ||
|
|
a51585f5d0 | ||
|
|
9ec75fb470 | ||
|
|
c8a7f6d76f | ||
|
|
01a8a199d2 | ||
|
|
f85c54596a | ||
|
|
b3e1acc563 | ||
|
|
745ff21551 | ||
|
|
31c8cf9766 | ||
|
|
8901db4e18 | ||
|
|
b1b8c4d713 | ||
|
|
b14b37c22d | ||
|
|
e73e628051 | ||
|
|
3bb920f22c | ||
|
|
2bed26f18a | ||
|
|
fb3363661b | ||
|
|
315b713005 | ||
|
|
70de0ba00b | ||
|
|
25cad3afc6 | ||
|
|
11aa126b80 | ||
|
|
d0e8bb3174 | ||
|
|
6b03108052 | ||
|
|
34447ef874 | ||
|
|
dcd79e87e1 | ||
|
|
8822b4edae | ||
|
|
a24d6ff018 | ||
|
|
707195f237 | ||
|
|
321fcd7b84 | ||
|
|
c5970e9246 | ||
|
|
538a0c5d6c | ||
|
|
4c4df60b81 | ||
|
|
d1cf08c6ba | ||
|
|
e091a8eb55 | ||
|
|
d579c9a2af | ||
|
|
a711d3a3e3 | ||
|
|
2c197af9fd | ||
|
|
d58d621f96 | ||
|
|
0203252b63 | ||
|
|
22edd121d3 | ||
|
|
31b83becad | ||
|
|
6cce3098db | ||
|
|
fd3d60d112 | ||
|
|
9094e5feb8 | ||
|
|
60bfabb097 | ||
|
|
2d4cf76825 | ||
|
|
6a7279ea05 | ||
|
|
4cb4a6224b | ||
|
|
a6e445b7ef | ||
|
|
123a139e43 | ||
|
|
4054315c19 | ||
|
|
d942cedb8e | ||
|
|
ec774b590b | ||
|
|
988a11a5da | ||
|
|
1488946fc5 | ||
|
|
1f05967b0b | ||
|
|
4924391ae8 | ||
|
|
f2668d7dbb | ||
|
|
d26779bee9 | ||
|
|
c75715b186 | ||
|
|
a238b7029d | ||
|
|
98511136ee | ||
|
|
6723b3a4c6 | ||
|
|
40c61149cf | ||
|
|
4f9a463b9d | ||
|
|
f3a8208425 | ||
|
|
cbf2f34f93 | ||
|
|
898fad6be4 | ||
|
|
eaa1a8edca | ||
|
|
08db154791 | ||
|
|
e1cf4c0c67 | ||
|
|
529c43b0e6 | ||
|
|
376abdf49e | ||
|
|
11a744a772 | ||
|
|
47f73ba455 | ||
|
|
001b11efc6 | ||
|
|
089f3a0e71 | ||
|
|
af9a3c85c6 | ||
|
|
a534f9aac1 | ||
|
|
a08016647a | ||
|
|
a557fc7d3c | ||
|
|
2d3d11ec2d | ||
|
|
9bc97c6dd3 | ||
|
|
52f1e33052 | ||
|
|
272e99d41f | ||
|
|
77b67d5a79 | ||
|
|
8e1f464209 | ||
|
|
5f960fd80a | ||
|
|
bddca30668 | ||
|
|
28a2b9668d | ||
|
|
f52d9feef8 | ||
|
|
f77ae6ee15 | ||
|
|
88b99a3835 | ||
|
|
8d16af8770 | ||
|
|
fde9ba86a2 | ||
|
|
c9356f9ef5 | ||
|
|
6a0529f02d | ||
|
|
760178c061 | ||
|
|
0bb2642d24 | ||
|
|
635a4f7265 | ||
|
|
0e34202d4d | ||
|
|
3a9c55a9ea | ||
|
|
2dd1775d9a | ||
|
|
a0635eeb08 | ||
|
|
9677653c54 | ||
|
|
6cf7167c09 | ||
|
|
9718123292 | ||
|
|
420559efec | ||
|
|
f4b6d7845e | ||
|
|
b966529487 | ||
|
|
9c7b83a52e | ||
|
|
ac9447d439 | ||
|
|
a5bcc3ce58 | ||
|
|
a020890244 | ||
|
|
616200f20f | ||
|
|
1f9c3759e7 | ||
|
|
9fb72cfea8 | ||
|
|
dd84abe927 | ||
|
|
aaa69adb0c | ||
|
|
982ee13631 | ||
|
|
8927e16b1f | ||
|
|
dd01504111 | ||
|
|
50e727d591 | ||
|
|
f84e98d836 | ||
|
|
7e92905618 | ||
|
|
9b24dd306c | ||
|
|
aa796266a7 | ||
|
|
a783d0dfc8 | ||
|
|
f9879be439 | ||
|
|
5f21efb1cd | ||
|
|
8e2b8f111f | ||
|
|
08766a0ff7 | ||
|
|
5b19e2e9d2 | ||
|
|
bef28583f3 | ||
|
|
eff53d90ab | ||
|
|
2aade8b7ff | ||
|
|
de0ac51b3d | ||
|
|
b161a907a7 | ||
|
|
397ec929aa | ||
|
|
f108de9ba2 | ||
|
|
e3a139f7bd | ||
|
|
90f8132030 | ||
|
|
60d89c15e6 | ||
|
|
58a0287be7 | ||
|
|
ac3b28da8b | ||
|
|
12cb1e4161 | ||
|
|
4e013b44d8 | ||
|
|
9934ab972e | ||
|
|
30adac5e63 | ||
|
|
d3d7c254f4 | ||
|
|
93ad040936 | ||
|
|
bfeac43f12 | ||
|
|
4388430491 | ||
|
|
b4e21a7817 | ||
|
|
4fe41fe416 | ||
|
|
d8184fb298 | ||
|
|
78dec51ad4 | ||
|
|
de38826897 | ||
|
|
f63e793006 | ||
|
|
ecfdd75e36 | ||
|
|
90b31a29f5 | ||
|
|
cfa0daefc5 | ||
|
|
4aeda6e9e8 | ||
|
|
4f1f10333f | ||
|
|
342c37a02c | ||
|
|
e347bc1c9e | ||
|
|
42116f4467 | ||
|
|
7ce72bafb0 | ||
|
|
f76771f0a8 | ||
|
|
6c29da94f3 | ||
|
|
981523789e | ||
|
|
d9aacfa059 | ||
|
|
5efc5289f7 | ||
|
|
1f68f4e654 | ||
|
|
5670e6696a | ||
|
|
ca6dc5195d | ||
|
|
30ebe318e0 | ||
|
|
a1c3f0d651 | ||
|
|
347e03d75e | ||
|
|
8543382bde | ||
|
|
4f1004472c | ||
|
|
7aee829b94 | ||
|
|
98701104d8 | ||
|
|
7a14e61762 | ||
|
|
f42f5c31ed | ||
|
|
342662c944 | ||
|
|
50088fe0bd | ||
|
|
687f87a748 | ||
|
|
6815c66a0e | ||
|
|
385fe1bb05 | ||
|
|
eddadcc179 | ||
|
|
9426f44cdd | ||
|
|
af7ff3df58 | ||
|
|
7c0cc8794f | ||
|
|
eda18bc990 | ||
|
|
a2c395db36 | ||
|
|
522b085499 | ||
|
|
3ea845cfd9 | ||
|
|
93013b2db1 | ||
|
|
d5a2dea06b | ||
|
|
d188224c06 | ||
|
|
3422c5d3eb | ||
|
|
ebeebbde72 | ||
|
|
e71eff852c | ||
|
|
bfff5682b5 | ||
|
|
429a7d926a | ||
|
|
262e711bcc | ||
|
|
b44b1cc859 | ||
|
|
75dfec1236 | ||
|
|
8c2f3cff8f | ||
|
|
32336b712b | ||
|
|
cfc51e9b96 | ||
|
|
31cefbfc8c | ||
|
|
2c940ecdac | ||
|
|
e51809d066 | ||
|
|
01a18fa587 | ||
|
|
f93deeceb6 | ||
|
|
3275395d53 | ||
|
|
d0881ab3fd | ||
|
|
5db09bf45c | ||
|
|
f4406bd9cf | ||
|
|
3b441073fd | ||
|
|
da22a8ff93 | ||
|
|
f8469cbe00 | ||
|
|
0188629fe2 | ||
|
|
5d246d2701 | ||
|
|
b3cd5486d6 | ||
|
|
7e961fc2a3 | ||
|
|
8fcd286eb0 | ||
|
|
4723a7cbdb | ||
|
|
dbc7b98b0d | ||
|
|
a5bc547c40 | ||
|
|
63b332216e | ||
|
|
8e5340ebc3 | ||
|
|
e4af611c91 | ||
|
|
c31281971c | ||
|
|
eda38cba66 | ||
|
|
b5a2e76926 | ||
|
|
38cc7435dc | ||
|
|
864a760e9c | ||
|
|
0838cbb874 | ||
|
|
4844be80da | ||
|
|
62a767db89 | ||
|
|
ce3463ad6d | ||
|
|
5d059d8537 | ||
|
|
332860b9ce | ||
|
|
2a443cd9db | ||
|
|
f4d1004d32 | ||
|
|
9d8aec7eca | ||
|
|
958c116fd0 | ||
|
|
ec1a125809 | ||
|
|
2dd8e719c8 | ||
|
|
d62c68a490 | ||
|
|
3c6dd290f4 | ||
|
|
07e589aae3 | ||
|
|
1119d3c17f | ||
|
|
eac5d1ee7a | ||
|
|
56cb5c092f | ||
|
|
9d7faf9ed9 | ||
|
|
7da661546f | ||
|
|
48d3280e5e | ||
|
|
b61c65636b | ||
|
|
087a0b079f | ||
|
|
2147417322 | ||
|
|
4304970059 | ||
|
|
fc981fda20 | ||
|
|
be9ff51fd9 | ||
|
|
adde56114e | ||
|
|
5cfd2dc799 | ||
|
|
c878775c72 | ||
|
|
574cdd374b | ||
|
|
a3943aab24 | ||
|
|
1503e58d11 | ||
|
|
2650d57d8e | ||
|
|
4d402c7229 | ||
|
|
d687543910 | ||
|
|
d8ad519cd0 | ||
|
|
a23d093271 | ||
|
|
8a35d69540 | ||
|
|
097a5a0894 | ||
|
|
8760c2bbb0 | ||
|
|
dc635fe7d7 | ||
|
|
f10a1d0ffb | ||
|
|
809779e508 | ||
|
|
80d358d1fd | ||
|
|
a1be17c72c | ||
|
|
0a066f51bb | ||
|
|
294141c353 | ||
|
|
5a47f9fa86 | ||
|
|
6ee2d7d823 | ||
|
|
f2881f02c8 | ||
|
|
9f5445689c | ||
|
|
0ea163e3ee | ||
|
|
f097aa4a67 | ||
|
|
1fcb9e649e | ||
|
|
1d0dc02013 | ||
|
|
8766d31943 | ||
|
|
d857bf483e | ||
|
|
b7774251eb | ||
|
|
da7507fc75 | ||
|
|
fe4699430d | ||
|
|
df4fc8149d | ||
|
|
c156f0c346 | ||
|
|
79a17b0c1c | ||
|
|
d3051ad127 | ||
|
|
f4c53aaf8a | ||
|
|
432ff95a98 | ||
|
|
fe29bb4b9f | ||
|
|
ae5347bc0f | ||
|
|
966de87ef9 | ||
|
|
3569f9a182 | ||
|
|
70a23f8a0a | ||
|
|
857e12b96e | ||
|
|
c10525ada9 | ||
|
|
fb8592495d | ||
|
|
a48ada306c | ||
|
|
8db0d663dc | ||
|
|
70744371a3 | ||
|
|
18c322e8d6 | ||
|
|
75cbfa1b1c | ||
|
|
48c7aa3e84 | ||
|
|
87bce65098 | ||
|
|
c288dc433b | ||
|
|
0cc29d070f | ||
|
|
8fd94b625c | ||
|
|
ccca3fff26 | ||
|
|
f77446919f | ||
|
|
96fdf265d5 | ||
|
|
b964e3f7c3 | ||
|
|
d93c83f775 | ||
|
|
6b9f6c29ec | ||
|
|
09b0bf62e2 | ||
|
|
15d7d3f8a2 | ||
|
|
dedbdf890a | ||
|
|
30085e1e34 | ||
|
|
1c30146491 | ||
|
|
037022b175 | ||
|
|
0aa67727f5 | ||
|
|
8e3e1d5f11 | ||
|
|
d2d70089ca | ||
|
|
94a566acc9 | ||
|
|
daab095557 | ||
|
|
2b9b5df1ee | ||
|
|
e7e62b8d40 | ||
|
|
3d242bbdb6 | ||
|
|
e796eae3c3 | ||
|
|
a257e83a62 | ||
|
|
d527584248 | ||
|
|
0a4de6e2fc | ||
|
|
4b20f12eff | ||
|
|
0de1187012 | ||
|
|
8e474170e4 | ||
|
|
2eeb9b1f35 | ||
|
|
3de6e2c3f1 | ||
|
|
98d166808f | ||
|
|
f75e15dfdc | ||
|
|
f2b892b7d5 | ||
|
|
883ada01f8 | ||
|
|
3a8f45a04d | ||
|
|
906609696b | ||
|
|
66ccde4310 | ||
|
|
4970cdc3f4 | ||
|
|
1becc874ba | ||
|
|
b107a8dc7c | ||
|
|
37aebc1716 | ||
|
|
836877ff93 | ||
|
|
28a846e0cb | ||
|
|
0185a30ec9 | ||
|
|
38e1947302 | ||
|
|
4fb4d6fc0c | ||
|
|
6d719988bf | ||
|
|
b1c1f0e21e | ||
|
|
3f34cc7365 | ||
|
|
3c6c2837bd | ||
|
|
4bcef76fd8 | ||
|
|
2fd5d7aa81 | ||
|
|
5080c68dce | ||
|
|
3403aef37d | ||
|
|
53a34c12d2 | ||
|
|
59417d6721 | ||
|
|
93d63dbca5 | ||
|
|
4643cf1070 | ||
|
|
91bf54019e | ||
|
|
ead716ef0d | ||
|
|
8fec1af257 | ||
|
|
99248caba3 | ||
|
|
af64bdf742 | ||
|
|
66a4925371 | ||
|
|
8eb6acd60f | ||
|
|
ce6892f2e6 | ||
|
|
c14a4e9305 | ||
|
|
5825eb1696 | ||
|
|
bfebbd0095 | ||
|
|
b204507a82 | ||
|
|
9f53426511 | ||
|
|
03c2282c3f | ||
|
|
20092d55fd | ||
|
|
69a2a5cfff | ||
|
|
618cfad100 | ||
|
|
56e625a9df | ||
|
|
79a1ef5d3e | ||
|
|
10dd7619bf | ||
|
|
f9dfec5bd0 | ||
|
|
a9488bc18b | ||
|
|
f0ee708710 | ||
|
|
3390a31cc6 | ||
|
|
0b4b272223 | ||
|
|
8d200ea653 | ||
|
|
eb359c5595 | ||
|
|
e1b8088c17 | ||
|
|
70a1eea231 | ||
|
|
c744974192 | ||
|
|
faa11a87a9 | ||
|
|
91da5c4ab1 | ||
|
|
da5e770e06 | ||
|
|
09557e378b | ||
|
|
72d26fed0f | ||
|
|
225de799e8 | ||
|
|
334c44760f | ||
|
|
ac7fc1020d | ||
|
|
461871327b | ||
|
|
60ddd799de | ||
|
|
80571fbe8f | ||
|
|
d407f85704 | ||
|
|
458dc7db42 | ||
|
|
beab794c0e | ||
|
|
8256f5461c | ||
|
|
0fe3ad7432 | ||
|
|
04e5dda127 | ||
|
|
f65adea2f9 | ||
|
|
cdfb0da5c9 | ||
|
|
cfa3d34dff | ||
|
|
01b7d4f742 | ||
|
|
9a359bf42c | ||
|
|
ebdf11300b | ||
|
|
e1a8f02bce | ||
|
|
862d38b587 | ||
|
|
2415767c06 | ||
|
|
aa59348a94 | ||
|
|
9c925d3327 | ||
|
|
30f7521a3a | ||
|
|
7b3869e385 | ||
|
|
0e641f7c5b | ||
|
|
733d16cf35 | ||
|
|
833bc1b251 | ||
|
|
840f3d9382 | ||
|
|
34d6d867f2 | ||
|
|
e56d5a0454 | ||
|
|
53fdf750f4 | ||
|
|
f096e915cf | ||
|
|
ce59488e8e | ||
|
|
47db522cc1 | ||
|
|
a2cac82cba | ||
|
|
2e74333eb7 | ||
|
|
0056be2d5f | ||
|
|
1d7e034d5e | ||
|
|
8deac175d1 | ||
|
|
d0b766a2d3 | ||
|
|
65692f2a83 | ||
|
|
d0b0786284 | ||
|
|
87ac1002de | ||
|
|
c51fde7f1f | ||
|
|
0a6735110f | ||
|
|
8a284c50a2 | ||
|
|
09431ef27c | ||
|
|
9f9de86d21 | ||
|
|
d9c04a09ba | ||
|
|
04a02cfdc8 | ||
|
|
b3a6c32ef6 | ||
|
|
254f3b5ac9 | ||
|
|
7f9ada14c8 | ||
|
|
f79a4741cc | ||
|
|
f3fd48d0c0 | ||
|
|
fbee3318bd | ||
|
|
813f807876 | ||
|
|
0060a86b20 | ||
|
|
15743c5f46 | ||
|
|
4b9d472f10 | ||
|
|
988006f913 | ||
|
|
2f05c472ce | ||
|
|
5c836cdaaf | ||
|
|
9e39c3495d | ||
|
|
b653aa57b7 | ||
|
|
2ffdd340af | ||
|
|
d63c3fc6d0 | ||
|
|
4486261413 | ||
|
|
a2e32179bb | ||
|
|
72b106e71f | ||
|
|
679f1ed629 | ||
|
|
734815c58d | ||
|
|
abfedf381d | ||
|
|
8e040ae8d9 | ||
|
|
0c9836eb03 | ||
|
|
62b13a9a84 | ||
|
|
c48ccae484 | ||
|
|
6264bfa15f | ||
|
|
b50ba9c02e | ||
|
|
b3474c04c7 | ||
|
|
a1c1271d21 | ||
|
|
79155887b0 | ||
|
|
4178604833 | ||
|
|
d1fcd6958f | ||
|
|
f39623c279 | ||
|
|
520f5cb116 | ||
|
|
43e2c813d1 | ||
|
|
c6ea32f0b0 | ||
|
|
976c3b8494 | ||
|
|
f3db90b6a9 | ||
|
|
82509fb476 | ||
|
|
c27d79cf25 | ||
|
|
de912c1e07 | ||
|
|
2159aa91ff | ||
|
|
748dba41dc | ||
|
|
9349416326 | ||
|
|
3b794c897d | ||
|
|
b460f7a564 | ||
|
|
383b048fef | ||
|
|
243a3bfbf6 | ||
|
|
c108a475e3 | ||
|
|
6b653fa606 | ||
|
|
818962e668 | ||
|
|
c729297615 | ||
|
|
e6e90954a9 | ||
|
|
4e86f60fd2 | ||
|
|
27ff545d46 | ||
|
|
7c891e9ba8 | ||
|
|
6143003516 | ||
|
|
8f83e328b0 | ||
|
|
9afa8efd7d | ||
|
|
393d9ca74e | ||
|
|
97c95c1c49 | ||
|
|
491df2cc82 | ||
|
|
b4a6ecc58c | ||
|
|
103bf593f3 | ||
|
|
0332c0f5e0 | ||
|
|
a004d6976d | ||
|
|
730f786d5b | ||
|
|
8993c71577 | ||
|
|
cc524bb2ab | ||
|
|
2e94eecda0 | ||
|
|
2466270b22 | ||
|
|
54a514edfa | ||
|
|
1336aeaef0 | ||
|
|
3c078100e8 | ||
|
|
13a623ea1f | ||
|
|
05b21eae5f | ||
|
|
e0358d42d6 | ||
|
|
26174d88f4 | ||
|
|
c12d4319ac | ||
|
|
a87bd14342 | ||
|
|
d5990eee71 | ||
|
|
f94343f13b | ||
|
|
ea4c424e0f | ||
|
|
f99e5e015d | ||
|
|
56b57da077 | ||
|
|
4b402d9837 | ||
|
|
6c2b1f555f | ||
|
|
cdcda03e92 | ||
|
|
65aa05a660 | ||
|
|
7c7aa994a5 | ||
|
|
2aec4a69ea | ||
|
|
06c9ea7068 | ||
|
|
c88583c1c0 | ||
|
|
d2b6838453 | ||
|
|
c9f1f8f662 | ||
|
|
7a08343304 | ||
|
|
3b1bb3e08a | ||
|
|
07cafd4866 | ||
|
|
48821a710f | ||
|
|
30a1b333b9 | ||
|
|
696bf71962 | ||
|
|
2d577e92f1 | ||
|
|
86b92b5b30 | ||
|
|
24c1dec046 | ||
|
|
6c478a26c4 | ||
|
|
2d3da6daf8 | ||
|
|
de3b2b8024 | ||
|
|
02a064ffc6 | ||
|
|
cb5303ce4d | ||
|
|
c0dee19cb0 | ||
|
|
870987bba7 | ||
|
|
5d63a4b910 | ||
|
|
3236ee5ec9 | ||
|
|
12ed2ac07b | ||
|
|
729f3b1df9 | ||
|
|
ee1be3599c | ||
|
|
12a6aca8cd | ||
|
|
2b81b8daeb | ||
|
|
5edbdec151 | ||
|
|
eaa38c11b8 | ||
|
|
e904e34556 | ||
|
|
445f805bb8 | ||
|
|
df77b9d0ed | ||
|
|
29f2525b58 | ||
|
|
5a68c7a335 | ||
|
|
69ef7f40d8 | ||
|
|
d1d6b80676 | ||
|
|
dfe83ff497 | ||
|
|
e5acf6d936 | ||
|
|
bca0ca6766 | ||
|
|
f17b5faaf6 | ||
|
|
f20fa571f1 | ||
|
|
b90d1c31c7 | ||
|
|
cf56ca35eb | ||
|
|
c31f5b5782 | ||
|
|
af98c8eb59 | ||
|
|
3a10b2d83c | ||
|
|
32e7c48fd8 | ||
|
|
af578870c7 | ||
|
|
cd470d5497 | ||
|
|
a9c5e2a04f | ||
|
|
0196fd8447 | ||
|
|
b1458840e7 | ||
|
|
1fea786669 | ||
|
|
6f9a57751e | ||
|
|
2e1c585005 | ||
|
|
811626e67b | ||
|
|
cdfd81a67a | ||
|
|
408b8b2107 | ||
|
|
6d5f3a52f4 | ||
|
|
2cdf08de9f | ||
|
|
71141a0f8d | ||
|
|
bded936af5 | ||
|
|
caaac232d7 | ||
|
|
a9d51dad34 | ||
|
|
88296da0af | ||
|
|
de3c4f8fd7 | ||
|
|
1785bab504 | ||
|
|
41da32cd1b | ||
|
|
93d586592e | ||
|
|
d6c6c75157 | ||
|
|
4889769522 | ||
|
|
6c70de6a58 | ||
|
|
fd9154e009 | ||
|
|
97b9214d6e | ||
|
|
a8d1376533 | ||
|
|
3be443c63c | ||
|
|
cc2c9eb21d | ||
|
|
9b3ae5c729 | ||
|
|
ccb7fc5886 | ||
|
|
60d69e3cc4 | ||
|
|
f64f62492f | ||
|
|
3fe936306b | ||
|
|
c79f8043ad | ||
|
|
8369ae4616 | ||
|
|
4715688fe8 | ||
|
|
62e03a4ef5 | ||
|
|
9ef3c721df | ||
|
|
f55039ac6b | ||
|
|
be792a1052 | ||
|
|
c612036db3 | ||
|
|
ad4ee6f402 | ||
|
|
49a5bd2ba6 | ||
|
|
8aac6a992b | ||
|
|
5da66f05d4 | ||
|
|
134e0db2e9 | ||
|
|
b3415ee2f4 | ||
|
|
14175a6dfd | ||
|
|
7b3fb46a9a | ||
|
|
0aea165a8f | ||
|
|
17b7a9bf10 | ||
|
|
bd611ee11c | ||
|
|
c6ca65f5c9 | ||
|
|
95f15e68fe | ||
|
|
89dabaeb43 | ||
|
|
c2e100b1e3 | ||
|
|
9f33c6cef1 | ||
|
|
7e241e3993 | ||
|
|
bc51505150 | ||
|
|
e0599a0dea | ||
|
|
d410251595 | ||
|
|
810c74dc2a | ||
|
|
100f2c7e56 | ||
|
|
e13e5295e8 | ||
|
|
b100b7bcc7 | ||
|
|
f4ff8518c2 | ||
|
|
dbd27b641e | ||
|
|
4a428a47af | ||
|
|
3252137ed7 | ||
|
|
68c4b99d1b | ||
|
|
f282891d0a | ||
|
|
7f4e3fedb3 | ||
|
|
2042e0cdbd | ||
|
|
2662fee9fb | ||
|
|
e8e2dcff46 | ||
|
|
3b09012b35 | ||
|
|
a774733af4 | ||
|
|
4a7e1e2b94 | ||
|
|
b8c1f868f5 | ||
|
|
3f56a8fbcf | ||
|
|
d8e86d0fc7 | ||
|
|
e125700b43 | ||
|
|
819a1c62ed | ||
|
|
4bc446e306 | ||
|
|
7f2f15d88e | ||
|
|
be4736fffd | ||
|
|
b4f4de4628 | ||
|
|
b9c652ef2b | ||
|
|
bf4e8d43ea | ||
|
|
468fbdab56 | ||
|
|
309dfd50cd | ||
|
|
44e3e4d1e1 | ||
|
|
476f426590 | ||
|
|
766f1f4127 | ||
|
|
b3cf9bf839 | ||
|
|
056f7cc93b | ||
|
|
741f629ab8 | ||
|
|
dd64c4008b | ||
|
|
3a5de8e2ce | ||
|
|
2d78c0738d | ||
|
|
77617ebee2 | ||
|
|
67e9d9c535 | ||
|
|
800786111c | ||
|
|
ed8197bd50 | ||
|
|
82f8c4ce36 | ||
|
|
b1cf7d0348 | ||
|
|
ae77313007 | ||
|
|
49cbaad47f | ||
|
|
1d96ed72dc | ||
|
|
ec378d046f | ||
|
|
a25dc24c6c | ||
|
|
68eb51a3d0 | ||
|
|
2eda3a9c83 | ||
|
|
ad8e200a84 | ||
|
|
0c83bf2a80 | ||
|
|
6eaec5ffab | ||
|
|
8a2c5fb051 | ||
|
|
9485869014 | ||
|
|
e1bf55b077 | ||
|
|
81140824e4 | ||
|
|
d5545de81f | ||
|
|
8632baed27 | ||
|
|
9aaea7e44f | ||
|
|
c2f8f4d016 | ||
|
|
5131e74349 | ||
|
|
3927427b5b | ||
|
|
4aef4c63fc | ||
|
|
fb4777e7f0 | ||
|
|
d8f3a54f9b | ||
|
|
de964a3a60 | ||
|
|
ce3bc07aa8 | ||
|
|
5a6bb363cf | ||
|
|
3f9c98d72e | ||
|
|
96b54387fe | ||
|
|
70eb67dd6a | ||
|
|
77f9f40065 | ||
|
|
14ae1a69c4 | ||
|
|
c9858dfd49 | ||
|
|
f75fe3cc89 | ||
|
|
c19ccbccac | ||
|
|
2f90e533a5 | ||
|
|
0cd0919447 | ||
|
|
e8b886fcc6 | ||
|
|
b8e937a234 | ||
|
|
eb2e0d3abf | ||
|
|
3365da7f8d | ||
|
|
a0e37a4a09 | ||
|
|
5541c15753 | ||
|
|
f87110749e | ||
|
|
a0ef0d5708 | ||
|
|
2e2abcd645 | ||
|
|
6baf820afa | ||
|
|
288287badf | ||
|
|
ca4feca073 | ||
|
|
7c9356955e | ||
|
|
57541ec233 | ||
|
|
9c6d1ce020 | ||
|
|
c72ead9d0a | ||
|
|
4262a1b2a5 | ||
|
|
eb589b6e78 | ||
|
|
98e5e53fda | ||
|
|
00918fbdc1 | ||
|
|
5ad0f2c624 | ||
|
|
babb9baa2b | ||
|
|
45143836e5 | ||
|
|
ceacd7dc52 | ||
|
|
6eb255632f | ||
|
|
3a37d0e092 | ||
|
|
4c7fb1854d | ||
|
|
763cff6898 | ||
|
|
fa34d06341 | ||
|
|
1ca53da0e2 | ||
|
|
57dfa00541 | ||
|
|
36ae84eada | ||
|
|
7f290504ad | ||
|
|
92b4be9a01 | ||
|
|
8cb8dea642 | ||
|
|
a63f745c73 | ||
|
|
4a0fee5796 | ||
|
|
cf90236e57 | ||
|
|
fc6c7bb1de | ||
|
|
1b92131ce9 | ||
|
|
792ecd6aad | ||
|
|
933b6f278b | ||
|
|
45dfc13ebd | ||
|
|
1254ab232a | ||
|
|
b49e56c857 | ||
|
|
d5bd9a1693 | ||
|
|
9b60cd96f9 | ||
|
|
0a05ed98d0 | ||
|
|
6a3a564bd4 | ||
|
|
3828f78480 | ||
|
|
239d7e33cb | ||
|
|
b8c479549c | ||
|
|
0a9fd4a92e | ||
|
|
4c96161acb | ||
|
|
ce7a7a31a7 | ||
|
|
834e26b44e | ||
|
|
f71b302f6f | ||
|
|
566a381e95 | ||
|
|
5d7d779a49 | ||
|
|
59a35b170c | ||
|
|
14eb473355 | ||
|
|
a8e23e08ee | ||
|
|
15f5dcf860 | ||
|
|
9be9908a22 | ||
|
|
446b6c107b | ||
|
|
5a3f8ad15f | ||
|
|
3a2c6a0827 | ||
|
|
e865acd871 | ||
|
|
4a0e1ba444 | ||
|
|
1a88b0b944 | ||
|
|
e0592b3f62 | ||
|
|
1ec55c2d7e | ||
|
|
6427a7dcdf | ||
|
|
7bac0e2ca5 | ||
|
|
e8bc2475c3 | ||
|
|
816b08b14a | ||
|
|
64e1448782 | ||
|
|
ae0a27991b | ||
|
|
f1b82dcbe6 | ||
|
|
bfbd50d8f4 | ||
|
|
de07316261 | ||
|
|
eae196c6a1 | ||
|
|
8af41975ff | ||
|
|
957bbbc9b2 | ||
|
|
17faf1561f | ||
|
|
ec6419f0ff | ||
|
|
f6e60bebcc | ||
|
|
797ac20567 | ||
|
|
3bc029a0de | ||
|
|
4eba33a1c6 | ||
|
|
800a452d62 | ||
|
|
177604e94a | ||
|
|
088015dd4d | ||
|
|
0f2d0aee5f | ||
|
|
1004e2a32b | ||
|
|
5c2b523f7a | ||
|
|
de42063171 | ||
|
|
a49d373af0 | ||
|
|
0095f7f9c7 | ||
|
|
f53820e4de | ||
|
|
25e4700ef9 | ||
|
|
58c7dcb705 | ||
|
|
44626c36a9 | ||
|
|
cfd5bfe2c4 | ||
|
|
f7928787dc | ||
|
|
d6630a0eb5 | ||
|
|
af39e84aef | ||
|
|
93fe2ff504 | ||
|
|
b42f2d4073 | ||
|
|
c5c231920d | ||
|
|
89ddf8c4fa | ||
|
|
71ab678945 | ||
|
|
14daee3b1b | ||
|
|
d2bbbb0fe7 | ||
|
|
fd8d9b02a9 | ||
|
|
a639a37637 | ||
|
|
7eec53d621 | ||
|
|
7523afffb5 | ||
|
|
2c8b9334b6 | ||
|
|
d41ccf9072 | ||
|
|
c98d298cf1 | ||
|
|
73d0b377ae | ||
|
|
df29306a1f | ||
|
|
435522415d | ||
|
|
a17d1d3a2f | ||
|
|
94a5bef62c | ||
|
|
2cd9a5658e | ||
|
|
3c5bd3cedd | ||
|
|
8e02b57369 | ||
|
|
935b8b7bc4 | ||
|
|
9c54f8fd11 | ||
|
|
6bfc1b84de | ||
|
|
59f545d5ce | ||
|
|
23983422e0 | ||
|
|
956bf2d763 | ||
|
|
964b2636fb | ||
|
|
490bc195d8 | ||
|
|
0ce41150c6 | ||
|
|
0455416dec | ||
|
|
a6e7febf77 | ||
|
|
ede0757d83 | ||
|
|
8282d84b16 | ||
|
|
223649ec28 | ||
|
|
68e433b3b7 | ||
|
|
1a51b93ec9 | ||
|
|
c31ffa5ab4 | ||
|
|
ca6bee07ea | ||
|
|
9acaa7b126 | ||
|
|
2bae937b28 | ||
|
|
51bf989418 | ||
|
|
07dd460d78 | ||
|
|
045d74fb9d | ||
|
|
c8c76f4174 | ||
|
|
83c4d09093 | ||
|
|
50ef8d9610 | ||
|
|
98c6abad36 | ||
|
|
62146480db | ||
|
|
6518d192ec | ||
|
|
3fe9cfee74 | ||
|
|
d495054eb5 | ||
|
|
ce80636141 | ||
|
|
fe93be66ad | ||
|
|
1f712063bf | ||
|
|
560c3860b4 | ||
|
|
36f1a2d78a | ||
|
|
3ddd8d2056 | ||
|
|
5441fcc374 | ||
|
|
1d83784820 | ||
|
|
fb5bab6e92 | ||
|
|
90fcf35c34 | ||
|
|
4ff6b5fbc7 | ||
|
|
ead1398132 | ||
|
|
6330c4a69e | ||
|
|
dcc18049a1 | ||
|
|
fcb8909a54 | ||
|
|
37e3bfe7d9 | ||
|
|
d61b837dcf | ||
|
|
f079e22789 | ||
|
|
1f53c62ced | ||
|
|
9fb4e0988b | ||
|
|
d8bbe459b9 | ||
|
|
8bd7526b43 | ||
|
|
24b1485555 | ||
|
|
7683dfc436 | ||
|
|
ccbffca278 | ||
|
|
aeaab43f44 | ||
|
|
a2450d2d07 | ||
|
|
c85bd8ab70 | ||
|
|
3f6bce0fc6 | ||
|
|
e566b20e2b | ||
|
|
f37a7d759a | ||
|
|
d1341b0be0 | ||
|
|
4ea3d690db | ||
|
|
d5dc9895e4 | ||
|
|
b1fc72e8a9 | ||
|
|
7479a02220 | ||
|
|
d1bf48ad79 | ||
|
|
a345737b8b | ||
|
|
c501ebb357 | ||
|
|
15e0570a8c | ||
|
|
09e77c8c94 | ||
|
|
f5c58f3679 | ||
|
|
ddcbe64db6 | ||
|
|
c5137eb884 | ||
|
|
e073eca458 | ||
|
|
78f2e0a064 | ||
|
|
df2defe969 | ||
|
|
6d4a2feaae | ||
|
|
8939fc09b3 | ||
|
|
e0e574c19e | ||
|
|
02126c93b9 | ||
|
|
37671bad9a | ||
|
|
0e8ce005d7 | ||
|
|
584a225d6e | ||
|
|
736359056f | ||
|
|
bf2e527e72 | ||
|
|
be7992d541 | ||
|
|
435eb7f8b9 | ||
|
|
001f1dbd3c | ||
|
|
7b5372a985 | ||
|
|
1647ef4fae | ||
|
|
ee86f8244f | ||
|
|
e518b58b23 | ||
|
|
5af1164b5c | ||
|
|
c9aba059e2 | ||
|
|
dc9469c0cc | ||
|
|
696e82e622 | ||
|
|
18a5ec73d7 | ||
|
|
83ee8dd3f8 | ||
|
|
04224b309a | ||
|
|
01a1cf5765 | ||
|
|
8fdf4042bb | ||
|
|
621969459a | ||
|
|
6fe1c85592 | ||
|
|
79346d92d7 | ||
|
|
24ceeb626b | ||
|
|
68727496ad | ||
|
|
d07b67b5bf | ||
|
|
4dc9c97978 | ||
|
|
99916f99fd | ||
|
|
4a5307f47b | ||
|
|
69aead58a7 | ||
|
|
f0dcfb0346 | ||
|
|
c85d52e594 | ||
|
|
4342abca3d | ||
|
|
11e4ff34d6 | ||
|
|
f118ac14ca | ||
|
|
f5eb7a10de | ||
|
|
36b09421e8 | ||
|
|
d6b39a11e7 | ||
|
|
23729f45ee | ||
|
|
27d7b73e57 | ||
|
|
af60f08a8b | ||
|
|
c19d3fd068 | ||
|
|
0f8312dd5e | ||
|
|
1edb11cedf | ||
|
|
6fea7c8d74 | ||
|
|
a4a1ba4331 | ||
|
|
de46277bea | ||
|
|
6d7d811814 | ||
|
|
98b98256b7 | ||
|
|
abd389f4de | ||
|
|
602956a555 | ||
|
|
8d0601babc | ||
|
|
050be563bf | ||
|
|
965dbda101 | ||
|
|
f2b2cd9cc0 | ||
|
|
3a78e1b487 | ||
|
|
db637f0bc9 | ||
|
|
b15f1dde28 | ||
|
|
28a78d820a | ||
|
|
a1792fe125 | ||
|
|
3f7b17961f | ||
|
|
0ea07d4bc7 | ||
|
|
190b7ee1f5 | ||
|
|
4ff4271da2 | ||
|
|
8705974e08 | ||
|
|
de0487d16f | ||
|
|
fc0c386ecb | ||
|
|
86db4251a2 | ||
|
|
effe5ec305 | ||
|
|
8fb92292bd | ||
|
|
375fa4f75c | ||
|
|
da25b02e0a | ||
|
|
d43ae17bd2 | ||
|
|
f81a763d6c | ||
|
|
385f8ca0b3 | ||
|
|
0ba4bc25c7 | ||
|
|
b0eb4b93a8 | ||
|
|
54f135aebd | ||
|
|
10e369f9c5 | ||
|
|
1ae9b0f4d2 | ||
|
|
198ee6a7ed | ||
|
|
2414ddf485 | ||
|
|
2cd52db8c9 | ||
|
|
5e00636761 | ||
|
|
a82cc9609b | ||
|
|
45c6c20ccd | ||
|
|
7a61f55e49 | ||
|
|
aa0b77a64c | ||
|
|
030c8e59d7 | ||
|
|
f21fbe2d40 | ||
|
|
9a5f4b638f | ||
|
|
9aa49a09da | ||
|
|
bf8945ac59 | ||
|
|
d9926bab4e | ||
|
|
38ba2c21e5 | ||
|
|
a48fb30edf | ||
|
|
92ec04bd46 | ||
|
|
0b6372a6ea | ||
|
|
4f8b66f94d | ||
|
|
0c52b3016c | ||
|
|
a2f80569e3 | ||
|
|
87df536a1f | ||
|
|
12e70490d8 | ||
|
|
23b1518dc0 | ||
|
|
6dbf2e0d95 | ||
|
|
60304e9643 | ||
|
|
614557e2fa | ||
|
|
e312e95aed | ||
|
|
2ee919b51f | ||
|
|
22f6ae858b | ||
|
|
3c3b4af2c4 | ||
|
|
feb0d1fe5d | ||
|
|
2d66b8ed12 | ||
|
|
483f348403 | ||
|
|
a8a5100f58 | ||
|
|
1f9dc70bb1 | ||
|
|
7f1ef61657 | ||
|
|
2e74c079b0 | ||
|
|
ce4295289a | ||
|
|
7fde04851d | ||
|
|
71d030e5ad | ||
|
|
b08649d0a4 | ||
|
|
0a11a9a2c8 | ||
|
|
068f47b523 | ||
|
|
79aab57abc | ||
|
|
2cf58f1b5b | ||
|
|
9678875b4b | ||
|
|
d1a7ce827a | ||
|
|
9b2f4b7bde | ||
|
|
24e5147a2a | ||
|
|
0423a7831d | ||
|
|
feea22b3a4 | ||
|
|
7f40a9f284 | ||
|
|
bc706109e0 | ||
|
|
a25bddba5e | ||
|
|
ab897724d3 | ||
|
|
a7861fc54b | ||
|
|
936bec8ff5 | ||
|
|
01d10971a1 | ||
|
|
12e388a392 | ||
|
|
fb450671d6 | ||
|
|
fca5f9ec98 | ||
|
|
c9ae6436bd | ||
|
|
b6c4d2b4ad | ||
|
|
27ab2f5b12 | ||
|
|
9b08062a58 | ||
|
|
401bdfa9ac | ||
|
|
68d8d6dd30 | ||
|
|
2a57d7007d | ||
|
|
fd675ac291 | ||
|
|
41f020bbb7 | ||
|
|
00dee500e0 | ||
|
|
36bdb8a63e | ||
|
|
aa9eb0868c | ||
|
|
48aafa9834 | ||
|
|
78f53f294a | ||
|
|
3158c7e3eb | ||
|
|
47d27ebf31 | ||
|
|
bc3773ae75 | ||
|
|
d8ddd27d71 | ||
|
|
8d5696507a | ||
|
|
9ec376a228 | ||
|
|
a05a0da9fb | ||
|
|
5029ad9d93 | ||
|
|
1444be665c | ||
|
|
3dedb94bdc | ||
|
|
c0f6c15a80 | ||
|
|
00626a4893 | ||
|
|
b416a59bb7 | ||
|
|
bf96fb2214 | ||
|
|
2e79c8d770 | ||
|
|
6c9d1c4953 | ||
|
|
df8df192d3 | ||
|
|
e5f43462c8 | ||
|
|
1867a3e040 | ||
|
|
6818f98de3 | ||
|
|
f910c76248 | ||
|
|
975cbf0bf8 | ||
|
|
f10b3cef01 | ||
|
|
ad39c94773 | ||
|
|
f189ab30e5 | ||
|
|
0ad18ee971 | ||
|
|
501f5de55a | ||
|
|
0b18ae8ff2 | ||
|
|
de12970486 | ||
|
|
7550b99aaa | ||
|
|
ed5a43966d | ||
|
|
95ea6703f1 | ||
|
|
55f9092aa6 | ||
|
|
5f50a46603 | ||
|
|
c5e6704530 | ||
|
|
8552192894 | ||
|
|
0261d16140 | ||
|
|
2b414526e5 | ||
|
|
c0b7eb526a | ||
|
|
7b7196a8c4 | ||
|
|
f648289035 | ||
|
|
8a0b1d548d | ||
|
|
1f17d5d11e | ||
|
|
18efd09421 | ||
|
|
18d3b30647 | ||
|
|
7f0243b2df | ||
|
|
33610c8997 | ||
|
|
8e0a1f4f70 | ||
|
|
b07cf6bdde | ||
|
|
7ed218ee7f | ||
|
|
3aedeea220 | ||
|
|
4f9b7b2609 | ||
|
|
09abab1b5d | ||
|
|
499713c8e7 | ||
|
|
cb953a1619 | ||
|
|
3ab4938f3d | ||
|
|
f6e9fd9f3a | ||
|
|
8dab75f3cb | ||
|
|
b36096e54d | ||
|
|
0574de4a29 | ||
|
|
6d6bc3de76 | ||
|
|
5c4c3cf59c | ||
|
|
0033c8864e | ||
|
|
e7c749ee3a | ||
|
|
5c026be0cd | ||
|
|
c465546871 | ||
|
|
3322677d32 | ||
|
|
76cf0ebb01 | ||
|
|
d34a0cca30 | ||
|
|
a77a916fcc | ||
|
|
e1ebb96545 | ||
|
|
d85a6bec43 | ||
|
|
78eb7787e9 | ||
|
|
b55ce30b2d | ||
|
|
14050cf096 | ||
|
|
5930128b7f | ||
|
|
08be78fa35 | ||
|
|
88f43d9a91 | ||
|
|
6cbf960dea | ||
|
|
374d34f76d | ||
|
|
cc486c2dc7 | ||
|
|
724dce07a9 | ||
|
|
1486e2063b | ||
|
|
50c9649b23 | ||
|
|
339a54b0ac | ||
|
|
b97afb85a1 | ||
|
|
15da9d580b | ||
|
|
62aed496cc | ||
|
|
fba131936a | ||
|
|
70601a4560 | ||
|
|
83604ecb6d | ||
|
|
b912f7072c | ||
|
|
7e7e468408 | ||
|
|
748c97f6c1 | ||
|
|
a3aab57cf8 | ||
|
|
5548e26dd9 | ||
|
|
89d2f07c03 | ||
|
|
f42a28f34f | ||
|
|
bdc753f03c | ||
|
|
68a7b540c5 | ||
|
|
b2dd820507 | ||
|
|
612308eb9a | ||
|
|
98dc7b853a | ||
|
|
a2fefd6fb6 | ||
|
|
17a0382283 | ||
|
|
eea5784527 | ||
|
|
1aff2cf9eb | ||
|
|
4fc6349824 | ||
|
|
7a3921eace | ||
|
|
e99599c377 | ||
|
|
e1f6366a00 | ||
|
|
182b01ac2f | ||
|
|
18f3914428 | ||
|
|
bd0a045da3 | ||
|
|
9a4bed8c67 | ||
|
|
ae0cf692cd | ||
|
|
2ca7d139fe | ||
|
|
7e67505dfb | ||
|
|
21100de85d | ||
|
|
d8f799f8b4 | ||
|
|
cb03a98113 | ||
|
|
4b36a11dda | ||
|
|
8099490213 | ||
|
|
6cb2843707 | ||
|
|
e831f0561a | ||
|
|
d57c253b19 | ||
|
|
c8c68ea7d9 | ||
|
|
150fe730bd | ||
|
|
8af425d067 | ||
|
|
c3845abd2a | ||
|
|
eba6820ec6 | ||
|
|
822e40bc1f | ||
|
|
3ffcaae122 | ||
|
|
42a30b4521 | ||
|
|
377ed9e8e5 | ||
|
|
be76fe61d8 | ||
|
|
07ba7a8d9e | ||
|
|
2be3e3b43c | ||
|
|
49bf190895 | ||
|
|
c9a53bdaca | ||
|
|
3a76a111d3 | ||
|
|
e59c7ac34a | ||
|
|
f05b9ae365 | ||
|
|
c60e5a65d6 | ||
|
|
1b4eda713f | ||
|
|
cb133ced80 | ||
|
|
062a3028f4 | ||
|
|
682c2631f0 | ||
|
|
faecb9a439 | ||
|
|
5dc40f3c03 | ||
|
|
569e87847f | ||
|
|
b448315f20 | ||
|
|
2c87ce06eb | ||
|
|
875091a1ce | ||
|
|
5ad7716137 | ||
|
|
8c97399cec | ||
|
|
27e0a9d3b6 | ||
|
|
07f9b287e7 | ||
|
|
fbee4f1b37 | ||
|
|
26542f3d6e | ||
|
|
14630fe956 | ||
|
|
30f5c761d9 | ||
|
|
365abaaa8f | ||
|
|
f4681a282c | ||
|
|
8a14d9ac26 | ||
|
|
0ab1986202 | ||
|
|
e11dc680de | ||
|
|
71249334c3 | ||
|
|
fa41dbce16 | ||
|
|
4246e6c900 | ||
|
|
1b421a24b0 | ||
|
|
9cc9eead52 | ||
|
|
8b21aea9c7 | ||
|
|
4f87cb6446 | ||
|
|
7525de1a72 | ||
|
|
78d2fa7520 | ||
|
|
7fe8122499 | ||
|
|
532c2e7450 | ||
|
|
b391a53c6b | ||
|
|
f3c6346b95 | ||
|
|
dd8984314f | ||
|
|
b82c3f41d3 | ||
|
|
7d6eb65776 | ||
|
|
dc0800e7e1 | ||
|
|
c151366952 | ||
|
|
212137ec3e | ||
|
|
31f36935d3 | ||
|
|
a14fc3e3c9 | ||
|
|
158b3c43f8 | ||
|
|
e31c1e33d9 | ||
|
|
25dfa6d34d | ||
|
|
431429a29c | ||
|
|
d4c8cc28a1 | ||
|
|
ce08405c00 | ||
|
|
da29185b7d | ||
|
|
87feb8c250 | ||
|
|
12797893df | ||
|
|
6d47e43ba9 | ||
|
|
f6b1643378 | ||
|
|
f1c16df63b | ||
|
|
c16e5231f4 | ||
|
|
2365c253dd | ||
|
|
c4e7f2597e | ||
|
|
13fd522bd4 | ||
|
|
b74f6e92dc | ||
|
|
630c3e81e6 | ||
|
|
0f77cf8066 | ||
|
|
52746fca76 | ||
|
|
dae25c2f2d | ||
|
|
a272316301 | ||
|
|
6772f4f169 | ||
|
|
9463e210b8 | ||
|
|
4c44b72f78 | ||
|
|
c849f751bb | ||
|
|
1cde45599e | ||
|
|
f1a22f5f6b | ||
|
|
90d6fbde48 | ||
|
|
802ad84613 | ||
|
|
c4aa9396fd | ||
|
|
f0c937ad47 | ||
|
|
fcc36ee5d7 | ||
|
|
0f023f627c | ||
|
|
fa645b5e00 | ||
|
|
1fb28eeee0 | ||
|
|
d7f67d43b3 | ||
|
|
5a1ec745ce | ||
|
|
6fd599bd31 | ||
|
|
afd706bed8 | ||
|
|
6c3820c747 | ||
|
|
0ebc555136 | ||
|
|
4992c50098 | ||
|
|
4e9322485a | ||
|
|
fc8ad40b00 | ||
|
|
f62e053a84 | ||
|
|
0af3c7ab7d | ||
|
|
7f4efe1775 | ||
|
|
80a5c2f9c4 | ||
|
|
90e13c9562 | ||
|
|
fe89c19969 | ||
|
|
0b6dfad7e5 | ||
|
|
f2b1758439 | ||
|
|
86eaa3b091 | ||
|
|
24153c2fb1 | ||
|
|
5e36683ff2 | ||
|
|
c53563e7d1 | ||
|
|
d778293531 | ||
|
|
7d8888d47d | ||
|
|
6fbfec48b0 | ||
|
|
1f25b0b00b | ||
|
|
0118346aaf | ||
|
|
287842c675 | ||
|
|
61dc77559b | ||
|
|
ca51b2f70f | ||
|
|
3cf01cb6f3 | ||
|
|
16a4b78580 | ||
|
|
94b560ba01 | ||
|
|
3ae9956df9 | ||
|
|
78109eb499 | ||
|
|
da5238878d | ||
|
|
f9a823e4b0 | ||
|
|
eb20da021d | ||
|
|
596f2fa78a | ||
|
|
fa99ebb391 | ||
|
|
9b685be84e | ||
|
|
96f9d2a030 | ||
|
|
2b7178fb00 | ||
|
|
c47bf84493 | ||
|
|
8cf16d4a1c | ||
|
|
5b5b73cde0 | ||
|
|
9f55c25775 | ||
|
|
92c6a7bfcf | ||
|
|
145a47c890 | ||
|
|
70160468c0 | ||
|
|
9730cdb880 | ||
|
|
399bf8e3b9 | ||
|
|
c3a69c8c55 | ||
|
|
db2bf9ee51 | ||
|
|
255dece550 | ||
|
|
d004361836 | ||
|
|
5453b0511d | ||
|
|
42bc5065df | ||
|
|
b0d609e9a3 | ||
|
|
814ffbe800 | ||
|
|
e7ee23b871 | ||
|
|
c14ceab24d | ||
|
|
70e8e534fe | ||
|
|
c4504de1da | ||
|
|
685f901e09 | ||
|
|
d196710a87 | ||
|
|
050f97e088 | ||
|
|
c2fea660e7 | ||
|
|
b2cdf21de5 | ||
|
|
ed09d1b390 | ||
|
|
171026ba23 | ||
|
|
dafa690a09 | ||
|
|
4cd4223ee0 | ||
|
|
3ac5ac385d | ||
|
|
0ae5421d10 | ||
|
|
3f56c8e690 | ||
|
|
c14f3777c0 | ||
|
|
2838a52e0c | ||
|
|
dcfdfa0e62 | ||
|
|
23719ace47 | ||
|
|
33882983e9 | ||
|
|
5aecedc074 | ||
|
|
69bf17a619 | ||
|
|
0292d3eefb | ||
|
|
0cd3e4ed84 | ||
|
|
3a26194a71 | ||
|
|
1313e3fe4b | ||
|
|
b2f400f61a | ||
|
|
9aa676cee1 | ||
|
|
eabf0f7f82 | ||
|
|
d0171809ec | ||
|
|
410c946faf | ||
|
|
3a7d88db4f | ||
|
|
9eba2c683b | ||
|
|
8059636b62 | ||
|
|
d78a1efbf6 | ||
|
|
c0b4a33346 | ||
|
|
2cef6700c7 | ||
|
|
df67bd6720 | ||
|
|
655dcb1c9b | ||
|
|
ce32792668 | ||
|
|
4b384abc51 | ||
|
|
82bccd357b | ||
|
|
12709bcd7f | ||
|
|
0b53f8266a | ||
|
|
a07f14e326 | ||
|
|
3349e9cb05 | ||
|
|
0e2746622d | ||
|
|
d9bd0ace9a | ||
|
|
e31b7d5c48 | ||
|
|
4bddbbf56e | ||
|
|
0654f27599 | ||
|
|
3f71dab0b1 | ||
|
|
bd45fff1b4 | ||
|
|
9618e45a11 | ||
|
|
3839373f5a | ||
|
|
1633617006 | ||
|
|
57e33bbf39 | ||
|
|
cddcf36016 | ||
|
|
dff03109a3 | ||
|
|
c0986a1f89 | ||
|
|
cd4c328320 | ||
|
|
03d0ecd450 | ||
|
|
3a809dab32 | ||
|
|
ade9e20cdd | ||
|
|
29520dc95c | ||
|
|
d40d89f29a | ||
|
|
9377de930f | ||
|
|
3219674678 | ||
|
|
a9438ed52b | ||
|
|
09169bd019 | ||
|
|
c30fdef615 | ||
|
|
109e9725a9 | ||
|
|
44ede5c3f8 | ||
|
|
c1161da6de | ||
|
|
80927417f2 | ||
|
|
91d8cd5da8 | ||
|
|
869d731b81 | ||
|
|
f6a18ef777 | ||
|
|
3e084b3b5d | ||
|
|
2c7f931c4d | ||
|
|
6b18cec7fb | ||
|
|
08960a2dbc | ||
|
|
5f4e269efa | ||
|
|
e5f6da01ec | ||
|
|
ae741a1b99 | ||
|
|
78a3ea4765 | ||
|
|
1a66ff7659 | ||
|
|
df53e2fd4f | ||
|
|
4210920c5f | ||
|
|
3440833af8 | ||
|
|
1e738263bc | ||
|
|
9cf322ca0b | ||
|
|
0c027ca697 | ||
|
|
27ed5f7c38 | ||
|
|
2f83e559a4 | ||
|
|
8b55744447 | ||
|
|
2f491b24e2 | ||
|
|
d2cb55befa | ||
|
|
e3e4cf9884 | ||
|
|
1b461ac96a | ||
|
|
1fc3c8fab2 | ||
|
|
7c28be5e62 | ||
|
|
cbe9cae4ea | ||
|
|
c0b7f8a323 | ||
|
|
f8b4412049 | ||
|
|
10e227a5ac | ||
|
|
077431630a | ||
|
|
37395a70e6 | ||
|
|
b779258d69 | ||
|
|
d3ec976f44 | ||
|
|
79a5732c4d | ||
|
|
12c6bfc2e8 | ||
|
|
31fff0623d | ||
|
|
0d2b87834c | ||
|
|
2feba8f64c | ||
|
|
cf82ae4c66 | ||
|
|
0d7c402c01 | ||
|
|
ae8b70be0f | ||
|
|
a87336b7ee | ||
|
|
7814fa8d46 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,4 +1,4 @@
|
||||
* text
|
||||
* text=auto
|
||||
|
||||
*.png binary
|
||||
*.wav binary
|
||||
|
||||
372
.gitignore
vendored
372
.gitignore
vendored
@@ -1,42 +1,330 @@
|
||||
# Eclipse stuff
|
||||
/.classpath
|
||||
/.project
|
||||
/.settings
|
||||
|
||||
# netbeans
|
||||
/nbproject
|
||||
|
||||
# we use maven!
|
||||
/build.xml
|
||||
|
||||
# maven
|
||||
/target
|
||||
|
||||
# vim
|
||||
.*.sw[a-p]
|
||||
|
||||
# various other potential build files
|
||||
/build
|
||||
/bin
|
||||
/dist
|
||||
/manifest.mf
|
||||
|
||||
/world
|
||||
|
||||
# Mac filesystem dust
|
||||
*.DS_Store
|
||||
|
||||
# intellij
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Project Stuff
|
||||
/src/main/resources/mcMMO
|
||||
|
||||
# Other Libraries
|
||||
*.jar
|
||||
|
||||
# Atlassian Stuff
|
||||
/atlassian-ide-plugin.xml
|
||||
|
||||
### Eclipse template
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
### Android template
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
gen/
|
||||
out/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
.idea/caches
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following line if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
### Dropbox template
|
||||
# Dropbox settings and caches
|
||||
.dropbox
|
||||
.dropbox.attr
|
||||
.dropbox.cache
|
||||
### Windows template
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
### Maven template
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
### NetBeans template
|
||||
nbproject/private/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
### macOS template
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
### Linux template
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
### GPG template
|
||||
secring.*
|
||||
|
||||
### Gradle template
|
||||
.gradle
|
||||
/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||
# gradle/wrapper/gradle-wrapper.properties
|
||||
### SBT template
|
||||
# Simple Build Tool
|
||||
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control
|
||||
|
||||
dist/*
|
||||
lib_managed/
|
||||
src_managed/
|
||||
project/boot/
|
||||
project/plugins/project/
|
||||
.history
|
||||
.cache
|
||||
.lib/
|
||||
### Example user template template
|
||||
### Example user template
|
||||
|
||||
# IntelliJ project files
|
||||
.idea
|
||||
out
|
||||
gen### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
### Kotlin template
|
||||
# Compiled class file
|
||||
# Log file
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
### Java template
|
||||
# Compiled class file
|
||||
# Log file
|
||||
# BlueJ files
|
||||
# Mobile Tools for Java (J2ME)
|
||||
# Package Files #
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
|
||||
703
Changelog.txt
703
Changelog.txt
@@ -7,6 +7,703 @@ Key:
|
||||
! Change
|
||||
- Removal
|
||||
|
||||
Version 2.2.0
|
||||
mcMMO has a new config system (WIP)
|
||||
mcMMO for Bukkit no longer requires Spigot in order to play, you can now use Bukkit instead (WIP)
|
||||
mcMMO is now abstracted from the Bukkit API in order to support more platforms (WIP)
|
||||
mcMMO has changed from using maven to gradle!
|
||||
mcMMO is now a gradle project (this makes it much easier for us to support older versions of MC and other APIs)
|
||||
|
||||
Version 2.1.12
|
||||
Salvage config entries are no longer case sensitive
|
||||
Fixed a bug where Fishing was not rewarding vanilla XP orbs
|
||||
|
||||
Version 2.1.11
|
||||
Fixed a bug where Rupture was using the wrong permission node (new permission node: mcmmo.ability.swords.rupture)
|
||||
|
||||
Version 2.1.10
|
||||
Fishing command did an oopsie
|
||||
Endstone now gives the same XP as Stone (update your experience.yml)
|
||||
|
||||
Version 2.1.9
|
||||
Fixed a bug where grabbing the version of WG would throw classnotdefined errors
|
||||
|
||||
Version 2.1.8
|
||||
mcMMO now checks for WG 7 before attempting to use the WG API
|
||||
Made some optimizations for our WG integration
|
||||
Fixed a bug where Bite chance for Master Angler was displaying too many decimal places
|
||||
Fixed a bug where Abilities didn't check for permission nodes before activating
|
||||
MaxBonusLevel now has specific entries for Standard and Retro in advanced.yml
|
||||
MaxBonusLevel for Critical Strikes changed from 75/750 to 100/1000
|
||||
MaxBonusLevel of Dodge changed from 80/800 to 100/1000
|
||||
MaxBonusLevel of Rupture changed from 20/200 to 100/1000
|
||||
MaxBonusLevel of Counter Attack changed from 60/600 to 100/1000
|
||||
|
||||
Version 2.1.7
|
||||
Fixed an almost 6 year old bug where Salvage materials did not have a defined material count so they defaulted to 2 (which could lead to shovels giving back more diamonds than normal)
|
||||
Added spam detection for Unarmed's bonus damage and disarm
|
||||
Corrected an error where master angler for retro only required level 150 instead of 500 (update your skillranks.yml)
|
||||
Fixed a bug where Players could see hidden party members in the party member listings
|
||||
(API) Added addXpFromBlocks to ExperienceAPI to help make adding XP for a player easier
|
||||
(API) Added addXpFromBlocksBySkill to ExperienceAPI to help make adding XP for a player easier
|
||||
(API) Added addXpFromBlock to ExperienceAPI to help make adding XP for a player easier
|
||||
(API) Added addXpFromBlockBySkill to ExperienceAPI to help make adding XP for a player easier
|
||||
|
||||
Version 2.1.6
|
||||
Fixed a bug where Arcane Salvage could never fail
|
||||
Recolored some lines in the locale related to failure from white to red
|
||||
Fixed a bug where Salvage was giving back too many resources
|
||||
SubSkillFailure renamed to SubSkillFailed in config.yml
|
||||
SubSkillFailed now sends copies to chat by default
|
||||
SubSkillFailed no longer sends messages to the action bar by default
|
||||
|
||||
Version 2.1.5
|
||||
mcMMO no longer ignores cancelled events relating to the player left or right clicking
|
||||
|
||||
Version 2.1.4
|
||||
Fixed a bug where Alchemy didn't gain XP
|
||||
Fixed a bug where Archery gained XP from mob spawned entities
|
||||
Fixed a display bug with Roll on /acrobatics command
|
||||
Fixed a display bug for bite chance on Fishing
|
||||
Fixed a display bug for treasure drop chances on Fishing
|
||||
Fixed a display bug for Arcane Forging on Repair
|
||||
Fixed a display bug for Super Repair on Repair
|
||||
Fixed a display bug for Repair Mastery on Repair
|
||||
Fixed a display bug for Second Smelt on Smelting
|
||||
Repair Mastery now uses a rank system
|
||||
Super Repair now uses a rank system
|
||||
Changed the stat for bite chance to be more clear that its additive chance
|
||||
Fixed Styling for the /salvage command
|
||||
Temporarily disabled Flux Mining
|
||||
Removed XP from entities that target endermite to prevent easy exploitation (Credits to TheBentoBox for the tip!) [Can be turned off in experience.yml]
|
||||
Fixed a bug where static chance skills like Arcane Salvage were using incorrect calculations for success
|
||||
Advanced Salvage now uses a rank system
|
||||
Arcane Salvage now goes by your rank to determine the maximum amount of materials salvaged and is no longer percentage based
|
||||
Fixed a bug where Iron Arm was checking for Iron Grip to be unlocked instead of itself
|
||||
(Plugin Compatibility) mcMMO no longer ignores cancelled block place events (this is to prevent XP gains from placed blocks)
|
||||
(Plugin Compatibility) mcMMO now ignores cancelled events relating to the player left or right clicking
|
||||
(Locale) Changed the string for "Salvage.Ability.Bonus.1" to fit the new material recovery mechanics of Salvage
|
||||
(Config) Added a toggle for the new endermite enderman xp farm fix in experience.yml "ExploitFix.EndermanEndermiteFarms"
|
||||
(Config) Cleaned up some leftover 'unlocklevel' settings, this stuff is now handled in skillranks.yml
|
||||
(Config) Removed Salvage.MaxPercentage
|
||||
(Config) Removed Salvage.MaxPercentageChance
|
||||
(Config) Added Salvage.ArcaneSalvage.MaxBonusLevel
|
||||
(Config) Added Salvage.ArcaneSalvage.MaxChance
|
||||
|
||||
Version 2.1.3
|
||||
Temporarily removed the unarmed no-item pickup feature until its fixed
|
||||
|
||||
Version 2.1.2
|
||||
(Compatibility) mcMMO now deals custom damage type for all damage sources to be more compatible with other plugins (such as anti-cheat)
|
||||
(Perks) Fixed a bug where the Lucky perk wasn't adding to success
|
||||
(Skills) mcMMO will now listen to cancelled events to remove our temporary enchantments from tools
|
||||
(Skills) Fixing a bug where Shake didn't calculate success correctly
|
||||
(Skills) Fixed a bug where Arcane Forging didn't calculate success and failure correctly
|
||||
(Skills) Fixed a bug where Salvage didn't calculate success and failure correctly
|
||||
(Skills) Fixed a bug where Flux Mining didn't calculate success correctly
|
||||
(Skills) Fixed a bug where Shake didn't calculate correctly
|
||||
(Skills) Fixed a bug where Pummel didn't calculate correctly
|
||||
(Skills) Tree Feller now works on Mushroom Stems
|
||||
(Skills) Fixed a bug where magic chance would show as null
|
||||
(Skills) Fixed a bug where Trap percentages were added to Fishing even though they no longer exist
|
||||
(Skills) Magic Hunter now uses a rank system
|
||||
(Skills) Fixed a bug where Magic Hunter would work without treasure hunter
|
||||
(Skills) As long are you are empty handed mcMMO will no longer put items into your hands
|
||||
(Skills) Improved the styling on /smelting
|
||||
(Skills) Iron Arm Style can now reach a bonus damage of 10 (up from 8)
|
||||
(Skills) Iron Arm Style now uses a rank system
|
||||
(Skills) Iron Grip now uses a rank system
|
||||
(Skills) Disarm now uses a rank system
|
||||
(Skills) Arrow Deflect now uses a rank system
|
||||
(Skills) Flux Mining is now a passive effect when you mine ore instead of requiring a special pickaxe
|
||||
(Skills) Removed the Flux Mining mcMMO Pickaxe Item
|
||||
(Style) Locked skills now are styled differently in the skill command display
|
||||
(Experience) Phantoms have been added to the default experience.yml with a value of 4.0 (update your config!)
|
||||
(Experience) Default XP value for witch set to 0.1 instead of 0.0
|
||||
(Experience) Default XP value for ender dragon set to 1.0 instead of 0.0
|
||||
(Style) Added @ symbol styling for hover tooltips to the locale
|
||||
(Style) Added the skill names in the skill commands display to the locale so it can now be edited and styled
|
||||
(Experience) Renamed Grass to Grass_Block in treasures.yml to allow grass to give items again (update your configs manually or delete to regen)
|
||||
(Experience) Wood blocks now give XP and are affected by Tree Feller (6 sided bark blocks)
|
||||
(API) Moved XPGainReason from skills to experience package
|
||||
(API) Added XpGainSource for tracking sources of XP
|
||||
(API) You can now specify XpGainSource when adding xp to players
|
||||
(Config) The Extra Stats option for XP bars now overrides the setting for updating XP bars every time XP is gained
|
||||
(Config) Added an option for Party XP gains to not update XP bars
|
||||
(Config) Added an option for Passive XP gains to not update XP bars (smelting/brewing)
|
||||
(Config) Added warnings if mcMMO finds a MaxBonusLevel of 0 for any skill that incorporates RNG
|
||||
(Config) Removed config options for Iron Arm
|
||||
(Config) Removed the options related to the Flux Mining Item
|
||||
(Config) Second Smelt has a max activation chance of 50% instead of 100% (you can update your configs or gen new ones to get this change)
|
||||
|
||||
Version 2.1.1
|
||||
= Fixed an issue where excavation wasn't using the correct permission node
|
||||
= Added protection against AFK fishing
|
||||
= Acrobatics now uses much better anti-exploit detection
|
||||
|
||||
Version 2.1.0
|
||||
+ mcMMO now features XP bars! Configurable in experience.yml
|
||||
+ Locale files now support & codes for colors and formatting!
|
||||
+ Prevented exploits involving blocks made from entities (snowmen, etc..)
|
||||
+ Added JSON integration to all Skill Commands
|
||||
+ Added config setting to enable or disable old mcMMO skill scaling (General.RetroMode) this is on by default for existing installs
|
||||
+ You can now disable specific skills in coreskills.yml without the need for permissions
|
||||
+ Added links to mcMMO related websites to various commands
|
||||
+ Certain elements of mcMMO's UI have been restyled
|
||||
+ Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
|
||||
+ You can now disable mcMMO completely for specific worlds via world_blacklist.txt in /plugins/mcMMO/
|
||||
+ (WorldGuard) mcMMO now supports worldguard, you can use the flags "mcmmo" and "mcmmo-xp" on regions (they default to on unless otherwise specified)
|
||||
! (Scoreboards) Scoreboards are now disabled by default, I don't like them. You can turn them back on in config.yml
|
||||
+ (Sounds) Rolling now plays a sound (Graceful Roll has a different sound :) )
|
||||
+ (Sounds) Activating Super abilities plays a sound (other plays can hear this)
|
||||
+ (Sounds) Skill Unlock Notifications have sounds
|
||||
+ (Sounds) Readying a tool for a super ability now plays a sound
|
||||
+ (Sounds) Bleed DOT now plays a sound
|
||||
+ (Experience) mcMMO now notifies you when you progress in a skill!
|
||||
+ (Experience) Coral (blocks) now give Mining XP
|
||||
+ (Experience) Coral (plants) now give Herbalism XP
|
||||
+ (Experience) Blue Ice now gives Mining XP
|
||||
+ (Experience) Dolphins now give combat XP
|
||||
+ (Experience) Drowned mobs now count towards combat XP
|
||||
+ (Experience) You can now set guaranteed minimum values for XP gained if diminishing returns are enabled, this value defaults to 5% (experience.yml)
|
||||
+ (Events) Starting an XP event will now use the title API (toggle this in advanced.yml)
|
||||
+ (Sound) Volume and Pitch of sounds can now be configured in the new sounds.yml file
|
||||
+ (MySQL) Added support for SSL for MySQL/MariaDB (On by default)
|
||||
! (Skills) Taming's Gore now uses Rupture Rank 1 for its DoT calculations
|
||||
! (Skills) Sword's Bleed has been renamed to Rupture
|
||||
! (Skills) Sword's Rupture no longer has an internal hard coded limit
|
||||
! (Skills) Sword's Serrated Strikes now uses your Rupture rank to determine the damage/ticks for its bleed effect.
|
||||
! (Skills) Sword's Rupture now ticks four times as fast
|
||||
! (Skills) Sword's Rupture now refreshes bleed duration instead of adding duration when applying bleed to the same target
|
||||
! (Skills) Sword's Rupture will now deal lethal damage
|
||||
= (Skills) Fixed a bug where Rupture would apply an incorrect amount of bleed ticks
|
||||
! (Skills) Sword's Rupture now reaches its max proc chance at level 20 (200 in Retro)
|
||||
! (Skills) Sword's Rupture now has a max chance to proc of 33% instead of 70%
|
||||
! (Skills) Sword's Rupture now deals 50% more damage at above Rank 3 and can last much longer! The base damage for Bleed has been increased as well (update your advanced.yml admins)
|
||||
! (Skills) Sword's Rupture no longer triggers invincibility frames when damaging your opponent
|
||||
= (Skills) Furnaces now give XP to the last person to modify their inventory instead of the first person to open them
|
||||
+ (Skills) Ability Lengths now have a default skill cap at which they stop increasing in length, configurable in advanced.yml (endurance perks extend this limit)
|
||||
+ (Skills) Added a new subskill to some skills 'Understanding The Art' this adds nothing new, but tracks benefits that increase together that seemed unrelated, which was previously a bit obfuscated.
|
||||
+ (Skills) Tool alerts now are sent to the Action Bar
|
||||
+ (Skills) Super Ability activation alerts are now sent to the Action Bar
|
||||
+ (Skills) Certain Skill messages are now sent to the Action Bar
|
||||
+ (Skills) Added some missing information to skill stats
|
||||
+ (Config) Skill Rank requirements are now defined in skillranks.yml you cannot add or remove ranks from this file
|
||||
+ (Config) Added option to use SSL for MySQL in config.yml
|
||||
+ (Config) Added option to disable the new URL links to config.yml
|
||||
+ (Config) New config file added coreskills.yml
|
||||
+ (Config) Added rank settings for the new Woodcutting skill
|
||||
+ (Config) Added configurable parameters for the new Tree Feller
|
||||
+ (Config) Added retro toggle for Tree Feller
|
||||
+ (Config) Added toggle to disable all scoreboards
|
||||
+ (Chat) Added ability for admins to spy on party chat (off unless toggled on)
|
||||
+ (Commands) Added new info command /mmoinfo or /mcinfo
|
||||
+ (Commands) Added toggle command /mcchatspy
|
||||
+ (API) Added many missing SubSkills to SubSkillType class
|
||||
+ (Permissions) Added permission node mcmmo.commands.mcchatspy & mcmmo.commands.mcchatspy.others
|
||||
+ (Permissions) Added permission nodes for Harvest Lumber, Splinter, Nature's Bounty, and Bark Surgeon
|
||||
+ (Permissions) Added mcmmo.commands.mmoinfo for the new mmoinfo/mcinfo command
|
||||
! (Permissions) Call of the wild now uses mcmmo.ability.taming.callofthewild instead of mcmmo.ability.taming.callofthewild.all
|
||||
+ (Locale) Added locale strings for new Woodcutting abilities
|
||||
+ (Locale) Added locale strings for mcchatspy command
|
||||
+ (Locale) Added locale strings for JSON integration
|
||||
+ (Locale) Added locale strings for Taming's Pummel SubSkill
|
||||
+ (Locale) Added locale strings for Unarmed's Block Cracker SubSkill
|
||||
- (Locale) Removed localizations with the following codes for being almost empty: id, HR_hr, et_EE, lv, lt, no, pl_PL, pt_PT, tr_TR
|
||||
- (Config) Removed SkillShot's IncreaseLevel & IncreasePercentage (replaced by RankDamageMultiplier)
|
||||
- (Config) Removed AxeMastery's MaxBonus & MaxBonusLevel (replaced by RankDamageMultiplier)
|
||||
= (Events) Fixed bug where XP rate could be a negative number
|
||||
= (Experience) Fixed a bug where you could set a players levels into the negative and bad things would happen
|
||||
= (Plugin Compatibility) mcMMO now fires new custom events relating to changes it makes to player scoreboards, plugin authors can listen to these events to improve compatibility
|
||||
= (Items) Chimaera Wing now tracks cooldowns between sessions for players (no more disconnect abuse)
|
||||
= (Skills) Added missing mushroom blocks to experience.yml defaults
|
||||
= (Skills) Tridents will no longer be considered unarmed
|
||||
= (MySQL) You can now inspect offline players
|
||||
= (MySQL) When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process
|
||||
= (Commands) '/mcMMO help' no longer displays the other/special commands category to players lacking permissions
|
||||
+ (Party) Parties can now have size limits (configurable in config.yml), party size is unlimited by default
|
||||
+ (Party) You can now turn on Friendly Fire for parties in config.yml
|
||||
+ (Debug Stick) The Debug stick can now tell you about properties of a block related to Excavation
|
||||
! (Deaths) Fixed the bug where mob names would be replaced by hearts
|
||||
! (Experience) The XP values of fish are now based on their rarity and have been drastically changed
|
||||
! (Experience) Skills now start at level 1 (configurable in advanced.yml)
|
||||
! (Item) Improved some of the messages sent to the player regarding the Chimaera Wing
|
||||
! (Party) Party member list will only include members of the party that you can see (aren't vanished)
|
||||
! (Skills) Excavation Treasure Hunter is renamed to Archaeology
|
||||
! (Skills) Swords no longer require blocking with a shield to trigger counter attacks
|
||||
! (Skills) Stripping wood and right clicking on stripped wood will no longer ready your Axe
|
||||
! (Skills) Some skill level rank requirements have changed
|
||||
! (Skills) Green Thumb now uses a rank system
|
||||
! (Skills) Farmer's Diet & Fisherman's Diet now use a rank system
|
||||
! (Skills) Fixed an edge case bug where Blast Mining wouldn't inform the player that it was on cooldown
|
||||
! (Skills) mcMMO skills will now be on a scale from 1-100 instead of 0-1000 (for existing mcMMO installs this is opt-in and off by default)
|
||||
! (Skills) Skill Super Powers now use a rank system, almost all of them unlocking first at level 10
|
||||
! (Skills) Acrobatics' Roll exploit detection was tweaked to still allow for Roll to trigger even if it rewards no XP
|
||||
! (Skills) Acrobatics' Roll & Gracefull Roll are now considered the same skill (both mechanics are still there)
|
||||
! (Skills) Woodcutting's Double Drop subskill is now named Harvest Lumber
|
||||
! (Skills) Archery's Skill Shot now uses a rank system
|
||||
! (Skills) Swords' Bleed now uses a rank system
|
||||
! (Skills) Swords' Counter Attack now uses a rank system
|
||||
! (Skills) Axe's Axe Mastery now uses a rank system
|
||||
! (Skills) Axe's Impact now uses a rank system
|
||||
! (Skills) Herbalism's Farmer's Diet now uses a rank system
|
||||
! (Skills) Herbalism's Green Thumb now uses a rank system
|
||||
! (Skills) Shake now uses a rank system
|
||||
! (Skills) Flux Mining now uses a rank system
|
||||
! (Skills) Removed traps from fishing
|
||||
! (Skills) Dodge now uses a rank system
|
||||
! (Skills) Arrow Retrieval now uses a rank system
|
||||
! (Skills) Axes' Critical Strikes now uses a rank system
|
||||
! (Skills) Axes' Greater Impact now uses a rank system
|
||||
! (Skills) Taming's Beast Lore now uses a rank system
|
||||
! (Skills) Taming's Gore now uses a rank system
|
||||
! (Skills) Taming's Call of the Wild now uses a rank system
|
||||
! (Skills) Taming's Pummel now uses a rank system
|
||||
! (Kraken) Removed everything involving the kraken
|
||||
= (Skills) Shake now sends custom damage types for better nocheat compat
|
||||
! (Config) Unarmed.IronArm in advanced.yml is now Unarmed.IronArmStyle
|
||||
! (Config) Unarmed.Deflect in advanced.yml is now Unarmed.ArrowDeflect
|
||||
! (Config) Swords.Counter in advanced.yml is now Swords.CounterAttack
|
||||
! (Config) Archery.Retrieve in advanced.yml is now Archery.ArrowRetrieval
|
||||
! (Config) Axes.CriticalHit in advanced.yml is now Axes.CriticalStrikes
|
||||
! (Config) Archery's Skill Shot now uses RankDamageMultiplier for its damage bonus calculations
|
||||
! (Config) Axe's Axe mastery now uses RankDamageMultiplier for its damage bonus calculations
|
||||
! (Permissions) Replaced the old Double Drop permission node for woodcutting with a new Harvest Lumber permission node
|
||||
! (Permissions) Fast Food Service permission node renamed to mcmmo.ability.taming.fastfoodservice
|
||||
! (Permissions) Counter Attack permission node renamed to mcmmo.ability.swords.counterattack
|
||||
! (Permissions) Arrow Deflect permission node renamed to mcmmo.ability.unarmed.arrowdeflect
|
||||
! (Permissions) Iron Arm Style permission node renamed to mcmmo.ability.unarmed.ironarmstyle
|
||||
! (Permissions) Remove all mob health bar permissions, this is no longer a per-player setting.
|
||||
! (Commands) Removed the mobhealthbar command, this is no longer a per-player setting.
|
||||
! (Locale) The descriptions of a few skills have changed
|
||||
! (Locale) Removed redundant information from some skill names and descriptions en_US (other locales will need to be updated)
|
||||
! (Locale) SubSkill locale keys are now located at {ParentSkill}.SubSkill.SubSkillName
|
||||
! (Locale) Super Abilities no longer have (ABILITY) in their Skill.Effect strings
|
||||
! (API) mcMMO is now built against Spigot-API instead of Bukkit
|
||||
! (API) Moved a lot of methods from SkillCommand to SkillUtils
|
||||
! (API) SkillType is now PrimarySkillType
|
||||
! (API) SecondarySkill is now SubSkillType
|
||||
! (API) AbilityType is now SuperAbilityType
|
||||
! (API) SecondaryAbilityEvent is now SubSkillEvent
|
||||
! (API) SubSkillType has had many helpful methods added to it
|
||||
! (API) GREEN_THUMB_PLANT & GREEN_THUMB_BLOCK are replaced by GREEN_THUMB
|
||||
! (Code) Refactored some unreadable code relating to SecondaryAbilityType activation in SkillUtils
|
||||
|
||||
Version 2.0.0
|
||||
= Fixed an interaction between Tree Feller and Stripped Wood
|
||||
! Fireworks no longer fire by default for ability activation/deactivation
|
||||
! Website has been changed and the MOTD string relating to it reflects this
|
||||
! Discord link added to mcMMO command
|
||||
! Updated misc strings relating to mcMMO
|
||||
|
||||
|
||||
Version 1.5.05-SNAPSHOT
|
||||
|
||||
Version 1.5.04
|
||||
+ Added option to config.yml to control mcMMO generated sound volume
|
||||
+ Added option to config.yml to truncate existing player skill levels that exceed the skill level cap
|
||||
+ Falling blocks persist mcMMO natural data
|
||||
= Woodcutting double drops correctly identify acacia and dark oak logs
|
||||
= Skill Reset command now correctly identifies arguments
|
||||
= Hylian Treasure config options are now actually used
|
||||
= Child skills now use parent skills configured skill caps properly
|
||||
= Auto Update config now properly works
|
||||
! Item dropped from blocks now drop from the center
|
||||
! Potions Config updated for 1.9
|
||||
! Flux mining now simulates a block break event for other plugins to act upon
|
||||
! Zombie Pigmen spawned from nether portals are now considered spawner mobs
|
||||
! Flux Pickaxe lore now appends to existing lore as opposed to replacing it
|
||||
! Party chat no longer displays colors when logged in server console
|
||||
- Treefeller no longer lowers exp for big trees
|
||||
- No longer supports 1.8 :(
|
||||
- Removed plugin metrics
|
||||
|
||||
Version 1.5.03
|
||||
= Fixed bug where absorption hearts could be attacked by allied players
|
||||
= Fixed bug where new forms of stone would drop the wrong type when mined with Silk Touch
|
||||
= Fixed bug where blocks would not get tracked correctly when using sticky pistons and slime blocks in certain situations
|
||||
= Fixed bug where config value for Daze damage was ignored
|
||||
= Fixed UUID updater to not lose data on errors
|
||||
= Fixed bug where uuid update could result in large amounts of user data being deleted
|
||||
= Fixed bug where custom potions were missed in potion stage calculation
|
||||
= Fixed piston dupe bugs permanently
|
||||
= Fixed bug involving user name changes
|
||||
= Fixed old user purge to properly calculate months
|
||||
= Fixed bug where Repair would incorrectly check items
|
||||
= Fixed bug where apostrophes in locale files would not read correctly
|
||||
= Fixed bug where treasure data was limited to 255 instead of Short.MAX_VALUE
|
||||
! Moved more user loading calculations to async loading thread to reduce lag on login
|
||||
|
||||
Version 1.5.02
|
||||
+ Added option to config.yml for Chimaera Wings to stop using bed spawn points
|
||||
+ Added option to config.yml to let non-tools in hand count as unarmed
|
||||
+ Added option to experience.yml to control XP gained by killing bred animals
|
||||
+ Added support for 1.8 mobs and features
|
||||
= Fixed bug where no Mining XP was granted when Flux Mining was successful
|
||||
= Fixed bug with UUID conversions in Flatfile
|
||||
= Fixed a couple Dupe bugs that were introduced recently
|
||||
= Fixed bug where MobHealthbarTypes were not saved between server restarts
|
||||
! Changed Flux Mining mechanics. In order to use the ability, you need to infuse a pickaxe with furnace powers first.
|
||||
! Scoreboard tips are only shown a couple of times to the player, instead of once per login session
|
||||
! Changed Archery distance multiplier to be configurable
|
||||
! Archery distance XP bonus cannot exceed indefinitely anymore
|
||||
|
||||
Version 1.5.01
|
||||
+ Added new child skill; Salvage
|
||||
+ Added UUID support!
|
||||
+ Added SQL connection pooling and async loading!
|
||||
+ Added the long awaited Diminished Returns feature
|
||||
+ Added new feature to Herbalism. Instantly-regrown crops are protected from being broken for 1 second
|
||||
+ Added option to config.yml to show the /mcstats scoreboard automatically after logging in
|
||||
+ Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles
|
||||
+ Added option to config.yml for Scoreboards, display "Ability" instead of ability names on the scoreboards
|
||||
+ Added options to experience.yml for Dirt and Sand variations
|
||||
+ Added support for `MATERIAL|data` format in treasures.yml
|
||||
+ Added API to experience events to get XP gain reason
|
||||
+ Added API to check if an entity is bleeding
|
||||
+ Added API to ExperienceAPI to get the amount of XP needed for a level
|
||||
+ Added API class SkillAPI used to get a list of valid skill names
|
||||
+ Added API events for hardcore features, McMMOPlayerPreDeathPenaltyEvent, McMMOPlayerStatLossEvent and McMMOPlayerVampirismEvent
|
||||
+ Added API to ExperienceAPI to specify if XP can be shared
|
||||
+ Added options to tools.yml and armor.yml config files to set a pretty repair material name
|
||||
+ Added full support for repairables in tools.yml and armor.yml config files
|
||||
+ Added magical mod config file import command, for Cauldron 1.7+. Check wiki for usage
|
||||
+ Added particle effects and sounds to "Call of the Wild" (Taming)
|
||||
+ Added summon length to "Call of the Wild". Summons will now commit suicide after their lifespan expires
|
||||
+ Added feature which makes tamed wolves attack a target shot by the owner
|
||||
= Fixed bug where pistons would mess with the block tracking
|
||||
= Fixed bug where the Updater was running on the main thread.
|
||||
= Fixed bug when players would use /ptp without being in a party
|
||||
= Fixed bug where player didn't have a mcMMOPlayer object in AsyncPlayerChatEvent
|
||||
= Fixed bug where dodge would check the wrong player skill level
|
||||
= Fixed bug which causes /party teleport to stop working
|
||||
= Fixed bug where SaveTimerTask would produce an IndexOutOfBoundsException
|
||||
= Fixed bug where Alchemy would not fire BrewEvents
|
||||
= Fixed bug with setting custom names and lore in treasures config
|
||||
= Fixed bug which would cause a NullPointerException with getFlowerAndGrassXp()
|
||||
= Fixed bug which could cause and SQLException regarding the connection property 'maxReconnects'.
|
||||
= Fixed bug where falling blocks were incorrectly tracked
|
||||
= Fixed bug where items would get deleted when in Berserk with a full inventory
|
||||
= Fixed bug where the console would not correctly show party chat colors
|
||||
= Fixed bug where party chat was using non thread safe methods
|
||||
= Fixed bug where Blast Mining unlock levels could be to high in certain occasions
|
||||
= Fixed bug where Blast Minings ability "Demolition Expert" would not work
|
||||
= Fixed bug where Repair_Material_Quantity wasn't read in mod config files
|
||||
! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities
|
||||
! Changed the way mcMMO handles bonus damage, updated for the new damage event API
|
||||
! Changed player data saving. Save tasks are now asynchronous
|
||||
! Vanished players no longer get hit by AoE effects
|
||||
! Changed Alchemy config option 'Prevent_Hopper_Transfer' renamed to 'Prevent_Hopper_Transfer_Ingredients'
|
||||
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
|
||||
! Changed behavior of the Blast Mining ability "Demolition Expert"; now only decreases damage for the ability user
|
||||
! Updated for new getOnlinePlayers() behavior
|
||||
! Updated for new blocks and entities
|
||||
! Changed McMMOPlayerDeathPenaltyEvent to get fired after hardcore penalty calculations, use McMMOPlayerPreDeathPenaltyEvent for old behavior
|
||||
! Moved Refresh_Chunks setting from hidden.yml to config.yml
|
||||
- Removed salvage ability from Repair, salvage has it's own (child) skill now
|
||||
|
||||
Version 1.5.00
|
||||
+ Added Podzol & Red Sand to Excavation
|
||||
+ Added Hardened Clay, Stained Clay, and Packed Ice to Mining blocks
|
||||
+ Added Acacia and Dark Oak to Woodcutting blocks
|
||||
+ Added Salmon, Clownfish, and Pufferfish to Fishing XP
|
||||
+ Added new flowers and grasses to Herbalism XP
|
||||
+ Added option to config.yml which allows players to always catch fish, even when a treasure is found
|
||||
+ Added option to config.yml to override vanilla Minecraft treasures
|
||||
! Fishing XP now depends on the type of fish.
|
||||
! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood.
|
||||
! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly.
|
||||
- Removed deprecated permission nodes
|
||||
- Removed "Treasure found!" message
|
||||
|
||||
Version 1.4.08
|
||||
+ Added a new skill; Alchemy. Special thanks to EasyMFnE for creating this!
|
||||
+ Added SecondaryAbilityType enum, and new SecondaryAbilityWeightedActivationCheckEvent, fired when a secondary ability checkes its activation chances
|
||||
+ Added the possibility to gain experience when using Fishing "Shake"
|
||||
+ Added config options to disable various sound effects
|
||||
+ Smelting now works with custom ores - add smelting XP value to blocks.yml, or it will default to 1/10th of normal XP.
|
||||
+ Added automatic cleanup of backups folder.
|
||||
+ Added bypass permission for finding Fishing traps
|
||||
+ Added level threshold settings to hardcore modes. When a players skill level is below this threshold, they will not lose any stats
|
||||
+ Added party alliances, two parties can now team up. Allies share party chat and cannot harm each other.
|
||||
+ Added new experience bonus perk 'mcmmo.perks.xp.10percentboost.<skillname>' multiplies incoming XP by 1.1
|
||||
+ Added new experience bonus perk 'mcmmo.perks.xp.customboost.<skillname>' multiplies incoming XP by the boost amount defined in the experience config
|
||||
+ Added Ender Dragon, Wither, and Witch to combat experience multipliers - they do not give XP by default
|
||||
+ Added support for multiple mod config files, naming can be done as either armor.<modname>.yml or <modname>.armor.yml
|
||||
+ Added config options to configure the items used in "Call of the Wild"
|
||||
+ Added config option to configure the database command cooldown
|
||||
= Fixed bug where healthbars wouldn't display if skills were disabled
|
||||
= Fixed bug with "Call of the Wild" entities despawning
|
||||
= Fixed bug with updating (very) old user data.
|
||||
= Fixed bug with checking maximum durability of mod items.
|
||||
= Fixed exploit involving Call of The Wild.
|
||||
= Fixed bug where LeafBlower permissions were ignored
|
||||
= Fixed bug with toggle commands not properly displaying the success message.
|
||||
= Fixed IllegalArgumentException caused by an empty Fishing treasure category
|
||||
= Fixed bug with Salvage not reading the config value for the anvil material.
|
||||
= Fixed exploit where you could receive smelting XP for improper items
|
||||
= Fixed bug where the Unbreaking enchantment was ignored when using "Super Breaker" or "Giga Drill Breaker"
|
||||
= Fixed bug which prevented players from gaining Acrobatics XP when the setting 'Prevent_XP_After_Teleport' was set to false
|
||||
= Fixed bug where cooldown donor perks were reducing more than expected
|
||||
= Fixed bug where disabling hardcore mode for specific skills didn't work
|
||||
= Fixed bug which caused the net.shatteredlands.shatt.backup cleanup to delete old backups while it should have kept those
|
||||
= Fixed bug where party chat broke if the display name contained special characters
|
||||
= Fixed bug where `/addlevels all` and `/skillreset all` didn't work
|
||||
= Fixed bug which made it possible to gain XP by taming the same horse multiple times, if a player "untamed" that horse
|
||||
= Fixed bug where some horses summoned with "Call of the Wild" were unable to jump
|
||||
= Fixed bug where the /ptp request expiration time was checked wrongly - preventing players from using the command
|
||||
= Fixed bug where Hylian Luck was broken
|
||||
= Fixed bug where Snow would never drop treasures
|
||||
= Fixed issues with commands giving away vanished players.
|
||||
= Fixed bug where the Repair lucky perk would increase the Arcane Forging downgrade chance, instead of decreasing it
|
||||
! Changed party system. Parties now have XP and Levels. Party features such as party teleport and party chat have to be unlocked before they can be used by the party members
|
||||
! Changed appearance of party member list. Gold = party leader, White = online, Gray = offline, Italic = not nearby
|
||||
! Updated localization files
|
||||
! Changed the appearance of /mcmmo commands
|
||||
! Changed AxesCritical to CriticalHit in config file
|
||||
! Changed several secondary ability permissions(deprecated versions still exist)
|
||||
! Changed /ptp config setting, Commands.ptp.Confirm_Required is now Commands.ptp.Accept.Required
|
||||
! Changed config validation for UnlockLevels, they can now also be 0
|
||||
! Changed config validation for Rank_Levels, successive Ranks can now be less than or equal to each other
|
||||
! Changed default amount of XP gained from mining Quartz Ore. From 250 to 100 XP.
|
||||
! Changed Acrobatics config setting, Skills.Acrobatics.Prevent_XP_After_Teleport is now Skills.Acrobatics.XP_After_Teleport_Cooldown
|
||||
- Removed /stats alias for /mcstats
|
||||
|
||||
Version 1.4.07
|
||||
+ Added XP boost to Acrobatics when wearing Boots of Feather Falling
|
||||
+ Added SQL Database can now recover from a dropped connection without losing data. (Thanks Riking!)
|
||||
+ Added more tiers to Fishing, Repair and Smelting!
|
||||
+ Added Carrot on a Stick and Flint & Steel to repair.vanilla.yml
|
||||
+ Added horses to the "Shake" ability
|
||||
+ Added ability to summon horses via "Call of the Wild" using apples
|
||||
+ Added XP gain to Taming for horses
|
||||
+ Added new permission nodes to allow more control over Taming and "Call of the Wild"
|
||||
+ Added new experience.yml config file! Moved all experience related settings from config.yml to experience.yml
|
||||
+ Added support for EXPONENTIAL formula curves to experience.yml
|
||||
+ Added new /mcconvert command to convert players levels and experience from one formula curve to another.
|
||||
+ Added snow to Excavation blocks
|
||||
+ Added new experience curve option. Cumulative curve, calculates experience needed for next level using power level.
|
||||
+ Added extra settings to config.yml for "Call of the Wild" (Taming)
|
||||
+ Added a 5 second cooldown after teleporting before Acrobatics XP can be earned. Plus a config option to disable
|
||||
+ Added new API methods to ExperienceAPI to get a players rank on the leaderboards
|
||||
+ Added new McMMOPlayerDeathPenaltyEvent, fired when a player dies and would lose levels
|
||||
+ Added new McMMOPlayerLevelChangeEvent, fired when a players level changes
|
||||
+ Added new McMMOPlayerLevelDownEvent, fired when a player loses levels
|
||||
+ Added ability to give custom names to items in treasures.yml - use the key "Custom_Name" to set, expects a string.
|
||||
+ Added ability to give lore to items in treasures.yml - use the key "Lore" to set, expects a list of strings.
|
||||
+ Added Quartz and Name Tags to the default Excavation treasures
|
||||
+ Added a warning message if the server is running NoCheatPlus without CompatNoCheatPlus
|
||||
+ Added cooldown to commands with heavy database access to prevent denial of service
|
||||
+ Added /mcscoreboard keep, to keep the scoreboard up forever
|
||||
+ Added Rainbow Mode to scoreboards
|
||||
+ Added new /mccooldowns command to show all ability cooldowns
|
||||
+ Commands may now both print text and display a scoreboard
|
||||
+ Killing a custom entity will automatically add it to the custom entity config file with default values.
|
||||
= Fixed bug which allowed players to bypass fishing's exploit prevention
|
||||
= Fixed bug where FakeEntityDamageByEntityEvent wasn't being fired
|
||||
= Fixed bug with "Skull Splitter" not finding the locale string
|
||||
= Fixed issue where locale strings could cause the scoreboard header to be longer than 16 characters.
|
||||
= Fixed a bug with "Beast Lore" when the entity had no owner but was tamed.
|
||||
= Fixed a bug where AbilityDeactivateEvent would throw an error if the player logged out before his ability ran out.
|
||||
= Fixed a bug where LevelUpEvent would be called for an offline player.
|
||||
= Fixed a bug where teleport location was never reset if warmup was set to 0 for "Chimaera Wing".
|
||||
= Fixed a bug where the "Dodge" DamageModifier wasn't being read from advanced.yml
|
||||
= Fixed a bug where squid were not awarding XP.
|
||||
= Fixed a bug where Combat XP was granted within 5 seconds for respawned players
|
||||
= Fixed a bug where wrong feedback messages were being send when using a command on an offline player
|
||||
= Fixed a bug where players were able to gain Herbalism XP in mine carts, even though Prevent_AFK_Leveling was enabled
|
||||
= Fixed a bug where players would get hit by fireworks if they leveled up while in a boat
|
||||
! Changed Fishing "Treasure Hunter" and "Magic Hunter" drop percentages
|
||||
! Changed format of mod config files. (blocks.yml, tools.yml, armor.yml and entities.yml) **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**
|
||||
! Changed format of treasures.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**
|
||||
! Changed format of repair.vanilla.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**
|
||||
! Changed default XP multiplier for repairing shears
|
||||
! Changed "Shake" drops for Witches. They no longer drop water bottles, since they no longer drop them in Vanilla.
|
||||
! Changed fishing exploit prevention, by default it will no longer send global sounds, effects and messages.
|
||||
! Changed Hardcore modes, they will also subtract experience
|
||||
! Changed various values to double in advanced.yml for the sake of consistency.
|
||||
! Nerfed Fishing "Master Angler" (removed skill level based bonus) and also made the modifiers configurable
|
||||
! Nerfed Archery damage to eliminate constant one-hit kills.
|
||||
! Changed the way Repair hands out XP, also added config options to control Repair XP
|
||||
! Changed Swords "Counter Attack" ability from passive to active. Blocking is required to activate.
|
||||
! Hardcore modes can now be toggled for each skill individually
|
||||
! Vampirism can now be enabled without having Skill Death Penalty enabled
|
||||
! Admin and Party chat prefixes are now customizable
|
||||
! Changed the color of party leader names in Party chat
|
||||
! Improved "Tree Feller" algorithm (Thanks Riking!)
|
||||
! Improved AFK Acrobatics prevention mechanism
|
||||
! Improved profile saving
|
||||
! Improved partial name matcher
|
||||
! Improved update checker
|
||||
! Updated localization files
|
||||
! Party item share category states are now saved when the server shuts down.
|
||||
! When using "Super Breaker" or "Giga Driller" abilities extra tool durability is used (again)
|
||||
! Mob healthbars are automatically disabled when the plugin "HealthBar" is found
|
||||
! Massively improved scoreboard handling
|
||||
! Reworked scoreboard configuration (config.yml) - **you will need to update**
|
||||
- The /mmoupdate command has been removed. It is replaced by /mcconvert database
|
||||
- Removed Abilities.Tools.Durability_Loss_Enabled, set Abilities.Tools.Durability_Loss to 0 to disable instead.
|
||||
- Removed Skills.Fishing.Shake_UnlockLevel from advanced.yml, now using Skills.Fishing.Rank_Levels.Rank_1 instead.
|
||||
- Removed SpoutPlugin support
|
||||
|
||||
Version 1.4.06
|
||||
+ Added "Ice Fishing" ability to Fishing
|
||||
+ Added global scoreboards to track skill rankings (display using /mctop)
|
||||
+ Added per-player scoreboard displays for the /inspect, /mcrank, /mcstats, and /<skillname> commands
|
||||
+ Added tab-complete support for all commands
|
||||
+ Added ability to configure drops from Shake in treasures.yml
|
||||
+ Added "Master Angler" ability to Fishing.
|
||||
+ Added health display for mobs during combat.
|
||||
+ Added new API method to McMMOPlayerLevelUpEvent to set levels gained
|
||||
+ Added new permission node for /ptp; mcmmo.commands.ptp.send (enabled by default)
|
||||
+ Added configurable cooldown and warmup times when using /ptp
|
||||
+ Added a new Party item share category "Misc" which contains a list of configurable items. (By default all tools and armor)
|
||||
+ Added fishing exploit prevention
|
||||
+ Added permission node to bypass the fishing exploit prevention
|
||||
+ Added boosts to Fishing chance depending on conditions
|
||||
+ Added McMMOAbilityActivateEvent and McMMOAbilityDeactivateEvent
|
||||
+ Added config option to toggle the size of fireworks
|
||||
+ Added config option to multiply xp gains from mob spawner mobs
|
||||
+ Added multiplier to Archery XP based on bow force
|
||||
+ Added information about /party itemshare and /party expshare to the party help page
|
||||
+ Added option to use scoreboards for power level display instead of Spout.
|
||||
+ Added permission node to prevent inspecting hidden players
|
||||
+ Added SQL to Flatfile database conversion
|
||||
+ Added ability to use custom database managers and convert to/from them
|
||||
= Fixed bug which could cause the server to hang for a minute when checking for updates. (Thanks to Riking)
|
||||
= Fixed bug where spawned arrows could throw ArrayIndexOutOfBoundsException
|
||||
= Fixed bug where custom Spout titles were overwritten by mcMMO.
|
||||
= Fixed bug where Nether Quartz wasn't included in Smelting or item sharing
|
||||
= Fixed bug where players were able to join the same party multiple times
|
||||
= Fixed displaying partial names when trying to use /ptp
|
||||
= Fixed wolves from Call of the Wild only having 8 health
|
||||
= Fixed bug where /party chat was not working
|
||||
= Fixed bug where experience commands were adding levels to all skills when they shouldn't
|
||||
= Fixed mcmmo.commands.ptp.send not being set by default
|
||||
= Fixed NPE when trying to tab-complete /mctop
|
||||
= Fixed Fishing treasures always having the same enchants
|
||||
= Fixed Smelting returning ink sacs instead of Lapis when double-dropping
|
||||
= Fixed bug where players could remain in party chat after leaving or being kicked from a party.
|
||||
= Fixed bug where non-player arrows couldn't be deflected.
|
||||
= Fixed experience being applied even when the permission for a skill was denied
|
||||
= Fixed possible item duplication bug with infinity bows
|
||||
= Fixed bug with removing players from mySQL database
|
||||
= Fixed bug with empty metadata lists and Smelting
|
||||
= Fixed bug where Blast Mining would drop wrong items
|
||||
= Fixed bug with Blast Mining where the Ability refreshed message was being send too early
|
||||
= Fixed bug where the chance of a successful Gracefull Roll was twice as high as displayed
|
||||
= Fixed bug where lucky perks where not working
|
||||
= Fixed bug with Ice Fishing on a single block of ice
|
||||
= Fixed bug with Ice Fishing which allowed players to break ice in protected areas
|
||||
= Fixed a small bug with mob healthbars and bosses, such as EnderDragons and Withers
|
||||
! Changed Spout notification tiers to be stored in SpoutConfig instead of AdvancedConfig
|
||||
! Changed Berserk to add items to inventory rather than denying pickup
|
||||
! Changed Call of the Wild, newly summoned pet's will have a custom name. (added permission node to disable this)
|
||||
! Changed Chimaera Wing's recipe result to use the ingredient Material
|
||||
! Changed Repair to ask a confirmation of the player when he tries to repair an enchanted item
|
||||
! Players will no longer pickup items to their hotbar while using Unarmed
|
||||
! ExperienceAPI methods will now throw InvalidSkillException if the skill name passed in is invalid.
|
||||
! Changed default value for recently-hurt cooldown between teleports, this is also fully configurable now
|
||||
! Changed the amount of info messages in the console when enabling/disabling, enable Verbose_Logging to enable them again
|
||||
! Items dropped by players are now being tracked and are not being shared with party members
|
||||
! Optimized tracking of tool & ability cooldowns.
|
||||
! Updated the localization files
|
||||
|
||||
Version 1.4.05
|
||||
+ Added option to allow refreshing of chunks after block-breaking abilities. (Disabled by default)
|
||||
+ Added fireworks effects when a player levels-up, for every 100 levels (configurable)
|
||||
= Fixed bug where /addxp was setting instead of adding experience
|
||||
= Fixed bug where /addxp was not processessing level-ups for online players
|
||||
= Fixed bug which allowed players to share experience with nearby dead players
|
||||
= Fixed bug with ChimaeraWings not taking Wings from a players inventory properly
|
||||
= Fixed bug which caused a NPE when trying to use /mctop smelting
|
||||
= Fixed Berserk misbehaving when /reload was used
|
||||
= Fixed parties misbehaving when /reload was used
|
||||
= Fixed Berserk getting "stuck" when /mcrefresh was used
|
||||
= Fixed ClassCastException with Taming
|
||||
= Fixed huge mushroom blocks not being properly tracked
|
||||
= Fixed potion buff option not using the appropriate # of ticks
|
||||
= Fixed Chimera Wing spamming console if Metrics was disabled
|
||||
= Fixed Chimera Wing displaying warmup message if warmup was set to 0
|
||||
= Fixed party & admin chat errors when not aysnc
|
||||
! Updated localization files
|
||||
|
||||
Version 1.4.04
|
||||
+ Added functions to ExperienceAPI for use with offline players
|
||||
+ Added Nether Quartz Ore to Mining
|
||||
+ Added Dropper, Hopper, and Trapped Chest to blocks that shouldn't activate abilities
|
||||
+ Added partial name matching
|
||||
= Fixed bug where trying to activate a Chimaera Wing would require one item too much
|
||||
= Fixed bug where Treefeller would try to cut too many leaves and reach the threshold when it shouldn't
|
||||
= Fixed bug where Mining wasn't awarding double drops
|
||||
= Fixed bug where Shake wouldn't damage mobs whose max health was less than 4
|
||||
= Fixed bug where the API would fail if the name of a player's current party is requested when the player isn't in one (Thanks @dualspiral!)
|
||||
= Fixed bug with retrieving a player's party members
|
||||
= Fixed bug which caused a NPE when trying to join the party of a non-existing player or when ptp to a non-existing player
|
||||
= Fixed bug which causes a NPE when trying to use /mcrefresh from the console
|
||||
= Fixed bug where Carrots and Potatoes weren't awarding Herbalism XP.
|
||||
= Fixed bug where some herbalism drops weren't properly shared within parties.
|
||||
= Fixed bug where players wouldn't be able to pick up items if they logged our while Berserk was still active.
|
||||
! Changed config node name for the skill experience modifiers from "Experience.Formula.Multiplier.[Skill]" to "Experience.Formula.Modifier.[Skill]"
|
||||
! Updated localization files
|
||||
! mcMMO abilities can no longer be activated while in Creative mode
|
||||
! Expanded ChatAPI to allow toggling of chat states for users
|
||||
! Updated to EMetrics 0.0.4-SNAPSHOT
|
||||
- Removed deprecated functions from API classes.
|
||||
- Removed functions for getting the PlayerProfile - using API classes is preferred, but if not the McMMOPlayer should be used instead
|
||||
- Removed Ender Dragon, Wither, and Witch from granting combat experience and related configuration options
|
||||
|
||||
Version 1.4.03
|
||||
+ Added option to advanced.yml to determine the # of enchant levels used when buffing Super Breaker & Giga Drill Breaker
|
||||
+ Improved stats display for child skills
|
||||
+ Added cooldown between using Chimaera Wings
|
||||
= Fixed bug with '/party chat (on|off)' and '/partychat (on|off)' not working
|
||||
= Fixed bug with Repair not decreasing enchanting levels properly
|
||||
= Fixed bug with Smelting not properly tracking furnaces
|
||||
= Fixed bug with Blast Mining not dropping blocks correctly
|
||||
= Fixed bug with custom blocks not working
|
||||
= Fixed bug with Blast Mining increasing TNT damage.
|
||||
= Fixed bug where Blast Mining was awarding too much XP
|
||||
= Fixed bug where triple drops would award twice the amount of experience in Herbalism and Mining
|
||||
= Fixed bug where Green Thumb would consume wheat instead of seeds
|
||||
= Fixed bug where Green Terra would consume twice the amount of seed when used on crops
|
||||
= Fixed bug where experience would be awarded in Herbalism for some player-placed blocks
|
||||
= Fixed bug where players were unable to salvage leather armor
|
||||
= Fixed bug with repairing using materials with byte metadata
|
||||
= Fixed bug where Fishing was becoming less successful at higher levels
|
||||
= Fixed bug with using Salvage on stacked items.
|
||||
= Fixed bug where the 'mcmmo.commands.ptp.world.all' was registered twice
|
||||
= Fixed bug where Beast Lore wouldn't work on friendly pets
|
||||
= Fixed bug where Deflect was calculated based on the attacker, not the defender. (We really did this time!)
|
||||
= Fixed bug where Treefeller would not deal durability damage when the axe "splinters into dozens of pieces"
|
||||
! Moved the Salvage unlock level from config.yml to advanced.yml
|
||||
! Changed how Chimaera Wings are acquired, you need to craft them now. (By default, use 5 feathers in a shapeless recipe)
|
||||
! Changed how Chimaera Wings teleport players to the spawnpoint, will now check if the location is safe
|
||||
- Removed option to disable Salvage via the config file. This should be handled via permissions instead.
|
||||
- Removed the option to use Woodcutting without an axe from the config file.
|
||||
|
||||
Version 1.4.02
|
||||
+ Added API to get the skill and power level caps.
|
||||
= Fixed bug where Deflect was calculated based on the attacker, not the defender
|
||||
= Fixed bug where some skills weren't registering as unlocked until one level later
|
||||
= Fixed bug where the PTP cooldown was being read improperly
|
||||
= Fixed bug where /ptp <accept|toggle|acceptall> where broken
|
||||
= Fixed ClassCastException relating to counter-attack with Swords
|
||||
= Fixed issue with some skill activations not activating enough or activating too much
|
||||
|
||||
Version 1.4.01
|
||||
= Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs
|
||||
= Fixed bug where /mctop and /mcrank wouldn't show overall power levels for servers using Flatfile
|
||||
= Fixed bug where Smelting would throw consistent errors due to offline players
|
||||
= Fixed bug where repairing an mcMMO ability-buffed item with mcMMO repair could take the enchant but leave the lore tag
|
||||
= Fixed bug where using '/party chat message...' would result in the first word of the message being printed repeatedly
|
||||
= Fixed bug where the wrong flag was being set when taking damage
|
||||
= Fixed bug where the PTP cooldown was set improperly
|
||||
= Fixed bug where ptp permissions weren't being handled properly
|
||||
= Fixed bug where Beast Lore wouldn't work
|
||||
= Fixed bug where Chimaera Wing would always teleport to spawn, even when the player had a valid bed spawn location
|
||||
= Updated locale files
|
||||
|
||||
Version 1.4.00
|
||||
+ Added new Child Skill - Smelting!
|
||||
+ Added a version check, admins will get notified when a new version is available!
|
||||
@@ -97,7 +794,7 @@ Version 1.4.00
|
||||
! Changed Excavation to have individual XP values for each block type, rather than a base XP value.
|
||||
! Changed the way party teleportation works. When using /ptp, the target player needs to confirm the teleport before it takes place. (Configurable)
|
||||
! Changed BeastLore: Now also displays offline player names
|
||||
! Changed backup task to include ALL config files
|
||||
! Changed net.shatteredlands.shatt.backup task to include ALL config files
|
||||
! Deprecated most functions in ExperienceAPI, replaced them with identical versions that use a String for the SkillName rather than the SkillType enum values
|
||||
! Changed Super Breaker & Giga Drill Breaker to be an enchantment-based boost, rather than an instabreak. Option exists in hidden.yml to change this to an potion-based buff.
|
||||
! Changed locales to fall back on English when translated strings cannot be found.
|
||||
@@ -320,7 +1017,7 @@ Version 1.3.07
|
||||
+ Added permission nodes for Treasure & Magic Hunter for Fishing
|
||||
+ Added a permission node for Farmer's Diet
|
||||
+ Added config options for enabling/disabling specific double drops
|
||||
+ Added automatic zip backup of flatfile database & config files
|
||||
+ Added automatic zip net.shatteredlands.shatt.backup of flatfile database & config files
|
||||
+ Added config options to enable/disable specific skills for PVP & PVE
|
||||
= Fixed bug where Tree Feller was looking at the wrong blocks for determining how much to take down.
|
||||
= Fixed bug where Green Terra consumed seeds even on Mossy Stone Brick
|
||||
@@ -906,7 +1603,7 @@ Fixed bug with randomly receiving Taming XP
|
||||
mcmmo.users file moved into /plugins/mcMMO/FlatFileStuff/
|
||||
Leaderboard files now moved into /plugins/mcMMO/FlatFileStuff/Leaderboards
|
||||
Locale files now have the prefix locale_ instead of messages_
|
||||
Locale files are now located inside com/gmail/nossr50/locale/ instead of com/gmail/nossr50/
|
||||
Locale files are now located inside com/com.gmail/com.gmail.nossr50/locale/ instead of com/com.gmail/com.gmail.nossr50/
|
||||
Updated the code that handles permissions (this may mean 3.1.6 will finally play well!)
|
||||
Some more source code organization
|
||||
Fixed warnings for compiler
|
||||
|
||||
234
Changelog_2.1.0.md
Normal file
234
Changelog_2.1.0.md
Normal file
@@ -0,0 +1,234 @@
|
||||
# **Version 2.1.0+**
|
||||
|
||||
### Please use Spigot or Paper!
|
||||
|
||||
* **mcMMO is now built against Spigot-API instead of Bukkit**
|
||||
|
||||
### New Level Scaling
|
||||
|
||||
* mcMMO now features an optional 1-100 scaling mode!
|
||||
* This is on by default for new installs, if you are upgrading mcMMO you will be put into Retro Mode instead (1-1000) scaling.
|
||||
* The two scaling modes are the same, the changes are completely cosmetic!
|
||||
* Skill Requirements in the config file will be multiplied by 10 if you are using Retro mode unless the setting has Retro in its name, keep this in mind if you need to edit anything!
|
||||
|
||||
### WorldGuard Support
|
||||
|
||||
* Added support for WorldGuard regions!
|
||||
* `mcmmo` region flag turns on or off a players ability to use anything related to mcMMO other than commands
|
||||
* `mcmmo-xp` region flag turns on or off a player's ability to gain XP
|
||||
* These flags default to on unless you specify otherwise
|
||||
|
||||
### World Blacklist
|
||||
|
||||
* You can now disable mcMMO completely for specific worlds via `world_blacklist.txt` in /plugins/mcMMO/
|
||||
* This file appears once mcMMO has been run at least once
|
||||
* Every line of this file should be the name of a world where you don't want mcMMO to be enabled!
|
||||
|
||||
### Rank System
|
||||
|
||||
* Skills that are not yet unlocked will show up as `???` until learned
|
||||
* Many skills now make use of a rank system!
|
||||
* Rank level requirements are modified in `skillranks.yml`
|
||||
* Woodcutting's Double Drop subskill is now named Harvest Lumber
|
||||
* Archery's Skill Shot now uses a rank system
|
||||
* Swords' Bleed now uses a rank system
|
||||
* Swords' Counter Attack now uses a rank system
|
||||
* Axe's Axe Mastery now uses a rank system
|
||||
* Axe's Impact now uses a rank system
|
||||
* Herbalism's Farmer's Diet now uses a rank system
|
||||
* Herbalism's Green Thumb now uses a rank system
|
||||
* Shake now uses a rank system
|
||||
* Flux Mining now uses a rank system
|
||||
* Removed traps from fishing
|
||||
* Dodge now uses a rank system
|
||||
* Arrow Retrieval now uses a rank system
|
||||
* Axes' Critical Strikes now uses a rank system
|
||||
* Axes' Greater Impact now uses a rank system
|
||||
* Taming's Beast Lore now uses a rank system
|
||||
* Taming's Gore now uses a rank system
|
||||
* Taming's Call of the Wild now uses a rank system
|
||||
* Taming's Pummel now uses a rank system
|
||||
* Green Thumb now uses a rank system
|
||||
* Farmer's Diet & Fisherman's Diet now use a rank system
|
||||
|
||||
### mcMMO Chat Alerts
|
||||
|
||||
* mcMMO no longer spams your chat!
|
||||
* Most messages are sent to your action bar instead!
|
||||
* Completely configurable! You can have mcMMO spam your chat again if you want!
|
||||
* You can configure it so that messages will be sent to your action bar AND your chat system!
|
||||
* Improved some of the messages sent to the player regarding the Chimaera Wing
|
||||
|
||||
### Localization File
|
||||
|
||||
* The descriptions of a few skills have changed
|
||||
* Locale files now support & codes for colors and formatting!
|
||||
* Added locale strings for new Woodcutting abilities
|
||||
* Added locale strings for mcchatspy command
|
||||
* Added locale strings for JSON integration
|
||||
* Added locale strings for Taming's Pummel SubSkill
|
||||
* Added locale strings for Unarmed's Block Cracker SubSkill
|
||||
* Removed localizations with the following codes for being almost empty: `id`, `HR_hr`, `et_EE`, `lv`, `lt`, `no`, `pl_PL`, `pt_PT`, `tr_TR`
|
||||
* Removed redundant information from some skill names and descriptions `en_US` (other locales will need to be updated)
|
||||
* SubSkill locale keys are now located at `{ParentSkill}.SubSkill.SubSkillName`
|
||||
* Super Abilities no longer have `(ABILITY)` in their `Skill.Effect` strings
|
||||
|
||||
### UI
|
||||
|
||||
* Certain elements of mcMMO's UI have been restyled
|
||||
* Skills can now be clicked on and hovered over for more information!
|
||||
* Added links to mcMMO related websites to various commands
|
||||
* Customizeable and optional XP Bars
|
||||
* Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
|
||||
* Added option to disable the new URL links to `config.yml`
|
||||
|
||||
### Sounds
|
||||
|
||||
* Volume and Pitch of sounds can now be configured in the new `sounds.yml` file
|
||||
|
||||
### Super Ability Changes
|
||||
|
||||
* Skill Super Abilities now use a rank system, the default rank to unlock is level 5
|
||||
* Activating Super abilities plays a sound (other plays can hear this)
|
||||
* Ability Lengths now have a default skill cap at which they stop increasing in length
|
||||
* Setting the cap to 0 removes it!
|
||||
* Configurable in `advanced.yml` (endurance perks extend this limit)
|
||||
|
||||
### Skills
|
||||
|
||||
* mcMMO now notifies you when you progress in a skill!
|
||||
* Excavation Treasure Hunter is renamed to Archaeology
|
||||
* Readying a tool for a super ability now plays a sound
|
||||
* Skill Unlock Notifications have sounds
|
||||
* Stripping wood and right clicking on stripped wood will no longer ready your Axe
|
||||
* Added new skill 'Understanding The Art' which adds nothing new but tracks previously hidden benefits of raising a skill
|
||||
* Tool alerts now are sent to the Action Bar
|
||||
* Super Ability activation alerts are now sent to the Action Bar
|
||||
* Almost all Skill-related messages are now sent to the Action Bar
|
||||
* Added some missing information to skill stats
|
||||
* Swords no longer require blocking with a shield to trigger counter attacks
|
||||
* Sword's Bleed has been renamed to Rupture
|
||||
* Sword's Rupture no longer has an internal hard coded limit
|
||||
* Sword's Serrated Strikes now uses your Rupture rank to determine the damage/ticks for its bleed effect.
|
||||
* Sword's Rupture now ticks four times as fast
|
||||
* Sword's Rupture now refreshes bleed duration instead of adding duration when applying bleed to the same target
|
||||
* Sword's Rupture will now deal lethal damage
|
||||
* Sword's Rupture now reaches its max proc chance at level 20 (200 in Retro)
|
||||
* Sword's Rupture now has a max chance to proc of 33% instead of 70%
|
||||
* Sword's Rupture now deals 50% more damage at above Rank 3 and can last much longer!
|
||||
* The base damage for Bleed has been increased as well (update your `advanced.yml` admins)
|
||||
* Sword's Rupture no longer triggers invincibility frames when damaging your opponent
|
||||
* Sword's Rupture now plays a sound
|
||||
* Taming's Gore now uses Rupture Rank 1 for its DoT calculations
|
||||
* Furnaces now give XP to the last person to modify their inventory instead of the first person to open them
|
||||
* Rolling now plays a sound (Graceful Roll has a different sound :) )
|
||||
* Acrobatics' Roll exploit detection was tweaked to still allow for Roll to trigger even if it rewards no XP
|
||||
* Acrobatics' Roll & Gracefull Roll are now considered the same skill (both mechanics are still there)
|
||||
* Some skill level rank requirements have changed
|
||||
|
||||
### Experience
|
||||
|
||||
* Skills now start at level 1 (configurable in advanced.yml)
|
||||
* Starting an XP event will now use the title API (toggle this in `advanced.yml`)
|
||||
* The XP values of fish are now based on their rarity and have been drastically changed
|
||||
* Coral (blocks) now give Mining XP
|
||||
* Coral (plants) now give Herbalism XP
|
||||
* Blue Ice now gives Mining XP
|
||||
* Dolphins now give combat XP
|
||||
* Drowned mobs now count towards combat XP
|
||||
* Added missing mushroom blocks for XP
|
||||
* You can now set guaranteed minimum values for XP gained if diminishing returns are enabled, this value defaults to 5% (`experience.yml`)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed the bug where mob names would be replaced by hearts
|
||||
* Fixed a bug where Rupture would apply an incorrect amount of bleed ticks
|
||||
* Fixed bug where XP rate could be a negative number
|
||||
* Fixed a bug where you could set a players levels into the negative and bad things would happen
|
||||
* Fixed an edge case bug where Blast Mining wouldn't inform the player that it was on cooldown
|
||||
|
||||
### Plugin Compatibility
|
||||
|
||||
* mcMMO now fires new custom events relating to changes it makes to player scoreboards, plugin authors can listen to these events to improve compatibility
|
||||
|
||||
### Exploit Fixes
|
||||
|
||||
* Prevented exploits involving blocks made from entities (snowmen, etc..)
|
||||
* Chimaera Wing now tracks cooldowns between sessions for players (no more disconnect abuse)
|
||||
* Tridents will no longer be considered unarmed
|
||||
* Prevented exploits involving 2 high herbs and chorus flowers
|
||||
* Vastly Improved the Acrobatics exploit detection checks
|
||||
|
||||
### Parties
|
||||
|
||||
* Parties can now have size limits (configurable in `config.yml`), party size is unlimited by default
|
||||
* You can now turn on Friendly Fire for parties in `config.yml`
|
||||
* Party member list will only include members of the party that you can see (aren't vanished)
|
||||
|
||||
### Scoreboards
|
||||
|
||||
* Scoreboards are now disabled by default since most of their functionality is handled better by XP bars.
|
||||
* Added toggle to disable all scoreboards (previously you had to disable them one by one)
|
||||
* You can turn them back on in `config.yml`
|
||||
* You can have XP bars and scoreboards on at the same time
|
||||
|
||||
### MySQL
|
||||
|
||||
* Added support for SSL for MySQL/MariaDB in config.yml (On by default)
|
||||
* mcMMO no longer spams your console if you are not using SSL for your MySQL server
|
||||
* You can now inspect offline players
|
||||
* When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process
|
||||
|
||||
### Admins
|
||||
|
||||
* Added ability for admins to spy on party chat (off unless toggled on) /mcchatspy
|
||||
* The Debug stick can now tell you about properties of a block related to Excavation
|
||||
|
||||
### API
|
||||
|
||||
* Detailed guide to API changes is available at http://api.mcmmo.org
|
||||
* Added many missing `SubSkills` to `SubSkillType` class
|
||||
* Moved a lot of methods from `SkillCommand` to `SkillUtils`
|
||||
* `SkillType` is now `PrimarySkillType`
|
||||
* `SecondarySkill` is now `SubSkillType`
|
||||
* `AbilityType` is now `SuperAbilityType`
|
||||
* `SecondaryAbilityEvent` is now `SubSkillEvent`
|
||||
* `SubSkillType` has had many helpful methods added to it
|
||||
* `GREEN_THUMB_PLANT` & `GREEN_THUMB_BLOCK` are replaced by `GREEN_THUMB`
|
||||
|
||||
### Permissions
|
||||
|
||||
* Removed all mob health bar permissions, this is no longer a per-player setting.
|
||||
* Added permission node `mcmmo.commands.mcchatspy` & `mcmmo.commands.mcchatspy.others`
|
||||
* Added `mcmmo.commands.mmoinfo` for the new `mmoinfo`/`mcinfo` command
|
||||
* Added permission nodes for Harvest Lumber, Splinter, Nature's Bounty, and Bark Surgeon
|
||||
* Call of the wild now uses `mcmmo.ability.taming.callofthewild` instead of `mcmmo.ability.taming.callofthewild.all`
|
||||
* Replaced the old Double Drop permission node for woodcutting with a new Harvest Lumber permission node
|
||||
* Fast Food Service permission node renamed to `mcmmo.ability.taming.fastfoodservice`
|
||||
* Counter Attack permission node renamed to `mcmmo.ability.swords.counterattack`
|
||||
* Arrow Deflect permission node renamed to `mcmmo.ability.unarmed.arrowdeflect`
|
||||
* Iron Arm Style permission node renamed to `mcmmo.ability.unarmed.ironarmstyle`
|
||||
|
||||
### Commands
|
||||
|
||||
* Added new info command `/mmoinfo` or `/mcinfo`
|
||||
* Added toggle command `/mcchatspy`
|
||||
* `/mcMMO help` no longer displays the other/special commands category to players lacking permissions
|
||||
* Removed the `mobhealthbar` command, this is no longer a per-player setting.
|
||||
|
||||
### Misc Config Changes
|
||||
|
||||
* Removed `SkillShot`'s `IncreaseLevel` & `IncreasePercentage` (replaced by `RankDamageMultiplier`)
|
||||
* Removed `AxeMastery`'s `MaxBonus` & `MaxBonusLevel` (replaced by `RankDamageMultiplier`)
|
||||
* `Unarmed.IronArm` in `advanced.yml` is now `Unarmed.IronArmStyle`
|
||||
* `Unarmed.Deflect` in `advanced.yml` is now `Unarmed.ArrowDeflect`
|
||||
* `Swords.Counter` in `advanced.yml` is now `Swords.CounterAttack`
|
||||
* `Archery.Retrieve` in `advanced.yml` is now `Archery.ArrowRetrieval`
|
||||
* `Axes.CriticalHit` in `advanced.yml` is now `Axes.CriticalStrikes`
|
||||
* Archery's Skill Shot now uses `RankDamageMultiplier` for its damage bonus calculations
|
||||
* Axe's Axe mastery now uses `RankDamageMultiplier` for its damage bonus calculations
|
||||
|
||||
### Misc Changes
|
||||
|
||||
* Removed everything involving the kraken
|
||||
* Code cleanup in a lot of places... unfortunately there is still much left to do!
|
||||
77
README.md
77
README.md
@@ -1,47 +1,66 @@
|
||||
# mcMMO
|
||||
## The RPG lovers mod
|
||||
|
||||
### Dev builds
|
||||
Our latest development builds are available [here](http://ci.mcmmo.info).
|
||||
## Website
|
||||
I'm working on a brand new website for mcMMO
|
||||
|
||||
You can check it out here http://www.mcmmo.org
|
||||
|
||||
I plan to post links to our new wiki (its still under development), downloads, and dev blogs there.
|
||||
|
||||
### Contributing
|
||||
As the plugin is being developed for multiple Minecraft versions, and multiple Minecraft platforms (read: [sponge](https://spongepowered.org/), [spigot](https://spigotmc.org/), bukkit, and [paper](https://papermc.io)), the
|
||||
overall build process is handled by [Gradle](https://gradle.org/) with [Kotlin-dsl](https://github.com/gradle/kotlin-dsl) based scripts.
|
||||
As such, an IDE is strongly recommended when attempting to contribute features, additions, changes, bug fixes, etc. to mcMMO as the scripts handle a
|
||||
majority of our dependencies and rebuilding a production worthy jar.
|
||||
|
||||
To get started, a few things need to be installed:
|
||||
- JDK 8 (not 9, 10, 11, or 7)
|
||||
- git
|
||||
- Your favorite IDE (can be [Eclipse](https://eclipse.org/), [IntelliJ](https://jetbrains.org/)
|
||||
- BuildTools.jar from [Spigot](https://www.spigotmc.org/wiki/buildtools/)
|
||||
|
||||
##### Using BuildTools
|
||||
BuildTools is used to generate the craftbukkit/spigot dependencies used for varoius versions of Minecraft.
|
||||
The key with this tool is that it can build and deploy multiple vesions of Minecraft based on "reviewions".
|
||||
|
||||
|
||||
### Builds
|
||||
Currently, you can obtain our builds via the Spigot resource page: https://spigot.mcmmo.org
|
||||
|
||||
### Brief Description
|
||||
mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience.
|
||||
|
||||
If you want an original RPG experience like no other mod out there, mcMMO is for you.
|
||||
The goal of mcMMO is to take core Minecraft game mechanics and expand them into add an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
|
||||
|
||||
## About the Team
|
||||
|
||||
mcMMO is currently developed by a team of individuals from all over the world.
|
||||
### Glorious Leader
|
||||
[]
|
||||
(https://github.com/gmcferrin)
|
||||
|
||||
### Project Lead & Founder
|
||||
[](https://github.com/com.gmail.nossr50)
|
||||
|
||||
### Former Lead
|
||||
[](https://github.com/gmcferrin)
|
||||
|
||||
### Developers
|
||||
[]
|
||||
(https://github.com/bm01)
|
||||
[]
|
||||
(https://github.com/Glitchfinder)
|
||||
[]
|
||||
(https://github.com/nossr50)
|
||||
[]
|
||||
(https://github.com/NuclearW)
|
||||
[]
|
||||
(https://github.com/shatteredbeam)
|
||||
[]
|
||||
(https://github.com/TfT-02)
|
||||
[]
|
||||
(https://github.com/t00thpick1)
|
||||
[](https://github.com/bm01)
|
||||
[](https://github.com/Glitchfinder)
|
||||
[](https://github.com/NuclearW)
|
||||
[](https://github.com/shatteredbeam)
|
||||
[](https://github.com/TfT-02)
|
||||
[](https://github.com/t00thpick1)
|
||||
[](https://github.com/riking)
|
||||
|
||||
### Special thanks
|
||||
[](https://github.com/EasyMFnE)
|
||||
Added the Alchemy skill
|
||||
|
||||
## Compiling
|
||||
|
||||
mcMMO uses Maven 3 to manage dependancies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
|
||||
mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
|
||||
|
||||
The typical command used to build mcMMO is: mvn clean package install
|
||||
The typical command used to build mcMMO is: `mvn clean package install`
|
||||
|
||||
Required Libraries:
|
||||
* Spout API
|
||||
* JUnit
|
||||
* Metrics
|
||||
* Bukkit
|
||||
* JUnit
|
||||
|
||||
http://dev.bukkit.org/server-mods/mcmmo for more up to date information.
|
||||
https://spigot.mcmmo.org for more up to date information.
|
||||
|
||||
139
build.gradle.kts
Normal file
139
build.gradle.kts
Normal file
@@ -0,0 +1,139 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
/*
|
||||
* Declares the version of the Gradle wrapper. We need 4.9 for now because
|
||||
* ForgeGradle 3+ is a hard dependency for Gradle 4.9, 4.10 is not compatible
|
||||
*/
|
||||
val wrapper by tasks.getting(Wrapper::class) {
|
||||
gradleVersion = "4.9"
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets up project references to be used in child scripts, like
|
||||
* ":bukkit", ":core", ":sponge" where these projects need to be
|
||||
* referred to for dependencies, paths, outputs etc.
|
||||
* Projects is specifically an object stored in <root>/buildSrc/src/main/java/Config.kt
|
||||
* It's a nullable variable, but we just store it here and use it elsewhere.
|
||||
*/
|
||||
Projects.core = project("core")
|
||||
Projects.bukkit = project("bukkit")
|
||||
Projects.sponge = project("sponge")
|
||||
/*
|
||||
Declares the various other projects and stores them to Gradle's `extra` properties.
|
||||
These are potentially usable for other purposes, but for now, they're here only to
|
||||
declare the values for this root project's dependency (for shadowjar)
|
||||
*/
|
||||
var core: Project by extra { project("core") }
|
||||
val bukkit by extra { project("bukkit") }
|
||||
val bukkit_18 by extra { bukkit.project("1_8_8") }
|
||||
val bukkit_112 by extra { bukkit.project("1_12") }
|
||||
val bukkit_113 by extra { bukkit.project("1_13") }
|
||||
val sponge by extra { project("sponge") }
|
||||
val sponge_7 by extra { sponge.project("api7") }
|
||||
|
||||
group = properties["pluginGroup"]!!
|
||||
version = properties["pluginVersion"]!!
|
||||
|
||||
/*
|
||||
Even though all projects declares some of these plugins, we want to declare them the traditional
|
||||
way so that we can have IDE utiliziation and processing, it helps with writing these scripts.
|
||||
*/
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "4.0.4"
|
||||
}
|
||||
|
||||
/*
|
||||
Default management for ALL projects, not just root, or ":bukkit", but all projects and
|
||||
their children projects.
|
||||
*/
|
||||
allprojects {
|
||||
/*
|
||||
We need the java library processing, and shadow allows us to run
|
||||
shadowJar to relocate dependencies and bundle dependencies into a fat jar.
|
||||
*/
|
||||
apply(plugin="java-library")
|
||||
apply(plugin="com.github.johnrengelman.shadow")
|
||||
|
||||
/*
|
||||
Defines all the repositories for all project dependency resolutions. Some of these
|
||||
repositories are meant for specific dependencies, so the content filters will
|
||||
prevent attempts at resolving those dependencies being requested at those repositories.
|
||||
Constants are defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
*/
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(Repos.sk89q) // WorldEdit/WorldGuard
|
||||
maven(Repos.bstats) // bstats
|
||||
maven(Repos.sponge) // Sponge, Configurate, and some other things
|
||||
maven(Repos.spigot) // Spigot and Bukkit
|
||||
maven(Repos.sonatype) // General Maven
|
||||
mavenLocal() // For nms packages
|
||||
}
|
||||
|
||||
// Sets all projects compatibility level to Java 8
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
// Encoding for all packages is UTF-8
|
||||
tasks.getting(JavaCompile::class) {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
// Default shadow jar configuration. Sub projects will override and add on,
|
||||
// but this sets up at the very least the jdbc connection dependencies to be relocated
|
||||
val shadowJar by tasks.getting(ShadowJar::class) { // Configure basics of relocation
|
||||
relocate(Shadow.Origin.juli, Shadow.Target.juli)
|
||||
relocate(Shadow.Origin.tomcat, Shadow.Target.tomcat)
|
||||
exclude(Shadow.Exclude.ForgeGradle.dummyThing)
|
||||
exclude(Shadow.Exclude.ForgeGradle.template)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
All subprojects shadowjar tasks that will exclude various dependencies, while
|
||||
the root project will include some of these dependencies (like jdbc, configurate)
|
||||
so that the sub project jars are already somewhat minimized, in the event those
|
||||
platform jars are to be deployed individually versus an overall "all platforms"
|
||||
jar.
|
||||
*/
|
||||
subprojects {
|
||||
val shadowJar by tasks.getting(ShadowJar::class) {
|
||||
dependencies {
|
||||
exclude(dependency("${Deps.Groups.sponge}:${Deps.Modules.configurate_yaml}"))
|
||||
exclude(dependency(Shadow.Exclude.guava))
|
||||
exclude(dependency(Shadow.Exclude.snakeyaml))
|
||||
exclude(dependency(Shadow.Exclude.tomcat))
|
||||
exclude(dependency(Shadow.Exclude.juli))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sets up this root project to depend on all the implementations supported.
|
||||
// By default, they all already should have shadow relocations and packaging,
|
||||
// and their dependencies should not be leaking into this project.
|
||||
dependencies {
|
||||
compile(bukkit)
|
||||
compile(sponge)
|
||||
compile(bukkit_18)
|
||||
compile(bukkit_112)
|
||||
compile(bukkit_113)
|
||||
compile(sponge_7)
|
||||
}
|
||||
|
||||
// Configure shadow for the root project, we want to relocate bstats-bukkit
|
||||
// and whatever else is configured in the allProjects configuration
|
||||
val shadowJar by tasks.getting(ShadowJar::class) { // Root shadow relocation
|
||||
|
||||
relocate(Shadow.Origin.bstatsBukkit, Shadow.Target.bstatsBukkit)
|
||||
|
||||
baseName = "mcMMO"
|
||||
classifier = "bundle"
|
||||
}
|
||||
|
||||
// Tell the build task to depend on shadowjar.
|
||||
val build by tasks
|
||||
build.dependsOn(shadowJar)
|
||||
8
buildSrc/build.gradle.kts
Normal file
8
buildSrc/build.gradle.kts
Normal file
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
191
buildSrc/src/main/java/Config.kt
Normal file
191
buildSrc/src/main/java/Config.kt
Normal file
@@ -0,0 +1,191 @@
|
||||
@file:Suppress("MayBeConstant", "unused")
|
||||
|
||||
import org.gradle.api.Project
|
||||
|
||||
object Plugins {
|
||||
const val spongeGradleId = "${Deps.Groups.sponge}.plugin"
|
||||
|
||||
object FG2_3 {
|
||||
const val classpath = "net.minecraftforge.gradle:ForgeGradle:${Versions.fg23}"
|
||||
const val extensionName = "minecraft"
|
||||
const val id = "net.minecraftforge.gradle.forge"
|
||||
}
|
||||
}
|
||||
|
||||
object Repos {
|
||||
const val sk89q = "https://maven.sk89q.com/repo"
|
||||
// bStats
|
||||
const val bstats = "https://repo.codemc.org/repository/maven-public"
|
||||
// configurate
|
||||
const val sponge = "https://repo.spongepowered.org/maven/"
|
||||
const val spigot = "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
|
||||
const val sonatype = "https://oss.sonatype.org/content/repositories/snapshots"
|
||||
const val forge = "https://files.minecraftforge.net/maven/"
|
||||
}
|
||||
|
||||
object Config {
|
||||
|
||||
object Libs {
|
||||
const val configurate = "${Deps.Groups.sponge}:${Deps.Modules.configurate_yaml}:${Versions.configurate}"
|
||||
const val jdbc = "${Deps.Groups.tomcat}:${Deps.Modules.jdbc}:${Versions.jdbc}"
|
||||
const val juli = "${Deps.Groups.tomcat}:${Deps.Modules.juli}:${Versions.jdbc}"
|
||||
const val junitDep = "${Deps.Groups.junit}:${Deps.Modules.junit}:${Versions.junit}"
|
||||
const val flowmath = "${Deps.Groups.flowpowered}:${Deps.Modules.flowmath}:${Versions.flowmath}"
|
||||
|
||||
object Bukkit {
|
||||
object `1_8` {
|
||||
const val api = "$bukkit:${Versions.bukkit18}"
|
||||
const val spigotApi = "${Bukkit.spigotApi}:${Versions.bukkit18}"
|
||||
const val spigot = "$${Bukkit.spigot}:${Versions.bukkit18}"
|
||||
const val nms = "$craftbukkit:${Versions.bukkit18}"
|
||||
// only legacy existed at this point, no core.
|
||||
const val wgLegacy = "${Bukkit.wgLegacy}:${Versions.wg18}"
|
||||
}
|
||||
|
||||
object `1_12` {
|
||||
const val api = "$bukkit:${Versions.bukkit112}"
|
||||
const val spigotApi = "${Bukkit.spigotApi}:${Versions.bukkit112}"
|
||||
const val spigot = "$${Bukkit.spigot}:${Versions.bukkit112}"
|
||||
const val nms = "$craftbukkit:${Versions.bukkit112}"
|
||||
// only legacy existed at this point, no core.
|
||||
const val wgLegacy = "${Bukkit.wgLegacy}:${Versions.wg112}"
|
||||
}
|
||||
|
||||
object `1_13` {
|
||||
const val api = "$bukkit:${Versions.bukkit113}"
|
||||
const val spigotApi = "${Bukkit.spigotApi}:${Versions.bukkit113}"
|
||||
const val spigot = "$${Bukkit.spigot}:${Versions.bukkit113}"
|
||||
const val nms = "$craftbukkit:${Versions.bukkit113}"
|
||||
const val wgCore = "${Bukkit.wgCore}:${Versions.wg113}"
|
||||
const val wgLegacy = "${Bukkit.wgLegacy}:${Versions.wg113}"
|
||||
}
|
||||
|
||||
const val bukkit = "${Deps.Groups.bukkit}:${Deps.Modules.bukkit}"
|
||||
const val craftbukkit = "${Deps.Groups.bukkit}:${Deps.Modules.craftbukkit}"
|
||||
const val wgCore = "${Deps.Groups.worldguard}:${Deps.Modules.wgCore}"
|
||||
const val wgLegacy = "${Deps.Groups.worldguard}:${Deps.Modules.wgLegacy}"
|
||||
const val spigotApi = "${Deps.Groups.spigot}:${Deps.Modules.spigotApi}"
|
||||
const val spigot = "${Deps.Groups.spigot}:${Deps.Modules.spigot}"
|
||||
const val bstats = "${Deps.Groups.bstats}:${Deps.Modules.bstatsBukit}:${Versions.bstats}"
|
||||
}
|
||||
|
||||
object Sponge {
|
||||
object API7 { // All of these are specific to the API7 module, API8 will change
|
||||
const val forgeGradleId = "net.minecraftforge.gradle.forge"
|
||||
const val spongeGradleId = "${Deps.Groups.sponge}.plugin"
|
||||
const val spongeGradleVersion = "0.9.0"
|
||||
const val api = "${Sponge.api}:${Versions.sapi7}"
|
||||
const val common = "${Sponge.common}:${Versions.spongeImpl7}"
|
||||
const val forge_version = "14.23.5.2768"
|
||||
const val minecraftVersion = "1.12.2-$forge_version"
|
||||
const val mappings = "snapshot_20180808"
|
||||
}
|
||||
|
||||
object Exclude {
|
||||
const val group = Deps.Groups.sponge
|
||||
const val module = Deps.Modules.spongeAPI
|
||||
}
|
||||
|
||||
const val api = "${Deps.Groups.sponge}:${Deps.Modules.spongeAPI}"
|
||||
const val common = "${Deps.Groups.sponge}:${Deps.Modules.spongecommon}"
|
||||
const val bstats = "${Deps.Groups.bstats}:${Deps.Modules.bstatsSponge}:${Versions.bstats}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object Deps {
|
||||
object Groups {
|
||||
const val nossr = "com.gmail.nossr50"
|
||||
const val google = "com.google"
|
||||
const val guava = "com.google.guava"
|
||||
const val gson = "com.google.code.gson"
|
||||
const val yaml = "org.yaml"
|
||||
const val sk89q = "com.sk89q"
|
||||
const val apache = "org.apache"
|
||||
const val worldguard = "$sk89q.worldguard"
|
||||
const val worldedit = "$sk89q.worldedit"
|
||||
const val sponge = "org.spongepowered"
|
||||
const val spigot = "org.spigotmc"
|
||||
const val md5 = "net.md_5"
|
||||
const val bukkit = "org.bukkit"
|
||||
const val bstats = "org.bstats"
|
||||
const val tomcat = "org.apache.tomcat"
|
||||
const val junit = "junit"
|
||||
const val checker = "org.checkerframework"
|
||||
const val flowpowered = "com.flowpowered"
|
||||
}
|
||||
|
||||
object Modules {
|
||||
const val guava = "guava"
|
||||
const val gson = "gson"
|
||||
const val snakeyaml = "snakeyaml"
|
||||
const val wgCore = "worldguard-core"
|
||||
const val wgLegacy = "worldguard-legacy"
|
||||
const val bungeecordChat = "bungeecord-chat"
|
||||
const val spongeAPI = "spongeapi"
|
||||
const val spongecommon = "spongecommon"
|
||||
const val spongeforge = "spongeforge"
|
||||
const val spongevanilla = "spongevanilla"
|
||||
const val bukkit = "bukkit"
|
||||
const val craftbukkit = "craftbukkit"
|
||||
const val bstatsBukit = "bstats-bukkit"
|
||||
const val bstatsSponge = "bstats-sponge"
|
||||
const val spigotApi = "spigot-api"
|
||||
const val spigot = "spigot"
|
||||
const val configurate = "configurate"
|
||||
const val configurate_core = "${configurate}-core"
|
||||
const val configurate_yaml = "${configurate}-yaml"
|
||||
const val jdbc = "tomcat-jdbc"
|
||||
const val juli = "tomcat-juli"
|
||||
const val junit = "junit"
|
||||
const val checker = "checker-qual"
|
||||
const val flowmath = "flow-math"
|
||||
}
|
||||
}
|
||||
|
||||
object Projects {
|
||||
var core: Project? = null
|
||||
var bukkit: Project? = null
|
||||
var sponge: Project? = null
|
||||
}
|
||||
|
||||
object Shadow {
|
||||
object Origin {
|
||||
const val juli = "${Deps.Groups.apache}.juli"
|
||||
const val tomcat = "${Deps.Groups.apache}.tomcat"
|
||||
const val apache = "${Deps.Groups.apache}.commons.logging"
|
||||
const val bstatsBukkit = "${Deps.Groups.bstats}.bukkit"
|
||||
const val configurate = "ninja.leaping.configurate"
|
||||
const val checker = "org.checkerframework"
|
||||
}
|
||||
|
||||
object Target {
|
||||
const val juli = "${Deps.Groups.nossr}.database.tomcat.juli"
|
||||
const val tomcat = "${Deps.Groups.nossr}.database.tomcat"
|
||||
const val apache = "${Deps.Groups.nossr}.commons.logging"
|
||||
const val bstatsBukkit = "${Deps.Groups.nossr}.metrics.bstat"
|
||||
const val configurate = "${Deps.Groups.nossr}.${Deps.Modules.configurate}"
|
||||
const val checker = "${Deps.Groups.nossr}.${Deps.Modules.configurate}.checkerframework"
|
||||
}
|
||||
|
||||
object Exclude {
|
||||
const val tomcat = "${Deps.Groups.tomcat}:${Deps.Modules.jdbc}"
|
||||
const val juli = "${Deps.Groups.apache}:${Deps.Modules.juli}"
|
||||
const val guava = "${Deps.Groups.guava}:${Deps.Modules.guava}"
|
||||
const val snakeyaml = "${Deps.Groups.yaml}:${Deps.Modules.snakeyaml}"
|
||||
const val bukkit = Deps.Groups.bukkit
|
||||
const val spigot = Deps.Groups.spigot
|
||||
const val sk89q = "com.sk89q"
|
||||
const val wg = "$sk89q.worldguard"
|
||||
const val intake = "$sk89q.intake"
|
||||
const val flyway = "com.flywaydb"
|
||||
const val khelekore = "org.khelekore"
|
||||
const val findbugs = "com.google.code.findbugs"
|
||||
const val bstats = "${Deps.Groups.bstats}"
|
||||
|
||||
object ForgeGradle {
|
||||
const val dummyThing = "dummyThing"
|
||||
const val template = "Version.java.template"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
buildSrc/src/main/java/Versions.kt
Normal file
16
buildSrc/src/main/java/Versions.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
object Versions {
|
||||
const val configurate = "3.6" // Latest configurate
|
||||
const val flowmath = "1.0.4-SNAPSHOT"
|
||||
const val bukkit18 = "1.8.8-R0.1-SNAPSHOT" // Last bukkit 1.8.8
|
||||
const val bukkit112 = "1.12.2-R0.1-SNAPSHOT" // Last bukkit 1.12.2
|
||||
const val bukkit113 = "1.13.2-R0.1-SNAPSHOT" // Latest bukkit
|
||||
const val sapi7 = "7.1.0" // Latest SpongeAPI stable
|
||||
const val spongeImpl7 = "7.1.5" // Latest SpongeCommon stable
|
||||
const val jdbc = "7.0.52"
|
||||
const val junit = "4.12"
|
||||
const val fg23 = "2.3-SNAPSHOT" // ForgeGradle to support MC 1.12.2
|
||||
const val wg18 = "6.1.2" // Bukkit/CraftBukkit/Spigot 1.8.8 supported build, works on newer, but last one to support 1.8.8
|
||||
const val wg112 = "6.2" // Last WorldGuard to support 1.12
|
||||
const val wg113 = "7.0.0-SNAPSHOT" // Latest WorldGuard to support 1.13.2
|
||||
const val bstats = "1.4" // Supports all backwards compatible. Always relocated
|
||||
}
|
||||
27
bukkit/1_12/build.gradle.kts
Normal file
27
bukkit/1_12/build.gradle.kts
Normal file
@@ -0,0 +1,27 @@
|
||||
import Config.Libs.Bukkit.`1_12` as Bukkit
|
||||
// Config is located in <root>/buildSrc/src/main/java/Config.kt
|
||||
// It provides a bunch of constant values we use as dependency
|
||||
// strings, so we don't have to duplicate a bunch of them in
|
||||
// various scripts.
|
||||
|
||||
plugins {
|
||||
java // This is already provided, but for static compilation,
|
||||
// we declare it here so we can use the IDE static type references
|
||||
}
|
||||
|
||||
/*
|
||||
Dependency inheritance is as follows
|
||||
- ":core", which provides
|
||||
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
|
||||
dependencies like guava and apache commons lang.
|
||||
- ":bukkit", which provides nothing on it's own, except the
|
||||
core bukkit classes that can be built on 1.13.2 API (which may change).
|
||||
It also defines all subprojects to depend on ":core", and ":bukkit",
|
||||
and bstats-bukkit.
|
||||
*/
|
||||
dependencies {
|
||||
compileOnly(Bukkit.api) // Bukkit API for 1.12.2
|
||||
compileOnly(Bukkit.nms) // CraftBukkit for 1.12.2
|
||||
compileOnly(Bukkit.wgLegacy) // WorldGuard for 1.12.2 bukkit
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.gmail.nossr50.bukkit.v1_12;
|
||||
|
||||
import com.gmail.nossr50.VersionedHandler;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.server.v1_12_R1.Chunk;
|
||||
import net.minecraft.server.v1_12_R1.EntityTypes;
|
||||
import net.minecraft.server.v1_12_R1.IBlockData;
|
||||
import net.minecraft.server.v1_12_R1.IBlockState;
|
||||
import net.minecraft.server.v1_12_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_12_R1.RegistryBlocks;
|
||||
import net.minecraft.server.v1_12_R1.RegistryMaterials;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.block.CraftBlockState;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class NmsHandler extends VersionedHandler {
|
||||
/**
|
||||
* Static reference to the block registry. Don't really care about the fact that
|
||||
* it is being stored as a reference here, but for imports reasons, it's smaller
|
||||
* line length makes it optimal to read for method usages.
|
||||
*/
|
||||
private static final RegistryBlocks<MinecraftKey, net.minecraft.server.v1_12_R1.Block> BLOCK_REGISTRY = net.minecraft.server.v1_12_R1.Block.REGISTRY;
|
||||
/**
|
||||
* We can keep track of block state id's by generating them on demand, i.e., when
|
||||
* they're being requested from Blocks, or BlockDatas.
|
||||
*/
|
||||
private static final RegistryMaterials<MinecraftKey, IBlockData> BLOCK_STATE_REGISTRY = new RegistryMaterials<>();
|
||||
|
||||
NmsHandler(mcMMO plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Block block) {
|
||||
// We have to get the underlying nms block by the block, which might as well just be the type id.
|
||||
final Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
|
||||
// Get the block state from the underlying chunk (stored by reference in CraftBlock)
|
||||
final IBlockData blockState = chunk.a(block.getX(), block.getY(), block.getZ());
|
||||
// Sadly, Mojang doesn't store the string id onto blocks, states, or any of their types, they just call the registry.
|
||||
final MinecraftKey key = BLOCK_REGISTRY.b(blockState.getBlock());
|
||||
return key.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Entity entity) {
|
||||
// Every entity knows it's "type". Here, we just use the right method getter to get the EntityTypes instance for that entity
|
||||
final net.minecraft.server.v1_12_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
|
||||
// And then... well. we get the string id from the registry, based on the entity class to id mapping in EntityTypes.
|
||||
final MinecraftKey key = EntityTypes.a(nmsEntity);
|
||||
// If the key is null, well, we've got bigger problems...
|
||||
return key == null ? "minecraft:slime" : key.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
@Override
|
||||
public String getIdFor(BlockState block) {
|
||||
// Since we don't really want to trust what "BlockState" gives us, and the API doesn't give us anything but
|
||||
// what the API wants to give us, we have to dig into internals to get the true BlockState representation
|
||||
final CraftBlockState craftState = (CraftBlockState) block;
|
||||
// Because CraftBlock also stores the chunk reference, we can short cut in to use the chunk, instead of pinging
|
||||
// the chunk map on WorldServer
|
||||
final CraftChunk craftChunk = (CraftChunk) craftState.getChunk();
|
||||
// Then query for the block state from the chunk.
|
||||
final IBlockData nmsState = craftChunk.getHandle().a(block.getX(), block.getY(), block.getZ());
|
||||
// And then we're gucci
|
||||
final net.minecraft.server.v1_12_R1.Block nmsBlock = nmsState.getBlock();
|
||||
final MinecraftKey blockKey = BLOCK_REGISTRY.b(nmsBlock);
|
||||
// Now we can check if our blockstate registry actually has the block state.
|
||||
final MinecraftKey stateKey = BLOCK_STATE_REGISTRY.b(nmsState);
|
||||
if (stateKey != null) { // If the state has been registered by the handler, then by all means.
|
||||
return stateKey.toString();
|
||||
}
|
||||
// If not, well, it needs to have a key generated and registered.
|
||||
final String nameSpace = blockKey.getKey();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(nameSpace); // We only want to get the block id, not the domain id, since that's going to be appended later
|
||||
|
||||
// Get the full Property -> Value mapping for the block state
|
||||
final ImmutableMap<IBlockState<?>, Comparable<?>> properties = nmsState.t();
|
||||
if (!properties.isEmpty()) {
|
||||
builder.append('[');
|
||||
Joiner joiner = Joiner.on(',');
|
||||
List<String> propertyValues = new ArrayList<>();
|
||||
// Yadadadada, go through all property entries and add each as a string for the "propertyName=value" (like "variant=oak")
|
||||
for (Map.Entry<IBlockState<?>, Comparable<?>> entry : properties.entrySet()) {
|
||||
// a() gets the inputted "name" for the state, the value, well, that gets the value, which is always toStringable.
|
||||
propertyValues.add(entry.getKey().a() + "=" + entry.getValue());
|
||||
}
|
||||
builder.append(joiner.join(propertyValues));
|
||||
builder.append(']');
|
||||
}
|
||||
// Now we can make the MinecraftKey...
|
||||
final MinecraftKey newKey = new MinecraftKey(builder.toString());
|
||||
BLOCK_STATE_REGISTRY.a(newKey, nmsState);
|
||||
return newKey.toString();
|
||||
}
|
||||
}
|
||||
27
bukkit/1_13/build.gradle.kts
Normal file
27
bukkit/1_13/build.gradle.kts
Normal file
@@ -0,0 +1,27 @@
|
||||
import Config.Libs.Bukkit.`1_13` as Bukkit
|
||||
// Config is located in <root>/buildSrc/src/main/java/Config.kt
|
||||
// It provides a bunch of constant values we use as dependency
|
||||
// strings, so we don't have to duplicate a bunch of them in
|
||||
// various scripts. The import allows us to "import as" for shorthand
|
||||
|
||||
plugins {
|
||||
`java-library` // This is already provided, but for static compilation,
|
||||
// we declare it here so we can use the IDE static type references
|
||||
}
|
||||
|
||||
/*
|
||||
Dependency inheritance is as follows
|
||||
- ":core", which provides
|
||||
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
|
||||
dependencies like guava and apache commons lang.
|
||||
- ":bukkit", which provides nothing on it's own, except the
|
||||
core bukkit classes that can be built on 1.13.2 API (which may change).
|
||||
It also defines all subprojects to depend on ":core", and ":bukkit",
|
||||
and bstats-bukkit.
|
||||
*/
|
||||
dependencies {
|
||||
compileOnly(Bukkit.api) // Bukkit API for 1.13.2 - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
compileOnly(Bukkit.nms) // CraftBukkit-1.13.2-R0.1-SNAPSHOT - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
compileOnly(Bukkit.wgCore) // WorldGuard-core - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
compileOnly(Bukkit.wgLegacy) // WorldGuard-legacy - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.gmail.nossr50.bukkit.v1_13;
|
||||
|
||||
import com.gmail.nossr50.VersionedHandler;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.server.v1_13_R2.EntityTypes;
|
||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||
import net.minecraft.server.v1_13_R2.IBlockState;
|
||||
import net.minecraft.server.v1_13_R2.IRegistry;
|
||||
import net.minecraft.server.v1_13_R2.MinecraftKey;
|
||||
import net.minecraft.server.v1_13_R2.RegistryMaterials;
|
||||
import net.minecraft.server.v1_13_R2.WorldServer;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlockState;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class NmsHandler extends VersionedHandler {
|
||||
|
||||
private static final IRegistry<net.minecraft.server.v1_13_R2.Block> BLOCK_REGISTRY = IRegistry.BLOCK;
|
||||
private static final IRegistry<EntityTypes<?>> ENTITY_REGISTRY = IRegistry.ENTITY_TYPE;
|
||||
/**
|
||||
* We use {@link RegistryMaterials} because we don't want to default to another block state,
|
||||
* if a {@link IBlockData} is not registered, we need to generate an ID and register that key to
|
||||
* that {@link IBlockData}. By default, this should be populated during plugin startup by
|
||||
* calling some init method, but that will be determined later.
|
||||
*/
|
||||
private static final IRegistry<IBlockData> BLOCK_STATE_REGISTRY = new RegistryMaterials<>();
|
||||
|
||||
NmsHandler(mcMMO plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Block block) {
|
||||
// We have to get the underlying nms block by the block, which might as well just be the type id.
|
||||
final WorldServer world = ((CraftBlock) block).getCraftWorld().getHandle();
|
||||
// The registry.c(T) will return MinecraftKey, and the toString() returns the "$mod:$name", so "minecraft:stone"
|
||||
final IBlockData blockState = world.getType(((CraftBlock) block).getPosition());
|
||||
// Sadly, Mojang doesn't store the string id onto blocks, states, or any of their types, they just call the registry.
|
||||
final MinecraftKey key = BLOCK_REGISTRY.getKey(blockState.getBlock());
|
||||
// Sometimes, there's a rare case with mods where the key is going to be null, but should never happen in bukkit/spigot.
|
||||
return key == null ? "minecraft:air" : key.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Entity entity) {
|
||||
// Every entity knows it's "type". Here, we just use the right method getter to get the EntityTypes instance for that entity
|
||||
final EntityTypes<?> entityType = ((CraftEntity) entity).getHandle().P();
|
||||
// And then... well. we get the string id from the registry!
|
||||
final MinecraftKey key = ENTITY_REGISTRY.getKey(entityType);
|
||||
// If the key is null, well, we've got bigger problems...
|
||||
return key == null ? "minecraft:slime" : key.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
@Override
|
||||
public String getIdFor(BlockState block) {
|
||||
// Much like #getIdFor(Block) except here we have the "state" by numerical id. So.. we have to grab it from
|
||||
// the world.
|
||||
final CraftBlockState craftState = (CraftBlockState) block;
|
||||
final IBlockData nmsState = craftState.getHandle();
|
||||
final net.minecraft.server.v1_13_R2.Block nmsBlock = nmsState.getBlock();
|
||||
final MinecraftKey blockKey = BLOCK_REGISTRY.getKey(nmsBlock);
|
||||
// Now we can check if our blockstate registry actually has the block state.
|
||||
final MinecraftKey stateKey = BLOCK_STATE_REGISTRY.getKey(nmsState);
|
||||
if (stateKey != null) { // If the state has been registered by the handler, then by all means.
|
||||
return stateKey.toString();
|
||||
}
|
||||
// If not, well, it needs to have a key generated and registered.
|
||||
final String nameSpace = blockKey.getKey();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(nameSpace); // We only want to get the block id, not the domain id, since that's going to be appended later
|
||||
|
||||
// Get the full Property -> Value mapping for the block state
|
||||
final ImmutableMap<IBlockState<?>, Comparable<?>> properties = nmsState.getStateMap();
|
||||
if (!properties.isEmpty()) {
|
||||
builder.append('[');
|
||||
Joiner joiner = Joiner.on(',');
|
||||
List<String> propertyValues = new ArrayList<>();
|
||||
// Yadadadada, go through all property entries and add each as a string for the "propertyName=value" (like "variant=oak")
|
||||
for (Map.Entry<IBlockState<?>, Comparable<?>> entry : properties.entrySet()) {
|
||||
// a() gets the inputted "name" for the state, the value, well, that gets the value, which is always toStringable.
|
||||
propertyValues.add(entry.getKey().a() + "=" + entry.getValue());
|
||||
}
|
||||
builder.append(joiner.join(propertyValues));
|
||||
builder.append(']');
|
||||
}
|
||||
// Now we can make the MinecraftKey...
|
||||
final MinecraftKey newKey = new MinecraftKey(builder.toString());
|
||||
BLOCK_STATE_REGISTRY.a(newKey, nmsState);
|
||||
return newKey.toString();
|
||||
}
|
||||
}
|
||||
23
bukkit/1_8_8/build.gradle.kts
Normal file
23
bukkit/1_8_8/build.gradle.kts
Normal file
@@ -0,0 +1,23 @@
|
||||
import Config.Libs.Bukkit.`1_8` as Bukkit
|
||||
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Dependency inheritance is as follows
|
||||
- ":core", which provides
|
||||
configurate, tomcat jdbc/juli, and flowmath. It excludes sub
|
||||
dependencies like guava and apache commons lang.
|
||||
- ":bukkit", which provides nothing on it's own, except the
|
||||
core bukkit classes that can be built on 1.13.2 API (which may change).
|
||||
It also defines all subprojects to depend on ":core", and ":bukkit",
|
||||
and bstats-bukkit.
|
||||
*/
|
||||
dependencies {
|
||||
compileOnly(Bukkit.api) // Bukkit API for 1.8.8 - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
compileOnly(Bukkit.nms) // CraftBukkit-1.8.8-R0.3-SNAPSHOT - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
compileOnly(Bukkit.wgLegacy) // Old worldguard - Defined in <root>/buildSrc/src/main/java/Config.kt
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.gmail.nossr50.bukkit.v1_8;
|
||||
|
||||
import com.gmail.nossr50.VersionedHandler;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.server.v1_8_R3.Blocks;
|
||||
import net.minecraft.server.v1_8_R3.EntityTypes;
|
||||
import net.minecraft.server.v1_8_R3.IBlockData;
|
||||
import net.minecraft.server.v1_8_R3.IBlockState;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftKey;
|
||||
import net.minecraft.server.v1_8_R3.RegistryBlocks;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings({"unused", "Duplicates"}) // We use reflection to load this handler on 1.8 versions
|
||||
public class NmsHandler extends VersionedHandler {
|
||||
|
||||
/**
|
||||
* Static reference to the block registry. Don't really care about the fact that
|
||||
* it is being stored as a reference here, but for imports reasons, it's smaller
|
||||
* line length makes it optimal to read for method usages.
|
||||
*/
|
||||
private static final RegistryBlocks<MinecraftKey, net.minecraft.server.v1_8_R3.Block> BLOCK_REGISTRY = net.minecraft.server.v1_8_R3.Block.REGISTRY;
|
||||
/**
|
||||
* We can keep track of block state id's by generating them on demand, i.e., when
|
||||
* they're being requested from Blocks, or BlockDatas.
|
||||
*/
|
||||
private static final RegistryBlocks<MinecraftKey, IBlockData> BLOCK_STATE_REGISTRY = new RegistryBlocks<>(BLOCK_REGISTRY.c(Blocks.AIR)); // Default to AIR
|
||||
|
||||
NmsHandler(mcMMO plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Block block) {
|
||||
// We have to get the underlying nms block by the block, which might as well just be the type id.
|
||||
final net.minecraft.server.v1_8_R3.Block block1 = CraftMagicNumbers.getBlock(block);
|
||||
// The registry.c(T) will return MinecraftKey, and the toString() returns the "$mod:$name", so "minecraft:stone"
|
||||
final MinecraftKey key = BLOCK_REGISTRY.c(block1);
|
||||
return key.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(Entity entity) {
|
||||
// EntityTypes maintains the maps of Class<? extends nms.Entity> to String for id's and to numerical id numbers.
|
||||
// We of course are using the method that gets us the String id of the entity, such as "minecraft:creeper"
|
||||
return EntityTypes.b(((CraftEntity) entity).getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdFor(BlockState block) {
|
||||
// Much like #getIdFor(Block) except here we have the "state" by numerical id. So.. we have to grab it from
|
||||
// the world.
|
||||
final net.minecraft.server.v1_8_R3.Block nmsBlock = net.minecraft.server.v1_8_R3.Block.REGISTRY.a(block.getTypeId());
|
||||
final MinecraftKey blockKey = net.minecraft.server.v1_8_R3.Block.REGISTRY.c(nmsBlock);
|
||||
final IBlockData blockState = nmsBlock.fromLegacyData(block.getRawData());
|
||||
// Now we can check if our blockstate registry actually has the block state.
|
||||
final MinecraftKey stateKey = BLOCK_STATE_REGISTRY.c(blockState);
|
||||
if (stateKey != null) { // If the state has been registered by the handler, then by all means.
|
||||
return stateKey.toString();
|
||||
}
|
||||
// If not, well, it needs to have a key generated and registered.
|
||||
final String nameSpace = blockKey.a();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(blockKey.a()); // We only want to get the block id, not the domain id, since that's going to be appended later
|
||||
|
||||
// Get the full Property -> Value mapping for the block state
|
||||
final ImmutableMap<IBlockState, Comparable> properties = blockState.b();
|
||||
if (!properties.isEmpty()) {
|
||||
builder.append('[');
|
||||
Joiner joiner = Joiner.on(',');
|
||||
List<String> propertyValues = new ArrayList<>();
|
||||
for (Map.Entry<IBlockState, Comparable> entry : properties.entrySet()) {
|
||||
// a() gets the inputted "name" for the state, the value, well, that gets the value, which is always toStringable.
|
||||
propertyValues.add(entry.getKey().a() + "=" + entry.getValue());
|
||||
}
|
||||
builder.append(joiner.join(propertyValues));
|
||||
builder.append(']');
|
||||
}
|
||||
// Now we can make the MinecraftKey...
|
||||
final MinecraftKey newKey = new MinecraftKey(builder.toString());
|
||||
BLOCK_STATE_REGISTRY.a(newKey, blockState);
|
||||
return newKey.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.gmail.nossr50.platform.bukkit;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock;
|
||||
|
||||
public class Testing18 {
|
||||
|
||||
Material material;
|
||||
|
||||
CraftBlock block;
|
||||
|
||||
}
|
||||
77
bukkit/build.gradle.kts
Normal file
77
bukkit/build.gradle.kts
Normal file
@@ -0,0 +1,77 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import Config.Libs.Bukkit as Bukkit
|
||||
// Config is located in <root>/buildSrc/src/main/java/Config.kt
|
||||
// It provides a bunch of constant values we use as dependency
|
||||
// strings, so we don't have to duplicate a bunch of them in
|
||||
// various scripts. The import as allows for shorthand.
|
||||
|
||||
val bukkit: Project = Projects.bukkit!! // Static project references
|
||||
val core: Project = Projects.core!! // Stored by Config.kt and created in <root>/build.gradle.kts
|
||||
|
||||
/* This configures ":bukkit" and it's dependent projects:
|
||||
- ":bukkit:1_8_8"
|
||||
- ":bukkit:1_12"
|
||||
- ":bukkit:1_13"
|
||||
Basically sets up all projects to depend on ":core" and
|
||||
bstats-bukkit. Also sets up shadow to relocate bukkit related
|
||||
packages to limit platform interference
|
||||
*/
|
||||
allprojects {
|
||||
|
||||
dependencies {
|
||||
compile(core) // includes junit for tests
|
||||
implementation(Bukkit.bstats) // Bukkit bstats
|
||||
}
|
||||
|
||||
// TODO dunno if this works yet... project needs to compile.
|
||||
val shadowJar by tasks.getting(ShadowJar::class) {
|
||||
// Relocate bstats for bukkit, as per requirement for bstats
|
||||
relocate(Shadow.Origin.bstatsBukkit, Shadow.Target.bstatsBukkit)
|
||||
// Relocate the bukkit platform classes of mcmmo so we don't
|
||||
// interfere with other platform classes (or core)
|
||||
relocate(Deps.Groups.nossr, "${Deps.Groups.nossr}.bukkit") {
|
||||
exclude("${Deps.Groups.nossr}.core")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tells all subprojects of ":bukkit" (":bukkit:1_8_8", ":bukkit:1_12",etc.)
|
||||
// to depend on this project (":bukkit") to inherit the dependencies, and
|
||||
// does NOT inherit the same configurations (anything configured outside
|
||||
// here does not persist to child projects).
|
||||
subprojects {
|
||||
dependencies {
|
||||
// Provide the base bukkit plugin dependency for plugin classloading.
|
||||
// All "versioned" implementations will be properly classloaded by the bukkit parent
|
||||
compileOnly(bukkit)
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
`java-library` // This is already provided, but for static compilation,
|
||||
// we declare it here so we can use the IDE static type references
|
||||
}
|
||||
dependencies {
|
||||
// Temporary dependencies while things are being moved.
|
||||
compileOnly(Bukkit.`1_13`.spigotApi) { // Spigot API for generic usage. Based on 1.13.2
|
||||
isTransitive = true // We don't want the dependencies
|
||||
}
|
||||
compileOnly(Bukkit.`1_13`.api) { // Bukkit API for generic usage. Based on 1.13.2
|
||||
isTransitive = true // We don't want the dependencies
|
||||
|
||||
}
|
||||
compileOnly(Bukkit.`1_13`.wgCore) { // WorldGuard dependency, again, for 1.13.2
|
||||
isTransitive = true // We don't want the dependencies
|
||||
exclude(group = Shadow.Exclude.sk89q)
|
||||
exclude(group = Shadow.Exclude.intake, module = "intake")
|
||||
exclude(group = Shadow.Exclude.sk89q, module = "squirrelid")
|
||||
exclude(group = Shadow.Exclude.flyway)
|
||||
exclude(group = Shadow.Exclude.khelekore)
|
||||
exclude(group = Shadow.Exclude.findbugs)
|
||||
}
|
||||
compileOnly(Bukkit.`1_13`.wgLegacy) {
|
||||
isTransitive = true // We don't want the dependencies
|
||||
exclude(group = Shadow.Exclude.bukkit)
|
||||
exclude(group = Shadow.Exclude.sk89q, module = "commandbook")
|
||||
exclude(group = Shadow.Exclude.bstats)
|
||||
}
|
||||
}
|
||||
12
bukkit/src/main/java/com/gmail/nossr50/BukkitBlockType.java
Normal file
12
bukkit/src/main/java/com/gmail/nossr50/BukkitBlockType.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.gmail.nossr50;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
public class BukkitBlockType {
|
||||
|
||||
private Material material;
|
||||
|
||||
private BlockData blockData;
|
||||
|
||||
}
|
||||
74
bukkit/src/main/java/com/gmail/nossr50/VersionedHandler.java
Normal file
74
bukkit/src/main/java/com/gmail/nossr50/VersionedHandler.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package com.gmail.nossr50;
|
||||
|
||||
import com.sk89q.worldedit.extension.platform.NoCapablePlatformException;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public abstract class VersionedHandler {
|
||||
private static VersionedHandler instance;
|
||||
|
||||
private final mcMMO plugin;
|
||||
|
||||
protected VersionedHandler(mcMMO plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string value id of the BlockType, note that this is not the
|
||||
* blockstate.
|
||||
*
|
||||
* Examples include: "minecraft:stone", "minecraft:chest", "thaumcraft:log2"
|
||||
* BlockStates are more specific like "minecraft:log[variant=oak,axis=x]"
|
||||
*
|
||||
* This should be casting down and retrieving the id from the block registry maintained by vanilla.
|
||||
*
|
||||
* @param block The block instance (holds byte/numerical id or sometimes block state in newer versions)
|
||||
* @return The string id of the block type
|
||||
*/
|
||||
public abstract String getIdFor(Block block);
|
||||
|
||||
/**
|
||||
* Gets the string value id of the Entity, much like blocks, this is not
|
||||
* the full string representation of the entity, just the string id of the
|
||||
* TYPE.
|
||||
*
|
||||
* Examples include: "minecraft:creeeper", "minecraft:sheep", "thaumcraft:wisp"
|
||||
*
|
||||
* @param entity The entity instance
|
||||
* @return The string id of the entity's registered type.
|
||||
*/
|
||||
public abstract String getIdFor(Entity entity);
|
||||
|
||||
// Technically can be TileEntity snapshot references as well.
|
||||
public abstract String getIdFor(BlockState block);
|
||||
|
||||
/**
|
||||
* Gets the {@link VersionedHandler} instance for this running platform.
|
||||
* Note that all the handler does is perform various operations necessitated
|
||||
* by either a lack of, or bridging an implementation of some API/core aspects
|
||||
* that are not available through Bukkit API (like getting BlockType id's, or
|
||||
* BlockState id's).
|
||||
*
|
||||
* @param plugin The mcmmo plugin
|
||||
* @return The version handler instance
|
||||
*/
|
||||
public VersionedHandler getInstance(mcMMO plugin) {
|
||||
if (instance == null) {
|
||||
final String serverPackage = mcMMO.p.getServer().getClass().getPackage().getName();
|
||||
final String serverVersion = serverPackage.substring(serverPackage.lastIndexOf(".") + 1);
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("com.gmail.nossr50.bukkit." + serverVersion + ".NmsHandler");
|
||||
if (VersionedHandler.class.isAssignableFrom(clazz)) {
|
||||
instance = (VersionedHandler) clazz.getConstructor(mcMMO.class).newInstance(plugin);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new NoCapablePlatformException("Could not discover a valid mcMMO VersionedHandler for version:" + serverVersion);
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager;
|
||||
import com.gmail.nossr50.core.data.database.SQLDatabaseManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MHDCommand implements TabExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (mcMMO.getDatabaseManager() instanceof SQLDatabaseManager) {
|
||||
SQLDatabaseManager m = (SQLDatabaseManager) mcMMO.getDatabaseManager();
|
||||
m.resetMobHealthSettings();
|
||||
for (McMMOPlayer player : UserManager.getPlayers()) {
|
||||
player.getProfile().setMobHealthbarType(MainConfig.getInstance().getMobHealthbarDefault());
|
||||
}
|
||||
sender.sendMessage("Mob health reset");
|
||||
return true;
|
||||
}
|
||||
if (mcMMO.getDatabaseManager() instanceof FlatfileDatabaseManager) {
|
||||
FlatfileDatabaseManager m = (FlatfileDatabaseManager) mcMMO.getDatabaseManager();
|
||||
m.resetMobHealthSettings();
|
||||
for (McMMOPlayer player : UserManager.getPlayers()) {
|
||||
player.getProfile().setMobHealthbarType(MainConfig.getInstance().getMobHealthbarDefault());
|
||||
}
|
||||
sender.sendMessage("Mob health reset");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.skills.ModConfigType;
|
||||
import com.gmail.nossr50.core.util.Misc;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class McImportCommand implements CommandExecutor {
|
||||
int fileAmount;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
importModConfig();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean importModConfig() {
|
||||
String importFilePath = mcMMO.getModDirectory() + File.separator + "import";
|
||||
File importFile = new File(importFilePath, "import.log");
|
||||
mcMMO.p.getLogger().info("Starting import of mod materials...");
|
||||
fileAmount = 0;
|
||||
|
||||
HashMap<ModConfigType, ArrayList<String>> materialNames = new HashMap<ModConfigType, ArrayList<String>>();
|
||||
|
||||
BufferedReader in = null;
|
||||
|
||||
try {
|
||||
// Open the file
|
||||
in = new BufferedReader(new FileReader(importFile));
|
||||
|
||||
String line;
|
||||
String materialName;
|
||||
String modName;
|
||||
|
||||
// While not at the end of the file
|
||||
while ((line = in.readLine()) != null) {
|
||||
String[] split1 = line.split("material ");
|
||||
|
||||
if (split1.length != 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] split2 = split1[1].split(" with");
|
||||
|
||||
if (split2.length != 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
materialName = split2[0];
|
||||
|
||||
// Categorise each material under a mod config type
|
||||
ModConfigType type = ModConfigType.getModConfigType(materialName);
|
||||
|
||||
if (!materialNames.containsKey(type)) {
|
||||
materialNames.put(type, new ArrayList<String>());
|
||||
}
|
||||
|
||||
materialNames.get(type).add(materialName);
|
||||
continue;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)");
|
||||
mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log");
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} finally {
|
||||
tryClose(in);
|
||||
}
|
||||
|
||||
createOutput(materialNames);
|
||||
|
||||
mcMMO.p.getLogger().info("Import finished! Created " + fileAmount + " files!");
|
||||
return true;
|
||||
}
|
||||
|
||||
private void createOutput(HashMap<ModConfigType, ArrayList<String>> materialNames) {
|
||||
for (ModConfigType modConfigType : materialNames.keySet()) {
|
||||
HashMap<String, ArrayList<String>> materialNamesType = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
for (String materialName : materialNames.get(modConfigType)) {
|
||||
String modName = Misc.getModName(materialName);
|
||||
|
||||
if (!materialNamesType.containsKey(modName)) {
|
||||
materialNamesType.put(modName, new ArrayList<String>());
|
||||
}
|
||||
|
||||
materialNamesType.get(modName).add(materialName);
|
||||
}
|
||||
|
||||
createOutput(modConfigType, materialNamesType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void tryClose(Closeable c) {
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
c.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void createOutput(ModConfigType modConfigType, HashMap<String, ArrayList<String>> materialNames) {
|
||||
File outputFilePath = new File(mcMMO.getModDirectory() + File.separator + "output");
|
||||
if (!outputFilePath.exists() && !outputFilePath.mkdirs()) {
|
||||
mcMMO.p.getLogger().severe("Could not create output directory! " + outputFilePath.getAbsolutePath());
|
||||
}
|
||||
|
||||
FileWriter out = null;
|
||||
String type = modConfigType.name().toLowerCase();
|
||||
|
||||
for (String modName : materialNames.keySet()) {
|
||||
File outputFile = new File(outputFilePath, modName + "." + type + ".yml");
|
||||
mcMMO.p.getLogger().info("Creating " + outputFile.getName());
|
||||
try {
|
||||
if (outputFile.exists() && !outputFile.delete()) {
|
||||
mcMMO.p.getLogger().severe("Not able to delete old output file! " + outputFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
if (!outputFile.createNewFile()) {
|
||||
mcMMO.p.getLogger().severe("Could not create output file! " + outputFile.getAbsolutePath());
|
||||
continue;
|
||||
}
|
||||
|
||||
StringBuilder writer = new StringBuilder();
|
||||
HashMap<String, ArrayList<String>> configSections = getConfigSections(modConfigType, modName, materialNames);
|
||||
|
||||
if (configSections == null) {
|
||||
mcMMO.p.getLogger().severe("Something went wrong!! type is " + type);
|
||||
return;
|
||||
}
|
||||
|
||||
// Write the file, go through each skill and write all the materials
|
||||
for (String configSection : configSections.keySet()) {
|
||||
if (configSection.equals("UNIDENTIFIED")) {
|
||||
writer.append("# This isn't a valid config section and all materials in this category need to be").append("\r\n");
|
||||
writer.append("# copy and pasted to a valid section of this config file.").append("\r\n");
|
||||
}
|
||||
writer.append(configSection).append(":").append("\r\n");
|
||||
|
||||
for (String line : configSections.get(configSection)) {
|
||||
writer.append(line).append("\r\n");
|
||||
}
|
||||
|
||||
writer.append("\r\n");
|
||||
}
|
||||
|
||||
out = new FileWriter(outputFile);
|
||||
out.write(writer.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
} finally {
|
||||
tryClose(out);
|
||||
fileAmount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<String, ArrayList<String>> getConfigSections(ModConfigType type, String modName, HashMap<String, ArrayList<String>> materialNames) {
|
||||
switch (type) {
|
||||
case BLOCKS:
|
||||
return getConfigSectionsBlocks(modName, materialNames);
|
||||
case TOOLS:
|
||||
return getConfigSectionsTools(modName, materialNames);
|
||||
case ARMOR:
|
||||
return getConfigSectionsArmor(modName, materialNames);
|
||||
case UNKNOWN:
|
||||
return getConfigSectionsUnknown(modName, materialNames);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private HashMap<String, ArrayList<String>> getConfigSectionsBlocks(String modName, HashMap<String, ArrayList<String>> materialNames) {
|
||||
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
// Go through all the materials and categorise them under a skill
|
||||
for (String materialName : materialNames.get(modName)) {
|
||||
String skillName = "UNIDENTIFIED";
|
||||
if (materialName.contains("ORE")) {
|
||||
skillName = "Mining";
|
||||
} else if (materialName.contains("LOG") || materialName.contains("LEAVES")) {
|
||||
skillName = "Woodcutting";
|
||||
} else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) {
|
||||
skillName = "Herbalism";
|
||||
} else if (materialName.contains("DIRT") || materialName.contains("SAND")) {
|
||||
skillName = "Excavation";
|
||||
}
|
||||
|
||||
if (!configSections.containsKey(skillName)) {
|
||||
configSections.put(skillName, new ArrayList<String>());
|
||||
}
|
||||
|
||||
ArrayList<String> skillContents = configSections.get(skillName);
|
||||
skillContents.add(" " + materialName + "|0:");
|
||||
skillContents.add(" " + " " + "XP_Gain: 99");
|
||||
skillContents.add(" " + " " + "Double_Drops_Enabled: true");
|
||||
|
||||
if (skillName.equals("Mining")) {
|
||||
skillContents.add(" " + " " + "Smelting_XP_Gain: 9");
|
||||
} else if (skillName.equals("Woodcutting")) {
|
||||
skillContents.add(" " + " " + "Is_Log: " + materialName.contains("LOG"));
|
||||
}
|
||||
}
|
||||
|
||||
return configSections;
|
||||
}
|
||||
|
||||
private HashMap<String, ArrayList<String>> getConfigSectionsTools(String modName, HashMap<String, ArrayList<String>> materialNames) {
|
||||
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
// Go through all the materials and categorise them under a tool type
|
||||
for (String materialName : materialNames.get(modName)) {
|
||||
String toolType = "UNIDENTIFIED";
|
||||
if (materialName.contains("PICKAXE")) {
|
||||
toolType = "Pickaxes";
|
||||
} else if (materialName.contains("AXE")) {
|
||||
toolType = "Axes";
|
||||
} else if (materialName.contains("BOW")) {
|
||||
toolType = "Bows";
|
||||
} else if (materialName.contains("HOE")) {
|
||||
toolType = "Hoes";
|
||||
} else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) {
|
||||
toolType = "Shovels";
|
||||
} else if (materialName.contains("SWORD")) {
|
||||
toolType = "Swords";
|
||||
}
|
||||
|
||||
if (!configSections.containsKey(toolType)) {
|
||||
configSections.put(toolType, new ArrayList<String>());
|
||||
}
|
||||
|
||||
ArrayList<String> skillContents = configSections.get(toolType);
|
||||
skillContents.add(" " + materialName + ":");
|
||||
skillContents.add(" " + " " + "XP_Modifier: 1.0");
|
||||
skillContents.add(" " + " " + "Tier: 1");
|
||||
skillContents.add(" " + " " + "Ability_Enabled: true");
|
||||
addRepairableLines(materialName, skillContents);
|
||||
}
|
||||
|
||||
return configSections;
|
||||
}
|
||||
|
||||
private HashMap<String, ArrayList<String>> getConfigSectionsArmor(String modName, HashMap<String, ArrayList<String>> materialNames) {
|
||||
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
// Go through all the materials and categorise them under an armor type
|
||||
for (String materialName : materialNames.get(modName)) {
|
||||
String toolType = "UNIDENTIFIED";
|
||||
if (materialName.contains("BOOT") || materialName.contains("SHOE")) {
|
||||
toolType = "Boots";
|
||||
} else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) {
|
||||
toolType = "Chestplates";
|
||||
} else if (materialName.contains("HELM") || materialName.contains("HAT")) {
|
||||
toolType = "Helmets";
|
||||
} else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) {
|
||||
toolType = "Leggings";
|
||||
}
|
||||
|
||||
if (!configSections.containsKey(toolType)) {
|
||||
configSections.put(toolType, new ArrayList<String>());
|
||||
}
|
||||
|
||||
ArrayList<String> skillContents = configSections.get(toolType);
|
||||
skillContents.add(" " + materialName + ":");
|
||||
addRepairableLines(materialName, skillContents);
|
||||
}
|
||||
|
||||
return configSections;
|
||||
}
|
||||
|
||||
private void addRepairableLines(String materialName, ArrayList<String> skillContents) {
|
||||
skillContents.add(" " + " " + "Repairable: true");
|
||||
skillContents.add(" " + " " + "Repair_Material: REPAIR_MATERIAL_NAME");
|
||||
skillContents.add(" " + " " + "Repair_Material_Data_Value: 0");
|
||||
skillContents.add(" " + " " + "Repair_Material_Quantity: 9");
|
||||
skillContents.add(" " + " " + "Repair_Material_Pretty_Name: Repair Item Name");
|
||||
skillContents.add(" " + " " + "Repair_MinimumLevel: 0");
|
||||
skillContents.add(" " + " " + "Repair_XpMultiplier: 1.0");
|
||||
|
||||
Material material = Material.matchMaterial(materialName);
|
||||
short durability = (material == null) ? (short) 9999 : material.getMaxDurability();
|
||||
skillContents.add(" " + " " + "Durability: " + ((durability > 0) ? durability : (short) 9999));
|
||||
}
|
||||
|
||||
private HashMap<String, ArrayList<String>> getConfigSectionsUnknown(String modName, HashMap<String, ArrayList<String>> materialNames) {
|
||||
HashMap<String, ArrayList<String>> configSections = new HashMap<String, ArrayList<String>>();
|
||||
|
||||
// Go through all the materials and print them
|
||||
for (String materialName : materialNames.get(modName)) {
|
||||
String configKey = "UNIDENTIFIED";
|
||||
|
||||
if (!configSections.containsKey(configKey)) {
|
||||
configSections.put(configKey, new ArrayList<String>());
|
||||
}
|
||||
|
||||
ArrayList<String> skillContents = configSections.get(configKey);
|
||||
skillContents.add(" " + materialName);
|
||||
}
|
||||
|
||||
return configSections;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class McabilityCommand extends ToggleCommand {
|
||||
@Override
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcabilityOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcability(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Ability." + (mcMMOPlayer.getAbilityUse() ? "Off" : "On")));
|
||||
mcMMOPlayer.toggleAbilityUse();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Ability.Toggle", playerName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
|
||||
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
|
||||
import com.gmail.nossr50.core.data.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.core.datatypes.database.DatabaseType;
|
||||
import com.gmail.nossr50.core.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class McconvertCommand implements TabExecutor {
|
||||
private static final List<String> FORMULA_TYPES;
|
||||
private static final List<String> DATABASE_TYPES;
|
||||
private static final List<String> SUBCOMMANDS = ImmutableList.of("database", "experience");
|
||||
|
||||
static {
|
||||
ArrayList<String> formulaTypes = new ArrayList<String>();
|
||||
ArrayList<String> databaseTypes = new ArrayList<String>();
|
||||
|
||||
for (FormulaType type : FormulaType.values()) {
|
||||
formulaTypes.add(type.toString());
|
||||
}
|
||||
|
||||
for (DatabaseType type : DatabaseType.values()) {
|
||||
databaseTypes.add(type.toString());
|
||||
}
|
||||
|
||||
// Custom stuff
|
||||
databaseTypes.remove(DatabaseType.CUSTOM.toString());
|
||||
|
||||
if (mcMMO.getDatabaseManager().getDatabaseType() == DatabaseType.CUSTOM) {
|
||||
databaseTypes.add(DatabaseManagerFactory.getCustomDatabaseManagerClass().getName());
|
||||
}
|
||||
|
||||
Collections.sort(formulaTypes);
|
||||
Collections.sort(databaseTypes);
|
||||
|
||||
FORMULA_TYPES = ImmutableList.copyOf(formulaTypes);
|
||||
DATABASE_TYPES = ImmutableList.copyOf(databaseTypes);
|
||||
|
||||
}
|
||||
|
||||
private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand();
|
||||
private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
|
||||
return databaseConvertCommand.onCommand(sender, command, label, args);
|
||||
} else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) {
|
||||
return experienceConvertCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], SUBCOMMANDS, new ArrayList<String>(SUBCOMMANDS.size()));
|
||||
case 2:
|
||||
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
|
||||
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<String>(DATABASE_TYPES.size()));
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[0].equalsIgnoreCase("exp")) {
|
||||
return StringUtil.copyPartialMatches(args[0], FORMULA_TYPES, new ArrayList<String>(FORMULA_TYPES.size()));
|
||||
}
|
||||
|
||||
return ImmutableList.of();
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class McgodCommand extends ToggleCommand {
|
||||
@Override
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcgodOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcgod(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
|
||||
mcMMOPlayer.toggleGodMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Toggle", playerName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class McmmoCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.mcmmoDescription(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
String description = LocaleLoader.getString("mcMMO.Description");
|
||||
String[] mcSplit = description.split(",");
|
||||
sender.sendMessage(mcSplit);
|
||||
|
||||
if (MainConfig.getInstance().getDonateMessageEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
|
||||
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "com.gmail.nossr50@com.gmail.com" + ChatColor.GOLD + " Paypal");
|
||||
}
|
||||
|
||||
if (Permissions.showversion(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
|
||||
}
|
||||
|
||||
mcMMO.getHolidayManager().anniversaryCheck(sender);
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("commands")) {
|
||||
if (!Permissions.mcmmoHelp(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcc.Header"));
|
||||
displayGeneralCommands(sender);
|
||||
displayOtherCommands(sender);
|
||||
displayPartyCommands(sender);
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void displayGeneralCommands(CommandSender sender) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mcstats " + LocaleLoader.getString("Commands.Stats"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /<skill>" + LocaleLoader.getString("Commands.SkillInfo"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mctop " + LocaleLoader.getString("Commands.Leaderboards"));
|
||||
|
||||
if (Permissions.inspect(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /inspect " + LocaleLoader.getString("Commands.Inspect"));
|
||||
}
|
||||
|
||||
if (Permissions.mcability(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayOtherCommands(CommandSender sender) {
|
||||
//Don't show them this category if they have none of the permissions
|
||||
if (!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender))
|
||||
return;
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Other"));
|
||||
|
||||
if (Permissions.skillreset(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
||||
}
|
||||
|
||||
if (Permissions.mmoedit(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
|
||||
}
|
||||
|
||||
if (Permissions.adminChat(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /adminchat " + LocaleLoader.getString("Commands.AdminToggle"));
|
||||
}
|
||||
|
||||
if (Permissions.mcgod(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mcgod " + LocaleLoader.getString("Commands.mcgod"));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayPartyCommands(CommandSender sender) {
|
||||
if (Permissions.party(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party quit " + LocaleLoader.getString("Commands.Party.Quit"));
|
||||
|
||||
if (Permissions.partyChat(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party chat " + LocaleLoader.getString("Commands.Party.Toggle"));
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party accept " + LocaleLoader.getString("Commands.Party.Accept"));
|
||||
|
||||
if (Permissions.partySubcommand(sender, PartySubcommandType.TELEPORT)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /party teleport <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Teleport"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class McnotifyCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
|
||||
mcMMOPlayer.toggleChatNotifications();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class McrefreshCommand extends ToggleCommand {
|
||||
@Override
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcrefreshOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcrefresh(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.setRecentlyHurt(0);
|
||||
mcMMOPlayer.resetCooldowns();
|
||||
mcMMOPlayer.resetToolPrepMode();
|
||||
mcMMOPlayer.resetAbilityMode();
|
||||
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", playerName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class McscoreboardCommand implements TabExecutor {
|
||||
private static final List<String> FIRST_ARGS = ImmutableList.of("keep", "time", "clear");
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("clear") || args[0].equalsIgnoreCase("reset")) {
|
||||
ScoreboardManager.clearBoard(sender.getName());
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Clear"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("keep")) {
|
||||
if (!MainConfig.getInstance().getAllowKeepBoard() || !MainConfig.getInstance().getScoreboardsEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!ScoreboardManager.isBoardShown(sender.getName())) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.NoBoard"));
|
||||
return true;
|
||||
}
|
||||
|
||||
ScoreboardManager.keepBoard(sender.getName());
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Keep"));
|
||||
return true;
|
||||
}
|
||||
|
||||
return help(sender);
|
||||
|
||||
case 2:
|
||||
if (args[0].equalsIgnoreCase("time") || args[0].equalsIgnoreCase("timer")) {
|
||||
if (CommandUtils.isInvalidInteger(sender, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int time = Math.abs(Integer.parseInt(args[1]));
|
||||
|
||||
ScoreboardManager.setRevertTimer(sender.getName(), time);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Timer", time));
|
||||
return true;
|
||||
}
|
||||
|
||||
return help(sender);
|
||||
|
||||
default:
|
||||
return help(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], FIRST_ARGS, new ArrayList<String>(FIRST_ARGS.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean help(CommandSender sender) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Help.0"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Help.1"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Help.2"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Help.3"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ToggleCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!hasSelfPermission(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
applyCommandAction(UserManager.getPlayer(sender.getName()));
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!hasOtherPermission(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.isOffline(sender, mcMMOPlayer.getPlayer())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
applyCommandAction(mcMMOPlayer);
|
||||
sendSuccessMessage(sender, playerName);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean hasOtherPermission(CommandSender sender);
|
||||
|
||||
protected abstract boolean hasSelfPermission(CommandSender sender);
|
||||
|
||||
protected abstract void applyCommandAction(McMMOPlayer mcMMOPlayer);
|
||||
|
||||
protected abstract void sendSuccessMessage(CommandSender sender, String playerName);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class XprateCommand implements TabExecutor {
|
||||
private final double ORIGINAL_XP_RATE = ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Permissions.xprateReset(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMO.p.isXPEventEnabled()) {
|
||||
|
||||
if (AdvancedConfig.getInstance().useTitlesForXPEvent()) {
|
||||
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
|
||||
LocaleLoader.getString("Commands.Event.Stop"),
|
||||
LocaleLoader.getString("Commands.Event.Stop.Subtitle"),
|
||||
10, 10 * 20, 20);
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop"));
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop.Subtitle"));
|
||||
|
||||
mcMMO.p.toggleXpEventEnabled();
|
||||
}
|
||||
|
||||
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(ORIGINAL_XP_RATE);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (CommandUtils.isInvalidInteger(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.xprateSet(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldDisableToggle(args[1])) {
|
||||
mcMMO.p.setXPEventEnabled(false);
|
||||
} else if (CommandUtils.shouldEnableToggle(args[1])) {
|
||||
mcMMO.p.setXPEventEnabled(true);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
int newXpRate = Integer.parseInt(args[0]);
|
||||
|
||||
if (newXpRate < 0) {
|
||||
sender.sendMessage(ChatColor.RED + LocaleLoader.getString("Commands.NegativeNumberWarn"));
|
||||
return true;
|
||||
}
|
||||
|
||||
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
|
||||
|
||||
if (mcMMO.p.isXPEventEnabled()) {
|
||||
if (AdvancedConfig.getInstance().useTitlesForXPEvent()) {
|
||||
NotificationManager.broadcastTitle(mcMMO.p.getServer(),
|
||||
LocaleLoader.getString("Commands.Event.Start"),
|
||||
LocaleLoader.getString("Commands.Event.XP", newXpRate),
|
||||
10, 10 * 20, 20);
|
||||
}
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start"));
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate));
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (StringUtils.isInt(args[0])) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
return StringUtil.copyPartialMatches(args[0], CommandUtils.RESET_OPTIONS, new ArrayList<String>(CommandUtils.RESET_OPTIONS.size()));
|
||||
case 2:
|
||||
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.chat.ChatMode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class AdminChatCommand extends ChatCommand {
|
||||
public AdminChatCommand() {
|
||||
super(ChatMode.ADMIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleChatSending(CommandSender sender, String[] args) {
|
||||
chatManager.handleChat(sender.getName(), getDisplayName(sender), buildChatMessage(args, 0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
import com.gmail.nossr50.core.chat.ChatManager;
|
||||
import com.gmail.nossr50.core.chat.ChatManagerFactory;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ChatCommand implements TabExecutor {
|
||||
protected ChatManager chatManager;
|
||||
private ChatMode chatMode;
|
||||
|
||||
public ChatCommand(ChatMode chatMode) {
|
||||
this.chatMode = chatMode;
|
||||
this.chatManager = ChatManagerFactory.getChatManager(mcMMO.p, chatMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
McMMOPlayer mcMMOPlayer;
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
|
||||
if (mcMMOPlayer.isChatEnabled(chatMode)) {
|
||||
disableChatMode(mcMMOPlayer, sender);
|
||||
} else {
|
||||
enableChatMode(mcMMOPlayer, sender);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldEnableToggle(args[0])) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
enableChatMode(UserManager.getPlayer(sender.getName()), sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldDisableToggle(args[0])) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
disableChatMode(UserManager.getPlayer(sender.getName()), sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Fallthrough
|
||||
|
||||
default:
|
||||
handleChatSending(sender, args);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected String buildChatMessage(String[] args, int index) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(args[index]);
|
||||
|
||||
for (int i = index + 1; i < args.length; i++) {
|
||||
builder.append(" ");
|
||||
builder.append(args[i]);
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
protected String getDisplayName(CommandSender sender) {
|
||||
return (sender instanceof Player) ? ((Player) sender).getDisplayName() : LocaleLoader.getString("Commands.Chat.Console");
|
||||
}
|
||||
|
||||
protected abstract void handleChatSending(CommandSender sender, String[] args);
|
||||
|
||||
private void enableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
|
||||
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMOPlayer.enableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getEnabledMessage());
|
||||
}
|
||||
|
||||
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
|
||||
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMOPlayer.disableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getDisabledMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
import com.gmail.nossr50.commands.ToggleCommand;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class McChatSpy extends ToggleCommand {
|
||||
@Override
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.adminChatSpyOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.adminChatSpy(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.AdminChatSpy." + (mcMMOPlayer.isPartyChatSpying() ? "Disabled" : "Enabled")));
|
||||
mcMMOPlayer.togglePartyChatSpying();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Toggle", playerName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
import com.gmail.nossr50.core.chat.PartyChatManager;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyChatCommand extends ChatCommand {
|
||||
public PartyChatCommand() {
|
||||
super(ChatMode.PARTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleChatSending(CommandSender sender, String[] args) {
|
||||
Party party;
|
||||
String message;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (party == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
|
||||
return;
|
||||
}
|
||||
|
||||
message = buildChatMessage(args, 0);
|
||||
} else {
|
||||
if (args.length < 2) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Specify"));
|
||||
return;
|
||||
}
|
||||
|
||||
party = PartyManager.getParty(args[0]);
|
||||
|
||||
if (party == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.InvalidName"));
|
||||
return;
|
||||
}
|
||||
|
||||
message = buildChatMessage(args, 1);
|
||||
}
|
||||
|
||||
((PartyChatManager) chatManager).setParty(party);
|
||||
chatManager.handleChat(sender.getName(), getDisplayName(sender), message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.data.database.DatabaseManager;
|
||||
import com.gmail.nossr50.core.data.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.core.datatypes.database.DatabaseType;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.runnables.database.DatabaseConversionTask;
|
||||
import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ConvertDatabaseCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
DatabaseType previousType = DatabaseType.getDatabaseType(args[1]);
|
||||
DatabaseType newType = mcMMO.getDatabaseManager().getDatabaseType();
|
||||
|
||||
if (previousType == newType || (newType == DatabaseType.CUSTOM && DatabaseManagerFactory.getCustomDatabaseManagerClass().getSimpleName().equalsIgnoreCase(args[1]))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Same", newType.toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
DatabaseManager oldDatabase = DatabaseManagerFactory.createDatabaseManager(previousType);
|
||||
|
||||
if (previousType == DatabaseType.CUSTOM) {
|
||||
Class<?> clazz;
|
||||
|
||||
try {
|
||||
clazz = Class.forName(args[1]);
|
||||
|
||||
if (!DatabaseManager.class.isAssignableFrom(clazz)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1]));
|
||||
return true;
|
||||
}
|
||||
|
||||
oldDatabase = DatabaseManagerFactory.createCustomDatabaseManager((Class<? extends DatabaseManager>) clazz);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1]));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString()));
|
||||
|
||||
UserManager.saveAll();
|
||||
UserManager.clearAll();
|
||||
|
||||
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
PlayerProfile profile = oldDatabase.loadPlayerProfile(player.getUniqueId());
|
||||
|
||||
if (profile.isLoaded()) {
|
||||
mcMMO.getDatabaseManager().saveUser(profile);
|
||||
}
|
||||
|
||||
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
|
||||
}
|
||||
|
||||
new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class McpurgeCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
mcMMO.getDatabaseManager().purgePowerlessUsers();
|
||||
|
||||
if (MainConfig.getInstance().getOldUsersCutoff() != -1) {
|
||||
mcMMO.getDatabaseManager().purgeOldUsers();
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class McremoveCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
|
||||
if (UserManager.getOfflinePlayer(playerName) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMO.getDatabaseManager().removeUser(playerName)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", playerName));
|
||||
} else {
|
||||
sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen.
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MmoshowdbCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Class<?> clazz = DatabaseManagerFactory.getCustomDatabaseManagerClass();
|
||||
|
||||
if (clazz != null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", clazz.getName()));
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoshowdb", (MainConfig.getInstance().getUseMySQL() ? "sql" : "flatfile")));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.EventUtils;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AddlevelsCommand extends ExperienceCommand {
|
||||
@Override
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.addlevels(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.addlevelsOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
|
||||
float xpRemoved = profile.getSkillXpLevelRaw(skill);
|
||||
profile.addLevels(skill, value);
|
||||
|
||||
if (player == null) {
|
||||
profile.scheduleAsyncSave();
|
||||
return;
|
||||
}
|
||||
|
||||
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageAll(Player player, int value) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", value));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getName()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AddxpCommand extends ExperienceCommand {
|
||||
@Override
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.addxp(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.addxpOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
|
||||
if (player != null) {
|
||||
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND);
|
||||
} else {
|
||||
profile.addXp(skill, value);
|
||||
profile.scheduleAsyncSave();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageAll(Player player, int value) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", value));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getName()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.runnables.database.FormulaConversionTask;
|
||||
import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ConvertExperienceCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
|
||||
FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase());
|
||||
|
||||
if (newType == FormulaType.UNKNOWN) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (previousType == newType) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Same", newType.toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Start", previousType.toString(), newType.toString()));
|
||||
|
||||
UserManager.saveAll();
|
||||
UserManager.clearAll();
|
||||
|
||||
new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);
|
||||
|
||||
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
new PlayerProfileLoadingTask(player).runTaskLaterAsynchronously(mcMMO.p, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class ExperienceCommand implements TabExecutor {
|
||||
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PrimarySkillType skill;
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!permissionsCheckSelf(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!validateArguments(sender, args[0], args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
skill = PrimarySkillType.getSkill(args[0]);
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
}
|
||||
|
||||
if (skill != null && skill.isChildSkill()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
|
||||
return true;
|
||||
}
|
||||
|
||||
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (!permissionsCheckOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!validateArguments(sender, args[1], args[2])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
skill = PrimarySkillType.getSkill(args[1]);
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
}
|
||||
|
||||
if (skill != null && skill.isChildSkill()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill"));
|
||||
return true;
|
||||
}
|
||||
|
||||
int value = Integer.parseInt(args[2]);
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
UUID uuid = null;
|
||||
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(playerName);
|
||||
if (player != null) {
|
||||
uuid = player.getUniqueId();
|
||||
}
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
|
||||
|
||||
if (CommandUtils.unloadedProfile(sender, profile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
editValues(null, profile, skill, value);
|
||||
} else {
|
||||
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value);
|
||||
}
|
||||
|
||||
handleSenderMessage(sender, playerName, skill);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
case 2:
|
||||
return StringUtil.copyPartialMatches(args[1], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean permissionsCheckSelf(CommandSender sender);
|
||||
|
||||
protected abstract boolean permissionsCheckOthers(CommandSender sender);
|
||||
|
||||
protected abstract void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value);
|
||||
|
||||
protected abstract void handlePlayerMessageAll(Player player, int value);
|
||||
|
||||
protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill);
|
||||
|
||||
private boolean validateArguments(CommandSender sender, String skillName, String value) {
|
||||
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName)));
|
||||
}
|
||||
|
||||
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
handleCommand(player, profile, primarySkillType, value);
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageAll(player, value);
|
||||
}
|
||||
} else {
|
||||
handleCommand(player, profile, skill, value);
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageSkill(player, value, skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.EventUtils;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class MmoeditCommand extends ExperienceCommand {
|
||||
@Override
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.mmoedit(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.mmoeditOthers(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
|
||||
int skillLevel = profile.getSkillLevel(skill);
|
||||
float xpRemoved = profile.getSkillXpLevelRaw(skill);
|
||||
|
||||
profile.modifySkill(skill, value);
|
||||
|
||||
if (player == null) {
|
||||
profile.scheduleAsyncSave();
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == skillLevel) {
|
||||
return;
|
||||
}
|
||||
|
||||
EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageAll(Player player, int value) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.AllSkills.1", value));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getName(), value));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.EventUtils;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This class mirrors the structure of ExperienceCommand, except the
|
||||
* value/quantity argument is removed.
|
||||
*/
|
||||
public class SkillresetCommand implements TabExecutor {
|
||||
protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PrimarySkillType skill;
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!permissionsCheckSelf(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!validateArguments(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
} else {
|
||||
skill = PrimarySkillType.getSkill(args[1]);
|
||||
}
|
||||
|
||||
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (!permissionsCheckOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!validateArguments(sender, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
} else {
|
||||
skill = PrimarySkillType.getSkill(args[1]);
|
||||
}
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
UUID uuid = null;
|
||||
OfflinePlayer player = mcMMO.p.getServer().getOfflinePlayer(playerName);
|
||||
if (player != null) {
|
||||
uuid = player.getUniqueId();
|
||||
}
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
|
||||
|
||||
if (CommandUtils.unloadedProfile(sender, profile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
editValues(null, profile, skill);
|
||||
} else {
|
||||
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill);
|
||||
}
|
||||
|
||||
handleSenderMessage(sender, playerName, skill);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
case 2:
|
||||
return StringUtil.copyPartialMatches(args[1], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill) {
|
||||
int levelsRemoved = profile.getSkillLevel(skill);
|
||||
float xpRemoved = profile.getSkillXpLevelRaw(skill);
|
||||
|
||||
profile.modifySkill(skill, 0);
|
||||
|
||||
if (player == null) {
|
||||
profile.scheduleAsyncSave();
|
||||
return;
|
||||
}
|
||||
|
||||
EventUtils.handleLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND);
|
||||
}
|
||||
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.skillreset(sender);
|
||||
}
|
||||
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.skillresetOthers(sender);
|
||||
}
|
||||
|
||||
protected void handlePlayerMessageAll(Player player) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
|
||||
}
|
||||
|
||||
protected void handlePlayerMessageSkill(Player player, PrimarySkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
|
||||
}
|
||||
|
||||
private boolean validateArguments(CommandSender sender, String skillName) {
|
||||
return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName);
|
||||
}
|
||||
|
||||
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
handleCommand(player, profile, primarySkillType);
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageAll(player);
|
||||
}
|
||||
} else {
|
||||
handleCommand(player, profile, skill);
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageSkill(player, skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class HardcoreCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreToggle(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreModify(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
if (!primarySkillType.getHardcoreStatLossEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return skill.getHardcoreStatLossEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void enable(PrimarySkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disable(PrimarySkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
MainConfig.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
primarySkillType.setHardcoreStatLossEnabled(enable);
|
||||
}
|
||||
} else {
|
||||
skill.setHardcoreStatLossEnabled(enable);
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class HardcoreModeCommand implements TabExecutor {
|
||||
protected final DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!checkTogglePermissions(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (checkEnabled(null)) {
|
||||
disable(null);
|
||||
} else {
|
||||
enable(null);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (CommandUtils.shouldEnableToggle(args[0])) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
enable(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldDisableToggle(args[0])) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
disable(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.isInvalidDouble(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.hardcoreModify(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
modify(sender, Double.parseDouble(args[0]));
|
||||
return true;
|
||||
|
||||
|
||||
case 2:
|
||||
if (CommandUtils.isInvalidSkill(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PrimarySkillType skill = PrimarySkillType.getSkill(args[0]);
|
||||
|
||||
if (!CommandUtils.isChildSkill(sender, skill)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldEnableToggle(args[1])) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
enable(skill);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldDisableToggle(args[1])) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
enable(skill);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (StringUtils.isDouble(args[0])) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
return StringUtil.copyPartialMatches(args[0], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean checkTogglePermissions(CommandSender sender);
|
||||
|
||||
protected abstract boolean checkModifyPermissions(CommandSender sender);
|
||||
|
||||
protected abstract boolean checkEnabled(PrimarySkillType skill);
|
||||
|
||||
protected abstract void enable(PrimarySkillType skill);
|
||||
|
||||
protected abstract void disable(PrimarySkillType skill);
|
||||
|
||||
protected abstract void modify(CommandSender sender, double newPercentage);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class VampirismCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.vampirismToggle(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.vampirismModify(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkEnabled(PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
if (!primarySkillType.getHardcoreVampirismEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return skill.getHardcoreVampirismEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void enable(PrimarySkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disable(PrimarySkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
MainConfig.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
private void toggle(boolean enable, PrimarySkillType skill) {
|
||||
if (skill == null) {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||
primarySkillType.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
} else {
|
||||
skill.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,21 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyAcceptCommand implements CommandExecutor {
|
||||
private McMMOPlayer mcMMOPlayer;
|
||||
private Player player;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
player = (Player) sender;
|
||||
mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (!mcMMOPlayer.hasPartyInvite()) {
|
||||
sender.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
|
||||
@@ -27,11 +23,11 @@ public class PartyAcceptCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
// Changing parties
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, player, mcMMOPlayer.getParty(), mcMMOPlayer.getPartyInvite().getName())) {
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, mcMMOPlayer.getPartyInvite().getName())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.joinInvitedParty(player, mcMMOPlayer);
|
||||
PartyManager.joinInvitedParty(mcMMOPlayer);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -1,29 +1,32 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyChangeOwnerCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
|
||||
|
||||
if (!playerParty.getMembers().contains(mcMMO.p.getServer().getOfflinePlayer(args[1]))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", args[1]));
|
||||
if (!playerParty.hasMember(target.getUniqueId())) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.setPartyLeader(args[1], playerParty);
|
||||
PartyManager.setPartyLeader(target.getUniqueId(), playerParty);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -1,31 +1,30 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyChangePasswordCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
Party party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
unprotectParty(sender, playerParty);
|
||||
unprotectParty(party, sender);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (args[1].equalsIgnoreCase("clear") || args[1].equalsIgnoreCase("reset")) {
|
||||
unprotectParty(sender, playerParty);
|
||||
unprotectParty(party, sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
protectParty(sender, playerParty, args[1]);
|
||||
protectParty(party, sender, args[1]);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -35,15 +34,15 @@ public class PartyChangePasswordCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
private void unprotectParty(CommandSender sender, Party playerParty) {
|
||||
playerParty.setLocked(true);
|
||||
playerParty.setPassword(null);
|
||||
private void unprotectParty(Party party, CommandSender sender) {
|
||||
party.setLocked(true);
|
||||
party.setPassword(null);
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Password.Removed"));
|
||||
}
|
||||
|
||||
private void protectParty(CommandSender sender, Party playerParty, String password) {
|
||||
playerParty.setLocked(true);
|
||||
playerParty.setPassword(password);
|
||||
private void protectParty(Party party, CommandSender sender, String password) {
|
||||
party.setLocked(true);
|
||||
party.setPassword(password);
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Password.Set", password));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.commands.chat.PartyChatCommand;
|
||||
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
|
||||
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PartyCommand implements TabExecutor {
|
||||
private static final List<String> PARTY_SUBCOMMANDS;
|
||||
private static final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
|
||||
private static final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
|
||||
|
||||
static {
|
||||
ArrayList<String> subcommands = new ArrayList<String>();
|
||||
|
||||
for (PartySubcommandType subcommand : PartySubcommandType.values()) {
|
||||
subcommands.add(subcommand.toString());
|
||||
}
|
||||
|
||||
Collections.sort(subcommands);
|
||||
PARTY_SUBCOMMANDS = ImmutableList.copyOf(subcommands);
|
||||
}
|
||||
|
||||
private CommandExecutor partyJoinCommand = new PartyJoinCommand();
|
||||
private CommandExecutor partyAcceptCommand = new PartyAcceptCommand();
|
||||
private CommandExecutor partyCreateCommand = new PartyCreateCommand();
|
||||
private CommandExecutor partyQuitCommand = new PartyQuitCommand();
|
||||
private CommandExecutor partyXpShareCommand = new PartyXpShareCommand();
|
||||
private CommandExecutor partyItemShareCommand = new PartyItemShareCommand();
|
||||
private CommandExecutor partyInviteCommand = new PartyInviteCommand();
|
||||
private CommandExecutor partyKickCommand = new PartyKickCommand();
|
||||
private CommandExecutor partyDisbandCommand = new PartyDisbandCommand();
|
||||
private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand();
|
||||
private CommandExecutor partyLockCommand = new PartyLockCommand();
|
||||
private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand();
|
||||
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
|
||||
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
|
||||
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
|
||||
private CommandExecutor partyTeleportCommand = new PtpCommand();
|
||||
private CommandExecutor partyChatCommand = new PartyChatCommand();
|
||||
private CommandExecutor partyAllianceCommand = new PartyAllianceCommand();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.party(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (args.length < 1) {
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
return partyInfoCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
|
||||
|
||||
if (subcommand == null) {
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
// Can't use this for lock/unlock since they're handled by the same command
|
||||
if (subcommand != PartySubcommandType.LOCK && subcommand != PartySubcommandType.UNLOCK && !Permissions.partySubcommand(sender, subcommand)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
case JOIN:
|
||||
return partyJoinCommand.onCommand(sender, command, label, args);
|
||||
case ACCEPT:
|
||||
return partyAcceptCommand.onCommand(sender, command, label, args);
|
||||
case CREATE:
|
||||
return partyCreateCommand.onCommand(sender, command, label, args);
|
||||
case HELP:
|
||||
return partyHelpCommand.onCommand(sender, command, label, args);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Party member commands
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
case INFO:
|
||||
return partyInfoCommand.onCommand(sender, command, label, args);
|
||||
case QUIT:
|
||||
return partyQuitCommand.onCommand(sender, command, label, args);
|
||||
case INVITE:
|
||||
return partyInviteCommand.onCommand(sender, command, label, args);
|
||||
case TELEPORT:
|
||||
return partyTeleportCommand.onCommand(sender, command, label, extractArgs(args));
|
||||
case CHAT:
|
||||
return partyChatCommand.onCommand(sender, command, label, extractArgs(args));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Party leader commands
|
||||
if (!mcMMOPlayer.getParty().getLeader().getUniqueId().equals(player.getUniqueId())) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
case XPSHARE:
|
||||
return partyXpShareCommand.onCommand(sender, command, label, args);
|
||||
case ITEMSHARE:
|
||||
return partyItemShareCommand.onCommand(sender, command, label, args);
|
||||
case KICK:
|
||||
return partyKickCommand.onCommand(sender, command, label, args);
|
||||
case DISBAND:
|
||||
return partyDisbandCommand.onCommand(sender, command, label, args);
|
||||
case OWNER:
|
||||
return partyChangeOwnerCommand.onCommand(sender, command, label, args);
|
||||
case LOCK:
|
||||
case UNLOCK:
|
||||
return partyLockCommand.onCommand(sender, command, label, args);
|
||||
case PASSWORD:
|
||||
return partyChangePasswordCommand.onCommand(sender, command, label, args);
|
||||
case RENAME:
|
||||
return partyRenameCommand.onCommand(sender, command, label, args);
|
||||
case ALLIANCE:
|
||||
return partyAllianceCommand.onCommand(sender, command, label, args);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], PARTY_SUBCOMMANDS, new ArrayList<String>(PARTY_SUBCOMMANDS.size()));
|
||||
case 2:
|
||||
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
|
||||
|
||||
if (subcommand == null) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
case JOIN:
|
||||
case INVITE:
|
||||
case KICK:
|
||||
case OWNER:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
case XPSHARE:
|
||||
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<String>(XPSHARE_COMPLETIONS.size()));
|
||||
case ITEMSHARE:
|
||||
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<String>(ITEMSHARE_COMPLETIONS.size()));
|
||||
case LOCK:
|
||||
case CHAT:
|
||||
return StringUtil.copyPartialMatches(args[1], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
|
||||
case PASSWORD:
|
||||
return StringUtil.copyPartialMatches(args[1], CommandUtils.RESET_OPTIONS, new ArrayList<String>(CommandUtils.RESET_OPTIONS.size()));
|
||||
case TELEPORT:
|
||||
List<String> matches = StringUtil.copyPartialMatches(args[1], PtpCommand.TELEPORT_SUBCOMMANDS, new ArrayList<String>(PtpCommand.TELEPORT_SUBCOMMANDS.size()));
|
||||
|
||||
if (matches.size() == 0) {
|
||||
Player player = (Player) sender;
|
||||
Party party = UserManager.getPlayer(player).getParty();
|
||||
|
||||
playerNames = party.getOnlinePlayerNames(player);
|
||||
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
}
|
||||
|
||||
return matches;
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
case 3:
|
||||
if (PartySubcommandType.getSubcommand(args[0]) == PartySubcommandType.ITEMSHARE && isItemShareCategory(args[1])) {
|
||||
return StringUtil.copyPartialMatches(args[2], CommandUtils.TRUE_FALSE_OPTIONS, new ArrayList<String>(CommandUtils.TRUE_FALSE_OPTIONS.size()));
|
||||
}
|
||||
|
||||
return ImmutableList.of();
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean printUsage(Player player) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Help.0", "/party join"));
|
||||
player.sendMessage(LocaleLoader.getString("Party.Help.1", "/party create"));
|
||||
player.sendMessage(LocaleLoader.getString("Party.Help.2", "/party ?"));
|
||||
return true;
|
||||
}
|
||||
|
||||
private String[] extractArgs(String[] args) {
|
||||
return Arrays.copyOfRange(args, 1, args.length);
|
||||
}
|
||||
|
||||
private boolean isItemShareCategory(String category) {
|
||||
return category.equalsIgnoreCase("loot") || category.equalsIgnoreCase("mining") || category.equalsIgnoreCase("herbalism") || category.equalsIgnoreCase("woodcutting") || category.equalsIgnoreCase("misc");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,34 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyCreateCommand implements CommandExecutor {
|
||||
private McMMOPlayer mcMMOPlayer;
|
||||
private Player player;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
// Fallthrough
|
||||
case 3:
|
||||
Party newParty = PartyManager.getParty(args[1]);
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
// Check to see if the party exists, and if it does cancel creating a new party
|
||||
if (newParty != null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.AlreadyExists", args[1]));
|
||||
if (PartyManager.checkPartyExistence(player, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
player = (Player) sender;
|
||||
mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
// Changing parties
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, player, mcMMOPlayer.getParty(), args[1])) {
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.createParty(player, mcMMOPlayer, args[1], getPassword(args));
|
||||
PartyManager.createParty(mcMMOPlayer, args[1], getPassword(args));
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -1,25 +1,25 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyDisbandCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
String partyName = playerParty.getName();
|
||||
|
||||
for (Player member : playerParty.getOnlineMembers()) {
|
||||
if (!PartyManager.handlePartyChangeEvent(member, playerParty.getName(), null, EventReason.KICKED_FROM_PARTY)) {
|
||||
if (!PartyManager.handlePartyChangeEvent(member, partyName, null, EventReason.KICKED_FROM_PARTY)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public class PartyHelpCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
@@ -19,6 +18,8 @@ public class PartyHelpCommand implements CommandExecutor {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Help.6", "/party kick"));
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Help.7", "/party leader"));
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Help.8", "/party disband"));
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Help.9", "/party itemshare"));
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Help.10", "/party xpshare"));
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -26,5 +27,4 @@ public class PartyHelpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PartyInfoCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
case 1:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
displayPartyHeader(player, party);
|
||||
displayShareModeInfo(player, party);
|
||||
displayPartyFeatures(player, party);
|
||||
displayMemberInfo(player, mcMMOPlayer, party);
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "info"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void displayPartyHeader(Player player, Party party) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Header"));
|
||||
|
||||
StringBuilder status = new StringBuilder();
|
||||
status.append(LocaleLoader.getString("Commands.Party.Status", party.getName(), LocaleLoader.getString("Party.Status." + (party.isLocked() ? "Locked" : "Unlocked")), party.getLevel()));
|
||||
|
||||
if (!party.hasReachedLevelCap()) {
|
||||
status.append(" (").append(party.getXpToLevelPercentage()).append(")");
|
||||
}
|
||||
|
||||
player.sendMessage(status.toString());
|
||||
}
|
||||
|
||||
private void displayPartyFeatures(Player player, Party party) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Features.Header"));
|
||||
|
||||
List<String> unlockedPartyFeatures = new ArrayList<String>();
|
||||
List<String> lockedPartyFeatures = new ArrayList<String>();
|
||||
|
||||
for (PartyFeature partyFeature : PartyFeature.values()) {
|
||||
if (!partyFeature.hasPermission(player)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isUnlockedFeature(party, partyFeature)) {
|
||||
unlockedPartyFeatures.add(partyFeature.getLocaleString());
|
||||
} else {
|
||||
lockedPartyFeatures.add(partyFeature.getFeatureLockedLocaleString());
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.UnlockedFeatures", unlockedPartyFeatures.isEmpty() ? "None" : unlockedPartyFeatures));
|
||||
|
||||
for (String message : lockedPartyFeatures) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isUnlockedFeature(Party party, PartyFeature partyFeature) {
|
||||
return party.getLevel() >= MainConfig.getInstance().getPartyFeatureUnlockLevel(partyFeature);
|
||||
}
|
||||
|
||||
private void displayShareModeInfo(Player player, Party party) {
|
||||
boolean xpShareEnabled = isUnlockedFeature(party, PartyFeature.XP_SHARE);
|
||||
boolean itemShareEnabled = isUnlockedFeature(party, PartyFeature.ITEM_SHARE);
|
||||
boolean itemSharingActive = (party.getItemShareMode() != ShareMode.NONE);
|
||||
|
||||
if (!xpShareEnabled && !itemShareEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
String expShareInfo = "";
|
||||
String itemShareInfo = "";
|
||||
String separator = "";
|
||||
|
||||
if (xpShareEnabled) {
|
||||
expShareInfo = LocaleLoader.getString("Commands.Party.ExpShare", party.getXpShareMode().toString());
|
||||
}
|
||||
|
||||
if (itemShareEnabled) {
|
||||
itemShareInfo = LocaleLoader.getString("Commands.Party.ItemShare", party.getItemShareMode().toString());
|
||||
}
|
||||
|
||||
if (xpShareEnabled && itemShareEnabled) {
|
||||
separator = ChatColor.DARK_GRAY + " || ";
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.ShareMode") + expShareInfo + separator + itemShareInfo);
|
||||
|
||||
if (itemSharingActive) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.ItemShareCategories", party.getItemShareCategories()));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
|
||||
/*
|
||||
* Only show members of the party that this member can see
|
||||
*/
|
||||
|
||||
List<Player> nearMembers = PartyManager.getNearVisibleMembers(mcMMOPlayer);
|
||||
int membersOnline = party.getVisibleMembers(player).size();
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size() + 1, membersOnline));
|
||||
player.sendMessage(party.createMembersList(player));
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,33 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyInviteCommand implements CommandExecutor {
|
||||
private McMMOPlayer mcMMOTarget;
|
||||
private Player target;
|
||||
|
||||
private McMMOPlayer mcMMOPlayer;
|
||||
private Player player;
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (!mcMMO.p.getServer().getOfflinePlayer(args[1]).isOnline()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotOnline", args[1]));
|
||||
return true;
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getOfflinePlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMOTarget = UserManager.getPlayer(args[1]);
|
||||
|
||||
if (mcMMOTarget == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
target = mcMMOTarget.getPlayer();
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
player = mcMMOPlayer.getPlayer();
|
||||
Player target = mcMMOTarget.getPlayer();
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
String playerName = player.getName();
|
||||
|
||||
if (player.equals(target)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Invite.Self"));
|
||||
@@ -46,21 +35,26 @@ public class PartyInviteCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (PartyManager.inSameParty(player, target)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Player.InSameParty", target.getName()));
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Player.InSameParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
if (!PartyManager.canInvite(player, playerParty)) {
|
||||
if (!PartyManager.canInvite(mcMMOPlayer)) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Party playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
if (PartyManager.isPartyFull(target, playerParty)) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), MainConfig.getInstance().getPartyMaxSize()));
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOTarget.setPartyInvite(playerParty);
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.0", playerParty.getName(), player.getName()));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.0", playerParty.getName(), playerName));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.1"));
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.ItemShareType;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyItemShareCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Party party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.4"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase());
|
||||
|
||||
if (mode == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
|
||||
return true;
|
||||
}
|
||||
|
||||
handleChangingShareMode(party, mode);
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
boolean toggle;
|
||||
|
||||
if (CommandUtils.shouldEnableToggle(args[2])) {
|
||||
toggle = true;
|
||||
} else if (CommandUtils.shouldDisableToggle(args[2])) {
|
||||
toggle = false;
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase()), toggle);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleChangingShareMode(Party party, ShareMode mode) {
|
||||
party.setItemShareMode(mode);
|
||||
|
||||
String changeModeMessage = LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Item"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
|
||||
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(changeModeMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToggleItemShareCategory(Party party, ItemShareType type, boolean toggle) {
|
||||
party.setSharingDrops(type, toggle);
|
||||
|
||||
String toggleMessage = LocaleLoader.getString("Commands.Party.ToggleShareCategory", StringUtils.getCapitalized(type.toString()), toggle ? "enabled" : "disabled");
|
||||
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(toggleMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyJoinCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
case 3:
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Player target = mcMMOTarget.getPlayer();
|
||||
|
||||
if (!mcMMOTarget.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.PlayerNotInParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Party targetParty = mcMMOTarget.getParty();
|
||||
|
||||
if (player.equals(target) || (mcMMOPlayer.inParty() && mcMMOPlayer.getParty().equals(targetParty))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Join.Self"));
|
||||
return true;
|
||||
}
|
||||
|
||||
String password = getPassword(args);
|
||||
|
||||
// Make sure party passwords match
|
||||
if (!PartyManager.checkPartyPassword(player, targetParty, password)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String partyName = targetParty.getName();
|
||||
|
||||
// Changing parties
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, partyName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PartyManager.isPartyFull(player, targetParty)) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull", targetParty.toString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Join", partyName));
|
||||
PartyManager.addToParty(mcMMOPlayer, targetParty);
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.3", "party", "join", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">", "[" + LocaleLoader.getString("Commands.Usage.Password") + "]"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private String getPassword(String[] args) {
|
||||
if (args.length == 3) {
|
||||
return args[2];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,33 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyKickCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
|
||||
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(args[1]);
|
||||
|
||||
if (!playerParty.getMembers().contains(target)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", args[1]));
|
||||
if (!playerParty.hasMember(targetName)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
OfflinePlayer target = mcMMO.p.getServer().getOfflinePlayer(targetName);
|
||||
|
||||
if (target.isOnline()) {
|
||||
Player onlineTarget = target.getPlayer();
|
||||
String partyName = playerParty.getName();
|
||||
@@ -35,6 +36,7 @@ public class PartyKickCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.processPartyLeaving(UserManager.getPlayer(onlineTarget));
|
||||
onlineTarget.sendMessage(LocaleLoader.getString("Commands.Party.Kick", partyName));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyLockCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("lock")) {
|
||||
togglePartyLock(sender, true);
|
||||
} else if (args[0].equalsIgnoreCase("unlock")) {
|
||||
togglePartyLock(sender, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (!args[0].equalsIgnoreCase("lock")) {
|
||||
sendUsageStrings(sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.shouldEnableToggle(args[1])) {
|
||||
togglePartyLock(sender, true);
|
||||
} else if (CommandUtils.shouldDisableToggle(args[1])) {
|
||||
togglePartyLock(sender, false);
|
||||
} else {
|
||||
sendUsageStrings(sender);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
sendUsageStrings(sender);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void sendUsageStrings(CommandSender sender) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "lock", "[on|off]"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "unlock"));
|
||||
}
|
||||
|
||||
private void togglePartyLock(CommandSender sender, boolean lock) {
|
||||
Party party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (!Permissions.partySubcommand(sender, lock ? PartySubcommandType.LOCK : PartySubcommandType.UNLOCK)) {
|
||||
sender.sendMessage(LocaleLoader.getString("mcMMO.NoPermission"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (lock ? party.isLocked() : !party.isLocked()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party." + (lock ? "IsLocked" : "IsntLocked")));
|
||||
return;
|
||||
}
|
||||
|
||||
party.setLocked(lock);
|
||||
sender.sendMessage(LocaleLoader.getString("Party." + (lock ? "Locked" : "Unlocked")));
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,35 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyQuitCommand implements CommandExecutor {
|
||||
private Player player;
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
player = (Player) sender;
|
||||
playerParty = UserManager.getPlayer(player).getParty();
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Party playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
if (!PartyManager.handlePartyChangeEvent(player, playerParty.getName(), null, EventReason.LEFT_PARTY)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.removeFromParty(player, playerParty);
|
||||
PartyManager.removeFromParty(mcMMOPlayer);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.Leave"));
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "[quit|q|leave]"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "quit"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,48 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyRenameCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
String leaderName = playerParty.getLeader();
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
Party playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
String oldPartyName = playerParty.getName();
|
||||
String newPartyName = args[1];
|
||||
|
||||
// This is to prevent party leaders from spamming other players with the rename message
|
||||
if (playerParty.getName().equalsIgnoreCase(newPartyName)) {
|
||||
if (oldPartyName.equalsIgnoreCase(newPartyName)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Rename.Same"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Party newParty = PartyManager.getParty(newPartyName);
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
// Check to see if the party exists, and if it does cancel renaming the party
|
||||
if (newParty != null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.AlreadyExists", newPartyName));
|
||||
if (PartyManager.checkPartyExistence(player, newPartyName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String leaderName = playerParty.getLeader().getPlayerName();
|
||||
|
||||
for (Player member : playerParty.getOnlineMembers()) {
|
||||
if (!PartyManager.handlePartyChangeEvent(member, playerParty.getName(), newPartyName, EventReason.CHANGED_PARTIES)) {
|
||||
if (!PartyManager.handlePartyChangeEvent(member, oldPartyName, newPartyName, EventReason.CHANGED_PARTIES)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!member.getName().equals(leaderName)) {
|
||||
if (!member.getName().equalsIgnoreCase(leaderName)) {
|
||||
member.sendMessage(LocaleLoader.getString("Party.InformedOnNameChange", leaderName, newPartyName));
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ public enum PartySubcommandType {
|
||||
HELP,
|
||||
INFO,
|
||||
QUIT,
|
||||
EXPSHARE,
|
||||
XPSHARE,
|
||||
ITEMSHARE,
|
||||
INVITE,
|
||||
KICK,
|
||||
@@ -18,7 +18,8 @@ public enum PartySubcommandType {
|
||||
PASSWORD,
|
||||
RENAME,
|
||||
TELEPORT,
|
||||
CHAT;
|
||||
CHAT,
|
||||
ALLIANCE;
|
||||
|
||||
public static PartySubcommandType getSubcommand(String commandName) {
|
||||
for (PartySubcommandType command : values()) {
|
||||
@@ -29,18 +30,16 @@ public enum PartySubcommandType {
|
||||
|
||||
if (commandName.equalsIgnoreCase("?")) {
|
||||
return HELP;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) {
|
||||
} else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) {
|
||||
return QUIT;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("leader")) {
|
||||
} else if (commandName.equalsIgnoreCase("leader")) {
|
||||
return OWNER;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) {
|
||||
return EXPSHARE;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) {
|
||||
} else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) {
|
||||
return XPSHARE;
|
||||
} else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) {
|
||||
return ITEMSHARE;
|
||||
} else if (commandName.equalsIgnoreCase("ally")) {
|
||||
return ALLIANCE;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyXpShareCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Party party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.5"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (args[1].equalsIgnoreCase("none") || CommandUtils.shouldDisableToggle(args[1])) {
|
||||
handleChangingShareMode(party, ShareMode.NONE);
|
||||
} else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || CommandUtils.shouldEnableToggle(args[1])) {
|
||||
handleChangingShareMode(party, ShareMode.EQUAL);
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleChangingShareMode(Party party, ShareMode mode) {
|
||||
party.setXpShareMode(mode);
|
||||
|
||||
String changeModeMessage = LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Xp"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
|
||||
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(changeModeMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyAllianceAcceptCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (!mcMMOPlayer.hasPartyAllianceInvite()) {
|
||||
sender.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.getParty().getAlly() != null) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.AlreadyAllies"));
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.acceptAllianceInvite(mcMMOPlayer);
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "alliance", "accept"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PartyAllianceCommand implements TabExecutor {
|
||||
public static final List<String> ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband");
|
||||
private Player player;
|
||||
private Party playerParty;
|
||||
private Party targetParty;
|
||||
private CommandExecutor partyAllianceInviteCommand = new PartyAllianceInviteCommand();
|
||||
private CommandExecutor partyAllianceAcceptCommand = new PartyAllianceAcceptCommand();
|
||||
private CommandExecutor partyAllianceDisbandCommand = new PartyAllianceDisbandCommand();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (playerParty.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.3"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (playerParty.getAlly() == null) {
|
||||
printUsage();
|
||||
return true;
|
||||
}
|
||||
|
||||
targetParty = playerParty.getAlly();
|
||||
|
||||
displayPartyHeader();
|
||||
displayMemberInfo(mcMMOPlayer);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
if (playerParty.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.3"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("invite")) {
|
||||
return partyAllianceInviteCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("accept")) {
|
||||
return partyAllianceAcceptCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("disband")) {
|
||||
return partyAllianceDisbandCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (playerParty.getAlly() == null) {
|
||||
printUsage();
|
||||
return true;
|
||||
}
|
||||
|
||||
targetParty = playerParty.getAlly();
|
||||
|
||||
displayPartyHeader();
|
||||
displayMemberInfo(mcMMOPlayer);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean printUsage() {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.0"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Help.1"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender commandSender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> matches = StringUtil.copyPartialMatches(args[0], ALLIANCE_SUBCOMMANDS, new ArrayList<String>(ALLIANCE_SUBCOMMANDS.size()));
|
||||
|
||||
if (matches.size() == 0) {
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(commandSender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
}
|
||||
|
||||
return matches;
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void displayPartyHeader() {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Ally", playerParty.getName(), targetParty.getName()));
|
||||
}
|
||||
|
||||
private void displayMemberInfo(McMMOPlayer mcMMOPlayer) {
|
||||
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Members.Header"));
|
||||
player.sendMessage(playerParty.createMembersList(player));
|
||||
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
|
||||
player.sendMessage(targetParty.createMembersList(player));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyAllianceDisbandCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
if (party.getAlly() == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.None"));
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.disbandAlliance(player, party, party.getAlly());
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "alliance", "disband"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PartyAllianceInviteCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 3:
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[2]);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getOfflinePlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player target = mcMMOTarget.getPlayer();
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
String playerName = player.getName();
|
||||
|
||||
if (player.equals(target)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Invite.Self"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!mcMMOTarget.inParty()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.PlayerNotInParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PartyManager.inSameParty(player, target)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Player.InSameParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!mcMMOTarget.getParty().getLeader().getUniqueId().equals(target.getUniqueId())) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Target.NotOwner", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
Party playerParty = mcMMOPlayer.getParty();
|
||||
|
||||
if (playerParty.getAlly() != null) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.AlreadyAllies"));
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOTarget.setPartyAllianceInvite(playerParty);
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Invite.0", playerParty.getName(), playerName));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.Party.Alliance.Invite.1"));
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.3", "party", "alliance", "invite", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class PtpAcceptAnyCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.partyTeleportAcceptAll(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyTeleportRecord ptpRecord = UserManager.getPlayer(sender.getName()).getPartyTeleportRecord();
|
||||
|
||||
if (ptpRecord.isConfirmRequired()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Disabled"));
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Enabled"));
|
||||
}
|
||||
|
||||
ptpRecord.toggleConfirmRequired();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.skills.SkillUtils;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PtpAcceptCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.partyTeleportAccept(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
PartyTeleportRecord ptpRecord = UserManager.getPlayer(player).getPartyTeleportRecord();
|
||||
|
||||
if (!ptpRecord.hasRequest()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.NoRequests"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), MainConfig.getInstance().getPTPCommandTimeout())) {
|
||||
ptpRecord.removeRequest();
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.RequestExpired"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Player target = ptpRecord.getRequestor();
|
||||
ptpRecord.removeRequest();
|
||||
|
||||
if (!PtpCommand.canTeleport(sender, player, target.getName())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (MainConfig.getInstance().getPTPCommandWorldPermissions()) {
|
||||
World targetWorld = target.getWorld();
|
||||
World playerWorld = player.getWorld();
|
||||
|
||||
if (!Permissions.partyTeleportAllWorlds(target)) {
|
||||
if (!Permissions.partyTeleportWorld(target, targetWorld)) {
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
|
||||
return true;
|
||||
} else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) {
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", playerWorld.getName()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PtpCommand.handleTeleportWarmup(target, player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.runnables.items.TeleportationWarmup;
|
||||
import com.gmail.nossr50.core.util.EventUtils;
|
||||
import com.gmail.nossr50.core.util.Misc;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PtpCommand implements TabExecutor {
|
||||
public static final List<String> TELEPORT_SUBCOMMANDS = ImmutableList.of("toggle", "accept", "acceptany", "acceptall");
|
||||
|
||||
private CommandExecutor ptpToggleCommand = new PtpToggleCommand();
|
||||
private CommandExecutor ptpAcceptAnyCommand = new PtpAcceptAnyCommand();
|
||||
private CommandExecutor ptpAcceptCommand = new PtpAcceptCommand();
|
||||
|
||||
protected static boolean canTeleport(CommandSender sender, Player player, String targetName) {
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player target = mcMMOTarget.getPlayer();
|
||||
|
||||
if (player.equals(target)) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Self"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!PartyManager.inSameParty(player, target)) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mcMMOTarget.getPartyTeleportRecord().isEnabled()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", targetName));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!target.isValid()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer);
|
||||
|
||||
long warmup = MainConfig.getInstance().getPTPCommandWarmup();
|
||||
|
||||
mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer);
|
||||
|
||||
if (warmup > 0) {
|
||||
teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup));
|
||||
new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup);
|
||||
} else {
|
||||
EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return true;
|
||||
}
|
||||
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(player.getWorld()))
|
||||
return true;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
if (party.getLevel() < MainConfig.getInstance().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.2"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("toggle")) {
|
||||
return ptpToggleCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("acceptany") || args[0].equalsIgnoreCase("acceptall")) {
|
||||
return ptpAcceptAnyCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
|
||||
int hurtCooldown = MainConfig.getInstance().getPTPCommandRecentlyHurtCooldown();
|
||||
|
||||
if (hurtCooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player);
|
||||
|
||||
if (timeRemaining > 0) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", timeRemaining));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("accept")) {
|
||||
return ptpAcceptCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
if (!Permissions.partyTeleportSend(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
int ptpCooldown = MainConfig.getInstance().getPTPCommandCooldown();
|
||||
long ptpLastUse = mcMMOPlayer.getPartyTeleportRecord().getLastUse();
|
||||
|
||||
if (ptpCooldown > 0) {
|
||||
int timeRemaining = SkillUtils.calculateTimeLeft(ptpLastUse * Misc.TIME_CONVERSION_FACTOR, ptpCooldown, player);
|
||||
|
||||
if (timeRemaining > 0) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.Generic.Wait", timeRemaining));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sendTeleportRequest(sender, player, CommandUtils.getMatchedPlayerName(args[0]));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> matches = StringUtil.copyPartialMatches(args[0], TELEPORT_SUBCOMMANDS, new ArrayList<String>(TELEPORT_SUBCOMMANDS.size()));
|
||||
|
||||
if (matches.size() == 0) {
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
List<String> playerNames = mcMMOPlayer.getParty().getOnlinePlayerNames(player);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
}
|
||||
|
||||
return matches;
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void sendTeleportRequest(CommandSender sender, Player player, String targetName) {
|
||||
if (!canTeleport(sender, player, targetName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName);
|
||||
Player target = mcMMOTarget.getPlayer();
|
||||
|
||||
PartyTeleportRecord ptpRecord = mcMMOTarget.getPartyTeleportRecord();
|
||||
|
||||
if (!ptpRecord.isConfirmRequired()) {
|
||||
handleTeleportWarmup(player, target);
|
||||
return;
|
||||
}
|
||||
|
||||
ptpRecord.setRequestor(player);
|
||||
ptpRecord.actualizeTimeout();
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName()));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", MainConfig.getInstance().getPTPCommandTimeout()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class PtpToggleCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.partyTeleportToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyTeleportRecord ptpRecord = UserManager.getPlayer(sender.getName()).getPartyTeleportRecord();
|
||||
|
||||
if (ptpRecord.isEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.ptp.Disabled"));
|
||||
} else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.ptp.Enabled"));
|
||||
}
|
||||
|
||||
ptpRecord.toggleEnabled();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InspectCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false); // Temporary Profile
|
||||
|
||||
if (!CommandUtils.isLoaded(sender, profile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CommandUtils.inspectOffline(sender, profile, Permissions.inspectOffline(sender))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (MainConfig.getInstance().getScoreboardsEnabled() && sender instanceof Player && MainConfig.getInstance().getInspectUseBoard()) {
|
||||
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile);
|
||||
|
||||
if (!MainConfig.getInstance().getInspectUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
|
||||
for (PrimarySkillType skill : PrimarySkillType.GATHERING_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
|
||||
for (PrimarySkillType skill : PrimarySkillType.COMBAT_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
|
||||
for (PrimarySkillType skill : PrimarySkillType.MISC_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
} else {
|
||||
Player target = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) {
|
||||
if (!Permissions.inspectOffline(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||
return true;
|
||||
}
|
||||
} else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (MainConfig.getInstance().getScoreboardsEnabled() && sender instanceof Player && MainConfig.getInstance().getInspectUseBoard()) {
|
||||
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile());
|
||||
|
||||
if (!MainConfig.getInstance().getInspectUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Stats", target.getName()));
|
||||
CommandUtils.printGatheringSkills(target, sender);
|
||||
CommandUtils.printCombatSkills(target, sender);
|
||||
CommandUtils.printMiscSkills(target, sender);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MccooldownCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (MainConfig.getInstance().getScoreboardsEnabled() && MainConfig.getInstance().getCooldownUseBoard()) {
|
||||
ScoreboardManager.enablePlayerCooldownScoreboard(player);
|
||||
|
||||
if (!MainConfig.getInstance().getCooldownUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||
|
||||
for (SuperAbilityType ability : SuperAbilityType.values()) {
|
||||
if (!ability.getPermissions(player)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int seconds = mcMMOPlayer.calculateTimeRemaining(ability);
|
||||
|
||||
if (seconds <= 0) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.Y", ability.getName()));
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.N", ability.getName(), seconds));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.runnables.commands.McrankCommandAsyncTask;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class McrankCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.mcrank(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(sender, sender.getName());
|
||||
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.mcrankOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
if (mcMMOPlayer != null) {
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
playerName = player.getName();
|
||||
|
||||
if (CommandUtils.tooFar(sender, player, Permissions.mcrankFar(sender))) {
|
||||
return true;
|
||||
}
|
||||
} else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(sender, playerName);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
|
||||
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<String>(playerNames.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void display(CommandSender sender, String playerName) {
|
||||
if (sender instanceof Player) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750);
|
||||
|
||||
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (((Player) sender).hasMetadata(mcMMO.databaseCommandKey)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Processing"));
|
||||
return;
|
||||
} else {
|
||||
((Player) sender).setMetadata(mcMMO.databaseCommandKey, new FixedMetadataValue(mcMMO.p, null));
|
||||
}
|
||||
|
||||
mcMMOPlayer.actualizeDatabaseATS();
|
||||
}
|
||||
|
||||
boolean useBoard = MainConfig.getInstance().getScoreboardsEnabled() && (sender instanceof Player) && (MainConfig.getInstance().getRankUseBoard());
|
||||
boolean useChat = !useBoard || MainConfig.getInstance().getRankUseChat();
|
||||
|
||||
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class McstatsCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (MainConfig.getInstance().getStatsUseBoard() && MainConfig.getInstance().getScoreboardsEnabled()) {
|
||||
ScoreboardManager.enablePlayerStatsScoreboard(player);
|
||||
|
||||
if (!MainConfig.getInstance().getStatsUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Stats.Own.Stats"));
|
||||
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||
|
||||
CommandUtils.printGatheringSkills(player);
|
||||
CommandUtils.printCombatSkills(player);
|
||||
CommandUtils.printMiscSkills(player);
|
||||
|
||||
int powerLevelCap = MainConfig.getInstance().getPowerLevelCap();
|
||||
|
||||
if (powerLevelCap != Integer.MAX_VALUE) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap));
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", UserManager.getPlayer(player).getPowerLevel()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.runnables.commands.MctopCommandAsyncTask;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MctopCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PrimarySkillType skill = null;
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
display(1, skill, sender, command);
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (StringUtils.isInt(args[0])) {
|
||||
display(Math.abs(Integer.parseInt(args[0])), skill, sender, command);
|
||||
return true;
|
||||
}
|
||||
|
||||
skill = extractSkill(sender, args[0]);
|
||||
|
||||
if (skill == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(1, skill, sender, command);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (CommandUtils.isInvalidInteger(sender, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
skill = extractSkill(sender, args[0]);
|
||||
|
||||
if (skill == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(Math.abs(Integer.parseInt(args[1])), skill, sender, command);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], PrimarySkillType.SKILL_NAMES, new ArrayList<String>(PrimarySkillType.SKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void display(int page, PrimarySkillType skill, CommandSender sender, Command command) {
|
||||
if (skill != null && !Permissions.mctop(sender, skill)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (sender instanceof Player) {
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
long cooldownMillis = Math.max(MainConfig.getInstance().getDatabasePlayerCooldown(), 1750);
|
||||
|
||||
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
||||
double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000;
|
||||
if (seconds < 1) {
|
||||
seconds = 1;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.formatString(LocaleLoader.getString("Commands.Database.Cooldown"), seconds));
|
||||
return;
|
||||
}
|
||||
|
||||
if (((Player) sender).hasMetadata(mcMMO.databaseCommandKey)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Processing"));
|
||||
return;
|
||||
} else {
|
||||
((Player) sender).setMetadata(mcMMO.databaseCommandKey, new FixedMetadataValue(mcMMO.p, null));
|
||||
}
|
||||
|
||||
mcMMOPlayer.actualizeDatabaseATS();
|
||||
}
|
||||
|
||||
display(page, skill, sender);
|
||||
}
|
||||
|
||||
private void display(int page, PrimarySkillType skill, CommandSender sender) {
|
||||
boolean useBoard = (sender instanceof Player) && (MainConfig.getInstance().getTopUseBoard());
|
||||
boolean useChat = !useBoard || MainConfig.getInstance().getTopUseChat();
|
||||
|
||||
new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
||||
}
|
||||
|
||||
private PrimarySkillType extractSkill(CommandSender sender, String skillName) {
|
||||
if (CommandUtils.isInvalidSkill(sender, skillName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PrimarySkillType skill = PrimarySkillType.getSkill(skillName);
|
||||
|
||||
if (CommandUtils.isChildSkill(sender, skill)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return skill;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.gmail.nossr50.commands.server;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* This command facilitates switching the skill system scale between classic and modern scale
|
||||
*/
|
||||
public class Mcmmoupgrade implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.random.RandomChanceSkill;
|
||||
import com.gmail.nossr50.core.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import com.gmail.nossr50.listeners.InteractionManager;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AcrobaticsCommand extends SkillCommand {
|
||||
private String dodgeChance;
|
||||
private String dodgeChanceLucky;
|
||||
|
||||
private boolean canDodge;
|
||||
private boolean canRoll;
|
||||
|
||||
public AcrobaticsCommand() {
|
||||
super(PrimarySkillType.ACROBATICS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// ACROBATICS_DODGE
|
||||
if (canDodge) {
|
||||
String[] dodgeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_DODGE);
|
||||
dodgeChance = dodgeStrings[0];
|
||||
dodgeChanceLucky = dodgeStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canDodge = canUseSubskill(player, SubSkillType.ACROBATICS_DODGE);
|
||||
canRoll = canUseSubskill(player, SubSkillType.ACROBATICS_ROLL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canDodge) {
|
||||
messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canRoll) {
|
||||
|
||||
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll");
|
||||
|
||||
if (abstractSubSkill != null) {
|
||||
double rollChance, graceChance;
|
||||
|
||||
//Chance to roll at half
|
||||
RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL);
|
||||
|
||||
//Chance to graceful roll
|
||||
RandomChanceSkill grace_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL);
|
||||
grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2); //Double Odds
|
||||
|
||||
//Chance Stat Calculations
|
||||
rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs);
|
||||
graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs);
|
||||
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
|
||||
|
||||
String rollStrings[] = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL);
|
||||
|
||||
//Format
|
||||
double rollChanceLucky = rollChance * 1.333D;
|
||||
double graceChanceLucky = graceChance * 1.333D;
|
||||
|
||||
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0])
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollStrings[1]) : ""));
|
||||
|
||||
/*messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, String.valueOf(graceChance))
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", String.valueOf(graceChanceLucky)) : ""));*/
|
||||
}
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ACROBATICS);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyCommand extends SkillCommand {
|
||||
private String brewSpeed;
|
||||
private String brewSpeedLucky;
|
||||
|
||||
private int tier;
|
||||
private int ingredientCount;
|
||||
private String ingredientList;
|
||||
|
||||
private boolean canCatalysis;
|
||||
private boolean canConcoctions;
|
||||
|
||||
public AlchemyCommand() {
|
||||
super(PrimarySkillType.ALCHEMY);
|
||||
}
|
||||
|
||||
protected String[] calculateAbilityDisplayValues(Player player) {
|
||||
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
|
||||
String[] displayValues = new String[2];
|
||||
|
||||
boolean isLucky = Permissions.lucky(player, PrimarySkillType.ALCHEMY);
|
||||
|
||||
displayValues[0] = decimal.format(alchemyManager.calculateBrewSpeed(false)) + "x";
|
||||
displayValues[1] = isLucky ? decimal.format(alchemyManager.calculateBrewSpeed(true)) + "x" : null;
|
||||
|
||||
return displayValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// ALCHEMY_CATALYSIS
|
||||
if (canCatalysis) {
|
||||
String[] catalysisStrings = calculateAbilityDisplayValues(player);
|
||||
brewSpeed = catalysisStrings[0];
|
||||
brewSpeedLucky = catalysisStrings[1];
|
||||
}
|
||||
|
||||
// ALCHEMY_CONCOCTIONS
|
||||
if (canConcoctions) {
|
||||
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
|
||||
tier = alchemyManager.getTier();
|
||||
ingredientCount = alchemyManager.getIngredients().size();
|
||||
ingredientList = alchemyManager.getIngredientList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canCatalysis = canUseSubskill(player, SubSkillType.ALCHEMY_CATALYSIS);
|
||||
canConcoctions = canUseSubskill(player, SubSkillType.ALCHEMY_CONCOCTIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canCatalysis) {
|
||||
messages.add(getStatMessage(SubSkillType.ALCHEMY_CATALYSIS, brewSpeed)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
|
||||
}
|
||||
|
||||
if (canConcoctions) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.ALCHEMY_CONCOCTIONS, String.valueOf(tier), String.valueOf(RankUtils.getHighestRank(SubSkillType.ALCHEMY_CONCOCTIONS))));
|
||||
messages.add(getStatMessage(true, true, SubSkillType.ALCHEMY_CONCOCTIONS, String.valueOf(ingredientCount), ingredientList));
|
||||
|
||||
//messages.add(LocaleLoader.getString("Alchemy.Concoctions.Rank", tier, RankUtils.getHighestRank(SubSkillType.ALCHEMY_CONCOCTIONS)));
|
||||
//messages.add(LocaleLoader.getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ALCHEMY);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.util.HolidayManager.FakeSkillType;
|
||||
import com.gmail.nossr50.core.util.Misc;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AprilCommand implements TabExecutor {
|
||||
protected DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
protected DecimalFormat decimal = new DecimalFormat("##0.00");
|
||||
private String skillName;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
skillName = StringUtils.getCapitalized(label);
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
FakeSkillType fakeSkillType = FakeSkillType.getByName(skillName);
|
||||
|
||||
float skillValue = Misc.getRandom().nextInt(99);
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain", getXPGainString(fakeSkillType)));
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Level", (int) skillValue, Misc.getRandom().nextInt(1000), 1000 + Misc.getRandom().nextInt(1000)));
|
||||
|
||||
|
||||
List<String> effectMessages = effectsDisplay(fakeSkillType);
|
||||
|
||||
if (!effectMessages.isEmpty()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Effects.Effects")));
|
||||
|
||||
for (String message : effectMessages) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> statsMessages = statsDisplay(fakeSkillType);
|
||||
|
||||
if (!statsMessages.isEmpty()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Commands.Stats.Self")));
|
||||
|
||||
for (String message : statsMessages) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.formatString("[[DARK_AQUA]]Guide for {0} available - type /APRIL FOOLS ! :D", skillName));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private String getXPGainString(FakeSkillType fakeSkillType) {
|
||||
switch (fakeSkillType) {
|
||||
case MACHO:
|
||||
return "Get beaten up";
|
||||
case JUMPING:
|
||||
return "Kris Kross will make ya Jump Jump";
|
||||
case THROWING:
|
||||
return "Chuck your items on the floor";
|
||||
case WRECKING:
|
||||
return "I'M GONNA WRECK IT!";
|
||||
case CRAFTING:
|
||||
return "Craft apple pies";
|
||||
case WALKING:
|
||||
return "Walk around the park";
|
||||
case SWIMMING:
|
||||
return "Like a fish on a bicycle";
|
||||
case FALLING:
|
||||
return "Faceplant the floor, headbutt the ground";
|
||||
case CLIMBING:
|
||||
return "Climb the highest mountain";
|
||||
case FLYING:
|
||||
return "I believe I can fly";
|
||||
case DIVING:
|
||||
return "Scuba club 4000";
|
||||
case PIGGY:
|
||||
return "OINK! OINK!";
|
||||
default:
|
||||
return "Sit and wait?";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return ImmutableList.of("?");
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> effectsDisplay(FakeSkillType fakeSkillType) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
switch (fakeSkillType) {
|
||||
case MACHO:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Punching bag", "Absorb damage, like a bag of sand"));
|
||||
break;
|
||||
case JUMPING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Jump", "PRESS SPACE TO JUMP"));
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Jump Twice", "PRESS SPACE TWICE TO JUMP TWICE"));
|
||||
break;
|
||||
case THROWING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Drop Item", "Randomly drop items, at random"));
|
||||
break;
|
||||
case WRECKING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Ralphinator", "Smash windows with your fists"));
|
||||
break;
|
||||
case CRAFTING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Crafting", "Chance of successful craft"));
|
||||
break;
|
||||
case WALKING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Walk", "Traveling gracefully by foot"));
|
||||
break;
|
||||
case SWIMMING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Swim", "Just keep swimming, swimming, swimming"));
|
||||
break;
|
||||
case FALLING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Skydiving", "Go jump of a cliff. No, seriously."));
|
||||
break;
|
||||
case CLIMBING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Rock Climber", "Use string to climb mountains faster"));
|
||||
break;
|
||||
case FLYING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Fly", "Throw yourself at the ground and miss"));
|
||||
break;
|
||||
case DIVING:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Hold Breath", "Press shift to hold your breath longer"));
|
||||
break;
|
||||
case PIGGY:
|
||||
messages.add(LocaleLoader.getString("Effects.Template", "Carrot Turbo", "Supercharge your pigs with carrots"));
|
||||
break;
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
private List<String> statsDisplay(FakeSkillType fakeSkillType) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
switch (fakeSkillType) {
|
||||
case MACHO:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Damage Taken: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(77))));
|
||||
break;
|
||||
case JUMPING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Double Jump Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case THROWING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Drop Item Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(87))));
|
||||
break;
|
||||
case WRECKING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Wrecking Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(14))));
|
||||
break;
|
||||
case CRAFTING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Crafting Success: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case WALKING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Walk Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case SWIMMING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Swim Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case FALLING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Skydiving Success: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(37))));
|
||||
break;
|
||||
case CLIMBING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Rock Climber Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case FLYING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Fly Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case DIVING:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Hold Breath Chance: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(27))));
|
||||
break;
|
||||
case PIGGY:
|
||||
messages.add(LocaleLoader.formatString("[[RED]]Carrot Turbo Boost: [[YELLOW]]{0}%", decimal.format(Misc.getRandom().nextInt(80)) + 10));
|
||||
break;
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.archery.Archery;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ArcheryCommand extends SkillCommand {
|
||||
private String skillShotBonus;
|
||||
private String dazeChance;
|
||||
private String dazeChanceLucky;
|
||||
private String retrieveChance;
|
||||
private String retrieveChanceLucky;
|
||||
|
||||
private boolean canSkillShot;
|
||||
private boolean canDaze;
|
||||
private boolean canRetrieve;
|
||||
|
||||
public ArcheryCommand() {
|
||||
super(PrimarySkillType.ARCHERY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// ARCHERY_ARROW_RETRIEVAL
|
||||
if (canRetrieve) {
|
||||
String[] retrieveStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
|
||||
retrieveChance = retrieveStrings[0];
|
||||
retrieveChanceLucky = retrieveStrings[1];
|
||||
}
|
||||
|
||||
// ARCHERY_DAZE
|
||||
if (canDaze) {
|
||||
String[] dazeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_DAZE);
|
||||
dazeChance = dazeStrings[0];
|
||||
dazeChanceLucky = dazeStrings[1];
|
||||
}
|
||||
|
||||
// SKILL SHOT
|
||||
if (canSkillShot) {
|
||||
skillShotBonus = percent.format(Archery.getDamageBonusPercent(player));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canSkillShot = canUseSubskill(player, SubSkillType.ARCHERY_SKILL_SHOT);
|
||||
canDaze = canUseSubskill(player, SubSkillType.ARCHERY_DAZE);
|
||||
canRetrieve = canUseSubskill(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canRetrieve) {
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canDaze) {
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canSkillShot) {
|
||||
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.ARCHERY);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.axes.Axes;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AxesCommand extends SkillCommand {
|
||||
private String critChance;
|
||||
private String critChanceLucky;
|
||||
private double axeMasteryDamage;
|
||||
private double impactDamage;
|
||||
private String skullSplitterLength;
|
||||
private String skullSplitterLengthEndurance;
|
||||
|
||||
private boolean canSkullSplitter;
|
||||
private boolean canCritical;
|
||||
private boolean canAxeMastery;
|
||||
private boolean canImpact;
|
||||
private boolean canGreaterImpact;
|
||||
|
||||
public AxesCommand() {
|
||||
super(PrimarySkillType.AXES);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// ARMOR IMPACT
|
||||
if (canImpact) {
|
||||
impactDamage = UserManager.getPlayer(player).getAxesManager().getImpactDurabilityDamage();
|
||||
}
|
||||
|
||||
// AXE MASTERY
|
||||
if (canAxeMastery) {
|
||||
axeMasteryDamage = Axes.getAxeMasteryBonusDamage(player);
|
||||
}
|
||||
|
||||
// CRITICAL HIT
|
||||
if (canCritical) {
|
||||
String[] criticalHitStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.AXES_CRITICAL_STRIKES);
|
||||
critChance = criticalHitStrings[0];
|
||||
critChanceLucky = criticalHitStrings[1];
|
||||
}
|
||||
|
||||
// SKULL SPLITTER
|
||||
if (canSkullSplitter) {
|
||||
String[] skullSplitterStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
skullSplitterLength = skullSplitterStrings[0];
|
||||
skullSplitterLengthEndurance = skullSplitterStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canSkullSplitter = Permissions.skullSplitter(player) && RankUtils.hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER);
|
||||
canCritical = canUseSubskill(player, SubSkillType.AXES_CRITICAL_STRIKES);
|
||||
canAxeMastery = canUseSubskill(player, SubSkillType.AXES_AXE_MASTERY);
|
||||
canImpact = canUseSubskill(player, SubSkillType.AXES_ARMOR_IMPACT);
|
||||
canGreaterImpact = canUseSubskill(player, SubSkillType.AXES_GREATER_IMPACT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canImpact) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", impactDamage)));
|
||||
}
|
||||
|
||||
if (canAxeMastery) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage)));
|
||||
}
|
||||
|
||||
if (canCritical) {
|
||||
messages.add(getStatMessage(SubSkillType.AXES_CRITICAL_STRIKES, critChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", critChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canGreaterImpact) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.4"), LocaleLoader.getString("Axes.Ability.Bonus.5", Axes.greaterImpactBonusDamage)));
|
||||
}
|
||||
|
||||
if (canSkullSplitter) {
|
||||
messages.add(getStatMessage(SubSkillType.AXES_SKULL_SPLITTER, skullSplitterLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.AXES);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ExcavationCommand extends SkillCommand {
|
||||
private String gigaDrillBreakerLength;
|
||||
private String gigaDrillBreakerLengthEndurance;
|
||||
|
||||
private boolean canGigaDrill;
|
||||
private boolean canTreasureHunt;
|
||||
|
||||
public ExcavationCommand() {
|
||||
super(PrimarySkillType.EXCAVATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// GIGA DRILL BREAKER
|
||||
if (canGigaDrill) {
|
||||
String gigaDrillStrings[] = calculateLengthDisplayValues(player, skillValue);
|
||||
gigaDrillBreakerLength = gigaDrillStrings[0];
|
||||
gigaDrillBreakerLengthEndurance = gigaDrillStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canGigaDrill = Permissions.gigaDrillBreaker(player) && RankUtils.hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
|
||||
canTreasureHunt = canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canGigaDrill) {
|
||||
messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
||||
|
||||
//messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.EXCAVATION);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.core.config.treasure.TreasureConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.fishing.Fishing;
|
||||
import com.gmail.nossr50.core.skills.primary.fishing.FishingManager;
|
||||
import com.gmail.nossr50.core.skills.treasure.Rarity;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FishingCommand extends SkillCommand {
|
||||
private int lootTier;
|
||||
private String shakeChance;
|
||||
private String shakeChanceLucky;
|
||||
private int fishermansDietRank;
|
||||
private String biteChance;
|
||||
|
||||
private String trapTreasure;
|
||||
private String commonTreasure;
|
||||
private String uncommonTreasure;
|
||||
private String rareTreasure;
|
||||
private String epicTreasure;
|
||||
private String legendaryTreasure;
|
||||
private String recordTreasure;
|
||||
|
||||
private String magicChance;
|
||||
|
||||
private boolean canTreasureHunt;
|
||||
private boolean canMagicHunt;
|
||||
private boolean canShake;
|
||||
private boolean canFishermansDiet;
|
||||
private boolean canMasterAngler;
|
||||
private boolean canIceFish;
|
||||
|
||||
public FishingCommand() {
|
||||
super(PrimarySkillType.FISHING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
||||
|
||||
// TREASURE HUNTER
|
||||
if (canTreasureHunt) {
|
||||
lootTier = fishingManager.getLootTier();
|
||||
|
||||
// ItemStack drop rates
|
||||
commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
|
||||
uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
|
||||
rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
|
||||
epicTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.EPIC) / 100.0);
|
||||
legendaryTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.LEGENDARY) / 100.0);
|
||||
recordTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RECORD) / 100.0);
|
||||
|
||||
// Magic hunter drop rates
|
||||
double totalEnchantChance = 0;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
if (rarity != Rarity.RECORD) {
|
||||
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
}
|
||||
}
|
||||
|
||||
if (totalEnchantChance >= 1)
|
||||
magicChance = percent.format(totalEnchantChance / 100.0);
|
||||
else
|
||||
magicChance = percent.format(0);
|
||||
}
|
||||
|
||||
// FISHING_SHAKE
|
||||
if (canShake) {
|
||||
String[] shakeStrings = RandomChanceUtil.calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());
|
||||
shakeChance = shakeStrings[0];
|
||||
shakeChanceLucky = shakeStrings[1];
|
||||
}
|
||||
|
||||
// FISHERMAN'S DIET
|
||||
if (canFishermansDiet) {
|
||||
fishermansDietRank = calculateRank(skillValue, Fishing.fishermansDietMaxLevel, Fishing.fishermansDietRankLevel1);
|
||||
}
|
||||
|
||||
// MASTER ANGLER
|
||||
if (canMasterAngler) {
|
||||
double rawBiteChance = 1.0 / (player.getWorld().hasStorm() ? 300 : 500);
|
||||
|
||||
Location location = fishingManager.getHookLocation();
|
||||
|
||||
if (location == null) {
|
||||
location = player.getLocation();
|
||||
}
|
||||
|
||||
if (Fishing.masterAnglerBiomes.contains(location.getBlock().getBiome())) {
|
||||
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
|
||||
}
|
||||
|
||||
if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
|
||||
rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
|
||||
}
|
||||
|
||||
double luckyModifier = Permissions.lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D;
|
||||
|
||||
biteChance = percent.format((rawBiteChance * 100.0D) * luckyModifier);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canTreasureHunt = canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||
canMagicHunt = canUseSubskill(player, SubSkillType.FISHING_MAGIC_HUNTER) && canUseSubskill(player, SubSkillType.FISHING_TREASURE_HUNTER);
|
||||
canShake = canUseSubskill(player, SubSkillType.FISHING_SHAKE);
|
||||
canFishermansDiet = canUseSubskill(player, SubSkillType.FISHING_FISHERMANS_DIET);
|
||||
canMasterAngler = canUseSubskill(player, SubSkillType.FISHING_MASTER_ANGLER);
|
||||
canIceFish = canUseSubskill(player, SubSkillType.FISHING_ICE_FISHING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canFishermansDiet) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank)));
|
||||
}
|
||||
|
||||
if (canIceFish) {
|
||||
messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription()));
|
||||
}
|
||||
|
||||
if (canMagicHunt) {
|
||||
messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance));
|
||||
}
|
||||
|
||||
if (canMasterAngler) {
|
||||
//TODO: Update this with more details
|
||||
messages.add(getStatMessage(false, true, SubSkillType.FISHING_MASTER_ANGLER, biteChance));
|
||||
}
|
||||
|
||||
if (canShake) {
|
||||
messages.add(getStatMessage(SubSkillType.FISHING_SHAKE, shakeChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canTreasureHunt) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER))));
|
||||
messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER,
|
||||
String.valueOf(commonTreasure),
|
||||
String.valueOf(uncommonTreasure),
|
||||
String.valueOf(rareTreasure),
|
||||
String.valueOf(epicTreasure),
|
||||
String.valueOf(legendaryTreasure),
|
||||
String.valueOf(recordTreasure)));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.FISHING);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HerbalismCommand extends SkillCommand {
|
||||
private String greenTerraLength;
|
||||
private String greenTerraLengthEndurance;
|
||||
private String greenThumbChance;
|
||||
private String greenThumbChanceLucky;
|
||||
private int greenThumbStage;
|
||||
private int farmersDietRank;
|
||||
private String doubleDropChance;
|
||||
private String doubleDropChanceLucky;
|
||||
private String hylianLuckChance;
|
||||
private String hylianLuckChanceLucky;
|
||||
private String shroomThumbChance;
|
||||
private String shroomThumbChanceLucky;
|
||||
|
||||
private boolean hasHylianLuck;
|
||||
private boolean canGreenTerra;
|
||||
private boolean canGreenThumbPlants;
|
||||
private boolean canGreenThumbBlocks;
|
||||
private boolean canFarmersDiet;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean canShroomThumb;
|
||||
|
||||
public HerbalismCommand() {
|
||||
super(PrimarySkillType.HERBALISM);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
|
||||
// DOUBLE DROPS
|
||||
if (canDoubleDrop) {
|
||||
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS);
|
||||
;
|
||||
doubleDropChance = doubleDropStrings[0];
|
||||
doubleDropChanceLucky = doubleDropStrings[1];
|
||||
}
|
||||
|
||||
// FARMERS DIET
|
||||
if (canFarmersDiet) {
|
||||
farmersDietRank = RankUtils.getRank(player, SubSkillType.HERBALISM_FARMERS_DIET);
|
||||
}
|
||||
|
||||
// GREEN TERRA
|
||||
if (canGreenTerra) {
|
||||
String[] greenTerraStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
greenTerraLength = greenTerraStrings[0];
|
||||
greenTerraLengthEndurance = greenTerraStrings[1];
|
||||
}
|
||||
|
||||
// GREEN THUMB
|
||||
if (canGreenThumbBlocks || canGreenThumbPlants) {
|
||||
greenThumbStage = RankUtils.getRank(player, SubSkillType.HERBALISM_GREEN_THUMB);
|
||||
|
||||
String[] greenThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_GREEN_THUMB);
|
||||
greenThumbChance = greenThumbStrings[0];
|
||||
greenThumbChanceLucky = greenThumbStrings[1];
|
||||
}
|
||||
|
||||
// HYLIAN LUCK
|
||||
if (hasHylianLuck) {
|
||||
String[] hylianLuckStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_HYLIAN_LUCK);
|
||||
hylianLuckChance = hylianLuckStrings[0];
|
||||
hylianLuckChanceLucky = hylianLuckStrings[1];
|
||||
}
|
||||
|
||||
// SHROOM THUMB
|
||||
if (canShroomThumb) {
|
||||
String[] shroomThumbStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_SHROOM_THUMB);
|
||||
shroomThumbChance = shroomThumbStrings[0];
|
||||
shroomThumbChanceLucky = shroomThumbStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
hasHylianLuck = canUseSubskill(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
|
||||
canGreenTerra = Permissions.greenTerra(player);
|
||||
canGreenThumbPlants = RankUtils.hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbPlant(player, Material.WHEAT) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.BEETROOT) || Permissions.greenThumbPlant(player, Material.NETHER_WART) || Permissions.greenThumbPlant(player, Material.COCOA));
|
||||
canGreenThumbBlocks = RankUtils.hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLESTONE_WALL) || Permissions.greenThumbBlock(player, Material.STONE_BRICKS));
|
||||
canFarmersDiet = canUseSubskill(player, SubSkillType.HERBALISM_FARMERS_DIET);
|
||||
canDoubleDrop = canUseSubskill(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||
canShroomThumb = canUseSubskill(player, SubSkillType.HERBALISM_SHROOM_THUMB);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canDoubleDrop) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canFarmersDiet) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.HERBALISM_FARMERS_DIET, String.valueOf(farmersDietRank)));
|
||||
}
|
||||
|
||||
if (canGreenTerra) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_TERRA, greenTerraLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
|
||||
|
||||
//messages.add(LocaleLoader.getString("Herbalism.Ability.GTe.Length", greenTerraLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
if (canGreenThumbBlocks || canGreenThumbPlants) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_THUMB, greenThumbChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Herbalism.Ability.GTh.Chance", greenThumbChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canGreenThumbPlants) {
|
||||
messages.add(getStatMessage(true, true, SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage)));
|
||||
}
|
||||
|
||||
if (hasHylianLuck) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_HYLIAN_LUCK, hylianLuckChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", hylianLuckChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canShroomThumb) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_SHROOM_THUMB, shroomThumbChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shroomThumbChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.HERBALISM);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.mining.MiningManager;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MiningCommand extends SkillCommand {
|
||||
private String doubleDropChance;
|
||||
private String doubleDropChanceLucky;
|
||||
private String superBreakerLength;
|
||||
private String superBreakerLengthEndurance;
|
||||
|
||||
private int blastMiningRank;
|
||||
private int bonusTNTDrops;
|
||||
private double blastRadiusIncrease;
|
||||
private String oreBonus;
|
||||
private String debrisReduction;
|
||||
private String blastDamageDecrease;
|
||||
|
||||
private boolean canSuperBreaker;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean canBlast;
|
||||
private boolean canBiggerBombs;
|
||||
private boolean canDemoExpert;
|
||||
|
||||
public MiningCommand() {
|
||||
super(PrimarySkillType.MINING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// BLAST MINING
|
||||
if (canBlast || canDemoExpert || canBiggerBombs) {
|
||||
MiningManager miningManager = UserManager.getPlayer(player).getMiningManager();
|
||||
|
||||
blastMiningRank = miningManager.getBlastMiningTier();
|
||||
bonusTNTDrops = miningManager.getDropMultiplier();
|
||||
oreBonus = percent.format(miningManager.getOreBonus() / 30.0D); // Base received in TNT is 30%
|
||||
debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30%
|
||||
blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D);
|
||||
blastRadiusIncrease = miningManager.getBlastRadiusModifier();
|
||||
}
|
||||
|
||||
// DOUBLE DROPS
|
||||
if (canDoubleDrop) {
|
||||
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS);
|
||||
doubleDropChance = doubleDropStrings[0];
|
||||
doubleDropChanceLucky = doubleDropStrings[1];
|
||||
}
|
||||
|
||||
// SUPER BREAKER
|
||||
if (canSuperBreaker) {
|
||||
String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
superBreakerLength = superBreakerStrings[0];
|
||||
superBreakerLengthEndurance = superBreakerStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canBiggerBombs = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(player);
|
||||
canBlast = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player);
|
||||
canDemoExpert = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player);
|
||||
canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled();
|
||||
canSuperBreaker = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canBiggerBombs) {
|
||||
messages.add(getStatMessage(true, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastRadiusIncrease)));
|
||||
//messages.add(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease));
|
||||
}
|
||||
|
||||
if (canBlast) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
|
||||
//messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops)));
|
||||
}
|
||||
|
||||
if (canDemoExpert) {
|
||||
messages.add(getStatMessage(SubSkillType.MINING_DEMOLITIONS_EXPERTISE, blastDamageDecrease));
|
||||
//messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease));
|
||||
}
|
||||
|
||||
if (canDoubleDrop) {
|
||||
messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canSuperBreaker) {
|
||||
messages.add(getStatMessage(SubSkillType.MINING_SUPER_BREAKER, superBreakerLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
|
||||
//messages.add(LocaleLoader.getString("Mining.Ability.Length", superBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.MINING);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.listeners.InteractionManager;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is the command that retrieves data about skills from in-game sources
|
||||
*/
|
||||
public class MmoInfoCommand implements TabExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
|
||||
/*
|
||||
* Only allow players to use this command
|
||||
*/
|
||||
if (commandSender instanceof Player) {
|
||||
if (args.length < 1)
|
||||
return false;
|
||||
|
||||
Player player = (Player) commandSender;
|
||||
if (Permissions.mmoinfo(player)) {
|
||||
if (args == null || args[0] == null)
|
||||
return false;
|
||||
|
||||
if (args[0].equalsIgnoreCase("???")) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", "???"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mystery"));
|
||||
return true;
|
||||
} else if (InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) {
|
||||
displayInfo(player, args[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
//Not a real skill
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.NoMatch"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], PrimarySkillType.SUBSKILL_NAMES, new ArrayList<String>(PrimarySkillType.SUBSKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void displayInfo(Player player, String subSkillName) {
|
||||
//Check to see if the skill exists in the new system
|
||||
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName);
|
||||
if (abstractSubSkill != null) {
|
||||
/* New System Skills are programmable */
|
||||
abstractSubSkill.printInfo(player);
|
||||
//TextComponentFactory.sendPlayerUrlHeader(player);
|
||||
} else {
|
||||
/*
|
||||
* Skill is only in the old system
|
||||
*/
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", subSkillName));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill"));
|
||||
}
|
||||
|
||||
for (SubSkillType subSkillType : SubSkillType.values()) {
|
||||
if (subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName))
|
||||
subSkillName = subSkillType.getWikiName(subSkillType.toString());
|
||||
}
|
||||
|
||||
//Send Player Wiki Link
|
||||
TextComponentFactory.sendPlayerSubSkillWikiLink(player, subSkillName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.MaterialType;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.repair.ArcaneForging;
|
||||
import com.gmail.nossr50.core.skills.primary.repair.Repair;
|
||||
import com.gmail.nossr50.core.skills.primary.repair.RepairManager;
|
||||
import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RepairCommand extends SkillCommand {
|
||||
private String repairMasteryBonus;
|
||||
private String superRepairChance;
|
||||
private String superRepairChanceLucky;
|
||||
|
||||
private boolean canSuperRepair;
|
||||
private boolean canMasterRepair;
|
||||
private boolean canArcaneForge;
|
||||
private boolean canRepairStone;
|
||||
private boolean canRepairIron;
|
||||
private boolean canRepairGold;
|
||||
private boolean canRepairDiamond;
|
||||
private boolean canRepairString;
|
||||
private boolean canRepairLeather;
|
||||
private boolean canRepairWood;
|
||||
private boolean arcaneBypass;
|
||||
|
||||
private int diamondLevel;
|
||||
private int goldLevel;
|
||||
private int ironLevel;
|
||||
private int stoneLevel;
|
||||
|
||||
public RepairCommand() {
|
||||
super(PrimarySkillType.REPAIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// We're using pickaxes here, not the best but it works
|
||||
Repairable diamondRepairable = mcMMO.getRepairableManager().getRepairable(Material.DIAMOND_PICKAXE);
|
||||
Repairable goldRepairable = mcMMO.getRepairableManager().getRepairable(Material.GOLDEN_PICKAXE);
|
||||
Repairable ironRepairable = mcMMO.getRepairableManager().getRepairable(Material.IRON_PICKAXE);
|
||||
Repairable stoneRepairable = mcMMO.getRepairableManager().getRepairable(Material.STONE_PICKAXE);
|
||||
|
||||
// TODO: This isn't really accurate - if they don't have pickaxes loaded it doesn't always mean the repair level is 0
|
||||
diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel();
|
||||
goldLevel = (goldRepairable == null) ? 0 : goldRepairable.getMinimumLevel();
|
||||
ironLevel = (ironRepairable == null) ? 0 : ironRepairable.getMinimumLevel();
|
||||
stoneLevel = (stoneRepairable == null) ? 0 : stoneRepairable.getMinimumLevel();
|
||||
|
||||
// REPAIR MASTERY
|
||||
if (canMasterRepair) {
|
||||
repairMasteryBonus = percent.format(Math.min(((Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * skillValue), Repair.repairMasteryMaxBonus) / 100D);
|
||||
}
|
||||
|
||||
// SUPER REPAIR
|
||||
if (canSuperRepair) {
|
||||
String[] superRepairStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.REPAIR_SUPER_REPAIR);
|
||||
superRepairChance = superRepairStrings[0];
|
||||
superRepairChanceLucky = superRepairStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canSuperRepair = canUseSubskill(player, SubSkillType.REPAIR_SUPER_REPAIR);
|
||||
canMasterRepair = canUseSubskill(player, SubSkillType.REPAIR_REPAIR_MASTERY);
|
||||
canArcaneForge = canUseSubskill(player, SubSkillType.REPAIR_ARCANE_FORGING);
|
||||
canRepairDiamond = Permissions.repairMaterialType(player, MaterialType.DIAMOND);
|
||||
canRepairGold = Permissions.repairMaterialType(player, MaterialType.GOLD);
|
||||
canRepairIron = Permissions.repairMaterialType(player, MaterialType.IRON);
|
||||
canRepairStone = Permissions.repairMaterialType(player, MaterialType.STONE);
|
||||
canRepairString = Permissions.repairMaterialType(player, MaterialType.STRING);
|
||||
canRepairLeather = Permissions.repairMaterialType(player, MaterialType.LEATHER);
|
||||
canRepairWood = Permissions.repairMaterialType(player, MaterialType.WOOD);
|
||||
arcaneBypass = Permissions.arcaneBypass(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canArcaneForge) {
|
||||
RepairManager repairManager = UserManager.getPlayer(player).getRepairManager();
|
||||
|
||||
messages.add(getStatMessage(false, true,
|
||||
SubSkillType.REPAIR_ARCANE_FORGING,
|
||||
String.valueOf(RankUtils.getRank(player, SubSkillType.REPAIR_ARCANE_FORGING)),
|
||||
RankUtils.getHighestRankStr(SubSkillType.REPAIR_ARCANE_FORGING)));
|
||||
|
||||
if (ArcaneForging.arcaneForgingEnchantLoss || ArcaneForging.arcaneForgingDowngrades) {
|
||||
messages.add(getStatMessage(true, true, SubSkillType.REPAIR_ARCANE_FORGING,
|
||||
String.valueOf(arcaneBypass ? 100 : repairManager.getKeepEnchantChance()),
|
||||
String.valueOf(arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); //Jesus those parentheses
|
||||
}
|
||||
}
|
||||
|
||||
if (canMasterRepair) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.REPAIR_REPAIR_MASTERY, repairMasteryBonus));
|
||||
}
|
||||
|
||||
if (canSuperRepair) {
|
||||
messages.add(getStatMessage(SubSkillType.REPAIR_SUPER_REPAIR, superRepairChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", superRepairChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.REPAIR);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.child.salvage.Salvage;
|
||||
import com.gmail.nossr50.core.skills.child.salvage.SalvageManager;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SalvageCommand extends SkillCommand {
|
||||
private boolean canAdvancedSalvage;
|
||||
private boolean canArcaneSalvage;
|
||||
|
||||
public SalvageCommand() {
|
||||
super(PrimarySkillType.SALVAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canAdvancedSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ADVANCED_SALVAGE);
|
||||
canArcaneSalvage = canUseSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager();
|
||||
|
||||
if (canAdvancedSalvage) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Ability.Bonus.0"),
|
||||
LocaleLoader.getString("Salvage.Ability.Bonus.1", salvageManager.getSalvageableAmount())));
|
||||
}
|
||||
|
||||
if (canArcaneSalvage) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.SALVAGE_ARCANE_SALVAGE,
|
||||
String.valueOf(salvageManager.getArcaneSalvageRank()),
|
||||
String.valueOf(RankUtils.getHighestRank(SubSkillType.SALVAGE_ARCANE_SALVAGE))));
|
||||
|
||||
if (Salvage.arcaneSalvageEnchantLoss) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Arcane.ExtractFull"), percent.format(salvageManager.getExtractFullEnchantChance() / 100)));
|
||||
}
|
||||
|
||||
if (Salvage.arcaneSalvageDowngrades) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Salvage.Arcane.ExtractPartial"), percent.format(salvageManager.getExtractPartialEnchantChance() / 100)));
|
||||
}
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SALVAGE);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.child.FamilyTree;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.core.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.gmail.nossr50.core.util.skills.PerksUtils;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class SkillCommand implements TabExecutor {
|
||||
protected PrimarySkillType skill;
|
||||
protected DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
protected DecimalFormat decimal = new DecimalFormat("##0.00");
|
||||
private String skillName;
|
||||
private CommandExecutor skillGuideCommand;
|
||||
|
||||
public SkillCommand(PrimarySkillType skill) {
|
||||
this.skill = skill;
|
||||
skillName = skill.getName();
|
||||
skillGuideCommand = new SkillGuideCommand(skill);
|
||||
}
|
||||
|
||||
public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
|
||||
String[] newArray = new String[existingArray.length + 1];
|
||||
newArray[0] = itemToAdd;
|
||||
|
||||
System.arraycopy(existingArray, 0, newArray, 1, existingArray.length);
|
||||
|
||||
return newArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandUtils.hasPlayerDataKey(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
boolean isLucky = Permissions.lucky(player, skill);
|
||||
boolean hasEndurance = (PerksUtils.handleActivationPerks(player, 0, 0) != 0);
|
||||
float skillValue = mcMMOPlayer.getSkillLevel(skill);
|
||||
|
||||
//Send the players a few blank lines to make finding the top of the skill command easier
|
||||
if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines())
|
||||
for (int i = 0; i < 2; i++) {
|
||||
player.sendMessage("");
|
||||
}
|
||||
|
||||
permissionsCheck(player);
|
||||
dataCalculations(player, skillValue);
|
||||
|
||||
sendSkillCommandHeader(player, mcMMOPlayer, (int) skillValue);
|
||||
|
||||
//Make JSON text components
|
||||
List<TextComponent> subskillTextComponents = getTextComponents(player);
|
||||
|
||||
//Subskills Header
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", LocaleLoader.getString("Effects.SubSkills.Overhaul")));
|
||||
|
||||
//Send JSON text components
|
||||
|
||||
TextComponentFactory.sendPlayerSubSkillList(player, subskillTextComponents);
|
||||
|
||||
/*for(TextComponent tc : subskillTextComponents)
|
||||
{
|
||||
player.spigot().sendMessage(new TextComponent[]{tc, new TextComponent(": TESTING")});
|
||||
}*/
|
||||
|
||||
//Stats
|
||||
getStatMessages(player, isLucky, hasEndurance, skillValue);
|
||||
|
||||
//Header
|
||||
|
||||
|
||||
//Link Header
|
||||
if (MainConfig.getInstance().getUrlLinksEnabled()) {
|
||||
player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header"));
|
||||
TextComponentFactory.sendPlayerUrlHeader(player);
|
||||
}
|
||||
|
||||
|
||||
if (MainConfig.getInstance().getScoreboardsEnabled() && MainConfig.getInstance().getSkillUseBoard()) {
|
||||
ScoreboardManager.enablePlayerSkillScoreboard(player, skill);
|
||||
}
|
||||
|
||||
return true;
|
||||
default:
|
||||
return skillGuideCommand.onCommand(sender, command, label, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void getStatMessages(Player player, boolean isLucky, boolean hasEndurance, float skillValue) {
|
||||
List<String> statsMessages = statsDisplay(player, skillValue, hasEndurance, isLucky);
|
||||
|
||||
if (!statsMessages.isEmpty()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", LocaleLoader.getString("Commands.Stats.Self.Overhaul")));
|
||||
|
||||
for (String message : statsMessages) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Guides.Available", skillName, skillName.toLowerCase()));
|
||||
}
|
||||
|
||||
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
|
||||
ChatColor hd1 = ChatColor.DARK_AQUA;
|
||||
ChatColor c1 = ChatColor.GOLD;
|
||||
ChatColor c2 = ChatColor.RED;
|
||||
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName));
|
||||
|
||||
if (!skill.isChildSkill()) {
|
||||
/*
|
||||
* NON-CHILD SKILLS
|
||||
*/
|
||||
|
||||
//XP GAIN METHOD
|
||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
|
||||
|
||||
//LEVEL
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Level.Overhaul", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
|
||||
|
||||
} else {
|
||||
/*
|
||||
* CHILD SKILLS
|
||||
*/
|
||||
|
||||
|
||||
Set<PrimarySkillType> parents = FamilyTree.getParents(skill);
|
||||
ArrayList<PrimarySkillType> parentList = new ArrayList<>();
|
||||
|
||||
//TODO: Add JSON here
|
||||
for (PrimarySkillType parent : parents) {
|
||||
parentList.add(parent);
|
||||
/*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/
|
||||
;
|
||||
}
|
||||
|
||||
String parentMessage = "";
|
||||
|
||||
for (int i = 0; i < parentList.size(); i++) {
|
||||
if (i + 1 < parentList.size()) {
|
||||
parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i)));
|
||||
parentMessage += ChatColor.GRAY + ", ";
|
||||
} else {
|
||||
parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
//XP GAIN METHOD
|
||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain.Overhaul", LocaleLoader.getString("Commands.XPGain.Child")));
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Child.Overhaul", skillValue, parentMessage));
|
||||
//LEVEL
|
||||
//player.sendMessage(LocaleLoader.getString("Effects.Child.Overhaul", skillValue, skillValue));
|
||||
|
||||
}
|
||||
/*
|
||||
if (!skill.isChildSkill()) {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Level", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", skillName + " " + LocaleLoader.getString("Skills.Child")));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.XPGain", LocaleLoader.getString("Commands.XPGain.Child")));
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Child", skillValue));
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Skills.Header", LocaleLoader.getString("Skills.Parents")));
|
||||
Set<PrimarySkillType> parents = FamilyTree.getParents(skill);
|
||||
|
||||
for (PrimarySkillType parent : parents) {
|
||||
player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)));
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return ImmutableList.of("?");
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected int calculateRank(float skillValue, int maxLevel, int rankChangeLevel) {
|
||||
return Math.min((int) skillValue, maxLevel) / rankChangeLevel;
|
||||
}
|
||||
|
||||
protected String[] getAbilityDisplayValues(SkillActivationType skillActivationType, Player player, SubSkillType subSkill) {
|
||||
return RandomChanceUtil.calculateAbilityDisplayValues(skillActivationType, player, subSkill);
|
||||
}
|
||||
|
||||
protected String[] calculateLengthDisplayValues(Player player, float skillValue) {
|
||||
int maxLength = skill.getAbility().getMaxLength();
|
||||
int abilityLengthVar = AdvancedConfig.getInstance().getAbilityLength();
|
||||
int abilityLengthCap = AdvancedConfig.getInstance().getAbilityLengthCap();
|
||||
|
||||
int length;
|
||||
|
||||
if (abilityLengthCap <= 0) {
|
||||
length = 2 + (int) (skillValue / abilityLengthVar);
|
||||
} else {
|
||||
length = 2 + (int) (Math.min(abilityLengthCap, skillValue) / abilityLengthVar);
|
||||
}
|
||||
|
||||
int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);
|
||||
|
||||
if (maxLength != 0) {
|
||||
length = Math.min(length, maxLength);
|
||||
}
|
||||
|
||||
return new String[]{String.valueOf(length), String.valueOf(enduranceLength)};
|
||||
}
|
||||
|
||||
protected String getStatMessage(SubSkillType subSkillType, String... vars) {
|
||||
return getStatMessage(false, false, subSkillType, vars);
|
||||
}
|
||||
|
||||
protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) {
|
||||
String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template";
|
||||
String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription() : subSkillType.getLocaleKeyStatExtraDescription();
|
||||
|
||||
if (isCustom)
|
||||
//Cast to Object[] to suppress warnings
|
||||
return LocaleLoader.getString(templateKey, LocaleLoader.getString(statDescriptionKey, (Object[]) vars));
|
||||
else {
|
||||
String[] mergedList = addItemToFirstPositionOfArray(LocaleLoader.getString(statDescriptionKey), vars);
|
||||
//Cast to Object[] to suppress warnings
|
||||
return LocaleLoader.getString(templateKey, (Object[]) mergedList);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void dataCalculations(Player player, float skillValue);
|
||||
|
||||
protected abstract void permissionsCheck(Player player);
|
||||
|
||||
//protected abstract List<String> effectsDisplay();
|
||||
|
||||
protected abstract List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky);
|
||||
|
||||
protected abstract List<TextComponent> getTextComponents(Player player);
|
||||
|
||||
/**
|
||||
* Checks if a player can use a skill
|
||||
*
|
||||
* @param player target player
|
||||
* @param subSkillType target subskill
|
||||
* @return true if the player has permission and has the skill unlocked
|
||||
*/
|
||||
protected boolean canUseSubskill(Player player, SubSkillType subSkillType) {
|
||||
return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SkillGuideCommand implements CommandExecutor {
|
||||
private String header;
|
||||
private ArrayList<String> guide;
|
||||
|
||||
private String invalidPage = LocaleLoader.getString("Guides.Page.Invalid");
|
||||
|
||||
public SkillGuideCommand(PrimarySkillType skill) {
|
||||
header = LocaleLoader.getString("Guides.Header", skill.getName());
|
||||
guide = getGuide(skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (!args[0].equals("?")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sendGuide(sender, 1);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
int totalPages = getTotalPageNumber();
|
||||
|
||||
if (!StringUtils.isInt(args[1])) {
|
||||
sender.sendMessage(invalidPage);
|
||||
return true;
|
||||
}
|
||||
|
||||
int pageNumber = Integer.parseInt(args[1]);
|
||||
|
||||
if (pageNumber > totalPages || pageNumber <= 0) {
|
||||
sender.sendMessage(LocaleLoader.getString("Guides.Page.OutOfRange", totalPages));
|
||||
return true;
|
||||
}
|
||||
|
||||
sendGuide(sender, pageNumber);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private int getTotalPageNumber() {
|
||||
return (int) Math.ceil(guide.size() / 8.0);
|
||||
}
|
||||
|
||||
private void sendGuide(CommandSender sender, int pageNumber) {
|
||||
for (String target : grabPageContents(pageNumber)) {
|
||||
sender.sendMessage(target);
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<String> grabPageContents(int page) {
|
||||
int pageIndexStart = 8 * (page - 1); // Determine what string to start at
|
||||
ArrayList<String> allStrings = new ArrayList<String>();
|
||||
|
||||
allStrings.add(header);
|
||||
|
||||
// Add targeted strings
|
||||
while (allStrings.size() < 9) {
|
||||
if (pageIndexStart + allStrings.size() > guide.size()) {
|
||||
allStrings.add("");
|
||||
} else {
|
||||
allStrings.add(guide.get(pageIndexStart + (allStrings.size() - 1)));
|
||||
}
|
||||
}
|
||||
|
||||
allStrings.add("Page " + page + " of " + getTotalPageNumber());
|
||||
return allStrings;
|
||||
}
|
||||
|
||||
private ArrayList<String> getGuide(PrimarySkillType skill) {
|
||||
ArrayList<String> guide = new ArrayList<String>();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
String[] section = LocaleLoader.getString("Guides." + StringUtils.getCapitalized(skill.toString()) + ".Section." + i).split("\n");
|
||||
|
||||
if (section[0].startsWith("!")) {
|
||||
break;
|
||||
}
|
||||
|
||||
guide.addAll(Arrays.asList(section));
|
||||
|
||||
if (section.length < 8) {
|
||||
for (int blankLine = 8 - section.length; blankLine > 0; blankLine--) {
|
||||
guide.add("");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return guide;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.child.smelting.Smelting;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SmeltingCommand extends SkillCommand {
|
||||
private String burnTimeModifier;
|
||||
private String str_secondSmeltChance;
|
||||
private String str_secondSmeltChanceLucky;
|
||||
private String str_fluxMiningChance;
|
||||
private String str_fluxMiningChanceLucky;
|
||||
|
||||
private boolean canFuelEfficiency;
|
||||
private boolean canSecondSmelt;
|
||||
private boolean canFluxMine;
|
||||
private boolean canUnderstandTheArt;
|
||||
|
||||
public SmeltingCommand() {
|
||||
super(PrimarySkillType.SMELTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// FUEL EFFICIENCY
|
||||
if (canFuelEfficiency) {
|
||||
burnTimeModifier = decimal.format(1 + ((skillValue / Smelting.burnModifierMaxLevel) * Smelting.burnTimeMultiplier));
|
||||
}
|
||||
|
||||
// FLUX MINING
|
||||
/*if (canFluxMine) {
|
||||
String[] fluxMiningStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_FLUX_MINING);
|
||||
str_fluxMiningChance = fluxMiningStrings[0];
|
||||
str_fluxMiningChanceLucky = fluxMiningStrings[1];
|
||||
}*/
|
||||
|
||||
// SECOND SMELT
|
||||
if (canSecondSmelt) {
|
||||
String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT);
|
||||
str_secondSmeltChance = secondSmeltStrings[0];
|
||||
str_secondSmeltChanceLucky = secondSmeltStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canFuelEfficiency = canUseSubskill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY);
|
||||
canSecondSmelt = canUseSubskill(player, SubSkillType.SMELTING_SECOND_SMELT);
|
||||
canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
|
||||
canUnderstandTheArt = Permissions.vanillaXpBoost(player, skill) && RankUtils.hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
/*if (canFluxMine) {
|
||||
messages.add(getStatMessage(SubSkillType.SMELTING_FLUX_MINING, str_fluxMiningChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Smelting.Ability.FluxMining", str_fluxMiningChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
|
||||
}*/
|
||||
|
||||
if (canFuelEfficiency) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier));
|
||||
}
|
||||
|
||||
if (canSecondSmelt) {
|
||||
messages.add(getStatMessage(SubSkillType.SMELTING_SECOND_SMELT, str_secondSmeltChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_secondSmeltChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canUnderstandTheArt) {
|
||||
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_UNDERSTANDING_THE_ART,
|
||||
String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getVanillaXpMultiplier())));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SMELTING);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SwordsCommand extends SkillCommand {
|
||||
private String counterChance;
|
||||
private String counterChanceLucky;
|
||||
private int bleedLength;
|
||||
private String bleedChance;
|
||||
private String bleedChanceLucky;
|
||||
private String serratedStrikesLength;
|
||||
private String serratedStrikesLengthEndurance;
|
||||
|
||||
private boolean canCounter;
|
||||
private boolean canSerratedStrike;
|
||||
private boolean canBleed;
|
||||
|
||||
public SwordsCommand() {
|
||||
super(PrimarySkillType.SWORDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// SWORDS_COUNTER_ATTACK
|
||||
if (canCounter) {
|
||||
String[] counterStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_COUNTER_ATTACK);
|
||||
counterChance = counterStrings[0];
|
||||
counterChanceLucky = counterStrings[1];
|
||||
}
|
||||
|
||||
// SWORDS_RUPTURE
|
||||
if (canBleed) {
|
||||
bleedLength = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
|
||||
|
||||
String[] bleedStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SWORDS_RUPTURE);
|
||||
bleedChance = bleedStrings[0];
|
||||
bleedChanceLucky = bleedStrings[1];
|
||||
}
|
||||
|
||||
// SERRATED STRIKES
|
||||
if (canSerratedStrike) {
|
||||
String[] serratedStrikesStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
serratedStrikesLength = serratedStrikesStrings[0];
|
||||
serratedStrikesLengthEndurance = serratedStrikesStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canBleed = canUseSubskill(player, SubSkillType.SWORDS_RUPTURE);
|
||||
canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
|
||||
canSerratedStrike = RankUtils.hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks();
|
||||
double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer();
|
||||
double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs();
|
||||
|
||||
if (canCounter) {
|
||||
messages.add(getStatMessage(SubSkillType.SWORDS_COUNTER_ATTACK, counterChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canBleed) {
|
||||
messages.add(getStatMessage(SubSkillType.SWORDS_RUPTURE, bleedChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", bleedChanceLucky) : ""));
|
||||
messages.add(getStatMessage(true, true, SubSkillType.SWORDS_RUPTURE,
|
||||
String.valueOf(ruptureTicks),
|
||||
String.valueOf(ruptureDamagePlayers),
|
||||
String.valueOf(ruptureDamageMobs)));
|
||||
|
||||
messages.add(LocaleLoader.getString("Swords.Combat.Rupture.Note"));
|
||||
}
|
||||
|
||||
if (canSerratedStrike) {
|
||||
messages.add(getStatMessage(SubSkillType.SWORDS_SERRATED_STRIKES, serratedStrikesLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.SWORDS);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.taming.Taming;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TamingCommand extends SkillCommand {
|
||||
private String goreChance;
|
||||
private String goreChanceLucky;
|
||||
|
||||
private boolean canBeastLore;
|
||||
private boolean canGore;
|
||||
private boolean canSharpenedClaws;
|
||||
private boolean canEnvironmentallyAware;
|
||||
private boolean canThickFur;
|
||||
private boolean canShockProof;
|
||||
private boolean canCallWild;
|
||||
private boolean canFastFood;
|
||||
private boolean canHolyHound;
|
||||
|
||||
public TamingCommand() {
|
||||
super(PrimarySkillType.TAMING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
if (canGore) {
|
||||
String[] goreStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.TAMING_GORE);
|
||||
goreChance = goreStrings[0];
|
||||
goreChanceLucky = goreStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE);
|
||||
canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);
|
||||
canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
|
||||
canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
|
||||
canGore = canUseSubskill(player, SubSkillType.TAMING_GORE);
|
||||
canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS);
|
||||
canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF);
|
||||
canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR);
|
||||
canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canEnvironmentallyAware) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1")));
|
||||
}
|
||||
|
||||
if (canFastFood) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D))));
|
||||
}
|
||||
|
||||
if (canGore) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template",
|
||||
LocaleLoader.getString("Taming.Combat.Chance.Gore"),
|
||||
goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canHolyHound) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11")));
|
||||
}
|
||||
|
||||
if (canSharpenedClaws) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage)));
|
||||
}
|
||||
|
||||
if (canShockProof) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier)));
|
||||
}
|
||||
|
||||
if (canThickFur) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier)));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, this.skill);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UnarmedCommand extends SkillCommand {
|
||||
private String berserkLength;
|
||||
private String berserkLengthEndurance;
|
||||
private String deflectChance;
|
||||
private String deflectChanceLucky;
|
||||
private String disarmChance;
|
||||
private String disarmChanceLucky;
|
||||
private String ironGripChance;
|
||||
private String ironGripChanceLucky;
|
||||
private double ironArmBonus;
|
||||
|
||||
private boolean canBerserk;
|
||||
private boolean canDisarm;
|
||||
private boolean canIronArm;
|
||||
private boolean canDeflect;
|
||||
private boolean canIronGrip;
|
||||
|
||||
public UnarmedCommand() {
|
||||
super(PrimarySkillType.UNARMED);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// UNARMED_ARROW_DEFLECT
|
||||
if (canDeflect) {
|
||||
String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT);
|
||||
;
|
||||
deflectChance = deflectStrings[0];
|
||||
deflectChanceLucky = deflectStrings[1];
|
||||
}
|
||||
|
||||
// BERSERK
|
||||
if (canBerserk) {
|
||||
String[] berserkStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
berserkLength = berserkStrings[0];
|
||||
berserkLengthEndurance = berserkStrings[1];
|
||||
}
|
||||
|
||||
// UNARMED_DISARM
|
||||
if (canDisarm) {
|
||||
String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM);
|
||||
;
|
||||
disarmChance = disarmStrings[0];
|
||||
disarmChanceLucky = disarmStrings[1];
|
||||
}
|
||||
|
||||
// IRON ARM
|
||||
if (canIronArm) {
|
||||
ironArmBonus = UserManager.getPlayer(player).getUnarmedManager().getIronArmDamage();
|
||||
}
|
||||
|
||||
// IRON GRIP
|
||||
if (canIronGrip) {
|
||||
String[] ironGripStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_IRON_GRIP);
|
||||
ironGripChance = ironGripStrings[0];
|
||||
ironGripChanceLucky = ironGripStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canBerserk = RankUtils.hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(player);
|
||||
canIronArm = canUseSubskill(player, SubSkillType.UNARMED_IRON_ARM_STYLE);
|
||||
canDeflect = canUseSubskill(player, SubSkillType.UNARMED_ARROW_DEFLECT);
|
||||
canDisarm = canUseSubskill(player, SubSkillType.UNARMED_DISARM);
|
||||
canIronGrip = canUseSubskill(player, SubSkillType.UNARMED_IRON_GRIP);
|
||||
// TODO: Apparently we forgot about block cracker?
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canDeflect) {
|
||||
messages.add(getStatMessage(SubSkillType.UNARMED_ARROW_DEFLECT, deflectChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canBerserk) {
|
||||
messages.add(getStatMessage(SubSkillType.UNARMED_BERSERK, berserkLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
|
||||
//messages.add(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
if (canDisarm) {
|
||||
messages.add(getStatMessage(SubSkillType.UNARMED_DISARM, disarmChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canIronArm) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
|
||||
}
|
||||
|
||||
if (canIronGrip) {
|
||||
messages.add(getStatMessage(SubSkillType.UNARMED_IRON_GRIP, ironGripChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
|
||||
//messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.UNARMED);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.TextComponentFactory;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.core.util.skills.SkillActivationType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WoodcuttingCommand extends SkillCommand {
|
||||
private String treeFellerLength;
|
||||
private String treeFellerLengthEndurance;
|
||||
private String doubleDropChance;
|
||||
private String doubleDropChanceLucky;
|
||||
|
||||
private boolean canTreeFell;
|
||||
private boolean canLeafBlow;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean canSplinter;
|
||||
private boolean canBarkSurgeon;
|
||||
private boolean canNaturesBounty;
|
||||
|
||||
public WoodcuttingCommand() {
|
||||
super(PrimarySkillType.WOODCUTTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// DOUBLE DROPS
|
||||
if (canDoubleDrop) {
|
||||
setDoubleDropClassicChanceStrings(player);
|
||||
}
|
||||
|
||||
// TREE FELLER
|
||||
if (canTreeFell) {
|
||||
String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue);
|
||||
treeFellerLength = treeFellerStrings[0];
|
||||
treeFellerLengthEndurance = treeFellerStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
private void setDoubleDropClassicChanceStrings(Player player) {
|
||||
String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);
|
||||
;
|
||||
doubleDropChance = doubleDropStrings[0];
|
||||
doubleDropChanceLucky = doubleDropStrings[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {
|
||||
canTreeFell = RankUtils.hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player);
|
||||
canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
|
||||
canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
|
||||
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
|
||||
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
|
||||
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canDoubleDrop) {
|
||||
messages.add(getStatMessage(SubSkillType.WOODCUTTING_HARVEST_LUMBER, doubleDropChance)
|
||||
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canLeafBlow) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1")));
|
||||
}
|
||||
|
||||
if (canTreeFell) {
|
||||
messages.add(getStatMessage(SubSkillType.WOODCUTTING_TREE_FELLER, treeFellerLength)
|
||||
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", treeFellerLengthEndurance) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<TextComponent> getTextComponents(Player player) {
|
||||
List<TextComponent> textComponents = new ArrayList<>();
|
||||
|
||||
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.WOODCUTTING);
|
||||
|
||||
return textComponents;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,566 @@
|
||||
package com.gmail.nossr50.listeners;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.config.ChunkConversionOptions;
|
||||
import com.gmail.nossr50.core.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.core.skills.ToolType;
|
||||
import com.gmail.nossr50.core.skills.child.salvage.Salvage;
|
||||
import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy;
|
||||
import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager;
|
||||
import com.gmail.nossr50.core.skills.primary.herbalism.Herbalism;
|
||||
import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager;
|
||||
import com.gmail.nossr50.core.skills.primary.mining.MiningManager;
|
||||
import com.gmail.nossr50.core.skills.primary.repair.Repair;
|
||||
import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager;
|
||||
import com.gmail.nossr50.core.util.BlockUtils;
|
||||
import com.gmail.nossr50.core.util.EventUtils;
|
||||
import com.gmail.nossr50.core.util.ItemUtils;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.core.util.sounds.SoundManager;
|
||||
import com.gmail.nossr50.core.util.sounds.SoundType;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.core.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeBlockDamageEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.block.*;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockListener implements Listener {
|
||||
private final mcMMO plugin;
|
||||
|
||||
public BlockListener(final mcMMO plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockPistonExtend events.
|
||||
*
|
||||
* @param event The event to monitor
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockPistonExtend(BlockPistonExtendEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
BlockFace direction = event.getDirection();
|
||||
Block movedBlock = event.getBlock();
|
||||
movedBlock = movedBlock.getRelative(direction, 2);
|
||||
|
||||
for (Block b : event.getBlocks()) {
|
||||
if (BlockUtils.shouldBeWatched(b.getState()) && mcMMO.getPlaceStore().isTrue(b)) {
|
||||
movedBlock = b.getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockPistonRetract events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
// Get opposite direction so we get correct block
|
||||
BlockFace direction = event.getDirection();
|
||||
Block movedBlock = event.getBlock().getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock);
|
||||
|
||||
for (Block block : event.getBlocks()) {
|
||||
movedBlock = block.getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor blocks formed by entities (snowmen)
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityBlockFormEvent(EntityBlockFormEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
if (BlockUtils.shouldBeWatched(event.getBlock().getState())) {
|
||||
mcMMO.getPlaceStore().setTrue(event.getBlock());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor falling blocks.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onFallingBlock(EntityChangeBlockEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
if (BlockUtils.shouldBeWatched(event.getBlock().getState()) && event.getEntityType().equals(EntityType.FALLING_BLOCK)) {
|
||||
if (event.getTo().equals(Material.AIR) && mcMMO.getPlaceStore().isTrue(event.getBlock())) {
|
||||
event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue(plugin, event.getBlock().getLocation()));
|
||||
} else {
|
||||
List<MetadataValue> values = event.getEntity().getMetadata("mcMMOBlockFall");
|
||||
|
||||
if (!values.isEmpty()) {
|
||||
|
||||
if (values.get(0).value() == null) return;
|
||||
Block spawn = ((org.bukkit.Location) values.get(0).value()).getBlock();
|
||||
|
||||
|
||||
mcMMO.getPlaceStore().setTrue(event.getBlock());
|
||||
mcMMO.getPlaceStore().setFalse(spawn);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockPlace events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onBlockPlace(BlockPlaceEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
|
||||
/* Check if the blocks placed should be monitored so they do not give out XP in the future */
|
||||
if (BlockUtils.shouldBeWatched(blockState)) {
|
||||
// Don't count de-barking wood
|
||||
if (!Tag.LOGS.isTagged(event.getBlockReplacedState().getType()) || !Tag.LOGS.isTagged(event.getBlockPlaced().getType()))
|
||||
mcMMO.getPlaceStore().setTrue(blockState);
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (blockState.getType() == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player)) {
|
||||
mcMMOPlayer.getRepairManager().placedAnvilCheck();
|
||||
} else if (blockState.getType() == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player)) {
|
||||
mcMMOPlayer.getSalvageManager().placedAnvilCheck();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockMultiPlace events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockMultiPlace(BlockMultiPlaceEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (BlockState replacedBlockState : event.getReplacedBlockStates()) {
|
||||
BlockState blockState = replacedBlockState.getBlock().getState();
|
||||
|
||||
/* Check if the blocks placed should be monitored so they do not give out XP in the future */
|
||||
if (BlockUtils.shouldBeWatched(blockState)) {
|
||||
mcMMO.getPlaceStore().setTrue(blockState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockGrow(BlockGrowEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
|
||||
if (!BlockUtils.shouldBeWatched(blockState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMO.getPlaceStore().setFalse(blockState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockBreak events.
|
||||
*
|
||||
* @param event The event to monitor
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer()))
|
||||
return;
|
||||
}
|
||||
|
||||
if (event instanceof FakeBlockBreakEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
Location location = blockState.getLocation();
|
||||
|
||||
if (!BlockUtils.shouldBeWatched(blockState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* ALCHEMY - Cancel any brew in progress for that BrewingStand */
|
||||
if (blockState instanceof BrewingStand && Alchemy.brewingStandMap.containsKey(location)) {
|
||||
Alchemy.brewingStandMap.get(location).cancelBrew();
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
/* HERBALISM */
|
||||
if (BlockUtils.affectedByGreenTerra(blockState)) {
|
||||
HerbalismManager herbalismManager = mcMMOPlayer.getHerbalismManager();
|
||||
|
||||
/* Green Terra */
|
||||
if (herbalismManager.canActivateAbility()) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.HERBALISM);
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't check the block store here because herbalism has too many unusual edge cases.
|
||||
* Instead, we check it inside the drops handler.
|
||||
*/
|
||||
if (PrimarySkillType.HERBALISM.getPermissions(player)) {
|
||||
herbalismManager.herbalismBlockCheck(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
/* MINING */
|
||||
else if (BlockUtils.affectedBySuperBreaker(blockState) && ItemUtils.isPickaxe(heldItem) && PrimarySkillType.MINING.getPermissions(player) && !mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
MiningManager miningManager = mcMMOPlayer.getMiningManager();
|
||||
miningManager.miningBlockCheck(blockState);
|
||||
}
|
||||
|
||||
/* WOOD CUTTING */
|
||||
else if (BlockUtils.isLog(blockState) && ItemUtils.isAxe(heldItem) && PrimarySkillType.WOODCUTTING.getPermissions(player) && !mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
WoodcuttingManager woodcuttingManager = mcMMOPlayer.getWoodcuttingManager();
|
||||
if (woodcuttingManager.canUseTreeFeller(heldItem)) {
|
||||
woodcuttingManager.processTreeFeller(blockState);
|
||||
} else {
|
||||
woodcuttingManager.woodcuttingBlockCheck(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
/* EXCAVATION */
|
||||
else if (BlockUtils.affectedByGigaDrillBreaker(blockState) && ItemUtils.isShovel(heldItem) && PrimarySkillType.EXCAVATION.getPermissions(player) && !mcMMO.getPlaceStore().isTrue(blockState)) {
|
||||
ExcavationManager excavationManager = mcMMOPlayer.getExcavationManager();
|
||||
excavationManager.excavationBlockCheck(blockState);
|
||||
|
||||
if (mcMMOPlayer.getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER)) {
|
||||
excavationManager.gigaDrillBreaker(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove metadata from placed watched blocks */
|
||||
mcMMO.getPlaceStore().setFalse(blockState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle BlockBreak events where the event is modified.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockBreakHigher(BlockBreakEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer()))
|
||||
return;
|
||||
}
|
||||
|
||||
if (event instanceof FakeBlockBreakEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (Herbalism.isRecentlyRegrown(blockState)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ItemUtils.isSword(heldItem)) {
|
||||
HerbalismManager herbalismManager = UserManager.getPlayer(player).getHerbalismManager();
|
||||
|
||||
if (herbalismManager.canUseHylianLuck()) {
|
||||
if (herbalismManager.processHylianLuck(blockState)) {
|
||||
blockState.update(true);
|
||||
event.setCancelled(true);
|
||||
} else if (blockState.getType() == Material.FLOWER_POT) {
|
||||
blockState.setType(Material.AIR);
|
||||
blockState.update(true);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else if (!heldItem.containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||
SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();
|
||||
|
||||
if (smeltingManager.canUseFluxMining(blockState)) {
|
||||
if (smeltingManager.processFluxMining(blockState)) {
|
||||
blockState.update(true);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor BlockDamage events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockDamage(BlockDamageEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer()))
|
||||
return;
|
||||
}
|
||||
|
||||
if (event instanceof FakeBlockDamageEvent) {
|
||||
return;
|
||||
}
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
/*
|
||||
* ABILITY PREPARATION CHECKS
|
||||
*
|
||||
* We check permissions here before processing activation.
|
||||
*/
|
||||
if (BlockUtils.canActivateAbilities(blockState)) {
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
if (mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && ItemUtils.isHoe(heldItem) && (BlockUtils.affectedByGreenTerra(blockState) || BlockUtils.canMakeMossy(blockState)) && Permissions.greenTerra(player)) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.HERBALISM);
|
||||
} else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && ItemUtils.isAxe(heldItem) && BlockUtils.isLog(blockState) && Permissions.treeFeller(player)) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.WOODCUTTING);
|
||||
} else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && ItemUtils.isPickaxe(heldItem) && BlockUtils.affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.MINING);
|
||||
} else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION);
|
||||
} else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* TREE FELLER SOUNDS
|
||||
*
|
||||
* We don't need to check permissions here because they've already been checked for the ability to even activate.
|
||||
*/
|
||||
if (mcMMOPlayer.getAbilityMode(SuperAbilityType.TREE_FELLER) && BlockUtils.isLog(blockState) && MainConfig.getInstance().getTreeFellerSoundsEnabled()) {
|
||||
SoundManager.sendSound(player, blockState.getLocation(), SoundType.FIZZ);
|
||||
}
|
||||
}
|
||||
|
||||
private Player getPlayerFromFurnace(Block furnaceBlock) {
|
||||
List<MetadataValue> metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey);
|
||||
|
||||
if (metadata.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return plugin.getServer().getPlayerExact(metadata.get(0).asString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle BlockDamage events where the event is modified.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockDamageHigher(BlockDamageEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
||||
return;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer()))
|
||||
return;
|
||||
}
|
||||
|
||||
if (event instanceof FakeBlockDamageEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
Block block = event.getBlock();
|
||||
BlockState blockState = block.getState();
|
||||
|
||||
/*
|
||||
* ABILITY TRIGGER CHECKS
|
||||
*
|
||||
* We don't need to check permissions here because they've already been checked for the ability to even activate.
|
||||
*/
|
||||
if (mcMMOPlayer.getAbilityMode(SuperAbilityType.GREEN_TERRA) && BlockUtils.canMakeMossy(blockState)) {
|
||||
if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) {
|
||||
blockState.update(true);
|
||||
}
|
||||
} else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) {
|
||||
if (SuperAbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
event.setInstaBreak(true);
|
||||
SoundManager.sendSound(player, block.getLocation(), SoundType.POP);
|
||||
} else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
|
||||
blockState.update();
|
||||
}
|
||||
}
|
||||
} else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
|
||||
event.setInstaBreak(true);
|
||||
SoundManager.sendSound(player, block.getLocation(), SoundType.POP);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onBlockDamageCleanup(BlockDamageEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
BlockState blockState = event.getBlock().getState();
|
||||
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
cleanupAbilityTools(player, mcMMOPlayer, blockState, heldItem);
|
||||
|
||||
debugStickDump(player, blockState);
|
||||
}
|
||||
|
||||
public void debugStickDump(Player player, BlockState blockState) {
|
||||
if (player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) {
|
||||
if (mcMMO.getPlaceStore().isTrue(blockState))
|
||||
player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP");
|
||||
else {
|
||||
player.sendMessage("[mcMMO DEBUG] This block is considered natural by mcMMO");
|
||||
UserManager.getPlayer(player).getExcavationManager().printExcavationDebug(player, blockState);
|
||||
}
|
||||
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
player.sendMessage("[mcMMO DEBUG] World Guard main flag is permitted for this player in this region");
|
||||
else
|
||||
player.sendMessage("[mcMMO DEBUG] World Guard main flag is DENIED for this player in this region");
|
||||
|
||||
if (WorldGuardManager.getInstance().hasXPFlag(player))
|
||||
player.sendMessage("[mcMMO DEBUG] World Guard xp flag is permitted for this player in this region");
|
||||
else
|
||||
player.sendMessage("[mcMMO DEBUG] World Guard xp flag is not permitted for this player in this region");
|
||||
}
|
||||
|
||||
if (blockState instanceof Furnace) {
|
||||
Furnace furnace = (Furnace) blockState;
|
||||
if (furnace.hasMetadata(mcMMO.furnaceMetadataKey)) {
|
||||
player.sendMessage("[mcMMO DEBUG] This furnace has a registered owner");
|
||||
Player furnacePlayer = getPlayerFromFurnace(furnace.getBlock());
|
||||
if (furnacePlayer != null) {
|
||||
player.sendMessage("[mcMMO DEBUG] This furnace is owned by player " + furnacePlayer.getName());
|
||||
}
|
||||
} else
|
||||
player.sendMessage("[mcMMO DEBUG] This furnace does not have a registered owner");
|
||||
}
|
||||
|
||||
if (ExperienceConfig.getInstance().isExperienceBarsEnabled())
|
||||
player.sendMessage("[mcMMO DEBUG] XP bars are enabled, however you should check per-skill settings to make sure those are enabled.");
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanupAbilityTools(Player player, McMMOPlayer mcMMOPlayer, BlockState blockState, ItemStack heldItem) {
|
||||
if (ChunkConversionOptions.getInstance().useEnchantmentBuffs()) {
|
||||
if ((ItemUtils.isPickaxe(heldItem) && !mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER)) || (ItemUtils.isShovel(heldItem) && !mcMMOPlayer.getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER))) {
|
||||
SkillUtils.removeAbilityBuff(heldItem);
|
||||
}
|
||||
} else {
|
||||
if ((mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) && !BlockUtils.affectedBySuperBreaker(blockState)) || (mcMMOPlayer.getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER) && !BlockUtils.affectedByGigaDrillBreaker(blockState))) {
|
||||
SkillUtils.handleAbilitySpeedDecrease(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,860 @@
|
||||
package com.gmail.nossr50.listeners;
|
||||
|
||||
import com.gmail.nossr50.core.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.core.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.core.config.MainConfig;
|
||||
import com.gmail.nossr50.core.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.meta.OldName;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.primary.archery.Archery;
|
||||
import com.gmail.nossr50.core.skills.primary.fishing.Fishing;
|
||||
import com.gmail.nossr50.core.skills.primary.mining.BlastMining;
|
||||
import com.gmail.nossr50.core.skills.primary.mining.MiningManager;
|
||||
import com.gmail.nossr50.core.skills.primary.taming.Taming;
|
||||
import com.gmail.nossr50.core.skills.primary.taming.TamingManager;
|
||||
import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType;
|
||||
import com.gmail.nossr50.core.util.BlockUtils;
|
||||
import com.gmail.nossr50.core.util.Misc;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityTameEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.*;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EntityListener implements Listener {
|
||||
private final mcMMO plugin;
|
||||
|
||||
public EntityListener(final mcMMO plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityTargetEntity(EntityTargetLivingEntityEvent event) {
|
||||
if (!ExperienceConfig.getInstance().isEndermanEndermiteFarmingPrevented())
|
||||
return;
|
||||
|
||||
//Prevent entities from giving XP if they target endermite
|
||||
if (event.getTarget() instanceof Endermite) {
|
||||
if (event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0)
|
||||
event.getEntity().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityShootBow(EntityShootBowEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player player = (Player) event.getEntity();
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Entity projectile = event.getProjectile();
|
||||
|
||||
if (!(projectile instanceof Arrow)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack bow = event.getBow();
|
||||
|
||||
if (bow != null && bow.containsEnchantment(Enchantment.ARROW_INFINITE)) {
|
||||
projectile.setMetadata(mcMMO.infiniteArrowKey, mcMMO.metadataValue);
|
||||
}
|
||||
|
||||
projectile.setMetadata(mcMMO.bowForceKey, new FixedMetadataValue(plugin, Math.min(event.getForce() * AdvancedConfig.getInstance().getForceMultiplier(), 1.0)));
|
||||
projectile.setMetadata(mcMMO.arrowDistanceKey, new FixedMetadataValue(plugin, projectile.getLocation()));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onProjectileLaunch(ProjectileLaunchEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player player = (Player) event.getEntity();
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Projectile projectile = event.getEntity();
|
||||
|
||||
if (!(projectile instanceof Arrow) || projectile.hasMetadata(mcMMO.bowForceKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
projectile.setMetadata(mcMMO.bowForceKey, new FixedMetadataValue(plugin, 1.0));
|
||||
projectile.setMetadata(mcMMO.arrowDistanceKey, new FixedMetadataValue(plugin, projectile.getLocation()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor EntityChangeBlock events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Block block = event.getBlock();
|
||||
|
||||
// When the event is fired for the falling block that changes back to a
|
||||
// normal block
|
||||
// event.getBlock().getType() returns AIR
|
||||
if (!BlockUtils.shouldBeWatched(block.getState()) && block.getType() != Material.AIR) {
|
||||
return;
|
||||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (entity instanceof FallingBlock || entity instanceof Enderman) {
|
||||
boolean isTracked = entity.hasMetadata(mcMMO.entityMetadataKey);
|
||||
|
||||
if (mcMMO.getPlaceStore().isTrue(block) && !isTracked) {
|
||||
mcMMO.getPlaceStore().setFalse(block);
|
||||
entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
} else if (isTracked) {
|
||||
mcMMO.getPlaceStore().setTrue(block);
|
||||
}
|
||||
} else if ((block.getType() == Material.REDSTONE_ORE)) {
|
||||
return;
|
||||
} else {
|
||||
if (mcMMO.getPlaceStore().isTrue(block)) {
|
||||
mcMMO.getPlaceStore().setFalse(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EntityDamageByEntity events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event instanceof FakeEntityDamageByEntityEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getEntity() instanceof ArmorStand) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
double damage = event.getFinalDamage();
|
||||
Entity defender = event.getEntity();
|
||||
Entity attacker = event.getDamager();
|
||||
|
||||
if (attacker instanceof Player) {
|
||||
Player player = (Player) attacker;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (damage <= 0) {
|
||||
if (defender instanceof Player && attacker instanceof Player) {
|
||||
Player defendingPlayer = (Player) defender;
|
||||
Player attackingPlayer = (Player) attacker;
|
||||
if (event.getDamage(DamageModifier.ABSORPTION) > 0) {
|
||||
//If friendly fire is off don't allow players to hurt one another
|
||||
if (!MainConfig.getInstance().getPartyFriendlyFire())
|
||||
if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
As far as I can tell at one point we registered meta-data about custom damage and we no longer do that.
|
||||
|
||||
if (defender.hasMetadata(mcMMO.customDamageKey)) {
|
||||
defender.removeMetadata(mcMMO.customDamageKey, plugin);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if (Misc.isNPCEntity(defender) || !defender.isValid() || !(defender instanceof LivingEntity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LivingEntity target = (LivingEntity) defender;
|
||||
|
||||
if (CombatUtils.isInvincible(target, damage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Misc.isNPCEntity(attacker)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (attacker instanceof Projectile) {
|
||||
ProjectileSource projectileSource = ((Projectile) attacker).getShooter();
|
||||
|
||||
if (projectileSource instanceof LivingEntity) {
|
||||
attacker = (LivingEntity) projectileSource;
|
||||
}
|
||||
} else if (attacker instanceof Tameable) {
|
||||
AnimalTamer animalTamer = ((Tameable) attacker).getOwner();
|
||||
|
||||
if (animalTamer != null && ((OfflinePlayer) animalTamer).isOnline()) {
|
||||
attacker = (Entity) animalTamer;
|
||||
}
|
||||
} else if (attacker instanceof TNTPrimed && defender instanceof Player) {
|
||||
if (BlastMining.processBlastMiningExplosion(event, (TNTPrimed) attacker, (Player) defender)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (defender instanceof Player && attacker instanceof Player) {
|
||||
Player defendingPlayer = (Player) defender;
|
||||
Player attackingPlayer = (Player) attacker;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(defendingPlayer) || !UserManager.hasPlayerDataKey(attackingPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We want to make sure we're not gaining XP or applying abilities
|
||||
// when we hit ourselves
|
||||
if (defendingPlayer.equals(attackingPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Party Friendly Fire
|
||||
if (!MainConfig.getInstance().getPartyFriendlyFire())
|
||||
if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CombatUtils.processCombatAttack(event, attacker, target);
|
||||
CombatUtils.handleHealthbars(attacker, target, event.getFinalDamage(), plugin);
|
||||
|
||||
/**
|
||||
* This sets entity names back to whatever they are supposed to be
|
||||
*/
|
||||
if (!(attacker instanceof Player) && defender instanceof Player) {
|
||||
if (event.getFinalDamage() >= ((LivingEntity) defender).getHealth()) {
|
||||
List<MetadataValue> metadataValue = attacker.getMetadata("mcMMO_oldName");
|
||||
|
||||
if (metadataValue.size() <= 0)
|
||||
return;
|
||||
|
||||
if (metadataValue != null) {
|
||||
OldName oldName = (OldName) metadataValue.get(0);
|
||||
attacker.setCustomName(oldName.asString());
|
||||
attacker.setCustomNameVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EntityDamage events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityDamage(EntityDamageEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player player = (Player) event.getEntity();
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Process Registered Interactions
|
||||
*/
|
||||
|
||||
InteractionManager.processEvent(event, plugin, InteractType.ON_ENTITY_DAMAGE);
|
||||
|
||||
/*
|
||||
* Old code
|
||||
*/
|
||||
|
||||
if (event instanceof FakeEntityDamageEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
double damage = event.getFinalDamage();
|
||||
|
||||
if (damage <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
/*
|
||||
As far as I can tell at one point we registered meta-data about custom damage and we no longer do that.
|
||||
if (entity.hasMetadata(mcMMO.customDamageKey)) {
|
||||
entity.removeMetadata(mcMMO.customDamageKey, plugin);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if (Misc.isNPCEntity(entity) || !entity.isValid() || !(entity instanceof LivingEntity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LivingEntity livingEntity = (LivingEntity) entity;
|
||||
|
||||
if (CombatUtils.isInvincible(livingEntity, damage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DamageCause cause = event.getCause();
|
||||
|
||||
if (livingEntity instanceof Player) {
|
||||
Player player = (Player) entity;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
/* Check for invincibility */
|
||||
if (mcMMOPlayer.getGodMode()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getFinalDamage() >= 1) {
|
||||
mcMMOPlayer.actualizeRecentlyHurt();
|
||||
}
|
||||
|
||||
} else if (livingEntity instanceof Tameable) {
|
||||
Tameable pet = (Tameable) livingEntity;
|
||||
AnimalTamer owner = pet.getOwner();
|
||||
|
||||
if (owner instanceof Player) {
|
||||
Player player = (Player) owner;
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Taming.canPreventDamage(pet, owner)) {
|
||||
Player player = (Player) owner;
|
||||
Wolf wolf = (Wolf) pet;
|
||||
|
||||
TamingManager tamingManager = UserManager.getPlayer(player).getTamingManager();
|
||||
|
||||
switch (cause) {
|
||||
case CONTACT:
|
||||
case FIRE:
|
||||
case LAVA:
|
||||
if (tamingManager.canUseEnvironmentallyAware()) {
|
||||
tamingManager.processEnvironmentallyAware(wolf, event.getDamage());
|
||||
}
|
||||
return;
|
||||
|
||||
case FALL:
|
||||
if (tamingManager.canUseEnvironmentallyAware()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
|
||||
case ENTITY_ATTACK:
|
||||
case PROJECTILE:
|
||||
if (tamingManager.canUseThickFur()) {
|
||||
event.setDamage(Taming.processThickFur(wolf, event.getDamage()));
|
||||
|
||||
if (event.getFinalDamage() == 0) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
case FIRE_TICK:
|
||||
if (tamingManager.canUseThickFur()) {
|
||||
Taming.processThickFurFire(wolf);
|
||||
}
|
||||
return;
|
||||
|
||||
case MAGIC:
|
||||
case POISON:
|
||||
case WITHER:
|
||||
if (tamingManager.canUseHolyHound()) {
|
||||
Taming.processHolyHound(wolf, event.getDamage());
|
||||
}
|
||||
return;
|
||||
|
||||
case BLOCK_EXPLOSION:
|
||||
case ENTITY_EXPLOSION:
|
||||
case LIGHTNING:
|
||||
if (tamingManager.canUseShockProof()) {
|
||||
event.setDamage(Taming.processShockProof(wolf, event.getDamage()));
|
||||
|
||||
if (event.getFinalDamage() == 0) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor EntityDeath events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDeathLowest(EntityDeathEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
LivingEntity entity = event.getEntity();
|
||||
|
||||
if (Misc.isNPCEntity(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity.hasMetadata(mcMMO.customNameKey)) {
|
||||
entity.setCustomName(entity.getMetadata(mcMMO.customNameKey).get(0).asString());
|
||||
entity.removeMetadata(mcMMO.customNameKey, plugin);
|
||||
}
|
||||
|
||||
if (entity.hasMetadata(mcMMO.customVisibleKey)) {
|
||||
entity.setCustomNameVisible(entity.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean());
|
||||
entity.removeMetadata(mcMMO.customVisibleKey, plugin);
|
||||
}
|
||||
|
||||
if (entity.hasMetadata(mcMMO.entityMetadataKey)) {
|
||||
entity.removeMetadata(mcMMO.entityMetadataKey, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor EntityDeath events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onEntityDeath(EntityDeathEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
LivingEntity entity = event.getEntity();
|
||||
|
||||
if (Misc.isNPCEntity(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Archery.arrowRetrievalCheck(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor CreatureSpawn events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
LivingEntity entity = event.getEntity();
|
||||
|
||||
switch (event.getSpawnReason()) {
|
||||
case NETHER_PORTAL:
|
||||
case SPAWNER:
|
||||
case SPAWNER_EGG:
|
||||
entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
|
||||
Entity passenger = entity.getPassenger();
|
||||
|
||||
if (passenger != null) {
|
||||
passenger.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
return;
|
||||
|
||||
case BREEDING:
|
||||
entity.setMetadata(mcMMO.bredMetadataKey, mcMMO.metadataValue);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle ExplosionPrime events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onExplosionPrime(ExplosionPrimeEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(mcMMO.tntMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We can make this assumption because we (should) be the only ones
|
||||
// using this exact metadata
|
||||
Player player = plugin.getServer().getPlayerExact(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
|
||||
MiningManager miningManager = UserManager.getPlayer(player).getMiningManager();
|
||||
|
||||
if (miningManager.canUseBiggerBombs()) {
|
||||
event.setRadius(miningManager.biggerBombs(event.getRadius()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EntityExplode events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEnitityExplode(EntityExplodeEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(mcMMO.tntMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We can make this assumption because we (should) be the only ones
|
||||
// using this exact metadata
|
||||
Player player = plugin.getServer().getPlayerExact(entity.getMetadata(mcMMO.tntMetadataKey).get(0).asString());
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
|
||||
MiningManager miningManager = UserManager.getPlayer(player).getMiningManager();
|
||||
|
||||
if (miningManager.canUseBlastMining()) {
|
||||
miningManager.blastMiningDropProcessing(event.getYield(), event.blockList());
|
||||
event.setYield(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EntityExplode events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityExplodeMonitor(EntityExplodeEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(mcMMO.tntsafeMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.blockList().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle FoodLevelChange events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) entity;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int currentFoodLevel = player.getFoodLevel();
|
||||
int newFoodLevel = event.getFoodLevel();
|
||||
int foodChange = newFoodLevel - currentFoodLevel;
|
||||
|
||||
if (foodChange <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some foods have 3 ranks Some foods have 5 ranks The number of ranks
|
||||
* is based on how 'common' the item is We can adjust this quite easily
|
||||
* if we find something is giving too much of a bonus
|
||||
*/
|
||||
switch (player.getInventory().getItemInMainHand().getType()) {
|
||||
case BAKED_POTATO: /*
|
||||
* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
case BEETROOT:
|
||||
case BREAD: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */
|
||||
case CARROT: /*
|
||||
* RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
case GOLDEN_CARROT: /*
|
||||
* RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
case MUSHROOM_STEW: /*
|
||||
* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
case PUMPKIN_PIE: /*
|
||||
* RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) {
|
||||
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel));
|
||||
}
|
||||
return;
|
||||
|
||||
case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
||||
case MELON_SLICE: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
||||
case POISONOUS_POTATO: /*
|
||||
* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER
|
||||
* @ 1000
|
||||
*/
|
||||
case POTATO: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */
|
||||
if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) {
|
||||
event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel));
|
||||
}
|
||||
return;
|
||||
|
||||
case COOKED_SALMON: /*
|
||||
* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @
|
||||
* 1000
|
||||
*/
|
||||
if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) {
|
||||
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel));
|
||||
}
|
||||
return;
|
||||
|
||||
case SALMON: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */
|
||||
if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) {
|
||||
event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel2, newFoodLevel));
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor EntityTame events.
|
||||
*
|
||||
* @param event The event to watch
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEntityTame(EntityTameEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event instanceof FakeEntityTameEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) event.getOwner();
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
|
||||
LivingEntity entity = event.getEntity();
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player) || Misc.isNPCEntity(entity) || entity.hasMetadata(mcMMO.entityMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
UserManager.getPlayer(player).getTamingManager().awardTamingXP(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EntityTarget events.
|
||||
*
|
||||
* @param event The event to process
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityTarget(EntityTargetEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
Entity target = event.getTarget();
|
||||
|
||||
if (!(entity instanceof Tameable) || !(target instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) target;
|
||||
|
||||
/* WORLD GUARD MAIN FLAG CHECK */
|
||||
if (WorldGuardUtils.isWorldGuardLoaded()) {
|
||||
if (!WorldGuardManager.getInstance().hasMainFlag(player))
|
||||
return;
|
||||
}
|
||||
|
||||
Tameable tameable = (Tameable) entity;
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(player) || !CombatUtils.isFriendlyPet(player, tameable)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// isFriendlyPet ensures that the Tameable is: Tamed, owned by a player,
|
||||
// and the owner is in the same party
|
||||
// So we can make some assumptions here, about our casting and our check
|
||||
if (!(Permissions.friendlyFire(player) && Permissions.friendlyFire((Player) tameable.getOwner()))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle PotionSplash events in order to fix broken Splash Potion of
|
||||
* Saturation.
|
||||
*
|
||||
* @param event The event to process
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPotionSplash(PotionSplashEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
for (PotionEffect effect : ((PotionMeta) event.getPotion().getItem().getItemMeta()).getCustomEffects()) {
|
||||
if (!effect.getType().equals(PotionEffectType.SATURATION)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (LivingEntity entity : event.getAffectedEntities()) {
|
||||
int duration = (int) (effect.getDuration() * event.getIntensity(entity));
|
||||
entity.addPotionEffect(new PotionEffect(effect.getType(), duration, effect.getAmplifier(), effect.isAmbient()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPigZapEvent(PigZapEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
||||
if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey)) {
|
||||
event.getPigZombie().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gmail.nossr50.listeners;
|
||||
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType;
|
||||
import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class InteractionManager {
|
||||
private static HashMap<InteractType, ArrayList<Interaction>> interactRegister;
|
||||
private static HashMap<String, AbstractSubSkill> subSkillNameMap; //Used for mmoinfo optimization
|
||||
private static ArrayList<AbstractSubSkill> subSkillList;
|
||||
|
||||
/**
|
||||
* Registers subskills with the Interaction registration
|
||||
*
|
||||
* @param abstractSubSkill the target subskill to register
|
||||
*/
|
||||
public static void registerSubSkill(AbstractSubSkill abstractSubSkill) {
|
||||
/* INIT MAPS */
|
||||
if (interactRegister == null)
|
||||
interactRegister = new HashMap<>();
|
||||
|
||||
if (subSkillList == null)
|
||||
subSkillList = new ArrayList<>();
|
||||
|
||||
if (subSkillNameMap == null)
|
||||
subSkillNameMap = new HashMap<>();
|
||||
|
||||
//Store a unique copy of each subskill
|
||||
if (!subSkillList.contains(abstractSubSkill))
|
||||
subSkillList.add(abstractSubSkill);
|
||||
|
||||
//Init ArrayList
|
||||
if (interactRegister.get(abstractSubSkill.getInteractType()) == null)
|
||||
interactRegister.put(abstractSubSkill.getInteractType(), new ArrayList<>());
|
||||
|
||||
//Registration array reference
|
||||
ArrayList<Interaction> arrayRef = interactRegister.get(abstractSubSkill.getInteractType());
|
||||
|
||||
//Register skill
|
||||
arrayRef.add(abstractSubSkill);
|
||||
|
||||
String lowerCaseName = abstractSubSkill.getConfigKeyName().toLowerCase();
|
||||
|
||||
//Register in name map
|
||||
if (subSkillNameMap.get(lowerCaseName) == null)
|
||||
subSkillNameMap.put(lowerCaseName, abstractSubSkill);
|
||||
|
||||
System.out.println("[mcMMO] registered subskill: " + abstractSubSkill.getConfigKeyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Grabs the registered abstract skill by its name
|
||||
* Is not case sensitive
|
||||
*
|
||||
* @param name name of subskill, not case sensitive
|
||||
* @return null if the subskill is not registered
|
||||
*/
|
||||
public static AbstractSubSkill getAbstractByName(String name) {
|
||||
return subSkillNameMap.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the associated Interactions for this event
|
||||
*
|
||||
* @param event target event
|
||||
* @param plugin instance of mcMMO plugin
|
||||
* @param curInteractType the associated interaction type
|
||||
*/
|
||||
public static void processEvent(Event event, mcMMO plugin, InteractType curInteractType) {
|
||||
for (Interaction interaction : interactRegister.get(curInteractType)) {
|
||||
interaction.doInteraction(event, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list that contains all unique instances of registered Interaction classes
|
||||
* Interactions are extensions of abstract classes that represent modifying behaviours in Minecraft through events
|
||||
*
|
||||
* @return the unique collection of all registered Interaction classes
|
||||
*/
|
||||
public static ArrayList<AbstractSubSkill> getSubSkillList() {
|
||||
return subSkillList;
|
||||
}
|
||||
|
||||
public static boolean hasSubSkill(String name) {
|
||||
return getAbstractByName(name) != null;
|
||||
}
|
||||
|
||||
public static boolean hasSubSkill(SubSkillType subSkillType) {
|
||||
return hasSubSkill(subSkillType.getNiceNameNoSpaces(subSkillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the associative map which contains all registered interactions
|
||||
*
|
||||
* @return the interact register
|
||||
*/
|
||||
public static HashMap<InteractType, ArrayList<Interaction>> getInteractRegister() {
|
||||
return interactRegister;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user