mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-18 09:43:00 +01:00
Compare commits
1042 Commits
1.4.03
...
dev-1.4.09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b791649432 | ||
|
|
306ac5d949 | ||
|
|
fb75eac1f7 | ||
|
|
44a4448527 | ||
|
|
001ea19b1c | ||
|
|
3f347091c4 | ||
|
|
f4dbbd7e57 | ||
|
|
e4d3cb5f4d | ||
|
|
e455b41ab9 | ||
|
|
ea704a87db | ||
|
|
813d9049c2 | ||
|
|
67314e1320 | ||
|
|
0e6611c7e9 | ||
|
|
7d82d5ff7b | ||
|
|
eb51081a66 | ||
|
|
00c89d2cf6 | ||
|
|
d88afaf696 | ||
|
|
c6be608e5e | ||
|
|
9def3d5eb4 | ||
|
|
a052bfda7e | ||
|
|
c35c3c0dab | ||
|
|
23f5946cac | ||
|
|
813eeb8873 | ||
|
|
8e60403fc1 | ||
|
|
23b4ff7134 | ||
|
|
b16dec4532 | ||
|
|
271ba2e5f1 | ||
|
|
c9ab2bebd6 | ||
|
|
ef4bbca36a | ||
|
|
ad789ea2bf | ||
|
|
b848968094 | ||
|
|
c572054e67 | ||
|
|
2e6a43ac97 | ||
|
|
837e59d187 | ||
|
|
7f7aa9e799 | ||
|
|
10c18de9bf | ||
|
|
0b92023937 | ||
|
|
04f02ca7f4 | ||
|
|
d701553efe | ||
|
|
e812a949db | ||
|
|
f88dd29926 | ||
|
|
c588708056 | ||
|
|
a9f800ac68 | ||
|
|
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 |
256
Changelog.txt
256
Changelog.txt
@@ -7,6 +7,262 @@ Key:
|
||||
! Change
|
||||
- Removal
|
||||
|
||||
Version 1.4.09-dev
|
||||
+ Added new child skill; Salvage
|
||||
+ 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 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
|
||||
= 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
|
||||
! 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'
|
||||
- Removed salvage ability from Repair, salvage has it's own (child) skill now
|
||||
|
||||
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 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
|
||||
|
||||
22
README.md
22
README.md
@@ -2,12 +2,10 @@
|
||||
## The RPG lovers mod
|
||||
|
||||
### Dev builds
|
||||
Our latest development builds are available [here](http://ci.mcmmo.info).
|
||||
Our latest development builds are available ~~[here](http://ci.mcmmo.info)~~. Unfortunately, the mcMMO site is down; a temporary dev build location is hosted [here](http://ci.ecocitycraft.com/job/mcMMO/).
|
||||
|
||||
### 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
|
||||
|
||||
@@ -29,19 +27,25 @@ mcMMO is currently developed by a team of individuals from all over the world.
|
||||
(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
|
||||
* EMetrics
|
||||
* Bukkit
|
||||
|
||||
http://dev.bukkit.org/server-mods/mcmmo for more up to date information.
|
||||
|
||||
439
extras/mods/LOTR.armor.yml
Executable file
439
extras/mods/LOTR.armor.yml
Executable file
@@ -0,0 +1,439 @@
|
||||
# Lord of the Rings mod config by Dragyn
|
||||
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
|
||||
#
|
||||
#
|
||||
# Settings for Boots
|
||||
###
|
||||
Boots:
|
||||
# Bronze
|
||||
X12015:
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Orc
|
||||
X12035:
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Gondorian
|
||||
X12060:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Mithril
|
||||
X12064:
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Elven
|
||||
X12088:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Warg
|
||||
X12098:
|
||||
Repairable: true
|
||||
Repair_Material: X12094
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dwarven
|
||||
X12129:
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Galven
|
||||
X12134:
|
||||
Repairable: true
|
||||
Repair_Material: X12130
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Uruk
|
||||
X12161:
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Wood Elf
|
||||
X12176:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Ancient
|
||||
X12180:
|
||||
Repairable: true
|
||||
Repair_Material: X12179
|
||||
Repair_Material_Data_Value: 3
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rohirric
|
||||
X12187:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rangers
|
||||
X12206:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dunlending
|
||||
X12210:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Morgul
|
||||
X12222:
|
||||
Repairable: true
|
||||
Repair_Material: X12217
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Chestplates
|
||||
###
|
||||
Chestplates:
|
||||
# Bronze
|
||||
X12013:
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Orc
|
||||
X12033:
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Gondorian
|
||||
X12058:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Mithril
|
||||
X12062:
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Elven
|
||||
X12086:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Warg
|
||||
X12096:
|
||||
Repairable: true
|
||||
Repair_Material: X12094
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dwarven
|
||||
X12127:
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Galven
|
||||
X12132:
|
||||
Repairable: true
|
||||
Repair_Material: X12130
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Uruk
|
||||
X12159:
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Wood Elf
|
||||
X12174:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Ancient
|
||||
X12178:
|
||||
Repairable: true
|
||||
Repair_Material: X12179
|
||||
Repair_Material_Data_Value: 3
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rohirric
|
||||
X12185:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rangers
|
||||
X12204:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dunlending
|
||||
X12208:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Morgul
|
||||
X12220:
|
||||
Repairable: true
|
||||
Repair_Material: X12217
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Helmets
|
||||
###
|
||||
Helmets:
|
||||
# Bronze
|
||||
X12012:
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Orc
|
||||
X12032:
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Gondorian
|
||||
X12057:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Mithril
|
||||
X12061:
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Elven
|
||||
X12085:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Warg
|
||||
X12095:
|
||||
Repairable: true
|
||||
Repair_Material: X12094
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dwarven
|
||||
X12126:
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Galven
|
||||
X12131:
|
||||
Repairable: true
|
||||
Repair_Material: X12130
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Uruk
|
||||
X12158:
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Wood Elf
|
||||
X12173:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Ancient
|
||||
X12177:
|
||||
Repairable: true
|
||||
Repair_Material: X12179
|
||||
Repair_Material_Data_Value: 3
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rohirric
|
||||
X12184:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rangers
|
||||
X12203:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dunlending
|
||||
X12207:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Morgul
|
||||
X12219:
|
||||
Repairable: true
|
||||
Repair_Material: X12217
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Leggings
|
||||
###
|
||||
Leggings:
|
||||
# Bronze
|
||||
X12014:
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Orc
|
||||
X12034:
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Gondorian
|
||||
X12059:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Mithril
|
||||
X12063:
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Elven
|
||||
X12087:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Warg
|
||||
X12097:
|
||||
Repairable: true
|
||||
Repair_Material: X12094
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dwarven
|
||||
X12128:
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Galven
|
||||
X12133:
|
||||
Repairable: true
|
||||
Repair_Material: X12130
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Uruk
|
||||
X12160:
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Wood Elf
|
||||
X12175:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Ancient
|
||||
X12179:
|
||||
Repairable: true
|
||||
Repair_Material: X12179
|
||||
Repair_Material_Data_Value: 3
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rohirric
|
||||
X12186:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Rangers
|
||||
X12205:
|
||||
Repairable: true
|
||||
Repair_Material: LEATHER
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Dunlending
|
||||
X12209:
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Morgul
|
||||
X12221:
|
||||
Repairable: true
|
||||
Repair_Material: X12217
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
211
extras/mods/LOTR.blocks.yml
Executable file
211
extras/mods/LOTR.blocks.yml
Executable file
@@ -0,0 +1,211 @@
|
||||
# Lord of the Rings mod config by Skuli (Updated by Dragyn)
|
||||
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
|
||||
#
|
||||
# Settings for Custom Excavation Blocks
|
||||
###
|
||||
Excavation:
|
||||
Block_1|0:
|
||||
XP_Gain: 99
|
||||
Double_Drops_Enabled: true
|
||||
Block_2|0:
|
||||
XP_Gain: 99
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
#
|
||||
# Settings for Custom Herbalism Blocks
|
||||
###
|
||||
Herbalism:
|
||||
|
||||
# Shireheather
|
||||
X1813:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Simbelmyne
|
||||
X1805:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Asphodel
|
||||
X1895:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Bluebell
|
||||
X1867:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Clover
|
||||
X1873:
|
||||
XP_Gain: 10
|
||||
Double_Drops_Enabled: false
|
||||
|
||||
# Dead Marsh Plant
|
||||
X1886:
|
||||
XP_Gain: 10
|
||||
Double_Drops_Enabled: false
|
||||
|
||||
# DwarfWort
|
||||
X1902:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Elanor
|
||||
X1833:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Lettuce Crop
|
||||
X1830:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Morgul Shroom
|
||||
X1870:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Niphredil
|
||||
X1834:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Pipeweed Crop
|
||||
X1823:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
# Pipeweed Plant
|
||||
X1822:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
|
||||
# Mithril
|
||||
X1803:
|
||||
XP_Gain: 2000
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: true
|
||||
# Naurite
|
||||
X1818:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
#Glowstone Ore
|
||||
X1859:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
# Remains
|
||||
X1885:
|
||||
XP_Gain: 1800
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
# Gulduril
|
||||
X1887:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
# Quendite
|
||||
X1846:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
|
||||
# MorgulIron
|
||||
X1819:
|
||||
XP_Gain: 25
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
# Rohan Rock
|
||||
X180|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
|
||||
|
||||
#Gondor Stone
|
||||
X180|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
|
||||
# Mordor Stone
|
||||
X180|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: false
|
||||
Is_Ore: false
|
||||
|
||||
#
|
||||
# Settings for Custom Woodcutting Blocks
|
||||
###
|
||||
Woodcutting:
|
||||
# Shire Pine
|
||||
X1806|0:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Mallorn
|
||||
X1806|1:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Apple
|
||||
X1860|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Pear
|
||||
X1860|1:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Cherry
|
||||
X1860|2:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Mirkwood
|
||||
X1806|2:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Charred
|
||||
X1806|3:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Lebethron
|
||||
X1896|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
# Beech
|
||||
X1896|1:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
|
||||
#
|
||||
# Settings for Custom Ability Blocks
|
||||
# (These blocks don't trigger abilities)
|
||||
###
|
||||
Ability_Blocks:
|
||||
Block_1|0:
|
||||
Block_2|0:
|
||||
700
extras/mods/LOTR.tools.yml
Executable file
700
extras/mods/LOTR.tools.yml
Executable file
@@ -0,0 +1,700 @@
|
||||
# Lord of the Rings mod config by Skuli (Updated by Dragyn)
|
||||
# Built against version [1.6.4] The Lord of the Rings Mod Public Beta 11.1
|
||||
|
||||
Axes:
|
||||
#DwarvenThrowingAxe
|
||||
X12146:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 451
|
||||
#UrukWarhammer
|
||||
X12156:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 391
|
||||
#Gondorian Warhammer
|
||||
X12140:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 281
|
||||
#UrukBattleaxe
|
||||
X12155:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 391
|
||||
#MithrilBattleaxe
|
||||
X12138:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 2479
|
||||
#MithrilWarhamer
|
||||
X12139:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 2479
|
||||
#OrcWarhammer
|
||||
X12125:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 261
|
||||
#Dwarven Warhammer
|
||||
X12120:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 451
|
||||
#DwarvenZbattleaxe
|
||||
X12119:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 451
|
||||
#BronzeAxe
|
||||
X12009:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 197
|
||||
#MithrilAxe
|
||||
X12050:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 2479
|
||||
#MallornAxe
|
||||
X12075:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 121
|
||||
#Elven Axe
|
||||
X12080:
|
||||
XP_Modifer: 2
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 313
|
||||
#DwarvenAxe
|
||||
X12115:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 450
|
||||
#OrcAxe
|
||||
X12123:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 261
|
||||
#UrukAxe
|
||||
X12150:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 391
|
||||
Bows:
|
||||
#ElvenBow
|
||||
X12093:
|
||||
XP_Modifer: 2
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 9
|
||||
Durability: 485
|
||||
#mallornbow
|
||||
X12084:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 417
|
||||
#orcBow
|
||||
X12099:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 441
|
||||
#UrukCrossbow
|
||||
X12163:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 471
|
||||
#MithrilCrossbow
|
||||
X12171:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 1761
|
||||
#IronCrossbow
|
||||
X12170:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 9
|
||||
Durability: 357
|
||||
#BowofMirkwood
|
||||
X12177:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X1806
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 417
|
||||
Hoes:
|
||||
#BronzeHoe
|
||||
X12011:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 197
|
||||
#MithrilHoe
|
||||
X12052:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 2479
|
||||
#MallornHoe
|
||||
X12077:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 1
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 121
|
||||
#CopperHoe
|
||||
X26511:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X26507
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 180
|
||||
#ElvenHoe
|
||||
X12082:
|
||||
XP_Modifer: 2
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12082
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#DwarvenHoe
|
||||
X12117:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X26507
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 180
|
||||
Pickaxes:
|
||||
#MEBronzePickaxe
|
||||
X12008:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 197
|
||||
#MithrilPixkaxe
|
||||
X12049:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 2479
|
||||
#MallornPickaxe
|
||||
X12074:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 121
|
||||
#ElvenPickaxe
|
||||
X12079:
|
||||
XP_Modifer: 2
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 313
|
||||
#DwarvenPickaxe
|
||||
X12114:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 451
|
||||
#UrukPickaxe
|
||||
X12149:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 391
|
||||
#OrcPickaxe
|
||||
X12122:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 3
|
||||
Durability: 261
|
||||
Shovels:
|
||||
#BronzeShovel
|
||||
X12007:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 197
|
||||
#MithrilShovel
|
||||
X12048:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 2479
|
||||
#MallornShovel
|
||||
X12073:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 1
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 121
|
||||
#ElvenShovel
|
||||
X12078:
|
||||
XP_Modifer: 2
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12082
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 313
|
||||
#DwarvenShovel
|
||||
X12113:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 451
|
||||
#UrukShovel
|
||||
X12148:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 391
|
||||
#OrcShovel
|
||||
X12121:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 261
|
||||
|
||||
Swords:
|
||||
#Uruk Dagger
|
||||
X12153:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#Poisoned urukd agger
|
||||
X12154:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#Uruk Spear
|
||||
X12157:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 391
|
||||
#Rohirric Sword
|
||||
X12181:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 251
|
||||
#Rohirric Dagger
|
||||
X12182:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 201
|
||||
#Rohirric Spear
|
||||
X12183:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 251
|
||||
#Dunlending Spear
|
||||
X12212:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 251
|
||||
#Uruk Scimitar
|
||||
X12151:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12147
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 391
|
||||
#Mithril Dagger
|
||||
X12137:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1983
|
||||
#Iron Dagger
|
||||
X12136:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 201
|
||||
#Dwarven Dagger
|
||||
X12118:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 361
|
||||
#Dwarven Sword
|
||||
X12116:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12112
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 451
|
||||
#Elven Sword
|
||||
X12081:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#Elven Spear
|
||||
X12083:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#Anduril
|
||||
X12070:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 4
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 313
|
||||
#Mallorn Sword
|
||||
X12076:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X1801
|
||||
Repair_Material_Data_Value: 1
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 121
|
||||
#Mithril Spear
|
||||
X12069:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 4
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 2479
|
||||
#Iron Spear
|
||||
X12068:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: IRON_INGOT
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 251
|
||||
#Orc Spear
|
||||
X12066:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 261
|
||||
#Bronze Spear
|
||||
X12067:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 197
|
||||
#Gondor Spear
|
||||
X12065:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 281
|
||||
#Gondor Sword
|
||||
X12056:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: false
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 281
|
||||
#Orc Scimitar
|
||||
X12031:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12036
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 261
|
||||
#Steel Sword
|
||||
X26862:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X26857
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 751
|
||||
#Bronze Sword
|
||||
X12010:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X12004
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 1
|
||||
Durability: 197
|
||||
#Mithril Sword
|
||||
X12051:
|
||||
XP_Modifer: 1
|
||||
Ability_Enabled: true
|
||||
Tier: 4
|
||||
Repairable: true
|
||||
Repair_Material: X12006
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 2479
|
||||
182
extras/mods/extrabiomesxl.blocks.yml
Executable file
182
extras/mods/extrabiomesxl.blocks.yml
Executable file
@@ -0,0 +1,182 @@
|
||||
# Config created by Dragyn
|
||||
# Created For ExtrabiomesXL-universal-1.6.4-3.14.5
|
||||
|
||||
#
|
||||
# Settings for Custom Excavation Blocks
|
||||
###
|
||||
Excavation:
|
||||
# Quicksand
|
||||
X2214|0:
|
||||
XP_Gain: 40
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
|
||||
#
|
||||
# Settings for Custom Herbalism Blocks
|
||||
###
|
||||
Herbalism:
|
||||
# Cattails
|
||||
X2201|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
# Hydrangea
|
||||
X2202|1:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
# Buttercups
|
||||
X2202|2:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
# Lavender
|
||||
X2202|3:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
# Tiny Cactus
|
||||
X2202|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
# Toadstool
|
||||
X2202|6:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
# Calla Lillies
|
||||
X2202|7:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
X254|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
X254|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
#
|
||||
# Settings for Custom Woodcutting Blocks
|
||||
###
|
||||
Woodcutting:
|
||||
# Fir
|
||||
X2208|0:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Acacia
|
||||
X2208|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Cypress
|
||||
X2208|2:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Japanese Maple
|
||||
X2208|3:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Redwood Quarter
|
||||
X2209|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2211|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2212|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2213|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Fir Quarters
|
||||
X2209|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2211|1:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2212|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2213|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Oak Quarters
|
||||
X2209|2:
|
||||
XP_Gain: 70
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2211|2:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2212|2:
|
||||
XP_Gain: 70
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2213|2:
|
||||
XP_Gain: 70
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Acacia
|
||||
X2209|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Cypress
|
||||
X2209|2:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Bald Cypress Quarter
|
||||
X2225|0:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Bald Cypress Elbow
|
||||
X2227|0:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Bald Cypress Log
|
||||
X2231|2:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Rainbow Eucalyptus
|
||||
X2228|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2229|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X2231|0:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Autumn Log
|
||||
X2231|1:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Sakura Log
|
||||
X2238|0:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
71
extras/mods/galacticraft.armor.yml
Executable file
71
extras/mods/galacticraft.armor.yml
Executable file
@@ -0,0 +1,71 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
|
||||
#
|
||||
# Settings for Boots
|
||||
###
|
||||
Boots:
|
||||
# Heavy Duty
|
||||
X10149:
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
X10171:
|
||||
Repairable: true
|
||||
Repair_Material: X10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 999
|
||||
#
|
||||
# Settings for Chestplates
|
||||
###
|
||||
Chestplates:
|
||||
# Heavy Duty
|
||||
X10147:
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
X10169:
|
||||
Repairable: true
|
||||
Repair_Material: X10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 999
|
||||
#
|
||||
# Settings for Helmets
|
||||
###
|
||||
Helmets:
|
||||
# Heavy Duty
|
||||
X10146:
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
X10168:
|
||||
Repairable: true
|
||||
Repair_Material: X10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 999
|
||||
#
|
||||
# Settings for Leggings
|
||||
###
|
||||
Leggings:
|
||||
# Heavy Duty
|
||||
X10148:
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
X10170:
|
||||
Repairable: true
|
||||
Repair_Material: X10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 999
|
||||
|
||||
98
extras/mods/galacticraft.blocks.yml
Executable file
98
extras/mods/galacticraft.blocks.yml
Executable file
@@ -0,0 +1,98 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
|
||||
#
|
||||
# Settings for Custom Excavation Blocks
|
||||
###
|
||||
Excavation:
|
||||
# Dirt
|
||||
X3347|3:
|
||||
XP_Gain: 40
|
||||
Double_Drops_Enabled: true
|
||||
Block_2|0:
|
||||
XP_Gain: 99
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
# Copper Ore
|
||||
X3347|0:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
X3372|5:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
X3390|0:
|
||||
XP_Gain: 550
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Tin Ore
|
||||
X3347|1:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
X3372|6:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
X3390|1:
|
||||
XP_Gain: 550
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Aluminum Ore
|
||||
X3372|7:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Silicon Ore
|
||||
X3372|8:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Cheese Ore
|
||||
X3347|2:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Iron Ore
|
||||
X3390|3:
|
||||
XP_Gain: 550
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Desh Ore
|
||||
X3390|2:
|
||||
XP_Gain: 600
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Moon Stone
|
||||
X3347|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Moon Turf
|
||||
X3347|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Mars Cobblestone
|
||||
X3390|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Mars Rock/Stone
|
||||
X3390|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X3390|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X3390|9:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
123
extras/mods/galacticraft.tools.yml
Executable file
123
extras/mods/galacticraft.tools.yml
Executable file
@@ -0,0 +1,123 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Galacticraft-1.6.4-2.0.7.904 and Galacticraft-Planets-1.6.4-2.0.7.904
|
||||
#
|
||||
# Settings for Axes
|
||||
###
|
||||
Axes:
|
||||
# Heavy Duty
|
||||
X10145:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Desh
|
||||
X10167:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: 10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1000
|
||||
|
||||
#
|
||||
# Settings for Hoes
|
||||
###
|
||||
Hoes:
|
||||
# Heavy Duty
|
||||
X10144:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Desh
|
||||
X10166:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: 10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1000
|
||||
#
|
||||
# Settings for Pickaxes
|
||||
###
|
||||
Pickaxes:
|
||||
# Heavy Duty
|
||||
X10142:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Desh
|
||||
X10164:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: 10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1000
|
||||
#
|
||||
# Settings for Shovels
|
||||
###
|
||||
Shovels:
|
||||
# Heavy Duty
|
||||
X10143:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Desh
|
||||
X10165:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: 10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1000
|
||||
#
|
||||
# Settings for Swords
|
||||
###
|
||||
Swords:
|
||||
# Heavy Duty
|
||||
X10141:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 4
|
||||
Repairable: true
|
||||
Repair_Material: X10150
|
||||
Repair_Material_Data_Value: 9
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Desh
|
||||
X10163:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: 10161
|
||||
Repair_Material_Data_Value: 2
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 1000
|
||||
1018
extras/mods/metallurgy3.armor.yml
Executable file
1018
extras/mods/metallurgy3.armor.yml
Executable file
File diff suppressed because it is too large
Load Diff
185
extras/mods/metallurgy3.blocks.yml
Executable file
185
extras/mods/metallurgy3.blocks.yml
Executable file
@@ -0,0 +1,185 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Metallurgy-1.6.4-3.3.1
|
||||
#
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
# Copper
|
||||
X900|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Tin
|
||||
X900|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Zinc
|
||||
X902|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Silver
|
||||
X902|1:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Platinum
|
||||
X902|3:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
|
||||
# NETHER ORES
|
||||
# Ignatius
|
||||
X903|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Shadow Iron
|
||||
X903|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Lemurite
|
||||
X903|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Midasium
|
||||
X903|3:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Vyroxeres
|
||||
X903|4:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Ceruclase
|
||||
X903|5:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Alduorite
|
||||
X903|6:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Kalendrite
|
||||
X903|7:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Vulcanite
|
||||
X903|8:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Sanguinite
|
||||
X903|9:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
|
||||
# Manganese
|
||||
X900|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Eximite
|
||||
X900|5:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Meutoite
|
||||
X900|6:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Sulfur
|
||||
X905|7:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Phosphorite
|
||||
X905|8:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Saltpeter
|
||||
X905|9:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Magnesium
|
||||
X905|10:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Bitumen
|
||||
X905|11:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Potash
|
||||
X905|12:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Prometheum
|
||||
X906|0:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Deep Iron
|
||||
X906|1:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Infuscolium
|
||||
X906|2:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Oureclase
|
||||
X906|4:
|
||||
XP_Gain: 650
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Astral Silver
|
||||
X906|5:
|
||||
XP_Gain: 650
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Carmot
|
||||
X906|6:
|
||||
XP_Gain: 350
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Mithril
|
||||
X906|7:
|
||||
XP_Gain: 750
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Rubracium
|
||||
X906|8:
|
||||
XP_Gain: 800
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Orichalcum
|
||||
X906|11:
|
||||
XP_Gain: 900
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Adamantine
|
||||
X906|13:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
# Atlarus
|
||||
X906|14:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: true
|
||||
1807
extras/mods/metallurgy3.tools.yml
Normal file
1807
extras/mods/metallurgy3.tools.yml
Normal file
File diff suppressed because it is too large
Load Diff
44
extras/mods/railcraft.armor.yml
Executable file
44
extras/mods/railcraft.armor.yml
Executable file
@@ -0,0 +1,44 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Railcraft_1.6.2-8.1.0.0
|
||||
#
|
||||
#
|
||||
# Settings for Boots
|
||||
###
|
||||
Boots:
|
||||
X7758:
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Chestplates
|
||||
###
|
||||
Chestplates:
|
||||
X7761:
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Helmets
|
||||
###
|
||||
Helmets:
|
||||
X7759:
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Leggings
|
||||
###
|
||||
Leggings:
|
||||
X7760:
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
103
extras/mods/railcraft.blocks.yml
Executable file
103
extras/mods/railcraft.blocks.yml
Executable file
@@ -0,0 +1,103 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Railcraft_1.6.2-8.1.0.0
|
||||
#
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
# Abyssal Stone
|
||||
X457|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Quarried Stone
|
||||
X457|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Sulfur
|
||||
X458|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Saltpeter
|
||||
X458|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Dark Diamond
|
||||
X458|2:
|
||||
XP_Gain: 750
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Dark Emerald
|
||||
X458|3:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Dark Lapis
|
||||
X458|4:
|
||||
XP_Gain: 400
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Firestone
|
||||
X458|5:
|
||||
XP_Gain: 450
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Infernal Stone
|
||||
X467|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X467|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Blood Stained Stone
|
||||
X468|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X468|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Sandy Stone
|
||||
X469|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X469|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Quarried Stone
|
||||
X471|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X471|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Frost Bound Stone
|
||||
X472|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X472|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
# Nether Stone
|
||||
X475|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X475|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
|
||||
76
extras/mods/railcraft.tools.yml
Executable file
76
extras/mods/railcraft.tools.yml
Executable file
@@ -0,0 +1,76 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Railcraft_1.6.2-8.1.0.0
|
||||
#
|
||||
#
|
||||
# Settings for Axes
|
||||
###
|
||||
Axes:
|
||||
# Steel
|
||||
X7819:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
|
||||
#
|
||||
# Settings for Hoes
|
||||
###
|
||||
Hoes:
|
||||
# Steel
|
||||
X7820:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
#
|
||||
# Settings for Pickaxes
|
||||
###
|
||||
Pickaxes:
|
||||
# Steel
|
||||
X7821:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Shovels
|
||||
###
|
||||
Shovels:
|
||||
# Steel
|
||||
X7823:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Swords
|
||||
###
|
||||
Swords:
|
||||
# Steel
|
||||
X7824:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X7796
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
543
extras/mods/simcraft.blocks.yml
Executable file
543
extras/mods/simcraft.blocks.yml
Executable file
@@ -0,0 +1,543 @@
|
||||
# Config created by Dragyn
|
||||
# Created For SimCraft 1.6.4
|
||||
#
|
||||
#
|
||||
# Settings for Custom Herbalism Blocks
|
||||
###
|
||||
Herbalism:
|
||||
X705|0:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|1:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|2:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|3:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|4:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|5:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|6:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|7:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|8:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|9:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|10:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|11:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|12:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|13:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|14:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X705|15:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|0:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|1:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|2:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|3:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|4:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|5:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|6:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|7:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|8:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|9:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|10:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|11:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|12:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|13:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|14:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X706|15:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|0:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|1:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|2:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|3:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|4:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|5:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|6:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|7:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|8:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|9:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|10:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|11:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|12:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|13:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|14:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
X707|15:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
X700|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|8:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|9:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|10:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|11:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|12:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|13:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|14:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X700|15:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|0:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|1:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|2:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|3:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|4:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|5:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|6:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|7:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|8:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|9:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|10:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|11:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|12:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|13:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|14:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X701|15:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|3:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|4:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|5:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|6:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|7:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|8:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|9:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|10:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|11:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|12:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|13:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|14:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X702|15:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|3:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|4:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|5:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|6:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|7:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|8:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|9:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|10:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|11:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|12:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|13:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|14:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X703|15:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|3:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|4:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|5:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|6:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|7:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|8:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|9:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|10:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|11:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|12:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|13:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|14:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X704|15:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
#
|
||||
# Settings for Custom Woodcutting Blocks
|
||||
###
|
||||
Woodcutting:
|
||||
X708|0:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|2:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|3:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|4:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|5:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|6:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|7:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|8:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|9:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|10:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X708|11:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X1095|0:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X1095|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X1095|2:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
X1095|3:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
61
extras/mods/simcraft.tools.yml
Executable file
61
extras/mods/simcraft.tools.yml
Executable file
@@ -0,0 +1,61 @@
|
||||
# Config created by Dragyn
|
||||
# Created For Railcraft_1.6.2-8.1.0.0
|
||||
#
|
||||
#
|
||||
# Settings for Axes
|
||||
###
|
||||
Axes:
|
||||
# Steel
|
||||
X15787:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X15260
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
|
||||
#
|
||||
# Settings for Pickaxes
|
||||
###
|
||||
Pickaxes:
|
||||
# Steel
|
||||
X15788:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X15260
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Shovels
|
||||
###
|
||||
Shovels:
|
||||
# Steel
|
||||
X15789:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X15260
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Swords
|
||||
###
|
||||
Swords:
|
||||
# Steel
|
||||
X15786:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X15260
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
134
extras/mods/twilightforest.armor.yml
Executable file
134
extras/mods/twilightforest.armor.yml
Executable file
@@ -0,0 +1,134 @@
|
||||
# Config created by Dragyn
|
||||
# Created For twilightforest-1.20.3
|
||||
#
|
||||
#
|
||||
# Settings for Boots
|
||||
###
|
||||
Boots:
|
||||
# Ironwood
|
||||
X27978:
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27995:
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Stealeaf
|
||||
X28002:
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28037:
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
#
|
||||
# Settings for Chestplates
|
||||
###
|
||||
Chestplates:
|
||||
# Ironwood
|
||||
X27976:
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27993:
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Stealeaf
|
||||
X28000:
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28035:
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
#
|
||||
# Settings for Helmets
|
||||
###
|
||||
Helmets:
|
||||
# Ironwood
|
||||
X27975:
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27992:
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Stealeaf
|
||||
X27999:
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28034:
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
#
|
||||
# Settings for Leggings
|
||||
###
|
||||
Leggings:
|
||||
# Ironwood
|
||||
X27977:
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27994:
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Stealeaf
|
||||
X28001:
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28036:
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
117
extras/mods/twilightforest.blocks.yml
Executable file
117
extras/mods/twilightforest.blocks.yml
Executable file
@@ -0,0 +1,117 @@
|
||||
# Config created by Dragyn
|
||||
# Created For twilightforest-1.20.3
|
||||
#
|
||||
#
|
||||
# Settings for Custom Herbalism Blocks
|
||||
###
|
||||
Herbalism:
|
||||
# Mushgloom
|
||||
X2169|9:
|
||||
XP_Gain: 150
|
||||
Double_Drops_Enabled: true
|
||||
# Torchberry Plant
|
||||
X2169|13:
|
||||
XP_Gain: 20
|
||||
Double_Drops_Enabled: true
|
||||
# Mayapple
|
||||
X2169|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
# Fiddlehead
|
||||
X2169|8:
|
||||
XP_Gain: 35
|
||||
Double_Drops_Enabled: true
|
||||
|
||||
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
# Mazestone
|
||||
X2165|0:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|1:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|2:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|3:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|4:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|5:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|6:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2165|7:
|
||||
XP_Gain: 250
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
|
||||
#
|
||||
# Settings for Custom Woodcutting Blocks
|
||||
###
|
||||
Woodcutting:
|
||||
# Twilight Oak
|
||||
X2163|0:
|
||||
XP_Gain: 70
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Canopy
|
||||
X2163|1:
|
||||
XP_Gain: 80
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Mangrove
|
||||
X2163|2:
|
||||
XP_Gain: 90
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Darkwood
|
||||
X2163|3:
|
||||
XP_Gain: 100
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Roots
|
||||
X2170|0:
|
||||
XP_Gain: 10
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: false
|
||||
X2170|1:
|
||||
XP_Gain: 10
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: false
|
||||
# Timewood
|
||||
X2176|0:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Transwood
|
||||
X2176|1:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Minewood
|
||||
X2176|2:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
# Sortingwood
|
||||
X2176|3:
|
||||
XP_Gain: 1000
|
||||
Double_Drops_Enabled: true
|
||||
Is_Log: true
|
||||
|
||||
186
extras/mods/twilightforest.tools.yml
Executable file
186
extras/mods/twilightforest.tools.yml
Executable file
@@ -0,0 +1,186 @@
|
||||
# Config created by Dragyn
|
||||
# Created For twilightforest-1.20.3
|
||||
#
|
||||
#
|
||||
# Settings for Axes
|
||||
###
|
||||
Axes:
|
||||
# Ironwood
|
||||
X27982:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Steeleaf
|
||||
X31989:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28040:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Minotaur
|
||||
X31984:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X264
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
|
||||
#
|
||||
# Settings for Hoes
|
||||
###
|
||||
Hoes:
|
||||
# Ironwood
|
||||
X27983:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Steeleaf
|
||||
X31988:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
|
||||
#
|
||||
# Settings for Pickaxes
|
||||
###
|
||||
Pickaxes:
|
||||
# Ironwood
|
||||
X27981:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27997:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Steeleaf
|
||||
X28005:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28039:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Shovels
|
||||
###
|
||||
Shovels:
|
||||
# Ironwood
|
||||
X27980:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Steeleaf
|
||||
X28004:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
#
|
||||
# Settings for Swords
|
||||
###
|
||||
Swords:
|
||||
# Ironwood
|
||||
X27979:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27974
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Fiery
|
||||
X27996:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27991
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Steeleaf
|
||||
X28003:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X27998
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
# Knightmetal
|
||||
X28038:
|
||||
XP_Modifer: 1.0
|
||||
Ability_Enabled: true
|
||||
Tier: 1
|
||||
Repairable: true
|
||||
Repair_Material: X28032
|
||||
Repair_Material_Data_Value: 0
|
||||
Repair_Material_Quantity: 2
|
||||
Durability: 500
|
||||
171
extras/mods/underground_biomes.blocks.yml
Executable file
171
extras/mods/underground_biomes.blocks.yml
Executable file
@@ -0,0 +1,171 @@
|
||||
# Config created by Dragyn
|
||||
# Created For UndergroundBiomes 1.6.x - 0.4.2c
|
||||
#
|
||||
#
|
||||
# Settings for Custom Mining Blocks
|
||||
###
|
||||
Mining:
|
||||
X2000|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2000|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
#
|
||||
X2001|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2001|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
#
|
||||
X2009|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2009|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
#
|
||||
X2010|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|4:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2010|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
#
|
||||
X2011|0:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|1:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|2:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|3:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|4:
|
||||
XP_Gain: 50
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|5:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|6:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
X2011|7:
|
||||
XP_Gain: 30
|
||||
Double_Drops_Enabled: true
|
||||
Is_Ore: false
|
||||
@@ -1,11 +1,11 @@
|
||||
#
|
||||
# Repair configuration
|
||||
# Last updated on ${project.version}-b${BUILD_NUMBER}
|
||||
#
|
||||
# Any file named repair.*.yml in the mcmmmo folder will be loaded as a repair config
|
||||
# All repair configs have a main section titled "Repairables"
|
||||
# Afterwards, all sub-items are considered a Repairable to be loaded
|
||||
# The bare minimum of a Repairable is that it have an ItemId, a RepairMaterialId, and a MaximumDurability
|
||||
#
|
||||
# ItemId: This is the id of the item to be repairable.
|
||||
## This is required to be set.
|
||||
# Afterwards, all sub-items are considered a Repairable to be loaded. The names of each subitem should be the exact material name.
|
||||
# The bare minimum of a Repairable is that it have a RepairMaterial and a MaximumDurability
|
||||
#
|
||||
# ItemType: This is the type of item to be repaired, this is only important to permissions.
|
||||
## Valid values are ARMOR, TOOL, and OTHER.
|
||||
@@ -15,7 +15,7 @@
|
||||
## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER
|
||||
## This defaults to OTHER.
|
||||
#
|
||||
# RepairMaterialId: This is the id of the item used to repair this repairable.
|
||||
# RepairMaterial: This is the material name of the item used to repair this repairable.
|
||||
## This is required to be set.
|
||||
#
|
||||
# RepairMaterialMetadata: This is the metadata of the item used to repair this repairable.
|
||||
@@ -26,7 +26,7 @@
|
||||
## This is required to be set.
|
||||
#
|
||||
# MinimumLevel: This is the minimum repair level needed to repair this item.
|
||||
## Valid values are > 0
|
||||
## Valid values are => 0
|
||||
## This defaults to 0
|
||||
#
|
||||
# MinimumQuantity: This is the minimum number of items needed to repair this item ignoring all other repair bonuses.
|
||||
@@ -42,32 +42,19 @@
|
||||
#
|
||||
###
|
||||
Repairables:
|
||||
ChainHelmet:
|
||||
ItemId: 302
|
||||
ItemType: ARMOR
|
||||
RepairMaterialId: 51
|
||||
MaximumDurability: 165
|
||||
MinimumQuantity: 5
|
||||
#
|
||||
# Chainmail repairables
|
||||
###
|
||||
# Armor
|
||||
CHAINMAIL_HELMET:
|
||||
RepairMaterial: FIRE
|
||||
XpMultiplier: 2
|
||||
ChainChest:
|
||||
ItemId: 303
|
||||
ItemType: ARMOR
|
||||
RepairMaterialId: 51
|
||||
MaximumDurability: 240
|
||||
MinimumQuantity: 8
|
||||
CHAINMAIL_CHESTPLATE:
|
||||
RepairMaterial: FIRE
|
||||
XpMultiplier: 2
|
||||
ChainLegs:
|
||||
ItemId: 304
|
||||
ItemType: ARMOR
|
||||
RepairMaterialId: 51
|
||||
MaximumDurability: 225
|
||||
MinimumQuantity: 7
|
||||
CHAINMAIL_LEGGINGS:
|
||||
RepairMaterial: FIRE
|
||||
XpMultiplier: 2
|
||||
ChainBoots:
|
||||
ItemId: 305
|
||||
ItemType: ARMOR
|
||||
RepairMaterialId: 51
|
||||
RepairMaterialMetadata: -1
|
||||
MaximumDurability: 195
|
||||
MinimumQuantity: 4
|
||||
CHAINMAIL_BOOTS:
|
||||
RepairMaterial: FIRE
|
||||
XpMultiplier: 2
|
||||
|
||||
71
pom.xml
71
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>1.4.03</version>
|
||||
<version>1.4.09-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<issueManagement>
|
||||
@@ -22,38 +22,6 @@
|
||||
<include>.jenkins</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/xpbar/</directory>
|
||||
<includes>
|
||||
<include>xpbar*.png</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/healthbar/</directory>
|
||||
<includes>
|
||||
<include>health*.png</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/skillicon/</directory>
|
||||
<includes>
|
||||
<include>*.png</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>resources</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<directory>${basedir}/src/main/resources/sound/</directory>
|
||||
<includes>
|
||||
<include>*.wav</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>com/gmail/nossr50/locale</targetPath>
|
||||
<filtering>true</filtering>
|
||||
@@ -62,6 +30,14 @@
|
||||
<include>locale*.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<targetPath>mods</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>${basedir}/src/main/resources/mods</directory>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -133,8 +109,8 @@
|
||||
<url>http://repo.bukkit.org/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spout-repo</id>
|
||||
<url>http://nexus.spout.org/content/groups/public/</url>
|
||||
<id>md_5-releases</id>
|
||||
<url>http://repo.md-5.net/content/repositories/releases/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>Plugin MetricsExtension</id>
|
||||
@@ -145,14 +121,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.getspout</groupId>
|
||||
<artifactId>spoutplugin</artifactId>
|
||||
<version>LATEST</version>
|
||||
<version>1.6.4-R2.0</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -165,18 +134,24 @@
|
||||
<dependency>
|
||||
<groupId>com.turt2live.metrics</groupId>
|
||||
<artifactId>MetricsExtension</artifactId>
|
||||
<version>0.0.2-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<version>0.0.5-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>mcmmo-repo</id>
|
||||
<url>file:///var/lib/jenkins/repo</url>
|
||||
<id>md_5-releases</id>
|
||||
<url>http://repo.md-5.net/content/repositories/releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>md_5-snapshots</id>
|
||||
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<ciManagement>
|
||||
<system>Jenkins</system>
|
||||
<url>http://ci.ecocitycraft.com/job/mcMMO</url>
|
||||
</ciManagement>
|
||||
</project>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.runnables.skills.BleedTimerTask;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public final class AbilityAPI {
|
||||
@@ -48,4 +50,40 @@ public final class AbilityAPI {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void resetCooldowns(Player player) {
|
||||
UserManager.getPlayer(player).resetCooldowns();
|
||||
}
|
||||
|
||||
public static void setBerserkCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.BERSERK, cooldown);
|
||||
}
|
||||
|
||||
public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GIGA_DRILL_BREAKER, cooldown);
|
||||
}
|
||||
|
||||
public static void setGreenTerraCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.GREEN_TERRA, cooldown);
|
||||
}
|
||||
|
||||
public static void setSerratedStrikesCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SERRATED_STRIKES, cooldown);
|
||||
}
|
||||
|
||||
public static void setSkullSplitterCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SKULL_SPLITTER, cooldown);
|
||||
}
|
||||
|
||||
public static void setSuperBreakerCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.SUPER_BREAKER, cooldown);
|
||||
}
|
||||
|
||||
public static void setTreeFellerCooldown(Player player, long cooldown) {
|
||||
UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown);
|
||||
}
|
||||
|
||||
public static boolean isBleeding(LivingEntity entity) {
|
||||
return BleedTimerTask.isBleeding(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gmail.nossr50.chat.ChatManager;
|
||||
import com.gmail.nossr50.chat.ChatManagerFactory;
|
||||
import com.gmail.nossr50.chat.PartyChatManager;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
@@ -22,7 +25,7 @@ public final class ChatAPI {
|
||||
* @param message The message to send
|
||||
*/
|
||||
public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) {
|
||||
ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, displayName, message);
|
||||
getPartyChatManager(plugin, party).handleChat(sender, displayName, message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,23 +39,7 @@ public final class ChatAPI {
|
||||
* @param message The message to send
|
||||
*/
|
||||
public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
|
||||
ChatManager.handlePartyChat(plugin, PartyManager.getParty(party), sender, sender, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to all members of a party
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @deprecated Replaced by sendPartyChat(Plugin, String, String, String)
|
||||
*
|
||||
* @param sender The name of the sender to display in the chat
|
||||
* @param party The name of the party to send to
|
||||
* @param message The message to send
|
||||
*/
|
||||
@Deprecated
|
||||
public static void sendPartyChat(String sender, String party, String message) {
|
||||
sendPartyChat(null, party, sender, sender, message);
|
||||
getPartyChatManager(plugin, party).handleChat(sender, message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +53,7 @@ public final class ChatAPI {
|
||||
* @param message The message to send
|
||||
*/
|
||||
public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) {
|
||||
ChatManager.handleAdminChat(plugin, sender, displayName, message);
|
||||
ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, displayName, message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,22 +66,7 @@ public final class ChatAPI {
|
||||
* @param message The message to send
|
||||
*/
|
||||
public static void sendAdminChat(Plugin plugin, String sender, String message) {
|
||||
ChatManager.handleAdminChat(plugin, sender, sender, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to administrators
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @deprecated Replaced by sendAdminChat(Plugin, String, String)
|
||||
*
|
||||
* @param sender The name of the sender to display in the chat
|
||||
* @param message The message to send
|
||||
*/
|
||||
@Deprecated
|
||||
public static void sendAdminChat(String sender, String message) {
|
||||
sendAdminChat(null, sender, sender, message);
|
||||
ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +76,7 @@ public final class ChatAPI {
|
||||
* @return true if the player is using party chat, false otherwise
|
||||
*/
|
||||
public static boolean isUsingPartyChat(Player player) {
|
||||
return UserManager.getPlayer(player).getPartyChatMode();
|
||||
return UserManager.getPlayer(player).isChatEnabled(ChatMode.PARTY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +86,7 @@ public final class ChatAPI {
|
||||
* @return true if the player is using party chat, false otherwise
|
||||
*/
|
||||
public static boolean isUsingPartyChat(String playerName) {
|
||||
return UserManager.getPlayer(playerName).getPartyChatMode();
|
||||
return UserManager.getPlayer(playerName).isChatEnabled(ChatMode.PARTY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +96,7 @@ public final class ChatAPI {
|
||||
* @return true if the player is using admin chat, false otherwise
|
||||
*/
|
||||
public static boolean isUsingAdminChat(Player player) {
|
||||
return UserManager.getPlayer(player).getAdminChatMode();
|
||||
return UserManager.getPlayer(player).isChatEnabled(ChatMode.ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,6 +106,49 @@ public final class ChatAPI {
|
||||
* @return true if the player is using admin chat, false otherwise
|
||||
*/
|
||||
public static boolean isUsingAdminChat(String playerName) {
|
||||
return UserManager.getPlayer(playerName).getAdminChatMode();
|
||||
return UserManager.getPlayer(playerName).isChatEnabled(ChatMode.ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the party chat mode of a player.
|
||||
*
|
||||
* @param player The player to toggle party chat on.
|
||||
*/
|
||||
public static void togglePartyChat(Player player) {
|
||||
UserManager.getPlayer(player).toggleChat(ChatMode.PARTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the party chat mode of a player.
|
||||
*
|
||||
* @param playerName The name of the player to toggle party chat on.
|
||||
*/
|
||||
public static void togglePartyChat(String playerName) {
|
||||
UserManager.getPlayer(playerName).toggleChat(ChatMode.PARTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the admin chat mode of a player.
|
||||
*
|
||||
* @param player The player to toggle admin chat on.
|
||||
*/
|
||||
public static void toggleAdminChat(Player player) {
|
||||
UserManager.getPlayer(player).toggleChat(ChatMode.ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the admin chat mode of a player.
|
||||
*
|
||||
* @param playerName The name of the player to toggle party chat on.
|
||||
*/
|
||||
public static void toggleAdminChat(String playerName) {
|
||||
UserManager.getPlayer(playerName).toggleChat(ChatMode.ADMIN);
|
||||
}
|
||||
|
||||
private static ChatManager getPartyChatManager(Plugin plugin, String party) {
|
||||
ChatManager chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.PARTY);
|
||||
((PartyChatManager) chatManager).setParty(PartyManager.getParty(party));
|
||||
|
||||
return chatManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +1,110 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.api.exceptions.InvalidPlayerException;
|
||||
import com.gmail.nossr50.api.exceptions.InvalidSkillException;
|
||||
import com.gmail.nossr50.api.exceptions.InvalidXPGainReasonException;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.skills.child.FamilyTree;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public final class ExperienceAPI {
|
||||
private ExperienceAPI() {}
|
||||
|
||||
/**
|
||||
* Adds raw XP to the player.
|
||||
* Returns whether given string is a valid type of skill suitable for the
|
||||
* other API calls in this class.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @deprecated Use {@link #addRawXP(Player, String, int)} instead
|
||||
* @param skillType A string that may or may not be a skill
|
||||
* @return true if this is a valid mcMMO skill
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addRawXP(Player player, SkillType skillType, int XP) {
|
||||
UserManager.getPlayer(player).applyXpGain(skillType, XP);
|
||||
public static boolean isValidSkillType(String skillType) {
|
||||
return SkillType.getSkill(skillType) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds raw XP to the player.
|
||||
* Returns whether the given skill type string is both valid and not a
|
||||
* child skill. (Child skills have no XP of their own, and their level is
|
||||
* derived from the parent(s).)
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @param skillType the skill to check
|
||||
* @return true if this is a valid, non-child mcMMO skill
|
||||
*/
|
||||
public static boolean isNonChildSkill(String skillType) {
|
||||
SkillType skill = SkillType.getSkill(skillType);
|
||||
|
||||
return skill != null && !skill.isChildSkill();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRawXP(Player player, String skillType, int XP) {
|
||||
UserManager.getPlayer(player).applyXpGain(SkillType.getSkill(skillType), XP);
|
||||
addRawXP(player, skillType, (float) XP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to the player, calculates for XP Rate only.
|
||||
* Adds raw XP to the player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @deprecated Use {@link #addMultipliedXP(Player, String, int)} instead
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addMultipliedXP(Player player, SkillType skillType, int XP) {
|
||||
UserManager.getPlayer(player).applyXpGain(skillType, (int) (XP * Config.getInstance().getExperienceGainsGlobalMultiplier()));
|
||||
public static void addRawXP(Player player, String skillType, float XP) {
|
||||
addRawXP(player, skillType, XP, "UNKNOWN");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds raw XP to the player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @param xpGainReason The reason to gain XP
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
|
||||
*/
|
||||
public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) {
|
||||
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRawXPOffline(String playerName, String skillType, int XP) {
|
||||
addRawXPOffline(playerName, skillType, (float) XP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds raw XP to an offline player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
public static void addRawXPOffline(String playerName, String skillType, float XP) {
|
||||
addOfflineXP(playerName, getSkillType(skillType), (int) Math.floor(XP));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,52 +115,133 @@ public final class ExperienceAPI {
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addMultipliedXP(Player player, String skillType, int XP) {
|
||||
UserManager.getPlayer(player).applyXpGain(SkillType.getSkill(skillType), (int) (XP * Config.getInstance().getExperienceGainsGlobalMultiplier()));
|
||||
addMultipliedXP(player, skillType, XP, "UNKNOWN");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to the player, calculates for XP Rate, skill modifiers and perks. May be shared with the party.
|
||||
* Adds XP to the player, calculates for XP Rate only.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @deprecated Use {@link #addXP(Player, String, int)} instead
|
||||
* @param xpGainReason The reason to gain XP
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
|
||||
*/
|
||||
public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) {
|
||||
UserManager.getPlayer(player).applyXpGain(getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to an offline player, calculates for XP Rate only.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
public static void addMultipliedXPOffline(String playerName, String skillType, int XP) {
|
||||
addOfflineXP(playerName, getSkillType(skillType), (int) (XP * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to the player, calculates for XP Rate and skill modifier.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addXP(Player player, SkillType skillType, int XP) {
|
||||
UserManager.getPlayer(player).beginXpGain(skillType, XP);
|
||||
public static void addModifiedXP(Player player, String skillType, int XP) {
|
||||
addModifiedXP(player, skillType, XP, "UNKNOWN");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to the player, calculates for XP Rate, skill modifiers and perks. May be shared with the party.
|
||||
* Adds XP to the player, calculates for XP Rate and skill modifier.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @param xpGainReason The reason to gain XP
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
|
||||
*/
|
||||
public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) {
|
||||
SkillType skill = getSkillType(skillType);
|
||||
|
||||
UserManager.getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to an offline player, calculates for XP Rate and skill modifier.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
public static void addModifiedXPOffline(String playerName, String skillType, int XP) {
|
||||
SkillType skill = getSkillType(skillType);
|
||||
|
||||
addOfflineXP(playerName, skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds XP to the player, calculates for XP Rate, skill modifiers, perks, child skills,
|
||||
* and party sharing.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addXP(Player player, String skillType, int XP) {
|
||||
UserManager.getPlayer(player).beginXpGain(SkillType.getSkill(skillType), XP);
|
||||
addXP(player, skillType, XP, "UNKNOWN");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of XP a player has in a specific skill.
|
||||
* Adds XP to the player, calculates for XP Rate, skill modifiers, perks, child skills,
|
||||
* and party sharing.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP in a given skill
|
||||
* @deprecated Use {@link #getXP(Player, String)} instead
|
||||
* @param player The player to add XP to
|
||||
* @param skillType The skill to add XP to
|
||||
* @param XP The amount of XP to add
|
||||
* @param xpGainReason The reason to gain XP
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidXPGainReasonException if the given xpGainReason is not valid
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getXP(Player player, SkillType skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getSkillXpLevel(skillType);
|
||||
public static void addXP(Player player, String skillType, int XP, String xpGainReason) {
|
||||
UserManager.getPlayer(player).beginXpGain(getSkillType(skillType), XP, getXPGainReason(xpGainReason));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,71 +252,136 @@ public final class ExperienceAPI {
|
||||
* @param player The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP in a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static int getXP(Player player, String skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getSkillXpLevel(SkillType.getSkill(skillType));
|
||||
return UserManager.getPlayer(player).getSkillXpLevel(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of XP left before leveling up.
|
||||
* Get the amount of XP an offline player has in a specific skill.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to get the XP amount for
|
||||
* @param skillType The skill to get the XP amount for
|
||||
* @return the amount of XP left before leveling up a specifc skill
|
||||
* @deprecated Use {@link #getXPToNextLevel(Player, String)} instead
|
||||
* @param playerName The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP in a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getXPToNextLevel(Player player, SkillType skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getXpToLevel(skillType);
|
||||
public static int getOfflineXP(String playerName, String skillType) {
|
||||
return getOfflineProfile(playerName).getSkillXpLevel(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of XP left before leveling up.
|
||||
* Get the raw amount of XP a player has in a specific skill.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP in a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static float getXPRaw(Player player, String skillType) {
|
||||
return UserManager.getPlayer(player).getSkillXpLevelRaw(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the raw amount of XP an offline player has in a specific skill.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP in a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static float getOfflineXPRaw(String playerName, String skillType) {
|
||||
return getOfflineProfile(playerName).getSkillXpLevelRaw(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total amount of XP needed to reach the next level.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to get the XP amount for
|
||||
* @param skillType The skill to get the XP amount for
|
||||
* @return the amount of XP left before leveling up a specifc skill
|
||||
* @return the total amount of XP needed to reach the next level
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static int getXPToNextLevel(Player player, String skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getXpToLevel(SkillType.getSkill(skillType));
|
||||
return UserManager.getPlayer(player).getXpToLevel(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add levels to a skill.
|
||||
* Get the total amount of XP an offline player needs to reach the next level.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add levels to
|
||||
* @param skillType Type of skill to add levels to
|
||||
* @param levels Number of levels to add
|
||||
* @param notify Unused argument
|
||||
* @deprecated Use addLevel(Player, SKillType, int) instead
|
||||
* @param playerName The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the total amount of XP needed to reach the next level
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static void addLevel(Player player, SkillType skillType, int levels, boolean notify) {
|
||||
UserManager.getProfile(player).addLevels(skillType, levels);
|
||||
|
||||
if (notify) {
|
||||
checkXP(player, skillType);
|
||||
}
|
||||
public static int getOfflineXPToNextLevel(String playerName, String skillType) {
|
||||
return getOfflineProfile(playerName).getXpToLevel(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add levels to a skill.
|
||||
* Get the amount of XP remaining until the next level.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to add levels to
|
||||
* @param skillType Type of skill to add levels to
|
||||
* @param levels Number of levels to add
|
||||
* @deprecated Use {@link #addLevel(Player, String, int)} instead
|
||||
* @param player The player to get the XP amount for
|
||||
* @param skillType The skill to get the XP amount for
|
||||
* @return the amount of XP remaining until the next level
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
@Deprecated
|
||||
public static void addLevel(Player player, SkillType skillType, int levels) {
|
||||
UserManager.getPlayer(player).getProfile().addLevels(skillType, levels);
|
||||
public static int getXPRemaining(Player player, String skillType) {
|
||||
SkillType skill = getNonChildSkillType(skillType);
|
||||
|
||||
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
|
||||
|
||||
return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of XP an offline player has left before leveling up.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to get XP for
|
||||
* @param skillType The skill to get XP for
|
||||
* @return the amount of XP needed to reach the next level
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static int getOfflineXPRemaining(String playerName, String skillType) {
|
||||
SkillType skill = getNonChildSkillType(skillType);
|
||||
|
||||
PlayerProfile profile = getOfflineProfile(playerName);
|
||||
|
||||
return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,24 +392,42 @@ public final class ExperienceAPI {
|
||||
* @param player The player to add levels to
|
||||
* @param skillType Type of skill to add levels to
|
||||
* @param levels Number of levels to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
public static void addLevel(Player player, String skillType, int levels) {
|
||||
UserManager.getPlayer(player).getProfile().addLevels(SkillType.getSkill(skillType), levels);
|
||||
UserManager.getPlayer(player).addLevels(getSkillType(skillType), levels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the level a player has in a specific skill.
|
||||
* Add levels to a skill for an offline player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to get the level for
|
||||
* @param skillType The skill to get the level for
|
||||
* @return the level of a given skill
|
||||
* @deprecated Use {@link #getLevel(Player, String)} instead
|
||||
* @param playerName The player to add levels to
|
||||
* @param skillType Type of skill to add levels to
|
||||
* @param levels Number of levels to add
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getLevel(Player player, SkillType skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getSkillLevel(skillType);
|
||||
public static void addLevelOffline(String playerName, String skillType, int levels) {
|
||||
PlayerProfile profile = getOfflineProfile(playerName);
|
||||
SkillType skill = getSkillType(skillType);
|
||||
|
||||
if (skill.isChildSkill()) {
|
||||
Set<SkillType> parentSkills = FamilyTree.getParents(skill);
|
||||
|
||||
for (SkillType parentSkill : parentSkills) {
|
||||
profile.addLevels(parentSkill, (levels / parentSkills.size()));
|
||||
}
|
||||
|
||||
profile.scheduleAsyncSave();
|
||||
return;
|
||||
}
|
||||
|
||||
profile.addLevels(skill, levels);
|
||||
profile.scheduleAsyncSave();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,9 +438,27 @@ public final class ExperienceAPI {
|
||||
* @param player The player to get the level for
|
||||
* @param skillType The skill to get the level for
|
||||
* @return the level of a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
public static int getLevel(Player player, String skillType) {
|
||||
return UserManager.getPlayer(player).getProfile().getSkillLevel(SkillType.getSkill(skillType));
|
||||
return UserManager.getPlayer(player).getSkillLevel(getSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the level an offline player has in a specific skill.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to get the level for
|
||||
* @param skillType The skill to get the level for
|
||||
* @return the level of a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
public static int getLevelOffline(String playerName, String skillType) {
|
||||
return getOfflineProfile(playerName).getSkillLevel(getSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,6 +473,27 @@ public final class ExperienceAPI {
|
||||
return UserManager.getPlayer(player).getPowerLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the power level of an offline player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The player to get the power level for
|
||||
* @return the power level of the player
|
||||
*
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
public static int getPowerLevelOffline(String playerName) {
|
||||
int powerLevel = 0;
|
||||
PlayerProfile profile = getOfflineProfile(playerName);
|
||||
|
||||
for (SkillType type : SkillType.NON_CHILD_SKILLS) {
|
||||
powerLevel += profile.getSkillLevel(type);
|
||||
}
|
||||
|
||||
return powerLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the level cap of a specific skill.
|
||||
* </br>
|
||||
@@ -244,9 +501,11 @@ public final class ExperienceAPI {
|
||||
*
|
||||
* @param skillType The skill to get the level cap for
|
||||
* @return the level cap of a given skill
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
public static int getLevelCap(String skillType) {
|
||||
return Config.getInstance().getLevelCap(SkillType.getSkill(skillType));
|
||||
return Config.getInstance().getLevelCap(getSkillType(skillType));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,25 +513,44 @@ public final class ExperienceAPI {
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @return the power level cap of a given skill
|
||||
* @return the overall power level cap
|
||||
*/
|
||||
public static int getPowerLevelCap() {
|
||||
return Config.getInstance().getPowerLevelCap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the level of a player in a specific skill type.
|
||||
* Get the position on the leaderboard of a player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to set the level of
|
||||
* @param skillType The skill to set the level for
|
||||
* @param skillLevel The value to set the level to
|
||||
* @deprecated Use {@link #setLevel(Player, String, int)} instead
|
||||
* @param playerName The name of the player to check
|
||||
* @param skillType The skill to check
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*
|
||||
* @return the position on the leaderboard
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setLevel(Player player, SkillType skillType, int skillLevel) {
|
||||
UserManager.getPlayer(player).getProfile().modifySkill(skillType, skillLevel);
|
||||
public static int getPlayerRankSkill(String playerName, String skillType) {
|
||||
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(getNonChildSkillType(skillType));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the position on the power level leaderboard of a player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param playerName The name of the player to check
|
||||
*
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*
|
||||
* @return the position on the power level leaderboard
|
||||
*/
|
||||
public static int getPlayerRankOverall(String playerName) {
|
||||
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,24 +561,27 @@ public final class ExperienceAPI {
|
||||
* @param player The player to set the level of
|
||||
* @param skillType The skill to set the level for
|
||||
* @param skillLevel The value to set the level to
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
*/
|
||||
public static void setLevel(Player player, String skillType, int skillLevel) {
|
||||
UserManager.getPlayer(player).getProfile().modifySkill(SkillType.getSkill(skillType), skillLevel);
|
||||
UserManager.getPlayer(player).modifySkill(getSkillType(skillType), skillLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the XP of a player in a specific skill type.
|
||||
* Sets the level of an offline player in a specific skill type.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to set the XP of
|
||||
* @param skillType The skill to set the XP for
|
||||
* @param newValue The value to set the XP to
|
||||
* @deprecated Use {@link #setXP(Player, String, int)} instead
|
||||
* @param playerName The player to set the level of
|
||||
* @param skillType The skill to set the level for
|
||||
* @param skillLevel The value to set the level to
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setXP(Player player, SkillType skillType, int newValue) {
|
||||
UserManager.getPlayer(player).getProfile().setSkillXpLevel(skillType, newValue);
|
||||
public static void setLevelOffline(String playerName, String skillType, int skillLevel) {
|
||||
getOfflineProfile(playerName).modifySkill(getSkillType(skillType), skillLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,24 +592,29 @@ public final class ExperienceAPI {
|
||||
* @param player The player to set the XP of
|
||||
* @param skillType The skill to set the XP for
|
||||
* @param newValue The value to set the XP to
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static void setXP(Player player, String skillType, int newValue) {
|
||||
UserManager.getPlayer(player).getProfile().setSkillXpLevel(SkillType.getSkill(skillType), newValue);
|
||||
UserManager.getPlayer(player).setSkillXpLevel(getNonChildSkillType(skillType), newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes XP from a player in a specific skill type.
|
||||
* Sets the XP of an offline player in a specific skill type.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to change the XP of
|
||||
* @param skillType The skill to change the XP for
|
||||
* @param xp The amount of XP to remove
|
||||
* @deprecated Use {@link #removeXP(Player, String, int)} instead
|
||||
* @param playerName The player to set the XP of
|
||||
* @param skillType The skill to set the XP for
|
||||
* @param newValue The value to set the XP to
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
@Deprecated
|
||||
public static void removeXP(Player player, SkillType skillType, int xp) {
|
||||
UserManager.getPlayer(player).getProfile().removeXp(skillType, xp);
|
||||
public static void setXPOffline(String playerName, String skillType, int newValue) {
|
||||
getOfflineProfile(playerName).setSkillXpLevel(getNonChildSkillType(skillType), newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,20 +625,77 @@ public final class ExperienceAPI {
|
||||
* @param player The player to change the XP of
|
||||
* @param skillType The skill to change the XP for
|
||||
* @param xp The amount of XP to remove
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
public static void removeXP(Player player, String skillType, int xp) {
|
||||
UserManager.getPlayer(player).getProfile().removeXp(SkillType.getSkill(skillType), xp);
|
||||
UserManager.getPlayer(player).removeXp(getNonChildSkillType(skillType), xp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the XP of a player. This should be called after giving XP to process level-ups.
|
||||
* Removes XP from an offline player in a specific skill type.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to check
|
||||
* @param skillType The skill to check
|
||||
* @deprecated Calling this function is no longer needed and should be avoided
|
||||
* @param playerName The player to change the XP of
|
||||
* @param skillType The skill to change the XP for
|
||||
* @param xp The amount of XP to remove
|
||||
*
|
||||
* @throws InvalidSkillException if the given skill is not valid
|
||||
* @throws InvalidPlayerException if the given player does not exist in the database
|
||||
* @throws UnsupportedOperationException if the given skill is a child skill
|
||||
*/
|
||||
@Deprecated
|
||||
private static void checkXP(Player player, SkillType skillType) {
|
||||
SkillUtils.xpCheckSkill(skillType, player, UserManager.getProfile(player));
|
||||
public static void removeXPOffline(String playerName, String skillType, int xp) {
|
||||
getOfflineProfile(playerName).removeXp(getNonChildSkillType(skillType), xp);
|
||||
}
|
||||
|
||||
// Utility methods follow.
|
||||
|
||||
private static void addOfflineXP(String playerName, SkillType skill, int XP) {
|
||||
PlayerProfile profile = getOfflineProfile(playerName);
|
||||
|
||||
profile.addXp(skill, XP);
|
||||
profile.scheduleAsyncSave();
|
||||
}
|
||||
|
||||
private static PlayerProfile getOfflineProfile(String playerName) {
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
throw new InvalidPlayerException();
|
||||
}
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
private static SkillType getSkillType(String skillType) throws InvalidSkillException {
|
||||
SkillType skill = SkillType.getSkill(skillType);
|
||||
|
||||
if (skill == null) {
|
||||
throw new InvalidSkillException();
|
||||
}
|
||||
|
||||
return skill;
|
||||
}
|
||||
|
||||
private static SkillType getNonChildSkillType(String skillType) throws InvalidSkillException, UnsupportedOperationException {
|
||||
SkillType skill = getSkillType(skillType);
|
||||
|
||||
if (skill.isChildSkill()) {
|
||||
throw new UnsupportedOperationException("Child skills do not have XP");
|
||||
}
|
||||
|
||||
return skill;
|
||||
}
|
||||
|
||||
private static XPGainReason getXPGainReason(String reason) throws InvalidXPGainReasonException {
|
||||
XPGainReason xpGainReason = XPGainReason.getXPGainReason(reason);
|
||||
|
||||
if (xpGainReason == null) {
|
||||
throw new InvalidXPGainReasonException();
|
||||
}
|
||||
|
||||
return xpGainReason;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
@@ -19,9 +21,13 @@ public final class PartyAPI {
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to check the party name of
|
||||
* @return the name of the player's party
|
||||
* @return the name of the player's party, or null if not in a party
|
||||
*/
|
||||
public static String getPartyName(Player player) {
|
||||
if (!inParty(player)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return UserManager.getPlayer(player).getParty().getName();
|
||||
}
|
||||
|
||||
@@ -73,12 +79,10 @@ public final class PartyAPI {
|
||||
Party party = PartyManager.getParty(partyName);
|
||||
|
||||
if (party == null) {
|
||||
party = new Party();
|
||||
party.setName(partyName);
|
||||
party.setLeader(player.getName());
|
||||
party = new Party(player.getName(), partyName);
|
||||
}
|
||||
|
||||
PartyManager.addToParty(player, UserManager.getPlayer(player), party);
|
||||
PartyManager.addToParty(UserManager.getPlayer(player), party);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +93,7 @@ public final class PartyAPI {
|
||||
* @param player The player to remove
|
||||
*/
|
||||
public static void removeFromParty(Player player) {
|
||||
PartyManager.removeFromParty(player, UserManager.getPlayer(player).getParty());
|
||||
PartyManager.removeFromParty(UserManager.getPlayer(player));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,28 +127,27 @@ public final class PartyAPI {
|
||||
*
|
||||
* @param player The player to check
|
||||
* @return all the players in the player's party
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<String> getAllMembers(Player player) {
|
||||
List<String> memberNames = new ArrayList<String>();
|
||||
public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) {
|
||||
List<OfflinePlayer> members = new ArrayList<OfflinePlayer>();
|
||||
|
||||
for (OfflinePlayer member : PartyManager.getAllMembers(player)) {
|
||||
memberNames.add(member.getName());
|
||||
for (String memberName : PartyManager.getAllMembers(player)) {
|
||||
OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberName);
|
||||
members.add(member);
|
||||
}
|
||||
|
||||
return memberNames;
|
||||
return members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all players in this player's party.
|
||||
* Get a list of all player names in this player's party.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param player The player to check
|
||||
* @return all the players in the player's party
|
||||
* @return all the player names in the player's party
|
||||
*/
|
||||
public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) {
|
||||
public static LinkedHashSet<String> getMembers(Player player) {
|
||||
return PartyManager.getAllMembers(player);
|
||||
}
|
||||
|
||||
@@ -171,4 +174,17 @@ public final class PartyAPI {
|
||||
public static List<Player> getOnlineMembers(Player player) {
|
||||
return PartyManager.getOnlineMembers(player);
|
||||
}
|
||||
|
||||
public static boolean hasAlly(String partyName) {
|
||||
return getAllyName(partyName) != null;
|
||||
}
|
||||
|
||||
public static String getAllyName(String partyName) {
|
||||
Party ally = PartyManager.getParty(partyName).getAlly();
|
||||
if (ally != null) {
|
||||
return ally.getName();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.spout.SpoutConfig;
|
||||
import com.gmail.nossr50.datatypes.spout.huds.HudType;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class SpoutHudAPI {
|
||||
private SpoutHudAPI() {}
|
||||
|
||||
/**
|
||||
* Disable the mcMMO XP bar for a player.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*/
|
||||
public static void disableXpBar(Player player) {
|
||||
UserManager.getPlayer(player).getProfile().setHudType(HudType.DISABLED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the mcMMO XP bar for the server.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*/
|
||||
public static void disableXpBar() {
|
||||
SpoutConfig.getInstance().setXPBarEnabled(false);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.gmail.nossr50.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||
|
||||
public final class SpoutToolsAPI {
|
||||
public static final List<ItemStack> spoutSwords = new ArrayList<ItemStack>();
|
||||
public static final List<ItemStack> spoutAxes = new ArrayList<ItemStack>();
|
||||
public static final List<ItemStack> spoutPickaxes = new ArrayList<ItemStack>();
|
||||
public static final List<ItemStack> spoutHoes = new ArrayList<ItemStack>();
|
||||
public static final List<ItemStack> spoutShovels = new ArrayList<ItemStack>();
|
||||
|
||||
private SpoutToolsAPI() {}
|
||||
|
||||
/**
|
||||
* Add a custom Spout tool to mcMMO for XP gain & ability use.
|
||||
* </br>
|
||||
* This function is designed for API usage.
|
||||
*
|
||||
* @param spoutTool The tool to add
|
||||
* @param type The type of tool to add
|
||||
*/
|
||||
public static void addCustomTool(ItemStack spoutTool, ToolType type) {
|
||||
switch (type) {
|
||||
case AXE:
|
||||
spoutAxes.add(spoutTool);
|
||||
break;
|
||||
|
||||
case HOE:
|
||||
spoutHoes.add(spoutTool);
|
||||
break;
|
||||
|
||||
case PICKAXE:
|
||||
spoutPickaxes.add(spoutTool);
|
||||
break;
|
||||
|
||||
case SHOVEL:
|
||||
spoutShovels.add(spoutTool);
|
||||
break;
|
||||
|
||||
case SWORD:
|
||||
spoutSwords.add(spoutTool);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.gmail.nossr50.api.exceptions;
|
||||
|
||||
public class InvalidPlayerException extends RuntimeException {
|
||||
private static final long serialVersionUID = 907213002618581385L;
|
||||
|
||||
public InvalidPlayerException() {
|
||||
super("That player does not exist in the database.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.gmail.nossr50.api.exceptions;
|
||||
|
||||
public class InvalidSkillException extends RuntimeException {
|
||||
private static final long serialVersionUID = 942705284195791157L;
|
||||
|
||||
public InvalidSkillException() {
|
||||
super("That is not a valid skill.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.gmail.nossr50.api.exceptions;
|
||||
|
||||
public class InvalidXPGainReasonException extends RuntimeException {
|
||||
private static final long serialVersionUID = 4427052841957931157L;
|
||||
|
||||
public InvalidXPGainReasonException() {
|
||||
super("That is not a valid XPGainReason.");
|
||||
}
|
||||
}
|
||||
22
src/main/java/com/gmail/nossr50/chat/AdminChatManager.java
Normal file
22
src/main/java/com/gmail/nossr50/chat/AdminChatManager.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||
|
||||
public class AdminChatManager extends ChatManager {
|
||||
protected AdminChatManager(Plugin plugin) {
|
||||
super(plugin, Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleChat(String senderName, String displayName, String message, boolean isAsync) {
|
||||
handleChat(new McMMOAdminChatEvent(plugin, senderName, displayName, message, isAsync));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendMessage() {
|
||||
plugin.getServer().broadcast(message, "mcmmo.chat.adminchat");
|
||||
}
|
||||
}
|
||||
@@ -1,78 +1,53 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||
import com.gmail.nossr50.events.chat.McMMOChatEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public final class ChatManager {
|
||||
public ChatManager () {}
|
||||
public abstract class ChatManager {
|
||||
protected Plugin plugin;
|
||||
protected boolean useDisplayNames;
|
||||
protected String chatPrefix;
|
||||
|
||||
public static void handleAdminChat(Plugin plugin, String playerName, String displayName, String message, boolean isAsync) {
|
||||
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(plugin, playerName, displayName, message, isAsync);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
|
||||
protected String senderName;
|
||||
protected String displayName;
|
||||
protected String message;
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
protected ChatManager(Plugin plugin, boolean useDisplayNames, String chatPrefix) {
|
||||
this.plugin = plugin;
|
||||
this.useDisplayNames = useDisplayNames;
|
||||
this.chatPrefix = chatPrefix;
|
||||
}
|
||||
|
||||
protected void handleChat(McMMOChatEvent event) {
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.getInstance().getAdminDisplayNames()) {
|
||||
displayName = chatEvent.getDisplayName();
|
||||
}
|
||||
else {
|
||||
displayName = chatEvent.getSender();
|
||||
}
|
||||
senderName = event.getSender();
|
||||
displayName = useDisplayNames ? event.getDisplayName() : senderName;
|
||||
message = LocaleLoader.formatString(chatPrefix, displayName) + " " + event.getMessage();
|
||||
|
||||
String adminMessage = chatEvent.getMessage();
|
||||
|
||||
mcMMO.p.getServer().broadcast(LocaleLoader.getString("Commands.AdminChat.Prefix", displayName) + adminMessage, "mcmmo.chat.adminchat");
|
||||
sendMessage();
|
||||
}
|
||||
|
||||
public static void handleAdminChat(Plugin plugin, String senderName, String message) {
|
||||
handleAdminChat(plugin, senderName, senderName, message);
|
||||
public void handleChat(String senderName, String message) {
|
||||
handleChat(senderName, senderName, message, false);
|
||||
}
|
||||
|
||||
public static void handleAdminChat(Plugin plugin, String playerName, String displayName, String message) {
|
||||
handleAdminChat(plugin, playerName, displayName, message, false);
|
||||
public void handleChat(Player player, String message, boolean isAsync) {
|
||||
handleChat(player.getName(), player.getDisplayName(), message, isAsync);
|
||||
}
|
||||
|
||||
public static void handlePartyChat(Plugin plugin, Party party, String playerName, String displayName, String message, boolean isAsync) {
|
||||
String partyName = party.getName();
|
||||
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, playerName, displayName, partyName, message, isAsync);
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
if (chatEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.getInstance().getPartyDisplayNames()) {
|
||||
displayName = chatEvent.getDisplayName();
|
||||
}
|
||||
else {
|
||||
displayName = chatEvent.getSender();
|
||||
}
|
||||
|
||||
String partyMessage = chatEvent.getMessage();
|
||||
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(LocaleLoader.getString("Commands.Party.Chat.Prefix", displayName) + partyMessage);
|
||||
}
|
||||
|
||||
mcMMO.p.getLogger().info("[P](" + partyName + ")" + "<" + ChatColor.stripColor(displayName) + "> " + partyMessage);
|
||||
public void handleChat(String senderName, String displayName, String message) {
|
||||
handleChat(senderName, displayName, message, false);
|
||||
}
|
||||
|
||||
public static void handlePartyChat(Plugin plugin, Party party, String senderName, String message) {
|
||||
handlePartyChat(plugin, party, senderName, senderName, message);
|
||||
}
|
||||
public abstract void handleChat(String senderName, String displayName, String message, boolean isAsync);
|
||||
|
||||
public static void handlePartyChat(Plugin plugin, Party party, String playerName, String displayName, String message) {
|
||||
handlePartyChat(plugin, party, playerName, displayName, message, false);
|
||||
}
|
||||
protected abstract void sendMessage();
|
||||
}
|
||||
|
||||
31
src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java
Normal file
31
src/main/java/com/gmail/nossr50/chat/ChatManagerFactory.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
|
||||
public class ChatManagerFactory {
|
||||
private static final HashMap<Plugin, AdminChatManager> adminChatManagers = new HashMap<Plugin, AdminChatManager>();
|
||||
private static final HashMap<Plugin, PartyChatManager> partyChatManagers = new HashMap<Plugin, PartyChatManager>();
|
||||
|
||||
public static ChatManager getChatManager(Plugin plugin, ChatMode mode) {
|
||||
switch (mode) {
|
||||
case ADMIN:
|
||||
if (!adminChatManagers.containsKey(plugin)) {
|
||||
adminChatManagers.put(plugin, new AdminChatManager(plugin));
|
||||
}
|
||||
|
||||
return adminChatManagers.get(plugin);
|
||||
case PARTY:
|
||||
if (!partyChatManagers.containsKey(plugin)) {
|
||||
partyChatManagers.put(plugin, new PartyChatManager(plugin));
|
||||
}
|
||||
|
||||
return partyChatManagers.get(plugin);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public enum ChatMode {
|
||||
ADMIN(LocaleLoader.getString("Commands.AdminChat.On"), LocaleLoader.getString("Commands.AdminChat.Off")),
|
||||
PARTY(LocaleLoader.getString("Commands.Party.Chat.On"), LocaleLoader.getString("Commands.Party.Chat.Off"));
|
||||
|
||||
private String enabledMessage;
|
||||
private String disabledMessage;
|
||||
|
||||
private ChatMode(String enabledMessage, String disabledMessage) {
|
||||
this.enabledMessage = enabledMessage;
|
||||
this.disabledMessage = disabledMessage;
|
||||
}
|
||||
|
||||
public boolean isEnabled(McMMOPlayer mcMMOPlayer) {
|
||||
switch (this) {
|
||||
case ADMIN:
|
||||
return mcMMOPlayer.getAdminChatMode();
|
||||
|
||||
case PARTY:
|
||||
return mcMMOPlayer.getPartyChatMode();
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void disable(McMMOPlayer mcMMOPlayer) {
|
||||
switch (this) {
|
||||
case ADMIN:
|
||||
mcMMOPlayer.setAdminChat(false);
|
||||
return;
|
||||
|
||||
case PARTY:
|
||||
mcMMOPlayer.setPartyChat(false);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void enable(McMMOPlayer mcMMOPlayer) {
|
||||
switch (this) {
|
||||
case ADMIN:
|
||||
mcMMOPlayer.setAdminChat(true);
|
||||
mcMMOPlayer.setPartyChat(false);
|
||||
return;
|
||||
|
||||
case PARTY:
|
||||
mcMMOPlayer.setPartyChat(true);
|
||||
mcMMOPlayer.setAdminChat(false);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public String getEnabledMessage() {
|
||||
return enabledMessage;
|
||||
}
|
||||
|
||||
public String getDisabledMessage() {
|
||||
return disabledMessage;
|
||||
}
|
||||
}
|
||||
50
src/main/java/com/gmail/nossr50/chat/PartyChatManager.java
Normal file
50
src/main/java/com/gmail/nossr50/chat/PartyChatManager.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public class PartyChatManager extends ChatManager {
|
||||
private Party party;
|
||||
|
||||
protected PartyChatManager(Plugin plugin) {
|
||||
super(plugin, Config.getInstance().getPartyDisplayNames(), Config.getInstance().getPartyChatPrefix());
|
||||
}
|
||||
|
||||
public void setParty(Party party) {
|
||||
this.party = party;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleChat(String senderName, String displayName, String message, boolean isAsync) {
|
||||
handleChat(new McMMOPartyChatEvent(plugin, senderName, displayName, party.getName(), message, isAsync));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendMessage() {
|
||||
if (Config.getInstance().getPartyChatColorLeaderName() && senderName.equalsIgnoreCase(party.getLeader())) {
|
||||
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET);
|
||||
}
|
||||
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(message);
|
||||
}
|
||||
|
||||
if (party.getAlly() != null) {
|
||||
for (Player member : party.getAlly().getOnlineMembers()) {
|
||||
String allyPrefix = LocaleLoader.formatString(Config.getInstance().getPartyChatPrefixAlly());
|
||||
member.sendMessage(allyPrefix + message);
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getLogger().info("[P]<" + party.getName() + ">" + message);
|
||||
}
|
||||
}
|
||||
66
src/main/java/com/gmail/nossr50/commands/KrakenCommand.java
Normal file
66
src/main/java/com/gmail/nossr50/commands/KrakenCommand.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class KrakenCommand 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.kraken(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
UserManager.getPlayer(sender.getName()).getFishingManager().unleashTheKraken();
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.krakenOthers(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;
|
||||
}
|
||||
|
||||
mcMMOPlayer.getFishingManager().unleashTheKraken();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +1,30 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class McabilityCommand implements CommandExecutor {
|
||||
public class McabilityCommand extends ToggleCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
McMMOPlayer mcMMOPlayer;
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcabilityOthers(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.mcability(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcability(sender);
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Ability." + (mcMMOPlayer.getAbilityUse() ? "Off" : "On")));
|
||||
mcMMOPlayer.toggleAbilityUse();
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.getAbilityUse()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Ability.Off"));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Ability.On"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.toggleAbilityUse();
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.mcabilityOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
PlayerProfile playerProfile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!playerProfile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (!player.isOnline()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.getAbilityUse()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Ability.Off"));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Ability.On"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.toggleAbilityUse();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Ability.Toggle", playerName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
|
||||
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
|
||||
import com.gmail.nossr50.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.datatypes.database.DatabaseType;
|
||||
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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");
|
||||
|
||||
private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand();
|
||||
private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand();
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,88 +1,30 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class McgodCommand implements CommandExecutor {
|
||||
public class McgodCommand extends ToggleCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
McMMOPlayer mcMMOPlayer;
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcgodOthers(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.mcgod(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcgod(sender);
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
|
||||
mcMMOPlayer.toggleGodMode();
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.getGodMode()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled"));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.toggleGodMode();
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.mcgodOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
PlayerProfile playerProfile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!playerProfile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (!player.isOnline()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mcMMOPlayer.getGodMode()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled"));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.toggleGodMode();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Toggle", playerName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
||||
@@ -28,16 +26,15 @@ public class McmmoCommand implements CommandExecutor {
|
||||
sender.sendMessage(mcSplit);
|
||||
|
||||
if (Config.getInstance().getDonateMessageEnabled()) {
|
||||
if (mcMMO.spoutEnabled && sender instanceof SpoutPlayer) {
|
||||
SpoutPlayer spoutPlayer = (SpoutPlayer) sender;
|
||||
spoutPlayer.sendNotification(LocaleLoader.getString("Spout.Donate"), ChatColor.GREEN + "gjmcferrin@gmail.com", Material.DIAMOND);
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Donate"));
|
||||
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "gjmcferrin@gmail.com" + ChatColor.GOLD + " Paypal");
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
|
||||
if (Permissions.showversion(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion()));
|
||||
}
|
||||
|
||||
mcMMO.getHolidayManager().anniversaryCheck(sender);
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
@@ -48,9 +45,9 @@ public class McmmoCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcc.Header"));
|
||||
displayPartyCommands(sender);
|
||||
displayGeneralCommands(sender);
|
||||
displayOtherCommands(sender);
|
||||
|
||||
displayPartyCommands(sender);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -59,55 +56,57 @@ public class McmmoCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
private void displayPartyCommands(CommandSender sender) {
|
||||
if (Permissions.party(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
|
||||
sender.sendMessage("/party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1"));
|
||||
sender.sendMessage("/party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2"));
|
||||
sender.sendMessage("/party quit " + LocaleLoader.getString("Commands.Party.Quit"));
|
||||
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.partyChat(sender)) {
|
||||
sender.sendMessage("/party chat " + LocaleLoader.getString("Commands.Party.Toggle"));
|
||||
}
|
||||
if (Permissions.inspect(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /inspect " + LocaleLoader.getString("Commands.Inspect"));
|
||||
}
|
||||
|
||||
sender.sendMessage("/party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite"));
|
||||
sender.sendMessage("/party accept " + LocaleLoader.getString("Commands.Party.Accept"));
|
||||
|
||||
if (Permissions.partySubcommand(sender, PartySubcommandType.TELEPORT)) {
|
||||
sender.sendMessage("/party teleport " + LocaleLoader.getString("Commands.Party.Teleport"));
|
||||
}
|
||||
if (Permissions.mcability(sender)) {
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayOtherCommands(CommandSender sender) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Other"));
|
||||
sender.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats"));
|
||||
sender.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards"));
|
||||
|
||||
if (Permissions.skillreset(sender)) {
|
||||
sender.sendMessage("/skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
||||
}
|
||||
|
||||
if (Permissions.mcability(sender)) {
|
||||
sender.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
|
||||
}
|
||||
|
||||
if (Permissions.adminChat(sender)) {
|
||||
sender.sendMessage("/adminchat " + LocaleLoader.getString("Commands.AdminToggle"));
|
||||
}
|
||||
|
||||
if (Permissions.inspect(sender)) {
|
||||
sender.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
||||
}
|
||||
|
||||
if (Permissions.mmoedit(sender)) {
|
||||
sender.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
|
||||
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("/mcgod " + LocaleLoader.getString("Commands.mcgod"));
|
||||
sender.sendMessage(ChatColor.DARK_AQUA + " /mcgod " + LocaleLoader.getString("Commands.mcgod"));
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.SkillInfo"));
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class McnotifyCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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);
|
||||
|
||||
if (mcMMOPlayer.useChatNotifications()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Notifications.Off"));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Notifications.On"));
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
|
||||
mcMMOPlayer.toggleChatNotifications();
|
||||
return true;
|
||||
|
||||
@@ -30,4 +28,9 @@ public class McnotifyCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +1,34 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class McrefreshCommand implements CommandExecutor {
|
||||
public class McrefreshCommand extends ToggleCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
McMMOPlayer mcMMOPlayer;
|
||||
protected boolean hasOtherPermission(CommandSender sender) {
|
||||
return Permissions.mcrefreshOthers(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.mcrefresh(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean hasSelfPermission(CommandSender sender) {
|
||||
return Permissions.mcrefresh(sender);
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
|
||||
mcMMOPlayer.setRecentlyHurt(0);
|
||||
mcMMOPlayer.resetCooldowns();
|
||||
mcMMOPlayer.resetToolPrepMode();
|
||||
mcMMOPlayer.resetAbilityMode();
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.setRecentlyHurt(0);
|
||||
mcMMOPlayer.getProfile().resetCooldowns();
|
||||
mcMMOPlayer.resetToolPrepMode();
|
||||
mcMMOPlayer.resetAbilityMode();
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (!Permissions.mcrefreshOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
PlayerProfile playerProfile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!playerProfile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (!player.isOnline()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer.setRecentlyHurt(0);
|
||||
mcMMOPlayer.getProfile().resetCooldowns();
|
||||
mcMMOPlayer.resetToolPrepMode();
|
||||
mcMMOPlayer.resetAbilityMode();
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0]));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void sendSuccessMessage(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", playerName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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 (!Config.getInstance().getAllowKeepBoard()) {
|
||||
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,67 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.datatypes.MobHealthbarType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class MobhealthCommand implements TabExecutor {
|
||||
private static final List<String> MOB_HEALTHBAR_TYPES;
|
||||
|
||||
static {
|
||||
ArrayList<String> types = new ArrayList<String>();
|
||||
|
||||
for (MobHealthbarType type : MobHealthbarType.values()) {
|
||||
types.add(type.toString());
|
||||
}
|
||||
|
||||
Collections.sort(types);
|
||||
MOB_HEALTHBAR_TYPES = ImmutableList.copyOf(types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
try {
|
||||
MobHealthbarType type = MobHealthbarType.valueOf(args[0].toUpperCase().trim());
|
||||
UserManager.getPlayer((Player) sender).getProfile().setMobHealthbarType(type);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Healthbars.Changed." + type.name()));
|
||||
return true;
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Healthbars.Invalid"));
|
||||
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], MOB_HEALTHBAR_TYPES, new ArrayList<String>(MOB_HEALTHBAR_TYPES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
75
src/main/java/com/gmail/nossr50/commands/ToggleCommand.java
Normal file
75
src/main/java/com/gmail/nossr50/commands/ToggleCommand.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,17 +1,24 @@
|
||||
package com.gmail.nossr50.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
|
||||
public class XprateCommand implements CommandExecutor {
|
||||
private static double originalRate = Config.getInstance().getExperienceGainsGlobalMultiplier();
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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) {
|
||||
@@ -31,12 +38,12 @@ public class XprateCommand implements CommandExecutor {
|
||||
mcMMO.p.toggleXpEventEnabled();
|
||||
}
|
||||
|
||||
Config.getInstance().setExperienceGainsGlobalMultiplier(originalRate);
|
||||
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(ORIGINAL_XP_RATE);
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (!StringUtils.isInt(args[0])) {
|
||||
return false;
|
||||
if (CommandUtils.isInvalidInteger(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.xprateSet(sender)) {
|
||||
@@ -44,13 +51,18 @@ public class XprateCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!args[1].equalsIgnoreCase("true") && !args[1].equalsIgnoreCase("false")) {
|
||||
if (CommandUtils.shouldDisableToggle(args[1])) {
|
||||
mcMMO.p.setXPEventEnabled(false);
|
||||
}
|
||||
else if (CommandUtils.shouldEnableToggle(args[1])) {
|
||||
mcMMO.p.setXPEventEnabled(true);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMO.p.setXPEventEnabled(Boolean.valueOf(args[1]));
|
||||
int newXpRate = Integer.parseInt(args[0]);
|
||||
Config.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
|
||||
ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
|
||||
|
||||
if (mcMMO.p.isXPEventEnabled()) {
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.0"));
|
||||
@@ -66,4 +78,20 @@ public class XprateCommand implements CommandExecutor {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.chat.ChatManager;
|
||||
import com.gmail.nossr50.chat.ChatMode;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
|
||||
public class AdminChatCommand extends ChatCommand {
|
||||
public AdminChatCommand() {
|
||||
@@ -15,12 +11,6 @@ public class AdminChatCommand extends ChatCommand {
|
||||
|
||||
@Override
|
||||
protected void handleChatSending(CommandSender sender, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
ChatManager.handleAdminChat(mcMMO.p, player.getName(), player.getDisplayName(), buildChatMessage(args, 0));
|
||||
}
|
||||
else {
|
||||
ChatManager.handleAdminChat(mcMMO.p, LocaleLoader.getString("Commands.Chat.Console"), buildChatMessage(args, 0));
|
||||
}
|
||||
chatManager.handleChat(sender.getName(), getDisplayName(sender), buildChatMessage(args, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +1,73 @@
|
||||
package com.gmail.nossr50.commands.chat;
|
||||
|
||||
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;
|
||||
|
||||
import com.gmail.nossr50.chat.ChatMode;
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.chat.ChatManager;
|
||||
import com.gmail.nossr50.chat.ChatManagerFactory;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public abstract class ChatCommand implements CommandExecutor {
|
||||
protected McMMOPlayer mcMMOPlayer;
|
||||
protected ChatMode chatMode;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public abstract class ChatCommand implements TabExecutor {
|
||||
private ChatMode chatMode;
|
||||
protected ChatManager chatManager;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
|
||||
if (chatMode.isEnabled(mcMMOPlayer)) {
|
||||
disableChatMode(sender);
|
||||
if (mcMMOPlayer.isChatEnabled(chatMode)) {
|
||||
disableChatMode(mcMMOPlayer, sender);
|
||||
}
|
||||
else {
|
||||
enableChatMode(sender);
|
||||
enableChatMode(mcMMOPlayer, sender);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("on")) {
|
||||
if (CommandUtils.shouldEnableToggle(args[0])) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
|
||||
enableChatMode(sender);
|
||||
enableChatMode(UserManager.getPlayer(sender.getName()), sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("off")) {
|
||||
if (CommandUtils.shouldDisableToggle(args[0])) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
|
||||
disableChatMode(sender);
|
||||
disableChatMode(UserManager.getPlayer(sender.getName()), sender);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,6 +79,16 @@ public abstract class ChatCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
@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]);
|
||||
@@ -81,25 +101,34 @@ public abstract class ChatCommand implements CommandExecutor {
|
||||
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(CommandSender sender) {
|
||||
private void enableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
|
||||
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
chatMode.enable(mcMMOPlayer);
|
||||
if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMOPlayer.enableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getEnabledMessage());
|
||||
}
|
||||
|
||||
private void disableChatMode(CommandSender sender) {
|
||||
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
|
||||
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
chatMode.disable(mcMMOPlayer);
|
||||
mcMMOPlayer.disableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getDisabledMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,11 @@ package com.gmail.nossr50.commands.chat;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.chat.ChatManager;
|
||||
import com.gmail.nossr50.chat.ChatMode;
|
||||
import com.gmail.nossr50.chat.PartyChatManager;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatMode;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
@@ -18,16 +19,23 @@ public class PartyChatCommand extends ChatCommand {
|
||||
|
||||
@Override
|
||||
protected void handleChatSending(CommandSender sender, String[] args) {
|
||||
Party party;
|
||||
String message;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
Party party = UserManager.getPlayer(player).getParty();
|
||||
party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (party == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatManager.handlePartyChat(mcMMO.p, party, player.getName(), player.getDisplayName(), buildChatMessage(args, 0));
|
||||
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.1"));
|
||||
return;
|
||||
}
|
||||
|
||||
message = buildChatMessage(args, 0);
|
||||
}
|
||||
else {
|
||||
if (args.length < 2) {
|
||||
@@ -35,14 +43,17 @@ public class PartyChatCommand extends ChatCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
Party party = PartyManager.getParty(args[0]);
|
||||
party = PartyManager.getParty(args[0]);
|
||||
|
||||
if (party == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.InvalidName"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatManager.handlePartyChat(mcMMO.p, party, LocaleLoader.getString("Commands.Chat.Console"), buildChatMessage(args, 1));
|
||||
message = buildChatMessage(args, 1);
|
||||
}
|
||||
|
||||
((PartyChatManager) chatManager).setParty(party);
|
||||
chatManager.handleChat(sender.getName(), getDisplayName(sender), message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
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.database.DatabaseManager;
|
||||
import com.gmail.nossr50.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.datatypes.database.DatabaseType;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.database.DatabaseConversionTask;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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.getName(), false);
|
||||
|
||||
if (profile.isLoaded()) {
|
||||
mcMMO.getDatabaseManager().saveUser(profile);
|
||||
}
|
||||
|
||||
UserManager.addUser(player);
|
||||
}
|
||||
|
||||
new DatabaseConversionTask(oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(mcMMO.p);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,26 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.DatabaseManager;
|
||||
import com.gmail.nossr50.database.LeaderboardManager;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public class McpurgeCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class McpurgeCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.mcpurge(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
DatabaseManager.purgePowerlessSQL();
|
||||
mcMMO.getDatabaseManager().purgePowerlessUsers();
|
||||
|
||||
if (Config.getInstance().getOldUsersCutoff() != -1) {
|
||||
DatabaseManager.purgeOldSQL();
|
||||
}
|
||||
}
|
||||
else {
|
||||
LeaderboardManager.purgePowerlessFlatfile();
|
||||
|
||||
if (Config.getInstance().getOldUsersCutoff() != -1) {
|
||||
LeaderboardManager.purgeOldFlatfile();
|
||||
}
|
||||
if (Config.getInstance().getOldUsersCutoff() != -1) {
|
||||
mcMMO.getDatabaseManager().purgeOldUsers();
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
|
||||
@@ -42,4 +30,9 @@ public class McpurgeCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,36 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.DatabaseManager;
|
||||
import com.gmail.nossr50.database.LeaderboardManager;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class McremoveCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class McremoveCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.mcremove(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
/* MySQL */
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
String tablePrefix = Config.getInstance().getMySQLTablePrefix();
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
|
||||
if (DatabaseManager.update("DELETE FROM " + tablePrefix + "users WHERE " + tablePrefix + "users.user = '" + args[0] + "'") != 0) {
|
||||
DatabaseManager.profileCleanup(args[0]);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
}
|
||||
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 {
|
||||
if (LeaderboardManager.removeFlatFileUser(args[0])) {
|
||||
DatabaseManager.profileCleanup(args[0]);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
}
|
||||
sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen.
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -48,4 +39,15 @@ public class McremoveCommand implements CommandExecutor {
|
||||
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,39 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.DatabaseManagerFactory;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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", (Config.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();
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.gmail.nossr50.commands.database;
|
||||
|
||||
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.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.database.SQLConversionTask;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class MmoupdateCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Permissions.mmoupdate(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoupdate.Start"));
|
||||
UserManager.clearAll();
|
||||
convertToMySQL();
|
||||
|
||||
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||
UserManager.addUser(player);
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoupdate.Finish"));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert FlatFile data to MySQL data.
|
||||
*/
|
||||
private void convertToMySQL() {
|
||||
if (!Config.getInstance().getUseMySQL()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMO.p.getServer().getScheduler().runTaskLaterAsynchronously(mcMMO.p, new SQLConversionTask(), 1);
|
||||
}
|
||||
}
|
||||
@@ -1,154 +1,46 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class AddlevelsCommand implements CommandExecutor {
|
||||
public class AddlevelsCommand extends ExperienceCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PlayerProfile profile;
|
||||
int levels;
|
||||
boolean allSkills = false;
|
||||
SkillType skill = null;
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.addlevels(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (!Permissions.addlevels(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.addlevelsOthers(sender);
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
|
||||
float xpRemoved = profile.getSkillXpLevelRaw(skill);
|
||||
profile.addLevels(skill, value);
|
||||
|
||||
if (args[0].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[0])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isInt(args[1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
levels = Integer.parseInt(args[1]);
|
||||
profile = UserManager.getPlayer((Player) sender).getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.addLevels(skillType, levels);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[0]);
|
||||
profile.addLevels(skill, levels);
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", levels));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", levels, SkillUtils.getSkillName(skill)));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (!Permissions.addlevelsOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[1])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isInt(args[2])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
levels = Integer.parseInt(args[2]);
|
||||
|
||||
// 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) {
|
||||
profile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.addLevels(skillType, levels);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
profile.addLevels(skill, levels);
|
||||
}
|
||||
|
||||
profile.save(); // Since this is a temporary profile, we save it here.
|
||||
}
|
||||
else {
|
||||
profile = mcMMOPlayer.getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.addLevels(skillType, levels);
|
||||
}
|
||||
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", levels));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
profile.addLevels(skill, levels);
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", levels, SkillUtils.getSkillName(skill)));
|
||||
}
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", SkillUtils.getSkillName(skill), args[0]));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
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, SkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,152 +1,44 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class AddxpCommand implements CommandExecutor {
|
||||
public class AddxpCommand extends ExperienceCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
int xp;
|
||||
McMMOPlayer mcMMOPlayer;
|
||||
PlayerProfile profile;
|
||||
boolean allSkills = false;
|
||||
SkillType skill = null;
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.addxp(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (!Permissions.addxp(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.addxpOthers(sender);
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[0])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isInt(args[1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
xp = Integer.parseInt(args[1]);
|
||||
mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
||||
profile = mcMMOPlayer.getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mcMMOPlayer.applyXpGain(skillType, xp);
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", xp));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[0]);
|
||||
|
||||
mcMMOPlayer.applyXpGain(skill, xp);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", xp, SkillUtils.getSkillName(skill)));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (!Permissions.addxpOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[1])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isInt(args[2])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
xp = Integer.parseInt(args[2]);
|
||||
|
||||
// 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) {
|
||||
profile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Currently the offline player doesn't level up automatically
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.setSkillXpLevel(skillType, xp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
profile.setSkillXpLevel(skill, xp);
|
||||
}
|
||||
|
||||
profile.save(); // Since this is a temporary profile, we save it here.
|
||||
}
|
||||
else {
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mcMMOPlayer.applyXpGain(skillType, xp);
|
||||
}
|
||||
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", xp));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
mcMMOPlayer.applyXpGain(skill, xp);
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", xp, SkillUtils.getSkillName(skill)));
|
||||
}
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", SkillUtils.getSkillName(skill), args[0]));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
|
||||
if (player != null) {
|
||||
UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.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, SkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
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.experience.FormulaType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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()) {
|
||||
UserManager.addUser(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public abstract class ExperienceCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
SkillType 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 = SkillType.getSkill(args[0]);
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
}
|
||||
|
||||
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 = SkillType.getSkill(args[1]);
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
}
|
||||
|
||||
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) {
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, 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], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.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, SkillType skill, int value);
|
||||
protected abstract void handlePlayerMessageAll(Player player, int value);
|
||||
protected abstract void handlePlayerMessageSkill(Player player, int value, SkillType skill);
|
||||
|
||||
private boolean validateArguments(CommandSender sender, String skillName, String value) {
|
||||
return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName)));
|
||||
}
|
||||
|
||||
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType 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));
|
||||
}
|
||||
}
|
||||
|
||||
protected void editValues(Player player, PlayerProfile profile, SkillType skill, int value) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
|
||||
handleCommand(player, profile, skillType, value);
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageAll(player, value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
handleCommand(player, profile, skill, value);
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageSkill(player, value, skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,150 +1,52 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
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.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class MmoeditCommand implements CommandExecutor {
|
||||
public class MmoeditCommand extends ExperienceCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PlayerProfile profile;
|
||||
int newValue;
|
||||
boolean allSkills = false;
|
||||
SkillType skill = null;
|
||||
protected boolean permissionsCheckSelf(CommandSender sender) {
|
||||
return Permissions.mmoedit(sender);
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
if (!Permissions.mmoedit(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean permissionsCheckOthers(CommandSender sender) {
|
||||
return Permissions.mmoeditOthers(sender);
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void handleCommand(Player player, PlayerProfile profile, SkillType skill, int value) {
|
||||
int skillLevel = profile.getSkillLevel(skill);
|
||||
float xpRemoved = profile.getSkillXpLevelRaw(skill);
|
||||
|
||||
if (args[0].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[0])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
profile.modifySkill(skill, value);
|
||||
|
||||
if (!StringUtils.isInt(args[1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
newValue = Integer.parseInt(args[1]);
|
||||
profile = UserManager.getPlayer((Player) sender).getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, newValue);
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.AllSkills.1", newValue));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[0]);
|
||||
profile.modifySkill(skill, newValue);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", SkillUtils.getSkillName(skill), newValue));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
if (!Permissions.mmoeditOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[1])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isInt(args[2])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
newValue = Integer.parseInt(args[2]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
|
||||
// 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) {
|
||||
profile = new PlayerProfile(args[0], false);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, newValue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
profile.modifySkill(skill, newValue);
|
||||
}
|
||||
|
||||
profile.save(); // Since this is a temporary profile, we save it here.
|
||||
}
|
||||
else {
|
||||
profile = mcMMOPlayer.getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, newValue);
|
||||
}
|
||||
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.mmoedit.AllSkills.1", newValue));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
profile.modifySkill(skill, newValue);
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", SkillUtils.getSkillName(skill), newValue));
|
||||
}
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.2", SkillUtils.getSkillName(skill), args[0]));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
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, SkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getName(), value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,169 +1,167 @@
|
||||
package com.gmail.nossr50.commands.experience;
|
||||
|
||||
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;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class SkillresetCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
/**
|
||||
* This class mirrors the structure of ExperienceCommand, except the
|
||||
* value/quantity argument is removed.
|
||||
*/
|
||||
public class SkillresetCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PlayerProfile profile;
|
||||
boolean allSkills = false;
|
||||
SkillType skill = null;
|
||||
String skillName = "";
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (!Permissions.skillreset(sender)) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!permissionsCheckSelf(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[0])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
if (!validateArguments(sender, args[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
profile = UserManager.getPlayer((Player) sender).getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Permissions.skillreset(sender, skillType)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, 0);
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Reset.All"));
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[0]);
|
||||
skillName = SkillUtils.getSkillName(skill);
|
||||
|
||||
if (!Permissions.skillreset(sender, skill)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
profile.modifySkill(skill, 0);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skillName));
|
||||
}
|
||||
|
||||
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]));
|
||||
return true;
|
||||
|
||||
case 2:
|
||||
if (!Permissions.skillresetOthers(sender)) {
|
||||
if (!permissionsCheckOthers(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
allSkills = true;
|
||||
}
|
||||
else if (!SkillUtils.isSkill(args[1])) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
if (!validateArguments(sender, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!allSkills) {
|
||||
SkillType skill;
|
||||
if (args[1].equalsIgnoreCase("all")) {
|
||||
skill = null;
|
||||
}
|
||||
else {
|
||||
skill = SkillType.getSkill(args[1]);
|
||||
skillName = SkillUtils.getSkillName(skill);
|
||||
|
||||
if (!Permissions.skillresetOthers(sender, skill)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
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) {
|
||||
profile = new PlayerProfile(args[0], false);
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
if (CommandUtils.unloadedProfile(sender, profile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Permissions.skillresetOthers(sender, skill)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
profile.modifySkill(skill, 0);
|
||||
}
|
||||
|
||||
profile.save(); // Since this is a temporary profile, we save it here.
|
||||
editValues(null, profile, skill);
|
||||
}
|
||||
else {
|
||||
profile = mcMMOPlayer.getProfile();
|
||||
|
||||
if (allSkills) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Permissions.skillresetOthers(sender, skillType)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
profile.modifySkill(skillType, 0);
|
||||
}
|
||||
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Reset.All"));
|
||||
}
|
||||
else {
|
||||
profile.modifySkill(skill, 0);
|
||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Reset.Single", skillName));
|
||||
}
|
||||
}
|
||||
|
||||
if (allSkills) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", args[0]));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.2", skillName, args[0]));
|
||||
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], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleCommand(Player player, PlayerProfile profile, SkillType 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, SkillType skill) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
|
||||
}
|
||||
|
||||
private boolean validateArguments(CommandSender sender, String skillName) {
|
||||
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all"));
|
||||
}
|
||||
|
||||
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType 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));
|
||||
}
|
||||
}
|
||||
|
||||
protected void editValues(Player player, PlayerProfile profile, SkillType skill) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
|
||||
handleCommand(player, profile, skillType);
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageAll(player);
|
||||
}
|
||||
}
|
||||
else {
|
||||
handleCommand(player, profile, skill);
|
||||
|
||||
if (player != null) {
|
||||
handlePlayerMessageSkill(player, skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +1,65 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public class HardcoreCommand implements CommandExecutor {
|
||||
public class HardcoreCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreToggle(sender);
|
||||
}
|
||||
|
||||
if (Config.getInstance().getHardcoreEnabled()) {
|
||||
disableHardcore();
|
||||
}
|
||||
else {
|
||||
enableHardcore();
|
||||
}
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.hardcoreModify(sender);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("on") || args[0].equalsIgnoreCase("true") || args[0].equalsIgnoreCase("enabled")) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
enableHardcore();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("off") || args[0].equalsIgnoreCase("false") || args[0].equalsIgnoreCase("disabled")) {
|
||||
if (!Permissions.hardcoreToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
disableHardcore();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isDouble(args[0])) {
|
||||
@Override
|
||||
protected boolean checkEnabled(SkillType skill) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (!skillType.getHardcoreStatLossEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Permissions.hardcoreModify(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
double newPercent = Double.parseDouble(args[0]);
|
||||
|
||||
Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercent);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.PercentageChanged", percent.format(newPercent / 100D)));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return skill.getHardcoreStatLossEnabled();
|
||||
}
|
||||
|
||||
private void disableHardcore() {
|
||||
Config.getInstance().setHardcoreEnabled(false);
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Disabled"));
|
||||
@Override
|
||||
protected void enable(SkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
private void enableHardcore() {
|
||||
Config.getInstance().setHardcoreEnabled(true);
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Enabled"));
|
||||
@Override
|
||||
protected void disable(SkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
private void toggle(boolean enable, SkillType skill) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
|
||||
skillType.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,132 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
SkillType skill = SkillType.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(SkillType skill);
|
||||
protected abstract void enable(SkillType skill);
|
||||
protected abstract void disable(SkillType skill);
|
||||
protected abstract void modify(CommandSender sender, double newPercentage);
|
||||
}
|
||||
@@ -1,90 +1,65 @@
|
||||
package com.gmail.nossr50.commands.hardcore;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public class VampirismCommand implements CommandExecutor {
|
||||
public class VampirismCommand extends HardcoreModeCommand {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Config.getInstance().getHardcoreEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.Disabled"));
|
||||
protected boolean checkTogglePermissions(CommandSender sender) {
|
||||
return Permissions.vampirismToggle(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkModifyPermissions(CommandSender sender) {
|
||||
return Permissions.vampirismModify(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkEnabled(SkillType skill) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (!skillType.getHardcoreVampirismEnabled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!Permissions.vampirismToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
return skill.getHardcoreVampirismEnabled();
|
||||
}
|
||||
|
||||
if (Config.getInstance().getHardcoreVampirismEnabled()) {
|
||||
disableVampirism();
|
||||
}
|
||||
else {
|
||||
enableVampirism();
|
||||
}
|
||||
@Override
|
||||
protected void enable(SkillType skill) {
|
||||
toggle(true, skill);
|
||||
}
|
||||
|
||||
return true;
|
||||
@Override
|
||||
protected void disable(SkillType skill) {
|
||||
toggle(false, skill);
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("on") || args[0].equalsIgnoreCase("true") || args[0].equalsIgnoreCase("enabled")) {
|
||||
if (!Permissions.vampirismToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void modify(CommandSender sender, double newPercentage) {
|
||||
Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage);
|
||||
sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D)));
|
||||
}
|
||||
|
||||
enableVampirism();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("off") || args[0].equalsIgnoreCase("false") || args[0].equalsIgnoreCase("disabled")) {
|
||||
if (!Permissions.vampirismToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
disableVampirism();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringUtils.isDouble(args[0])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Permissions.vampirismModify(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
double newPercent = Double.parseDouble(args[0]);
|
||||
|
||||
Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercent);
|
||||
sender.sendMessage(LocaleLoader.getString("Vampirism.PercentageChanged", percent.format(newPercent / 100D)));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
private void toggle(boolean enable, SkillType skill) {
|
||||
if (skill == null) {
|
||||
for (SkillType skillType : SkillType.NON_CHILD_SKILLS) {
|
||||
skillType.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
}
|
||||
else {
|
||||
skill.setHardcoreVampirismEnabled(enable);
|
||||
}
|
||||
}
|
||||
|
||||
private void disableVampirism() {
|
||||
Config.getInstance().setHardcoreVampirismEnabled(false);
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Vampirism.Disabled"));
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill)));
|
||||
}
|
||||
|
||||
private void enableVampirism() {
|
||||
Config.getInstance().setHardcoreVampirismEnabled(true);
|
||||
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Vampirism.Enabled"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,15 +11,12 @@ 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 +24,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:
|
||||
|
||||
@@ -5,10 +5,10 @@ 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.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyChangeOwnerCommand implements CommandExecutor {
|
||||
@@ -17,13 +17,14 @@ public class PartyChangeOwnerCommand implements CommandExecutor {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
|
||||
if (!playerParty.getMembers().contains(mcMMO.p.getServer().getOfflinePlayer(args[1]))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", args[1]));
|
||||
if (!playerParty.getMembers().contains(targetName)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName));
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.setPartyLeader(args[1], playerParty);
|
||||
PartyManager.setPartyLeader(targetName, playerParty);
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
||||
@@ -12,20 +12,20 @@ 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 +35,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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,50 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
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.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyCommand implements CommandExecutor {
|
||||
private McMMOPlayer mcMMOPlayer;
|
||||
private Player player;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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 partyExpShareCommand = new PartyExpShareCommand();
|
||||
private CommandExecutor partyXpShareCommand = new PartyXpShareCommand();
|
||||
private CommandExecutor partyItemShareCommand = new PartyItemShareCommand();
|
||||
private CommandExecutor partyInviteCommand = new PartyInviteCommand();
|
||||
private CommandExecutor partyKickCommand = new PartyKickCommand();
|
||||
@@ -31,8 +55,9 @@ public class PartyCommand implements CommandExecutor {
|
||||
private CommandExecutor partyRenameCommand = new PartyRenameCommand();
|
||||
private CommandExecutor partyInfoCommand = new PartyInfoCommand();
|
||||
private CommandExecutor partyHelpCommand = new PartyHelpCommand();
|
||||
private CommandExecutor partyTeleportCommand = mcMMO.p.getCommand("ptp").getExecutor();
|
||||
private CommandExecutor partyChatCommand = mcMMO.p.getCommand("partychat").getExecutor();
|
||||
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) {
|
||||
@@ -45,13 +70,13 @@ public class PartyCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
player = (Player) sender;
|
||||
mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (args.length < 1) {
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return printUsage();
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
return partyInfoCommand.onCommand(sender, command, label, args);
|
||||
@@ -60,7 +85,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
|
||||
|
||||
if (subcommand == null) {
|
||||
return printUsage();
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
// Can't use this for lock/unlock since they're handled by the same command
|
||||
@@ -85,7 +110,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
// Party member commands
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return printUsage();
|
||||
return printUsage(player);
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
@@ -110,8 +135,8 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
switch (subcommand) {
|
||||
case EXPSHARE:
|
||||
return partyExpShareCommand.onCommand(sender, command, label, args);
|
||||
case XPSHARE:
|
||||
return partyXpShareCommand.onCommand(sender, command, label, args);
|
||||
case ITEMSHARE:
|
||||
return partyItemShareCommand.onCommand(sender, command, label, args);
|
||||
case KICK:
|
||||
@@ -121,13 +146,14 @@ public class PartyCommand implements CommandExecutor {
|
||||
case OWNER:
|
||||
return partyChangeOwnerCommand.onCommand(sender, command, label, args);
|
||||
case LOCK:
|
||||
// Fallthrough
|
||||
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;
|
||||
}
|
||||
@@ -135,7 +161,61 @@ public class PartyCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean printUsage() {
|
||||
@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 ?"));
|
||||
@@ -143,12 +223,11 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
private String[] extractArgs(String[] args) {
|
||||
String[] newArgs = new String[args.length - 1];
|
||||
return Arrays.copyOfRange(args, 1, args.length);
|
||||
}
|
||||
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
newArgs[i - 1] = args[i];
|
||||
}
|
||||
|
||||
return newArgs;
|
||||
private boolean isItemShareCategory(String category) {
|
||||
return category.equalsIgnoreCase("loot") || category.equalsIgnoreCase("mining") || category.equalsIgnoreCase("herbalism") || category.equalsIgnoreCase("woodcutting") || category.equalsIgnoreCase("misc");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,39 +5,31 @@ 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:
|
||||
|
||||
@@ -17,9 +17,10 @@ public class PartyDisbandCommand implements CommandExecutor {
|
||||
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,55 +0,0 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.ShareHandler;
|
||||
import com.gmail.nossr50.party.ShareHandler.ShareMode;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyExpShareCommand implements CommandExecutor {
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Config.getInstance().getExpShareEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.ExpShare.Disabled"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (args[1].equalsIgnoreCase("none") || args[1].equalsIgnoreCase("off") || args[1].equalsIgnoreCase("false")) {
|
||||
handleChangingShareMode(ShareMode.NONE);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || args[1].equalsIgnoreCase("on") || args[1].equalsIgnoreCase("true")) {
|
||||
handleChangingShareMode(ShareMode.EQUAL);
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "[NONE | EQUAL]"));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "expshare", "<NONE | EQUAL>"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleChangingShareMode(ShareHandler.ShareMode mode) {
|
||||
playerParty.setXpShareMode(mode);
|
||||
|
||||
for (Player member : playerParty.getOnlineMembers()) {
|
||||
member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Exp"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,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 +28,4 @@ public class PartyHelpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -9,50 +11,82 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.party.ShareHandler;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyInfoCommand implements CommandExecutor {
|
||||
private Player player;
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
playerParty = mcMMOPlayer.getParty();
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
case 1:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
displayPartyHeader();
|
||||
displayShareModeInfo();
|
||||
displayMemberInfo();
|
||||
return true;
|
||||
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 String createMembersList() {
|
||||
StringBuilder memberList = new StringBuilder();
|
||||
private void displayPartyHeader(Player player, Party party) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Header"));
|
||||
|
||||
for (OfflinePlayer member : playerParty.getMembers()) {
|
||||
if (playerParty.getLeader().equalsIgnoreCase(member.getName())) {
|
||||
memberList.append(ChatColor.GOLD).append(member.getName()).append(" ");
|
||||
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;
|
||||
}
|
||||
else if (member.isOnline()) {
|
||||
memberList.append(ChatColor.WHITE).append(member.getName()).append(" ");
|
||||
|
||||
if (isUnlockedFeature(party, partyFeature)) {
|
||||
unlockedPartyFeatures.add(partyFeature.getLocaleString());
|
||||
}
|
||||
else {
|
||||
memberList.append(ChatColor.GRAY).append(member.getName()).append(" ");
|
||||
lockedPartyFeatures.add(partyFeature.getFeatureLockedLocaleString());
|
||||
}
|
||||
}
|
||||
|
||||
return memberList.toString();
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.UnlockedFeatures", unlockedPartyFeatures.isEmpty() ? "None" : unlockedPartyFeatures));
|
||||
|
||||
for (String message : lockedPartyFeatures) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void displayShareModeInfo() {
|
||||
boolean xpShareEnabled = Config.getInstance().getExpShareEnabled();
|
||||
boolean itemShareEnabled = Config.getInstance().getItemShareEnabled();
|
||||
boolean itemSharingActive = playerParty.getItemShareMode() != ShareHandler.ShareMode.NONE;
|
||||
private boolean isUnlockedFeature(Party party, PartyFeature partyFeature) {
|
||||
return party.getLevel() >= Config.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;
|
||||
@@ -63,11 +97,11 @@ public class PartyInfoCommand implements CommandExecutor {
|
||||
String separator = "";
|
||||
|
||||
if (xpShareEnabled) {
|
||||
expShareInfo = LocaleLoader.getString("Commands.Party.ExpShare", playerParty.getXpShareMode().toString());
|
||||
expShareInfo = LocaleLoader.getString("Commands.Party.ExpShare", party.getXpShareMode().toString());
|
||||
}
|
||||
|
||||
if (itemShareEnabled) {
|
||||
itemShareInfo = LocaleLoader.getString("Commands.Party.ItemShare", playerParty.getItemShareMode().toString());
|
||||
itemShareInfo = LocaleLoader.getString("Commands.Party.ItemShare", party.getItemShareMode().toString());
|
||||
}
|
||||
|
||||
if (xpShareEnabled && itemShareEnabled) {
|
||||
@@ -75,28 +109,18 @@ public class PartyInfoCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.ShareMode") + expShareInfo + separator + itemShareInfo);
|
||||
|
||||
if (itemSharingActive) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.ItemShareCategories", playerParty.getItemShareCategories()));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.ItemShareCategories", party.getItemShareCategories()));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayPartyHeader() {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Header"));
|
||||
|
||||
if (playerParty.isLocked()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Status", playerParty.getName(), LocaleLoader.getString("Party.Status.Locked")));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Status", playerParty.getName(), LocaleLoader.getString("Party.Status.Unlocked")));
|
||||
}
|
||||
}
|
||||
|
||||
private void displayMemberInfo() {
|
||||
int membersNear = PartyManager.getNearMembers(player, playerParty, Config.getInstance().getPartyShareRange()).size();
|
||||
int membersOnline = playerParty.getOnlineMembers().size() - 1;
|
||||
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
|
||||
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
|
||||
int membersOnline = party.getOnlineMembers().size() - 1;
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", membersNear, membersOnline));
|
||||
player.sendMessage(createMembersList());
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size(), membersOnline));
|
||||
player.sendMessage(party.createMembersList(player.getName(), nearMembers));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,40 +5,29 @@ 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.commands.CommandUtils;
|
||||
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,20 @@ 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();
|
||||
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;
|
||||
|
||||
|
||||
@@ -6,96 +6,84 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.ItemShareType;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.ShareHandler;
|
||||
import com.gmail.nossr50.party.ShareHandler.ShareMode;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyItemShareCommand implements CommandExecutor {
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!Config.getInstance().getItemShareEnabled()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.ItemShare.Disabled"));
|
||||
Party party = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
if (party.getLevel() < Config.getInstance().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Feature.Disabled.4"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase());
|
||||
|
||||
if (args[1].equalsIgnoreCase("none") || args[1].equalsIgnoreCase("off") || args[1].equalsIgnoreCase("false")) {
|
||||
handleChangingShareMode(ShareMode.NONE);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even")) {
|
||||
handleChangingShareMode(ShareMode.EQUAL);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("random")) {
|
||||
handleChangingShareMode(ShareMode.RANDOM);
|
||||
}
|
||||
else {
|
||||
if (mode == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
|
||||
return true;
|
||||
}
|
||||
|
||||
handleChangingShareMode(party, mode);
|
||||
return true;
|
||||
|
||||
case 3:
|
||||
playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
boolean toggle = false;
|
||||
boolean toggle;
|
||||
|
||||
if (args[2].equalsIgnoreCase("true") || args[2].equalsIgnoreCase("on") || args[2].equalsIgnoreCase("enabled")) {
|
||||
if (CommandUtils.shouldEnableToggle(args[2])) {
|
||||
toggle = true;
|
||||
}
|
||||
else if (args[2].equalsIgnoreCase("false") || args[2].equalsIgnoreCase("off") || args[2].equalsIgnoreCase("disabled")) {
|
||||
else if (CommandUtils.shouldDisableToggle(args[2])) {
|
||||
toggle = false;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("loot")) {
|
||||
playerParty.setSharingLootDrops(toggle);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("mining")) {
|
||||
playerParty.setSharingMiningDrops(toggle);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("herbalism")) {
|
||||
playerParty.setSharingHerbalismDrops(toggle);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("woodcutting")) {
|
||||
playerParty.setSharingWoodcuttingDrops(toggle);
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting> <true | false>"));
|
||||
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>"));
|
||||
}
|
||||
|
||||
notifyToggleItemShareCategory(args, toggle);
|
||||
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> <true | false>"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleChangingShareMode(ShareHandler.ShareMode mode) {
|
||||
playerParty.setItemShareMode(mode);
|
||||
private void handleChangingShareMode(Party party, ShareMode mode) {
|
||||
party.setItemShareMode(mode);
|
||||
|
||||
for (Player member : playerParty.getOnlineMembers()) {
|
||||
member.sendMessage(LocaleLoader.getString("Commands.Party.SetSharing", LocaleLoader.getString("Party.ShareType.Item"), LocaleLoader.getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString()))));
|
||||
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 notifyToggleItemShareCategory(String[] args, boolean toggle) {
|
||||
String state = "disabled";
|
||||
private void handleToggleItemShareCategory(Party party, ItemShareType type, boolean toggle) {
|
||||
party.setSharingDrops(type, toggle);
|
||||
|
||||
if (toggle) {
|
||||
state = "enabled";
|
||||
}
|
||||
String toggleMessage = LocaleLoader.getString("Commands.Party.ToggleShareCategory", StringUtils.getCapitalized(type.toString()), toggle ? "enabled" : "disabled");
|
||||
|
||||
for (Player member : playerParty.getOnlineMembers()) {
|
||||
member.sendMessage(LocaleLoader.getString("Commands.Party.ToggleShareCategory", StringUtils.getCapitalized(args[1]), state));
|
||||
for (Player member : party.getOnlineMembers()) {
|
||||
member.sendMessage(toggleMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,30 +5,39 @@ 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.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyJoinCommand implements CommandExecutor {
|
||||
private McMMOPlayer mcMMOTarget;
|
||||
private Player target;
|
||||
private Party targetParty;
|
||||
|
||||
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:
|
||||
// Fallthrough
|
||||
case 3:
|
||||
// Verify target exists and is in a different party than the player
|
||||
if (!canJoinParty(sender, args[1])) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -39,12 +48,15 @@ public class PartyJoinCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
String partyName = targetParty.getName();
|
||||
|
||||
// Changing parties
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, player, playerParty, targetParty.getName())) {
|
||||
if (!PartyManager.changeOrJoinParty(mcMMOPlayer, partyName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.joinParty(player, mcMMOPlayer, targetParty, password);
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Party.Join", partyName));
|
||||
PartyManager.addToParty(mcMMOPlayer, targetParty);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -60,37 +72,4 @@ public class PartyJoinCommand implements CommandExecutor {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean canJoinParty(CommandSender sender, String targetName) {
|
||||
if (!mcMMO.p.getServer().getOfflinePlayer(targetName).isOnline()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.NotOnline", targetName));
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMOTarget = UserManager.getPlayer(targetName);
|
||||
|
||||
if (mcMMOTarget == null) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
target = mcMMOTarget.getPlayer();
|
||||
|
||||
if (!mcMMOTarget.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.PlayerNotInParty", targetName));
|
||||
return false;
|
||||
}
|
||||
|
||||
player = (Player) sender;
|
||||
mcMMOPlayer = UserManager.getPlayer(player);
|
||||
playerParty = mcMMOPlayer.getParty();
|
||||
targetParty = mcMMOTarget.getParty();
|
||||
|
||||
if (player.equals(target) || (mcMMOPlayer.inParty() && playerParty.equals(targetParty))) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Join.Self"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ 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.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyKickCommand implements CommandExecutor {
|
||||
@@ -19,14 +20,15 @@ public class PartyKickCommand implements CommandExecutor {
|
||||
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.getMembers().contains(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 +37,7 @@ public class PartyKickCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
PartyManager.processPartyLeaving(UserManager.getPlayer(onlineTarget));
|
||||
onlineTarget.sendMessage(LocaleLoader.getString("Commands.Party.Kick", partyName));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,22 +8,19 @@ import org.bukkit.entity.Player;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PartyLockCommand implements CommandExecutor {
|
||||
private Party playerParty;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
if (args[0].equalsIgnoreCase("lock")) {
|
||||
lockParty(sender, command);
|
||||
togglePartyLock(sender, true);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("unlock")) {
|
||||
unlockParty(sender, command);
|
||||
togglePartyLock(sender, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -34,11 +31,11 @@ public class PartyLockCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("on") || args[1].equalsIgnoreCase("true")) {
|
||||
lockParty(sender, command);
|
||||
if (CommandUtils.shouldEnableToggle(args[1])) {
|
||||
togglePartyLock(sender, true);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("off") || args[1].equalsIgnoreCase("false")) {
|
||||
unlockParty(sender, command);
|
||||
else if (CommandUtils.shouldDisableToggle(args[1])) {
|
||||
togglePartyLock(sender, false);
|
||||
}
|
||||
else {
|
||||
sendUsageStrings(sender);
|
||||
@@ -52,46 +49,25 @@ public class PartyLockCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle locking a party.
|
||||
*/
|
||||
private void lockParty(CommandSender sender, Command command) {
|
||||
if (!Permissions.partySubcommand(sender, PartySubcommandType.LOCK)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerParty.isLocked()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.IsLocked"));
|
||||
return;
|
||||
}
|
||||
|
||||
playerParty.setLocked(true);
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle unlocking a party.
|
||||
*
|
||||
* @return true if party is successfully unlocked, false otherwise.
|
||||
*/
|
||||
private void unlockParty(CommandSender sender, Command command) {
|
||||
if (!Permissions.partySubcommand(sender, PartySubcommandType.UNLOCK)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!playerParty.isLocked()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Party.IsntLocked"));
|
||||
return;
|
||||
}
|
||||
|
||||
playerParty.setLocked(false);
|
||||
sender.sendMessage(LocaleLoader.getString("Party.Unlocked"));
|
||||
}
|
||||
|
||||
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")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,32 +6,31 @@ 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.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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
@@ -14,29 +15,31 @@ 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();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
@@ -37,11 +38,14 @@ public enum PartySubcommandType {
|
||||
return OWNER;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) {
|
||||
return EXPSHARE;
|
||||
return XPSHARE;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) {
|
||||
return ITEMSHARE;
|
||||
}
|
||||
else if (commandName.equalsIgnoreCase("ally")) {
|
||||
return ALLIANCE;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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() < Config.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import org.bukkit.World;
|
||||
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.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class PtpCommand implements CommandExecutor {
|
||||
private Player player;
|
||||
private McMMOPlayer mcMMOPlayer;
|
||||
|
||||
private Player target;
|
||||
private McMMOPlayer mcMMOTarget;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
player = (Player) sender;
|
||||
mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (args[0].equalsIgnoreCase("toggle")) {
|
||||
if (!Permissions.partyTeleportToggle(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
return togglePartyTeleportation();
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("acceptany") || args[0].equalsIgnoreCase("acceptall")) {
|
||||
if (!Permissions.partyTeleportAcceptAll(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
return acceptAnyTeleportRequest();
|
||||
}
|
||||
|
||||
int ptpCooldown = Config.getInstance().getPTPCommandCooldown();
|
||||
long recentlyHurt = UserManager.getPlayer(player).getRecentlyHurt();
|
||||
|
||||
if ((recentlyHurt * Misc.TIME_CONVERSION_FACTOR + ptpCooldown * Misc.TIME_CONVERSION_FACTOR) > System.currentTimeMillis()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", ptpCooldown));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("accept")) {
|
||||
if (!Permissions.partyTeleportAccept(sender)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
return acceptTeleportRequest();
|
||||
}
|
||||
|
||||
return sendTeleportRequest(args[0]);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean sendTeleportRequest(String targetName) {
|
||||
if (!canTeleport(targetName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!mcMMOTarget.getPtpConfirmRequired()) {
|
||||
return handlePartyTeleportEvent(player, target);
|
||||
}
|
||||
|
||||
mcMMOTarget.setPtpRequest(player);
|
||||
mcMMOTarget.actualizePtpTimeout();
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||
|
||||
int ptpRequestExpire = Config.getInstance().getPTPCommandTimeout();
|
||||
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName()));
|
||||
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", ptpRequestExpire));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean acceptTeleportRequest() {
|
||||
if (!mcMMOPlayer.hasPtpRequest()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.NoRequests"));
|
||||
return true;
|
||||
}
|
||||
|
||||
int ptpRequestExpire = Config.getInstance().getPTPCommandTimeout();
|
||||
|
||||
if ((mcMMOPlayer.getPtpTimeout() + ptpRequestExpire) * Misc.TIME_CONVERSION_FACTOR < System.currentTimeMillis()) {
|
||||
mcMMOPlayer.removePtpRequest();
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.RequestExpired"));
|
||||
return true;
|
||||
}
|
||||
|
||||
target = mcMMOPlayer.getPtpRequest();
|
||||
mcMMOPlayer.removePtpRequest();
|
||||
|
||||
if (!canTeleport(target.getName())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Config.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return handlePartyTeleportEvent(target, player);
|
||||
}
|
||||
|
||||
private boolean acceptAnyTeleportRequest() {
|
||||
if (mcMMOPlayer.getPtpConfirmRequired()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Disabled"));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Enabled"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.togglePtpConfirmRequired();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean togglePartyTeleportation() {
|
||||
if (mcMMOPlayer.getPtpEnabled()) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.Disabled"));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.ptp.Enabled"));
|
||||
}
|
||||
|
||||
mcMMOPlayer.togglePtpUse();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean canTeleport(String targetName) {
|
||||
if (!mcMMO.p.getServer().getOfflinePlayer(targetName).isOnline()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.NotOnline", targetName));
|
||||
return false;
|
||||
}
|
||||
|
||||
mcMMOTarget = UserManager.getPlayer(targetName);
|
||||
|
||||
if (mcMMOTarget == null) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
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.getPtpEnabled()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", target.getName()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.isDead()) {
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handlePartyTeleportEvent(Player player, Player target) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, mcMMOPlayer.getParty().getName());
|
||||
|
||||
mcMMO.p.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
player.teleport(target);
|
||||
player.sendMessage(LocaleLoader.getString("Party.Teleport.Player", target.getName()));
|
||||
target.sendMessage(LocaleLoader.getString("Party.Teleport.Target", player.getName()));
|
||||
mcMMOPlayer.actualizeRecentlyHurt();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
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 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,135 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class PartyAllianceCommand implements TabExecutor {
|
||||
private Player player;
|
||||
private Party playerParty;
|
||||
private Party targetParty;
|
||||
|
||||
public static final List<String> ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband");
|
||||
|
||||
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() < Config.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() < Config.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.getName(), nearMembers));
|
||||
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
|
||||
player.sendMessage(targetParty.createMembersList(player.getName(), nearMembers));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
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 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,71 @@
|
||||
package com.gmail.nossr50.commands.party.alliance;
|
||||
|
||||
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.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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().equalsIgnoreCase(targetName)) {
|
||||
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,32 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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,64 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
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(), Config.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 (Config.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,206 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.runnables.items.TeleportationWarmup;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
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();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
if (!mcMMOPlayer.inParty()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||
return true;
|
||||
}
|
||||
|
||||
Party party = mcMMOPlayer.getParty();
|
||||
|
||||
if (party.getLevel() < Config.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 = Config.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 = Config.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", Config.getInstance().getPTPCommandTimeout()));
|
||||
}
|
||||
|
||||
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 = Config.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +1,94 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
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;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
|
||||
public class InspectCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class InspectCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
PlayerProfile profile;
|
||||
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
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) {
|
||||
profile = new PlayerProfile(args[0], false); // Temporary Profile
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false); // Temporary Profile
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
if (CommandUtils.inspectOffline(sender, profile, Permissions.inspectOffline(sender))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Why do we care if this is a player?
|
||||
if (sender instanceof Player && !Permissions.inspectOffline(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||
return true;
|
||||
if (sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
|
||||
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile);
|
||||
|
||||
if (!Config.getInstance().getInspectUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", args[0]));
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName));
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Excavation.Listener"), profile.getSkillLevel(SkillType.EXCAVATION), profile.getSkillXpLevel(SkillType.EXCAVATION), profile.getXpToLevel(SkillType.EXCAVATION)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Fishing.Listener"), profile.getSkillLevel(SkillType.FISHING), profile.getSkillXpLevel(SkillType.FISHING), profile.getXpToLevel(SkillType.FISHING)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Herbalism.Listener"), profile.getSkillLevel(SkillType.HERBALISM), profile.getSkillXpLevel(SkillType.HERBALISM), profile.getXpToLevel(SkillType.HERBALISM)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Mining.Listener"), profile.getSkillLevel(SkillType.MINING), profile.getSkillXpLevel(SkillType.MINING), profile.getXpToLevel(SkillType.MINING)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Woodcutting.Listener"), profile.getSkillLevel(SkillType.WOODCUTTING), profile.getSkillXpLevel(SkillType.WOODCUTTING), profile.getXpToLevel(SkillType.WOODCUTTING)));
|
||||
for (SkillType skill : SkillType.GATHERING_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Axes.Listener"), profile.getSkillLevel(SkillType.AXES), profile.getSkillXpLevel(SkillType.AXES), profile.getXpToLevel(SkillType.AXES)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Archery.Listener"), profile.getSkillLevel(SkillType.ARCHERY), profile.getSkillXpLevel(SkillType.ARCHERY), profile.getXpToLevel(SkillType.ARCHERY)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Swords.Listener"), profile.getSkillLevel(SkillType.SWORDS), profile.getSkillXpLevel(SkillType.SWORDS), profile.getXpToLevel(SkillType.SWORDS)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Taming.Listener"), profile.getSkillLevel(SkillType.TAMING), profile.getSkillXpLevel(SkillType.TAMING), profile.getXpToLevel(SkillType.TAMING)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Unarmed.Listener"), profile.getSkillLevel(SkillType.UNARMED), profile.getSkillXpLevel(SkillType.UNARMED), profile.getXpToLevel(SkillType.UNARMED)));
|
||||
for (SkillType skill : SkillType.COMBAT_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Acrobatics.Listener"), profile.getSkillLevel(SkillType.ACROBATICS), profile.getSkillXpLevel(SkillType.ACROBATICS), profile.getXpToLevel(SkillType.ACROBATICS)));
|
||||
sender.sendMessage(LocaleLoader.getString("Skills.Stats", LocaleLoader.getString("Repair.Listener"), profile.getSkillLevel(SkillType.REPAIR), profile.getSkillXpLevel(SkillType.REPAIR), profile.getXpToLevel(SkillType.REPAIR)));
|
||||
for (SkillType skill : SkillType.MISC_SKILLS) {
|
||||
sender.sendMessage(CommandUtils.displaySkill(profile, skill));
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
Player target = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player inspector = (Player) sender;
|
||||
|
||||
if (!Misc.isNear(inspector.getLocation(), target.getLocation(), 5.0) && !Permissions.inspectFar(inspector)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||
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 (sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
|
||||
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile());
|
||||
|
||||
if (!Config.getInstance().getInspectUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
profile = mcMMOPlayer.getProfile();
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Stats", target.getName()));
|
||||
CommandUtils.printGatheringSkills(target, profile, sender);
|
||||
CommandUtils.printCombatSkills(target, profile, sender);
|
||||
CommandUtils.printMiscSkills(target, profile, sender);
|
||||
CommandUtils.printGatheringSkills(target, sender);
|
||||
CommandUtils.printCombatSkills(target, sender);
|
||||
CommandUtils.printMiscSkills(target, sender);
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
|
||||
}
|
||||
|
||||
@@ -84,4 +98,15 @@ public class InspectCommand implements CommandExecutor {
|
||||
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,70 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class MccooldownCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (Config.getInstance().getCooldownUseBoard()) {
|
||||
ScoreboardManager.enablePlayerCooldownScoreboard(player);
|
||||
|
||||
if (!Config.getInstance().getCooldownUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Header"));
|
||||
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||
|
||||
for (AbilityType ability : AbilityType.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();
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,32 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.LeaderboardManager;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
|
||||
public class McrankCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class McrankCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
if (!(sender instanceof Player)) {
|
||||
return false;
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Permissions.mcrank(sender)) {
|
||||
@@ -32,13 +34,7 @@ public class McrankCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
sqlDisplay(sender, sender.getName());
|
||||
}
|
||||
else {
|
||||
LeaderboardManager.updateLeaderboards(); // Make sure the information is up to date
|
||||
flatfileDisplay(sender, sender.getName());
|
||||
}
|
||||
display(sender, sender.getName());
|
||||
|
||||
return true;
|
||||
|
||||
@@ -48,38 +44,22 @@ public class McrankCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0]);
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
if (mcMMOPlayer == null) {
|
||||
PlayerProfile profile = new PlayerProfile(args[0], false); // Temporary Profile
|
||||
if (mcMMOPlayer != null) {
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
playerName = player.getName();
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sender instanceof Player && !Permissions.mcrankOffline(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||
if (CommandUtils.tooFar(sender, player, Permissions.mcrankFar(sender))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Player target = mcMMOPlayer.getPlayer();
|
||||
|
||||
if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), 5.0) && !Permissions.mcrankFar(sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
sqlDisplay(sender, args[0]);
|
||||
}
|
||||
else {
|
||||
LeaderboardManager.updateLeaderboards(); // Make sure the information is up to date
|
||||
flatfileDisplay(sender, args[0]);
|
||||
else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(sender, playerName);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -87,37 +67,33 @@ public class McrankCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
private void flatfileDisplay(CommandSender sender, String playerName) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", playerName));
|
||||
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
int[] rankInts = LeaderboardManager.getPlayerRank(playerName, skillType);
|
||||
|
||||
if ((sender instanceof Player && !Permissions.skillEnabled(sender, skillType)) || skillType.isChildSkill()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rankInts[1] == 0) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked"))); // Don't bother showing ranking for players without skills
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", SkillUtils.getSkillName(skillType), rankInts[0]));
|
||||
}
|
||||
}
|
||||
|
||||
// Show the powerlevel ranking
|
||||
int[] rankInts = LeaderboardManager.getPlayerRank(playerName);
|
||||
|
||||
if (rankInts[1] == 0) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", LocaleLoader.getString("Commands.mcrank.Unranked"))); // Don't bother showing ranking for players without skills
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", rankInts[0]));
|
||||
@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 sqlDisplay(CommandSender sender, String playerName) {
|
||||
mcMMO.p.getServer().getScheduler().runTaskAsynchronously(mcMMO.p, new McrankCommandAsyncTask(playerName, sender));
|
||||
private void display(CommandSender sender, String playerName) {
|
||||
if (sender instanceof Player) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
|
||||
|
||||
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMOPlayer.actualizeDatabaseATS();
|
||||
}
|
||||
|
||||
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getRankUseBoard());
|
||||
boolean useChat = !useBoard || Config.getInstance().getRankUseChat();
|
||||
|
||||
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
|
||||
public class McstatsCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class McstatsCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (CommandUtils.noConsoleUsage(sender)) {
|
||||
@@ -22,23 +25,29 @@ public class McstatsCommand implements CommandExecutor {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
Player player = (Player) sender;
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
PlayerProfile profile = mcMMOPlayer.getProfile();
|
||||
|
||||
if (Config.getInstance().getStatsUseBoard()) {
|
||||
ScoreboardManager.enablePlayerStatsScoreboard(player);
|
||||
|
||||
if (!Config.getInstance().getStatsUseChat()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Stats.Own.Stats"));
|
||||
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||
|
||||
CommandUtils.printGatheringSkills(player, profile);
|
||||
CommandUtils.printCombatSkills(player, profile);
|
||||
CommandUtils.printMiscSkills(player, profile);
|
||||
CommandUtils.printGatheringSkills(player);
|
||||
CommandUtils.printCombatSkills(player);
|
||||
CommandUtils.printMiscSkills(player);
|
||||
|
||||
int powerLevelCap = Config.getInstance().getPowerLevelCap();
|
||||
|
||||
if (powerLevelCap != Integer.MAX_VALUE) {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", mcMMOPlayer.getPowerLevel(), powerLevelCap));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
|
||||
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", UserManager.getPlayer(player).getPowerLevel()));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -47,4 +56,9 @@ public class McstatsCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,64 @@
|
||||
package com.gmail.nossr50.commands.player;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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 com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.database.LeaderboardManager;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class MctopCommand implements CommandExecutor {
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class MctopCommand implements TabExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
boolean useMySQL = Config.getInstance().getUseMySQL();
|
||||
SkillType skill = null;
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
display(1, "ALL", sender, useMySQL, command);
|
||||
display(1, skill, sender, command);
|
||||
return true;
|
||||
|
||||
case 1:
|
||||
if (StringUtils.isInt(args[0])) {
|
||||
display(Integer.parseInt(args[0]), "ALL", sender, useMySQL, command);
|
||||
}
|
||||
else if (SkillUtils.isSkill(args[0])) {
|
||||
SkillType skill = SkillType.getSkill(args[0]);
|
||||
|
||||
if (skill.isChildSkill()) {
|
||||
sender.sendMessage("Child skills are not yet supported by this command."); // TODO: Localize this
|
||||
return true;
|
||||
}
|
||||
|
||||
display(1, skill.toString(), sender, useMySQL, command);
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
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 (!StringUtils.isInt(args[1])) {
|
||||
return false;
|
||||
if (CommandUtils.isInvalidInteger(sender, args[1])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (SkillUtils.isSkill(args[0])) {
|
||||
SkillType skill = SkillType.getSkill(args[0]);
|
||||
skill = extractSkill(sender, args[0]);
|
||||
|
||||
if (skill.isChildSkill()) {
|
||||
sender.sendMessage("Child skills are not yet supported by this command."); // TODO: Localize this
|
||||
return true;
|
||||
}
|
||||
|
||||
display(Integer.parseInt(args[1]), skill.toString(), sender, useMySQL, command);
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||
if (skill == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
display(Math.abs(Integer.parseInt(args[1])), skill, sender, command);
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -71,58 +66,55 @@ public class MctopCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
private void display(int page, String skill, CommandSender sender, boolean sql, Command command) {
|
||||
if (!skill.equalsIgnoreCase("all") && !Permissions.mctop(sender, SkillType.getSkill(skill))) {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
return StringUtil.copyPartialMatches(args[0], SkillType.SKILL_NAMES, new ArrayList<String>(SkillType.SKILL_NAMES.size()));
|
||||
default:
|
||||
return ImmutableList.of();
|
||||
}
|
||||
}
|
||||
|
||||
private void display(int page, SkillType skill, CommandSender sender, Command command) {
|
||||
if (skill != null && !Permissions.mctop(sender, skill)) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (sql) {
|
||||
if (skill.equalsIgnoreCase("all")) {
|
||||
sqlDisplay(page, "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing", sender);
|
||||
}
|
||||
else {
|
||||
sqlDisplay(page, skill, sender);
|
||||
if (sender instanceof Player) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
|
||||
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
|
||||
|
||||
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMOPlayer.actualizeDatabaseATS();
|
||||
}
|
||||
else {
|
||||
flatfileDisplay(page, skill, sender);
|
||||
}
|
||||
|
||||
display(page, skill, sender);
|
||||
}
|
||||
|
||||
private void flatfileDisplay(int page, String skill, CommandSender sender) {
|
||||
LeaderboardManager.updateLeaderboards(); // Make sure we have the latest information
|
||||
private void display(int page, SkillType skill, CommandSender sender) {
|
||||
boolean useBoard = (sender instanceof Player) && (Config.getInstance().getTopUseBoard());
|
||||
boolean useChat = !useBoard || Config.getInstance().getTopUseChat();
|
||||
|
||||
String[] info = LeaderboardManager.retrieveInfo(skill, page);
|
||||
|
||||
if (skill.equalsIgnoreCase("all")) {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", StringUtils.getCapitalized(skill)));
|
||||
}
|
||||
|
||||
int n = (page * 10) - 9; // Position
|
||||
for (String x : info) {
|
||||
if (x != null) {
|
||||
String digit = String.valueOf(n);
|
||||
|
||||
if (n < 10) {
|
||||
digit = "0" + digit;
|
||||
}
|
||||
|
||||
String[] splitx = x.split(":");
|
||||
|
||||
// Format: 1. Playername - skill value
|
||||
sender.sendMessage(digit + ". " + ChatColor.GREEN + splitx[1] + " - " + ChatColor.WHITE + splitx[0]);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip"));
|
||||
new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
||||
}
|
||||
|
||||
private void sqlDisplay(int page, String query, CommandSender sender) {
|
||||
mcMMO.p.getServer().getScheduler().runTaskAsynchronously(mcMMO.p, new MctopCommandAsyncTask(page, query, sender));
|
||||
private SkillType extractSkill(CommandSender sender, String skillName) {
|
||||
if (CommandUtils.isInvalidSkill(sender, skillName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
SkillType skill = SkillType.getSkill(skillName);
|
||||
|
||||
if (CommandUtils.isChildSkill(sender, skill)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return skill;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public class AcrobaticsCommand extends SkillCommand {
|
||||
@@ -22,84 +27,71 @@ public class AcrobaticsCommand extends SkillCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dataCalculations() {
|
||||
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
||||
// DODGE
|
||||
String[] dodgeStrings = calculateAbilityDisplayValues(Acrobatics.dodgeMaxBonusLevel, Acrobatics.dodgeMaxChance);
|
||||
dodgeChance = dodgeStrings[0];
|
||||
dodgeChanceLucky = dodgeStrings[1];
|
||||
if (canDodge) {
|
||||
String[] dodgeStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.DODGE, isLucky);
|
||||
dodgeChance = dodgeStrings[0];
|
||||
dodgeChanceLucky = dodgeStrings[1];
|
||||
}
|
||||
|
||||
// ROLL
|
||||
String[] rollStrings = calculateAbilityDisplayValues(Acrobatics.rollMaxBonusLevel, Acrobatics.rollMaxChance);
|
||||
rollChance = rollStrings[0];
|
||||
rollChanceLucky = rollStrings[1];
|
||||
if (canRoll) {
|
||||
String[] rollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.ROLL, isLucky);
|
||||
rollChance = rollStrings[0];
|
||||
rollChanceLucky = rollStrings[1];
|
||||
}
|
||||
|
||||
// GRACEFUL ROLL
|
||||
String[] gracefulRollStrings = calculateAbilityDisplayValues(Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollMaxChance);
|
||||
gracefulRollChance = gracefulRollStrings[0];
|
||||
gracefulRollChanceLucky = gracefulRollStrings[1];
|
||||
if (canGracefulRoll) {
|
||||
String[] gracefulRollStrings = calculateAbilityDisplayValues(skillValue, SecondaryAbility.GRACEFUL_ROLL, isLucky);
|
||||
gracefulRollChance = gracefulRollStrings[0];
|
||||
gracefulRollChanceLucky = gracefulRollStrings[1];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck() {
|
||||
canDodge = Permissions.dodge(player);
|
||||
canRoll = Permissions.roll(player);
|
||||
canGracefulRoll = Permissions.gracefulRoll(player);
|
||||
protected void permissionsCheck(Player player) {
|
||||
canDodge = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.DODGE);
|
||||
canRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.ROLL);
|
||||
canGracefulRoll = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.GRACEFUL_ROLL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean effectsHeaderPermissions() {
|
||||
return canDodge || canGracefulRoll || canRoll;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void effectsDisplay() {
|
||||
luckyEffectsDisplay();
|
||||
protected List<String> effectsDisplay() {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canRoll) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1")));
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1")));
|
||||
}
|
||||
|
||||
if (canGracefulRoll) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.2"), LocaleLoader.getString("Acrobatics.Effect.3")));
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.2"), LocaleLoader.getString("Acrobatics.Effect.3")));
|
||||
}
|
||||
|
||||
if (canDodge) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.4"), LocaleLoader.getString("Acrobatics.Effect.5")));
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Acrobatics.Effect.4"), LocaleLoader.getString("Acrobatics.Effect.5")));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean statsHeaderPermissions() {
|
||||
return canDodge || canGracefulRoll || canRoll;
|
||||
}
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
@Override
|
||||
protected void statsDisplay() {
|
||||
if (canRoll) {
|
||||
if (isLucky) {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { rollChanceLucky }));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }));
|
||||
}
|
||||
messages.add(LocaleLoader.getString("Acrobatics.Roll.Chance", rollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", rollChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canGracefulRoll) {
|
||||
if (isLucky) {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { gracefulRollChanceLucky }));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }));
|
||||
}
|
||||
messages.add(LocaleLoader.getString("Acrobatics.Roll.GraceChance", gracefulRollChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", gracefulRollChanceLucky) : ""));
|
||||
}
|
||||
|
||||
if (canDodge) {
|
||||
if (isLucky) {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { dodgeChanceLucky }));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }));
|
||||
}
|
||||
messages.add(LocaleLoader.getString("Acrobatics.DodgeChance", dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.alchemy.Alchemy.Tier;
|
||||
import com.gmail.nossr50.skills.alchemy.AlchemyManager;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
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(SkillType.ALCHEMY);
|
||||
}
|
||||
|
||||
protected String[] calculateAbilityDisplayValues(Player player, boolean isLucky) {
|
||||
AlchemyManager alchemyManager = UserManager.getPlayer(player).getAlchemyManager();
|
||||
String[] displayValues = new String[2];
|
||||
|
||||
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, boolean isLucky) {
|
||||
// CATALYSIS
|
||||
if (canCatalysis) {
|
||||
String[] catalysisStrings = calculateAbilityDisplayValues(player, isLucky);
|
||||
brewSpeed = catalysisStrings[0];
|
||||
brewSpeedLucky = catalysisStrings[1];
|
||||
}
|
||||
|
||||
// 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 = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CATALYSIS);
|
||||
canConcoctions = Permissions.secondaryAbilityEnabled(player, SecondaryAbility.CONCOCTIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> effectsDisplay() {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canCatalysis) {
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.0"), LocaleLoader.getString("Alchemy.Effect.1")));
|
||||
}
|
||||
|
||||
if (canConcoctions) {
|
||||
messages.add(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Alchemy.Effect.2"), LocaleLoader.getString("Alchemy.Effect.3")));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
||||
if (canCatalysis) {
|
||||
int unlockLevel = AdvancedConfig.getInstance().getCatalysisUnlockLevel();
|
||||
|
||||
if (skillValue < unlockLevel) {
|
||||
messages.add(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Alchemy.Ability.Locked.0", unlockLevel)));
|
||||
}
|
||||
else {
|
||||
messages.add(LocaleLoader.getString("Alchemy.Catalysis.Speed", brewSpeed) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
|
||||
}
|
||||
}
|
||||
|
||||
if (canConcoctions) {
|
||||
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Rank", tier, Tier.values().length));
|
||||
messages.add(LocaleLoader.getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.HolidayManager.FakeSkillType;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
public class AprilCommand implements TabExecutor {
|
||||
private String skillName;
|
||||
|
||||
protected DecimalFormat percent = new DecimalFormat("##0.00%");
|
||||
protected DecimalFormat decimal = new DecimalFormat("##0.00");
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user