Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8725ace739 | ||
|
|
0d9106185c | ||
|
|
7449f6f9af | ||
|
|
2316b6806e | ||
|
|
94418d3648 | ||
|
|
479b2d026c | ||
|
|
8e9683b33f | ||
|
|
6481bac045 | ||
|
|
86aadf2cf8 | ||
|
|
95d2832884 | ||
|
|
213b2fcb44 | ||
|
|
c4bd657826 | ||
|
|
a5e15b8a29 | ||
|
|
7a37fcd792 | ||
|
|
81cbe02a9c | ||
|
|
79c10c986e | ||
|
|
c836cce59b | ||
|
|
287c0f7f7a | ||
|
|
dc52807a46 | ||
|
|
916e3dbb0b | ||
|
|
4b0574710e | ||
|
|
7764a04d46 | ||
|
|
9438df787a | ||
|
|
fd954d8293 | ||
|
|
72dec16f54 | ||
|
|
40218563e1 | ||
|
|
0251f2add9 | ||
|
|
f0e42c6db6 | ||
|
|
4b793d1f14 | ||
|
|
61e5da928a | ||
|
|
419707aa5f | ||
|
|
8b970c21fc | ||
|
|
7a31edea09 | ||
|
|
b286faa1c5 | ||
|
|
5e2f45ebd0 | ||
|
|
eff93c788b | ||
|
|
4667ffc681 | ||
|
|
bafada4f17 | ||
|
|
5b97d01363 | ||
|
|
3474c66c1c | ||
|
|
8f8c916be3 | ||
|
|
a823290d66 | ||
|
|
5577e3f590 | ||
|
|
ffe6c24b53 | ||
|
|
4e4982a98d | ||
|
|
7f4f9bb917 | ||
|
|
8d8024ba5e | ||
|
|
2e16b15b0e | ||
|
|
1ebed37297 | ||
|
|
ff37ad176b | ||
|
|
d0c5d89e91 | ||
|
|
f49446011a | ||
|
|
d762a0aaa6 | ||
|
|
2dc211a91e | ||
|
|
2c62de9658 | ||
|
|
494ab6787f | ||
|
|
b81e8a40a4 | ||
|
|
2fd2f4fedb | ||
|
|
493e5d08be | ||
|
|
62a834e145 | ||
|
|
241f13c8f1 | ||
|
|
98ea255667 | ||
|
|
420ec2bf1a | ||
|
|
364a494ac6 | ||
|
|
821d1cb8dd | ||
|
|
544ffbad19 | ||
|
|
4fa6cd2577 | ||
|
|
37d1f5efab | ||
|
|
7cd8e8bf5b | ||
|
|
8eed4558f4 | ||
|
|
62ca2d9c79 | ||
|
|
c7a0d7026c | ||
|
|
ce74813ce5 | ||
|
|
d1511e43f2 | ||
|
|
6ef749c76a | ||
|
|
8846932cb6 | ||
|
|
12b861db3f | ||
|
|
0a50df6557 | ||
|
|
3726f6de41 | ||
|
|
d1ca7684d6 | ||
|
|
512b621a7a | ||
|
|
2cf919a17a | ||
|
|
46072eb465 | ||
|
|
ae63a42c2e | ||
|
|
8773ec07ab | ||
|
|
287cc308d6 | ||
|
|
beeb4fa169 | ||
|
|
4ef3d50965 | ||
|
|
dae64fc8c4 | ||
|
|
215031a1f3 | ||
|
|
85d2f0b51f | ||
|
|
d91355e4d6 | ||
|
|
1a690dabd7 | ||
|
|
526448ce40 | ||
|
|
43d04a97f5 | ||
|
|
307614e704 | ||
|
|
f6c0794691 | ||
|
|
83db00aef8 | ||
|
|
22252fa46d | ||
|
|
7b8426977a | ||
|
|
d9912cb93f | ||
|
|
5db999f995 | ||
|
|
b744e35ad8 | ||
|
|
b6769811a2 | ||
|
|
1d9fc568e4 | ||
|
|
3c0d1ba7a1 | ||
|
|
78a74510cf | ||
|
|
d3ae3324fa | ||
|
|
4b97c9419e | ||
|
|
db830a0bef | ||
|
|
797c195424 | ||
|
|
4788290615 | ||
|
|
d0c016f6b7 | ||
|
|
9b1c73ed23 | ||
|
|
048768007d | ||
|
|
ec7a5321a6 | ||
|
|
c396323308 | ||
|
|
6fc2321fad | ||
|
|
a0d04790a5 | ||
|
|
c4154c09da | ||
|
|
8eed3131f2 | ||
|
|
e5c4b710f6 | ||
|
|
2ccffc6e6d | ||
|
|
fc69002c86 | ||
|
|
e3a6db5f97 | ||
|
|
6d8077ffd0 | ||
|
|
784161d66d | ||
|
|
115f793733 | ||
|
|
2cb5e437fd | ||
|
|
8c57c2b46d | ||
|
|
879a88a398 | ||
|
|
7e50c3c777 | ||
|
|
4b1cf51530 | ||
|
|
de24817d9c | ||
|
|
085e7af681 | ||
|
|
1aabd7610e | ||
|
|
ef31db1431 | ||
|
|
757e9d6be6 | ||
|
|
b3a028e3ca | ||
|
|
e222e4e98c | ||
|
|
1213e58240 | ||
|
|
b7ff0824b9 | ||
|
|
7b5917660c | ||
|
|
1544487e92 | ||
|
|
c19ef84116 | ||
|
|
e8c4a55dc3 | ||
|
|
97d6aaed5c | ||
|
|
fe77834cef | ||
|
|
2da6298c53 | ||
|
|
e111270aed | ||
|
|
e07f8c0fbe | ||
|
|
90246afd03 | ||
|
|
9809e591ad | ||
|
|
26973461e7 | ||
|
|
759ec5d499 | ||
|
|
58ab3c325c | ||
|
|
44c8c67803 | ||
|
|
acb56d683a | ||
|
|
5dda522a62 | ||
|
|
79091c726b | ||
|
|
e5be06e07b | ||
|
|
f63992e209 | ||
|
|
9988011308 | ||
|
|
8584a9b72c | ||
|
|
42c8cb1354 | ||
|
|
aaeaf5cfa0 | ||
|
|
45b4e1463f | ||
|
|
be92a67544 | ||
|
|
5e0b8ebdf6 | ||
|
|
9d4ccd33e1 | ||
|
|
f5c42c70e5 | ||
|
|
dcc4656e5e | ||
|
|
ee2de3cff1 | ||
|
|
f96518b8e4 | ||
|
|
dac59966aa | ||
|
|
8115fbaa98 | ||
|
|
8b97439ffc | ||
|
|
fa83986250 | ||
|
|
e1b16465f8 | ||
|
|
57619dacb1 | ||
|
|
64e54d89eb | ||
|
|
aa4139f0b7 | ||
|
|
e2f1c1e16b | ||
|
|
1e7ef15e54 | ||
|
|
1cc156d6f6 | ||
|
|
1445a3faec | ||
|
|
1cf90692cf | ||
|
|
5656bea3f9 | ||
|
|
8e344cea76 | ||
|
|
5b1229c882 | ||
|
|
834649b390 | ||
|
|
d28170cc3f | ||
|
|
04e511026d | ||
|
|
11a3ecbba0 | ||
|
|
51b7bb93e2 | ||
|
|
9fd2028d9f | ||
|
|
75f0f40d70 | ||
|
|
3941c77826 | ||
|
|
4987ca3ba2 | ||
|
|
5fa481337a | ||
|
|
dd78e0e271 | ||
|
|
3c773e6823 | ||
|
|
54a9ff9256 | ||
|
|
eca6b09b18 | ||
|
|
b7f8ca6658 | ||
|
|
ffdeadac8a | ||
|
|
9e769904bf | ||
|
|
8d79ec6b07 | ||
|
|
3a123f9fa1 | ||
|
|
f0c0328919 | ||
|
|
274286032a | ||
|
|
76517374a2 | ||
|
|
2da027f3b5 | ||
|
|
fd712f131f | ||
|
|
38613e5f03 | ||
|
|
ec9060ba80 | ||
|
|
502d57e744 | ||
|
|
c59f2ab37a | ||
|
|
066189b486 | ||
|
|
37d4f92c33 | ||
|
|
55220e9d10 | ||
|
|
bd41286076 | ||
|
|
d84484c81c | ||
|
|
fec87d4c6a | ||
|
|
68ec6e2a37 | ||
|
|
a784ad435f | ||
|
|
cc9bb34873 | ||
|
|
2ddae5a96c | ||
|
|
40ad489c56 | ||
|
|
56c55d71fe | ||
|
|
56df15caf8 | ||
|
|
03720665b3 | ||
|
|
445429b510 | ||
|
|
c698587d53 | ||
|
|
b8466beee5 | ||
|
|
efa666445f | ||
|
|
59c7d77525 | ||
|
|
553da9baf6 | ||
|
|
486ddb3d42 | ||
|
|
381922fc02 | ||
|
|
4c891f0819 | ||
|
|
4b3d11ccab | ||
|
|
b1ab465991 | ||
|
|
952e41ad3d | ||
|
|
ae3adf23c8 | ||
|
|
c3cdf387c2 | ||
|
|
054f0c2c19 | ||
|
|
2f7fce2109 | ||
|
|
07469599bc | ||
|
|
08869da96e | ||
|
|
7540a6eb70 | ||
|
|
fa2d9357b8 | ||
|
|
247a40b65f | ||
|
|
01ffe6ad5a | ||
|
|
da3c2a073a | ||
|
|
c16630c32b | ||
|
|
bf64f465a8 | ||
|
|
c1e0b874d8 | ||
|
|
c780266139 | ||
|
|
08454d58d0 | ||
|
|
ee13540d78 | ||
|
|
b4ff54ffc8 | ||
|
|
6f96d9c7d1 | ||
|
|
5b66436519 | ||
|
|
379eb00b69 | ||
|
|
2036127612 | ||
|
|
957a918bd6 | ||
|
|
6b305972ac | ||
|
|
b8c06904ab | ||
|
|
6baa472567 | ||
|
|
9c449def57 | ||
|
|
e4acc133a9 | ||
|
|
8b181b877b | ||
|
|
194790110d | ||
|
|
c0cd197bd0 | ||
|
|
30ce269873 | ||
|
|
4d7be13c16 | ||
|
|
8cf0f7da5f | ||
|
|
bcb4e5ca64 | ||
|
|
07b003c77a | ||
|
|
f4e4f727dd | ||
|
|
644c53a074 | ||
|
|
c66622bd09 | ||
|
|
adf0589184 | ||
|
|
b7de0e6901 | ||
|
|
a90e59ec97 | ||
|
|
f4882c1c14 | ||
|
|
ed3b5a3cf1 | ||
|
|
45e2b7b12f | ||
|
|
1e73986c60 | ||
|
|
20f992110d | ||
|
|
18f09f9862 | ||
|
|
a0be1c7c48 | ||
|
|
5d34661a15 | ||
|
|
1639879106 | ||
|
|
a927ca659f | ||
|
|
804c884d8b | ||
|
|
51f215b8ac | ||
|
|
64838708ab | ||
|
|
91b7af52ac | ||
|
|
d3dded8791 | ||
|
|
022b385c0a | ||
|
|
7ee9b93365 | ||
|
|
c4c98aaabf | ||
|
|
10c0efaa5d | ||
|
|
d8a7d8de4a | ||
|
|
ab8b675bae | ||
|
|
194b602fd6 | ||
|
|
7da0c58b76 | ||
|
|
2dbbea4993 | ||
|
|
55d59bb1c4 | ||
|
|
a6facf7492 | ||
|
|
b8a1871cf1 | ||
|
|
f556c75d94 | ||
|
|
58bd7de66a | ||
|
|
4547b52748 | ||
|
|
b9acb84119 | ||
|
|
e3a783c546 | ||
|
|
2e136666be | ||
|
|
7d089cb5f0 | ||
|
|
3784d904fb | ||
|
|
fef6ebf793 | ||
|
|
316e177c1d | ||
|
|
4cdff14c7c | ||
|
|
97121bc719 | ||
|
|
1312aac349 | ||
|
|
8a5c9ddef2 | ||
|
|
55382519a1 | ||
|
|
cbb562b603 | ||
|
|
ba51f803ba | ||
|
|
d73543408e | ||
|
|
7d90dba08b | ||
|
|
f11ebe6166 | ||
|
|
1b917f0901 | ||
|
|
328353d053 | ||
|
|
4e87489dc1 | ||
|
|
8e5bcdd5ea | ||
|
|
882a29029e | ||
|
|
4704c5c975 | ||
|
|
957365ab91 | ||
|
|
f8d34d7f46 | ||
|
|
cb185e4827 | ||
|
|
f5c6b9e3d4 | ||
|
|
96f0f46b3e | ||
|
|
6a5b7ce3a1 | ||
|
|
f33c540efb | ||
|
|
7684ac5d3a | ||
|
|
c13b01da01 | ||
|
|
3453f05aca | ||
|
|
c8bb85a06b | ||
|
|
2aabc9902f | ||
|
|
6dba778e60 | ||
|
|
cbeaaca7af | ||
|
|
0e69c8902d | ||
|
|
f63d6cfced | ||
|
|
72f9de6cc7 | ||
|
|
509e89b9cf | ||
|
|
90cce19baf | ||
|
|
e4e93b1af1 | ||
|
|
8f30176edd | ||
|
|
4923d10b86 | ||
|
|
bd3a4e1ad7 | ||
|
|
0f99a6c5ca | ||
|
|
0150da94a8 | ||
|
|
b8da286f64 | ||
|
|
da797f154d | ||
|
|
926195efc4 | ||
|
|
8c1c5c820c | ||
|
|
f63f652edb | ||
|
|
174ef187e8 | ||
|
|
d1e76f401a | ||
|
|
d52983c5af | ||
|
|
4773934481 | ||
|
|
dbfc524180 | ||
|
|
60aa7c6104 | ||
|
|
907d716929 | ||
|
|
1689a8abe2 | ||
|
|
5db3820df4 | ||
|
|
f969e2e52b | ||
|
|
cde2306079 | ||
|
|
f6c440c172 | ||
|
|
1b98667365 | ||
|
|
bf69d5314e | ||
|
|
6d2ea659a4 | ||
|
|
0d89840179 | ||
|
|
f93e8fdccd | ||
|
|
68e4d36f40 | ||
|
|
cd5447de38 | ||
|
|
6c0bb61cb1 | ||
|
|
d9a45b1090 | ||
|
|
7549b3eb9e | ||
|
|
8f82ef7eb4 | ||
|
|
fbe84322b5 | ||
|
|
98fb9946e4 | ||
|
|
984bc5860f | ||
|
|
a42d27f056 | ||
|
|
aa4833ed74 | ||
|
|
6704ac4b46 | ||
|
|
4e4ec8e608 | ||
|
|
4f4a387f04 | ||
|
|
d0143f9e54 | ||
|
|
b2175e885f | ||
|
|
68dd96e563 | ||
|
|
168e712324 | ||
|
|
2889c28815 | ||
|
|
966bf8bf51 | ||
|
|
63ff3c34b3 | ||
|
|
736105cc12 | ||
|
|
b1fa4263ed | ||
|
|
31d435dc2b | ||
|
|
da9977a30f | ||
|
|
9c92522564 | ||
|
|
31e436868d | ||
|
|
794455d728 | ||
|
|
0adf85746d | ||
|
|
f1047df98e | ||
|
|
765f9d2545 | ||
|
|
0b5588a7dd | ||
|
|
4fda89d5c8 | ||
|
|
b8c5c60ece | ||
|
|
a3730aceeb | ||
|
|
df5240a67c | ||
|
|
620b0c898c | ||
|
|
02ac4bc48b | ||
|
|
d14310768c | ||
|
|
63f8e8849f | ||
|
|
7e7268bb5a | ||
|
|
173286d404 | ||
|
|
fd937e3209 | ||
|
|
31df29194b | ||
|
|
a1a2e189b6 | ||
|
|
5799a26cb7 | ||
|
|
fe200ca1ec | ||
|
|
7f7116e1c7 | ||
|
|
0cc1c4e5a7 | ||
|
|
2bc56de1c3 | ||
|
|
e28d15456c | ||
|
|
54dbede130 | ||
|
|
982254ff5e | ||
|
|
e1c60fa70f | ||
|
|
6923c4e247 | ||
|
|
0eba5f1cbc | ||
|
|
4858e59b70 | ||
|
|
1f70ad978f | ||
|
|
40294b10f5 | ||
|
|
8d045be0b0 | ||
|
|
e24a482deb | ||
|
|
f18d230ff6 | ||
|
|
72d4e5cf7a | ||
|
|
4c3e28ba85 | ||
|
|
821dc4ef56 | ||
|
|
612712f015 | ||
|
|
03a93b1186 | ||
|
|
04ffd00c0e | ||
|
|
a74475d4cd | ||
|
|
05ac7e6041 | ||
|
|
5ae90f2a4b | ||
|
|
b800db03fc | ||
|
|
662b958a7f | ||
|
|
7cd5eea6d3 | ||
|
|
ed223f0e4e | ||
|
|
8a374aed04 | ||
|
|
9ceacdb739 | ||
|
|
39daed23c4 | ||
|
|
19e6d4e4c8 | ||
|
|
22006617d0 | ||
|
|
3201d10bdd | ||
|
|
ea94bd8696 | ||
|
|
f646c04d09 | ||
|
|
17ff9ac328 | ||
|
|
283516614b | ||
|
|
6c8f04f829 | ||
|
|
505a10a8b1 | ||
|
|
4fd89e6a34 | ||
|
|
7bf666b062 | ||
|
|
764665cf15 | ||
|
|
b9dfd7db54 | ||
|
|
e09c5622f7 | ||
|
|
717347273d | ||
|
|
9bb1ba12b2 | ||
|
|
bff9715e7f | ||
|
|
cfcd896c59 | ||
|
|
aaa50cacda | ||
|
|
3413adf16f | ||
|
|
3d6aa69ca1 | ||
|
|
ab115c4a6b | ||
|
|
e1e7bc8e0d | ||
|
|
6602b23f09 | ||
|
|
862fe6e2e3 | ||
|
|
5a34fa182a | ||
|
|
0b72507e2d | ||
|
|
cc3ddd51fd | ||
|
|
f793fd5010 | ||
|
|
fb92fd9357 | ||
|
|
a415a2705f | ||
|
|
765f140121 | ||
|
|
cb47f9f94b | ||
|
|
d0fb9f6aee | ||
|
|
9d424f5122 | ||
|
|
f71237ea95 | ||
|
|
fb5925e1e8 | ||
|
|
f86bdb7619 | ||
|
|
ad5299d0cd | ||
|
|
904bb90385 | ||
|
|
2e7a08c006 | ||
|
|
38e75da92f | ||
|
|
97708c2c80 | ||
|
|
e5ce64266f | ||
|
|
a765be0a6f | ||
|
|
0bec93ab1c | ||
|
|
dfb1b8f841 | ||
|
|
322b522a52 | ||
|
|
9dd4f71526 | ||
|
|
94b4e3d366 | ||
|
|
bbb2897d20 | ||
|
|
a5e41e479a | ||
|
|
2baea0ce13 | ||
|
|
90cbff885f | ||
|
|
0d9034504e | ||
|
|
800749c5ed | ||
|
|
30f27f29b4 | ||
|
|
2985cf7237 | ||
|
|
003ddc51de | ||
|
|
c369ac6b90 | ||
|
|
e2b9e37867 | ||
|
|
1e105b4135 | ||
|
|
c5c253af4e | ||
|
|
717835e5c1 | ||
|
|
e9ba62dbd9 | ||
|
|
ad5c22ecdb | ||
|
|
2e92b97f01 | ||
|
|
ae8fe0fe1e | ||
|
|
d992d7f77c | ||
|
|
a7cb7ec1af | ||
|
|
3afeb30795 | ||
|
|
26feeb125e | ||
|
|
211fb219a7 | ||
|
|
e71ef834c0 | ||
|
|
29eba93ee3 | ||
|
|
52ebfe9309 | ||
|
|
b3e78c6dc1 | ||
|
|
cd0184970a | ||
|
|
6401480874 | ||
|
|
6ca9eb13dd | ||
|
|
987ea51264 | ||
|
|
df37491199 | ||
|
|
9a420403de | ||
|
|
17da2807cf | ||
|
|
22fba0c172 | ||
|
|
14005563a3 | ||
|
|
a115ff8ce2 | ||
|
|
d75b29f51d | ||
|
|
3e8f7911af | ||
|
|
175a21c0e4 | ||
|
|
a2801bff7c | ||
|
|
f1a50f433f | ||
|
|
76bfde4d77 | ||
|
|
d393a4c9ca | ||
|
|
9ea6b0b8bb | ||
|
|
c20b91d5ea | ||
|
|
fad8a38bdf | ||
|
|
2440a38e82 | ||
|
|
b7541c43c8 | ||
|
|
0f10bb0bc9 | ||
|
|
357717886e | ||
|
|
94a4051d29 | ||
|
|
0e581cbcf3 | ||
|
|
230d9725e8 | ||
|
|
dee41b315f | ||
|
|
72e6c75433 | ||
|
|
ebe12f838c | ||
|
|
7279fdc25f | ||
|
|
af5c859385 | ||
|
|
e8896fbdf7 | ||
|
|
54695b8046 | ||
|
|
c573c755d2 | ||
|
|
b299301b69 | ||
|
|
a3a7198777 | ||
|
|
ca8cc91f37 | ||
|
|
26c813c07b | ||
|
|
f109cb684a | ||
|
|
1baefaade4 | ||
|
|
5ac0f93214 | ||
|
|
ecfbed00b1 | ||
|
|
6e429d6c78 | ||
|
|
fa4bb0447a | ||
|
|
aa0be40124 | ||
|
|
04d5310c04 | ||
|
|
74069af309 | ||
|
|
6bfeec6d16 | ||
|
|
0f4c057395 | ||
|
|
2fd74f3b7e | ||
|
|
fb171a57c2 | ||
|
|
b26fc69e73 | ||
|
|
28961b1cfa | ||
|
|
597f2f7b1b | ||
|
|
00cd8bb3f3 | ||
|
|
5732e60510 | ||
|
|
7b271e21e3 | ||
|
|
1a5f9683c2 | ||
|
|
3b74d55442 | ||
|
|
8920396360 | ||
|
|
9c505e4402 | ||
|
|
de4c6b384c | ||
|
|
6dec1ba8af | ||
|
|
9e6788de2f | ||
|
|
1bd7e5c9c4 | ||
|
|
ec75fdddb5 | ||
|
|
f98aafb97c | ||
|
|
f4d2a0daf9 | ||
|
|
de8fb8de90 | ||
|
|
44d137b8f9 | ||
|
|
777c972bdc | ||
|
|
f9efa15781 | ||
|
|
1d1cd679dd | ||
|
|
a9ed4686dd | ||
|
|
5b742eb5b2 | ||
|
|
a3d78f4d0e | ||
|
|
214929e5e5 | ||
|
|
67602b8d85 | ||
|
|
2412edaa3a | ||
|
|
b1584aa2c3 | ||
|
|
a14a416193 | ||
|
|
f3251e9407 | ||
|
|
096885d91f | ||
|
|
368700156c | ||
|
|
81cf50520b | ||
|
|
649748c2d3 | ||
|
|
bf7a708440 | ||
|
|
8faa4d137b | ||
|
|
479bd91b74 | ||
|
|
6bc7f1fca2 | ||
|
|
dadd8e2c50 | ||
|
|
03f342a21c | ||
|
|
7fe5397e21 | ||
|
|
b6e1fd179e | ||
|
|
754c7d8e3b | ||
|
|
925d3ccd1b | ||
|
|
d60d0ac9c5 | ||
|
|
e1b51dd6af | ||
|
|
fbe9d9f128 | ||
|
|
509826949d | ||
|
|
39aaa8a292 | ||
|
|
069c76c53a | ||
|
|
f45c0caa45 | ||
|
|
41b0e10709 | ||
|
|
8e8da20c13 | ||
|
|
269aa39378 | ||
|
|
ae8be97db7 | ||
|
|
f0ad40825b | ||
|
|
36d292747a | ||
|
|
b65d2262bf | ||
|
|
a7ab0c6b36 | ||
|
|
c02fcb6508 | ||
|
|
07c38de44b | ||
|
|
188d62c99b | ||
|
|
76b203ad10 | ||
|
|
909844aef5 | ||
|
|
046202719a | ||
|
|
ed15e2838d | ||
|
|
82466c2e5d | ||
|
|
c598daf350 | ||
|
|
a40421fa1f | ||
|
|
d98b464ce9 | ||
|
|
1d5e3205ac | ||
|
|
07eb17f5d5 | ||
|
|
3951725852 | ||
|
|
77956d69ad | ||
|
|
5784458d03 | ||
|
|
3d2115ff3c | ||
|
|
8618a67e2e | ||
|
|
234b9cafd7 | ||
|
|
4ecd899bac | ||
|
|
ce2c943397 | ||
|
|
51898abb71 | ||
|
|
e2f800dd63 | ||
|
|
d9e5bc9345 | ||
|
|
e42cc101cc | ||
|
|
845367e847 | ||
|
|
90afd3c3ed | ||
|
|
b4aeb04d1b | ||
|
|
65b0d45738 | ||
|
|
3c44388883 | ||
|
|
400f3a9156 | ||
|
|
ad6e837aa5 | ||
|
|
cadd7545c5 | ||
|
|
b41dea9ee1 | ||
|
|
7a6c0ab154 | ||
|
|
1bb1f5ebb3 | ||
|
|
fce5b8430d | ||
|
|
0befa6a491 | ||
|
|
b12ce943f7 | ||
|
|
d23b29aeb1 | ||
|
|
42d48c8da2 | ||
|
|
9e83a5e4d9 | ||
|
|
d2bf940105 | ||
|
|
7d4aca68cc | ||
|
|
d7094909c0 | ||
|
|
7083d55a9b | ||
|
|
770db2fee0 | ||
|
|
b8e65c4f26 | ||
|
|
5cd5186092 | ||
|
|
fa0b66c2dc | ||
|
|
1b199fd2c7 | ||
|
|
2ffbeeef8e | ||
|
|
26ce8b8ab7 | ||
|
|
8e224c4a27 | ||
|
|
cf5318b92b | ||
|
|
e50fa17f7c | ||
|
|
8766e3b408 | ||
|
|
c4c7f06d83 | ||
|
|
413e304845 | ||
|
|
046daf23d0 | ||
|
|
c57947949c | ||
|
|
0acefde805 | ||
|
|
a9e751b4b8 | ||
|
|
3df1ae8ded | ||
|
|
b4a2da0ea8 | ||
|
|
5c5d1e8d0a | ||
|
|
ff0c988a1d | ||
|
|
b9fc8f4b5f | ||
|
|
2ecaa39cb6 | ||
|
|
7b8654339c | ||
|
|
306e252c31 | ||
|
|
87c3bd6293 | ||
|
|
307beebb58 | ||
|
|
4109863aa9 | ||
|
|
0febdbe3a4 | ||
|
|
139dd5302b | ||
|
|
cc907b6530 | ||
|
|
ca1dacf2b6 | ||
|
|
abc1c164cf | ||
|
|
dc801464ef | ||
|
|
99c6fe20c2 | ||
|
|
9d780ae24a | ||
|
|
a44dec0402 | ||
|
|
a081152baa | ||
|
|
9b50d48f46 | ||
|
|
5121fc6b1f | ||
|
|
d4ac261e85 | ||
|
|
2e9561371d | ||
|
|
942fd3c4ce | ||
|
|
8cf32752e9 | ||
|
|
b240ca9939 | ||
|
|
e25d99129c | ||
|
|
1fee47e087 | ||
|
|
e835b31277 | ||
|
|
6817945e12 | ||
|
|
030fb1262e | ||
|
|
fae49096f3 | ||
|
|
afd491ecea | ||
|
|
09bc100ad9 | ||
|
|
037f18ac56 | ||
|
|
a5746dfa21 | ||
|
|
cedc5108fc | ||
|
|
65af3d0f54 | ||
|
|
6c4fa65f91 | ||
|
|
4731ad8061 | ||
|
|
7dc41e15d3 | ||
|
|
8326539d40 | ||
|
|
163e6e0f2a | ||
|
|
f56bb251e9 | ||
|
|
152ca99276 | ||
|
|
7c398d2c67 | ||
|
|
a526c942ca | ||
|
|
af8fd15929 | ||
|
|
7bfd5d4bc8 | ||
|
|
4382d5c56d | ||
|
|
f43b9c96de | ||
|
|
c64f72e394 | ||
|
|
3d54f832c5 | ||
|
|
867ba24c6c | ||
|
|
9715c5394c | ||
|
|
67b5c72520 | ||
|
|
43450f6cc7 | ||
|
|
a3737d4f35 | ||
|
|
3314e94a9a | ||
|
|
a27436b086 | ||
|
|
fe5554ffb1 | ||
|
|
f305f8d822 | ||
|
|
1f54bc41cc | ||
|
|
c82d028429 | ||
|
|
be2a8b7b07 | ||
|
|
261fc82016 | ||
|
|
37b940f3a5 | ||
|
|
0504e904a2 | ||
|
|
71bfdd9bfd | ||
|
|
c7305f6b06 | ||
|
|
4fb07ff181 | ||
|
|
4631dcf857 | ||
|
|
f6f9840eb7 | ||
|
|
4de8165c95 | ||
|
|
242672f49d | ||
|
|
c32c975a71 | ||
|
|
82e759d708 | ||
|
|
9de44d2605 | ||
|
|
132d0cf578 | ||
|
|
029dc9f8d9 | ||
|
|
5567b1dad8 | ||
|
|
ea00ec64af | ||
|
|
7259e6be0a | ||
|
|
2e40557b39 | ||
|
|
e68fc7c558 | ||
|
|
055dfb000d | ||
|
|
b997ab6e3f | ||
|
|
25f31d0bb8 | ||
|
|
4cfd8a7e2c | ||
|
|
0ec19a8fee | ||
|
|
2749563f5d | ||
|
|
e7e2e3f7e0 | ||
|
|
0a33c0aac5 | ||
|
|
24e09fd2d9 | ||
|
|
4d0499a61e | ||
|
|
ae82807139 | ||
|
|
65147e1935 | ||
|
|
8e557d122b | ||
|
|
486b19aa90 | ||
|
|
14cb34ac95 | ||
|
|
abfc23b04d | ||
|
|
ebb24aefa1 | ||
|
|
2573f46f40 | ||
|
|
5dcb8cd73a | ||
|
|
e4bfe09882 | ||
|
|
eecbfe04db | ||
|
|
671e2adc32 | ||
|
|
1137e476dd | ||
|
|
cb63b321d0 | ||
|
|
c36b0d2975 | ||
|
|
f8ad562b95 | ||
|
|
c35ab38f36 | ||
|
|
073b775566 | ||
|
|
85c7a7db8d | ||
|
|
1e134df27d | ||
|
|
bdff84885a | ||
|
|
f1a9c3722c | ||
|
|
8b402f6423 | ||
|
|
a0aec52661 | ||
|
|
407ab43dd1 | ||
|
|
c2165e0196 | ||
|
|
2e75bc3f3b | ||
|
|
e91c2ca427 | ||
|
|
965ff04bcc | ||
|
|
ac4bd418f3 | ||
|
|
e9e844c1f7 | ||
|
|
aa2941fcdb | ||
|
|
dbc909a317 | ||
|
|
11465a4ce9 | ||
|
|
f5007f94dc | ||
|
|
d18ac2e6eb | ||
|
|
b9fc5c39ae | ||
|
|
9dc2278083 | ||
|
|
281060a972 | ||
|
|
91626f079d | ||
|
|
7305c6c54b | ||
|
|
bce7fa871d | ||
|
|
a35fd80763 | ||
|
|
b383f9dfbc | ||
|
|
680ad3c145 | ||
|
|
7b712e7f90 | ||
|
|
2462eac497 | ||
|
|
bb818c8942 | ||
|
|
ddc881af11 | ||
|
|
838fba9173 | ||
|
|
0b6f326c18 | ||
|
|
00895fc7ab | ||
|
|
07f38aa283 | ||
|
|
ecf1d3790c | ||
|
|
53c9e5bb4a | ||
|
|
b20b03113a | ||
|
|
ec8273aa9f | ||
|
|
2862f0dfae | ||
|
|
fd4963c74b | ||
|
|
df99ef4481 | ||
|
|
35d1057673 | ||
|
|
e6a90a18c4 | ||
|
|
26afb69a14 | ||
|
|
e8c0c43e9d | ||
|
|
1707f333bf | ||
|
|
6798fb21b2 | ||
|
|
89ff3b169b | ||
|
|
abddb265be | ||
|
|
b328fa74a7 | ||
|
|
f97aa651a0 | ||
|
|
8d86eed0a7 | ||
|
|
05f906a759 | ||
|
|
4b16be1b75 | ||
|
|
bd97a7c5d2 | ||
|
|
a3a23d8870 | ||
|
|
30bddceac5 | ||
|
|
989a2cc89c | ||
|
|
3f17e8c3c8 | ||
|
|
140e6b08ca | ||
|
|
6a39b721ba | ||
|
|
1df6f4b9df | ||
|
|
9493fb3a7a | ||
|
|
0d1f3b855f | ||
|
|
0982154a15 | ||
|
|
378f3f5efa | ||
|
|
9b8d6e1dc7 | ||
|
|
6540c695de | ||
|
|
1d71ec07be | ||
|
|
c837dd5cc8 | ||
|
|
bc52e4da0e | ||
|
|
f0b4040458 | ||
|
|
d804c4be2a | ||
|
|
ede413a213 | ||
|
|
9cee319ed9 | ||
|
|
f7b281f655 | ||
|
|
8dbb083b90 | ||
|
|
0be6d658ed | ||
|
|
1efce41767 | ||
|
|
da23b6ea9a | ||
|
|
a61d3b3fd4 | ||
|
|
ab9284b80f | ||
|
|
424af27a47 | ||
|
|
5039a05055 | ||
|
|
d150b22eae | ||
|
|
a617675771 | ||
|
|
f27034bb35 | ||
|
|
86b203c21b | ||
|
|
73c5a1ad9b | ||
|
|
81c71777cb | ||
|
|
599072eef6 | ||
|
|
02ea3afbe9 | ||
|
|
0c1a2e82bf | ||
|
|
f89fb87c92 | ||
|
|
98d6cf842a | ||
|
|
69dc02b2c2 | ||
|
|
7d1a3d32e9 | ||
|
|
d93cc826b2 | ||
|
|
8025f3a082 | ||
|
|
247871f678 | ||
|
|
327c8b83be | ||
|
|
0f8c334de8 | ||
|
|
292d4cd450 | ||
|
|
38d1c9974b | ||
|
|
0be7300677 | ||
|
|
c03585aeca | ||
|
|
d39dad3287 | ||
|
|
0a3ca3affe | ||
|
|
b7cf0e6bc7 | ||
|
|
7430013cc3 | ||
|
|
6dd093fe72 | ||
|
|
8a8d6f16ae | ||
|
|
2e16844141 | ||
|
|
a152cc47c7 | ||
|
|
241507228f | ||
|
|
8aa7d272fa | ||
|
|
01ac5382ea | ||
|
|
02b88a8357 | ||
|
|
c99d6556db | ||
|
|
1db777cd31 | ||
|
|
aea44fc8bc | ||
|
|
c0da9d49d9 | ||
|
|
ce42573f43 | ||
|
|
148fe4c729 | ||
|
|
32fd484b58 | ||
|
|
7d24e748b7 | ||
|
|
f1a1612f5d | ||
|
|
6501e5cf8d | ||
|
|
cd4a684613 | ||
|
|
d06fda6d9d | ||
|
|
139010e75b | ||
|
|
7638b07e34 | ||
|
|
f7bf4416c9 | ||
|
|
2b96b656a9 | ||
|
|
0fe251b6ec | ||
|
|
a1afc70bcb | ||
|
|
ced3e6959c | ||
|
|
1c229d54d9 | ||
|
|
dd50193c18 | ||
|
|
ab0f9bbdbd | ||
|
|
055d181c67 | ||
|
|
7042c45deb | ||
|
|
960c2291b6 | ||
|
|
773bfe1407 | ||
|
|
a23f995717 | ||
|
|
bd509b3c75 | ||
|
|
a0f8ba9afb | ||
|
|
a71e040c6d | ||
|
|
454abec468 | ||
|
|
96035d5257 | ||
|
|
9f2b59f2a2 | ||
|
|
a54046907d | ||
|
|
2ce5679373 | ||
|
|
2dad9f84fc | ||
|
|
a81a361a93 | ||
|
|
4660e68abf | ||
|
|
f8a77cf809 | ||
|
|
0abe9598f6 | ||
|
|
20de713716 | ||
|
|
9dbef6acc2 | ||
|
|
4c93bf7cf0 | ||
|
|
a8fea0fc49 | ||
|
|
2d5975d6e3 | ||
|
|
6874cfd5b1 | ||
|
|
d34013396a | ||
|
|
a35b0915ab | ||
|
|
b35f3b4375 | ||
|
|
f4f9612789 | ||
|
|
bfc79c6051 | ||
|
|
d3e60487bb | ||
|
|
f36f411a8d | ||
|
|
35f4aea69f | ||
|
|
8795383e7c | ||
|
|
fc4750706b | ||
|
|
0ae59bd3e6 | ||
|
|
61fd14c816 | ||
|
|
c7d3d87b09 | ||
|
|
5e68f7b58c | ||
|
|
8a692200d5 | ||
|
|
829eacb0fb | ||
|
|
9aeca91f22 | ||
|
|
1bdb512826 | ||
|
|
060fa6e5f7 | ||
|
|
171a54c0fc | ||
|
|
17406b448d | ||
|
|
b4b661a3ad | ||
|
|
4857969ca4 | ||
|
|
d9d01e09aa | ||
|
|
dadca97d8a | ||
|
|
8afba8b53d | ||
|
|
85dac1184c | ||
|
|
4167460d28 | ||
|
|
1d8a60749d | ||
|
|
31a597ca81 | ||
|
|
e5e77ffec5 | ||
|
|
41c3df41b4 | ||
|
|
053066f1a7 | ||
|
|
21135dac07 | ||
|
|
22ccce3208 | ||
|
|
70aa3964ee | ||
|
|
167489823a | ||
|
|
d1426f1b37 | ||
|
|
7dcdc59c8e | ||
|
|
1e13ee87af | ||
|
|
5101c1a759 | ||
|
|
74bb079625 | ||
|
|
2da7979d94 | ||
|
|
4ecb2c7c27 | ||
|
|
251f51b01c | ||
|
|
2fba9b83af | ||
|
|
1c97cb3cec | ||
|
|
25511f898c | ||
|
|
d820f153a9 | ||
|
|
77b06acad4 | ||
|
|
6760a96527 | ||
|
|
257f426ab9 | ||
|
|
3771a50f30 | ||
|
|
85ee211172 | ||
|
|
1b7a66b41a | ||
|
|
8f9a1aa931 | ||
|
|
8b60fd0e55 | ||
|
|
cd7b3b4f6e | ||
|
|
83b0f62d59 | ||
|
|
dd3a78ada8 | ||
|
|
307e2b889c | ||
|
|
a063f7664d | ||
|
|
b1ab857592 | ||
|
|
2b8bbc434f | ||
|
|
c6878c27b9 | ||
|
|
02ff4a4acb | ||
|
|
23f757e916 | ||
|
|
f0ababa409 | ||
|
|
331ff341f3 | ||
|
|
793a84edfb | ||
|
|
2893d4aebd | ||
|
|
b7ac7680d9 | ||
|
|
18dd59ed0f | ||
|
|
443906da55 | ||
|
|
a9f29da4f8 | ||
|
|
cf456cff81 | ||
|
|
69b3c96e09 | ||
|
|
61eb86b3a0 | ||
|
|
f0ad32bc37 | ||
|
|
aeeb2820f9 | ||
|
|
2d88405d69 | ||
|
|
f32ed5db89 | ||
|
|
f1606ac51b | ||
|
|
d13eb1a55d | ||
|
|
384fbf5464 | ||
|
|
4874f9d051 | ||
|
|
51732fa660 | ||
|
|
bb25632178 | ||
|
|
9a2cf82623 | ||
|
|
c0734fc29e | ||
|
|
c60067e733 | ||
|
|
6293634e36 | ||
|
|
a047695a84 | ||
|
|
db9d84ed76 | ||
|
|
e296b1df60 | ||
|
|
b72e5f5437 | ||
|
|
de09ae94b8 | ||
|
|
b36a33f015 | ||
|
|
d95891256b | ||
|
|
9c8097ecb9 | ||
|
|
18a3dfd604 | ||
|
|
59fd337e44 | ||
|
|
696cd235fd | ||
|
|
59c7efccb2 | ||
|
|
b031ebbffd | ||
|
|
67415babc2 | ||
|
|
563dd4683d | ||
|
|
e9131f729a | ||
|
|
c4ea626e33 | ||
|
|
fefba7976b | ||
|
|
2ce8555692 | ||
|
|
9fe9c386bb | ||
|
|
e8cd2c7548 | ||
|
|
158d8b086a | ||
|
|
1c534d7475 | ||
|
|
90f8dbe243 | ||
|
|
0c33b26fa9 | ||
|
|
d320679f69 | ||
|
|
8d5398b5a3 | ||
|
|
6cd8593fa5 | ||
|
|
5ebbc178a5 | ||
|
|
4f6e229943 | ||
|
|
3e846d9527 | ||
|
|
981d745b74 | ||
|
|
2dd0858960 | ||
|
|
f72819a664 | ||
|
|
5361b1e87b | ||
|
|
e15d03ed4e | ||
|
|
6c9041ce40 | ||
|
|
8da96e6e48 | ||
|
|
385aa6d438 | ||
|
|
79f24a5944 | ||
|
|
80570717f9 | ||
|
|
ebab79c4ca | ||
|
|
42882ebe11 | ||
|
|
d2de26f765 | ||
|
|
e2cebfbd16 | ||
|
|
a58cc6bdf3 | ||
|
|
36bc1553c0 | ||
|
|
17b06c39e9 | ||
|
|
ba2f6eb7be | ||
|
|
b93145f26d | ||
|
|
e88ea9c13d | ||
|
|
1275d0023d | ||
|
|
27f6f225c9 | ||
|
|
41362aa34a | ||
|
|
a99609e016 | ||
|
|
c0ea2d8ec3 | ||
|
|
bb6b31d715 | ||
|
|
21695dd2cb | ||
|
|
531835c948 | ||
|
|
77e3b351fd | ||
|
|
66f756575a | ||
|
|
7acc8bc7ed | ||
|
|
0a4d337a53 | ||
|
|
0198068a13 | ||
|
|
1c15f8462f | ||
|
|
3929ce0dfc | ||
|
|
7deeaf305d | ||
|
|
0f04c06e13 | ||
|
|
d1863fa714 | ||
|
|
46b122a167 | ||
|
|
ee3db1e5c5 | ||
|
|
bd830617c9 | ||
|
|
a9b6493091 | ||
|
|
9894e45516 | ||
|
|
2cfc82f3aa | ||
|
|
bb9eab0989 | ||
|
|
dc87ec1c82 | ||
|
|
98b7b65ce7 | ||
|
|
9f8f32b33e | ||
|
|
a80ec6d893 | ||
|
|
4d85930f5a | ||
|
|
f722f4112d | ||
|
|
383276f47a | ||
|
|
33c78e4a17 | ||
|
|
55a0de7899 | ||
|
|
6b3aab66bf | ||
|
|
77e70ef8d3 | ||
|
|
9b92143501 | ||
|
|
87f94f6b8f | ||
|
|
5d955e77b6 | ||
|
|
270a276b98 | ||
|
|
be7d914e39 | ||
|
|
37fc00cce8 | ||
|
|
0d515abadb | ||
|
|
daef01194e | ||
|
|
258bf1cc41 | ||
|
|
ce3d7829d7 | ||
|
|
c66a01c1a6 | ||
|
|
d113a92ce5 | ||
|
|
7b655d12df | ||
|
|
a4c872f1e8 | ||
|
|
0e7d9bf9c1 | ||
|
|
6252a5bc75 | ||
|
|
e4e80c9c31 | ||
|
|
165c5610c3 | ||
|
|
13fbc7dd39 | ||
|
|
02a75fc32a | ||
|
|
699c4d107b | ||
|
|
e4810302e1 | ||
|
|
73f10cad66 | ||
|
|
f1d670dc46 | ||
|
|
045539c752 | ||
|
|
782c09b686 | ||
|
|
6109718c67 | ||
|
|
cd758d7e48 | ||
|
|
fcb0fcadeb | ||
|
|
26fb506560 | ||
|
|
b6c4239322 | ||
|
|
74f9283f18 | ||
|
|
60e6ae6e23 | ||
|
|
83d9229295 | ||
|
|
e079b0f3ed | ||
|
|
d433a5461d | ||
|
|
2c43f6bf21 | ||
|
|
ac57509a29 | ||
|
|
c5ce655cf6 | ||
|
|
9fe05efb4e | ||
|
|
dcf207f5e5 | ||
|
|
11facab71c | ||
|
|
5b4975f34c | ||
|
|
069e535f1a | ||
|
|
1eb053447e | ||
|
|
93c7c06b2d | ||
|
|
b0085bc1e1 | ||
|
|
9133951446 | ||
|
|
7853d4686a | ||
|
|
ed5892eb56 | ||
|
|
687804de2c | ||
|
|
9d166041ab | ||
|
|
924041bff4 | ||
|
|
e9216d3e0f | ||
|
|
db8f1bca66 | ||
|
|
2429831153 | ||
|
|
80d2246634 | ||
|
|
56df2477ca | ||
|
|
9b4384dc33 | ||
|
|
bc65857831 | ||
|
|
de462d2385 | ||
|
|
90150428be | ||
|
|
2a7f951f4f | ||
|
|
82789328c1 | ||
|
|
13bccd1d3f | ||
|
|
43c514132d | ||
|
|
9e0fdcbfee | ||
|
|
008dc3fc52 | ||
|
|
9fde237d9b | ||
|
|
d626c08b4c | ||
|
|
58e223e74b | ||
|
|
1da1df156e | ||
|
|
3442372281 | ||
|
|
1b3b50c113 | ||
|
|
18e126b781 | ||
|
|
c88600adda | ||
|
|
4787361e66 | ||
|
|
b5ece8b5bd | ||
|
|
7ee3116f29 | ||
|
|
1fc0d77971 | ||
|
|
a32ab4bf7f | ||
|
|
2d8083bf18 | ||
|
|
63b9be9845 | ||
|
|
85a83d8c71 | ||
|
|
71b33a296c | ||
|
|
becdfd6f03 | ||
|
|
41744f9416 | ||
|
|
cb89a92ba9 | ||
|
|
93d54373c6 | ||
|
|
385addfe08 | ||
|
|
4c21957b04 | ||
|
|
ab6b011225 | ||
|
|
e72d91503c | ||
|
|
b9ee206908 | ||
|
|
4c9abba5fa | ||
|
|
3424b0542a | ||
|
|
fec90b8958 | ||
|
|
4da7fe4ff9 | ||
|
|
c53623dd67 | ||
|
|
6540ffa4dd | ||
|
|
5ee6db02ff | ||
|
|
d8221f466a | ||
|
|
462bea2a09 | ||
|
|
f452a97278 | ||
|
|
eb9d2be587 | ||
|
|
df1e747861 | ||
|
|
f48595b1ff | ||
|
|
12cd4e19cb | ||
|
|
a195e94522 | ||
|
|
02abb39dc2 | ||
|
|
f7a0b1ef78 | ||
|
|
7678f25879 | ||
|
|
fa9324bda8 | ||
|
|
1e72f9d8fe | ||
|
|
50fd954599 | ||
|
|
b1e34b55f8 | ||
|
|
cff1b8a411 | ||
|
|
6ffa6720be | ||
|
|
f52a106165 | ||
|
|
bf247b71e1 | ||
|
|
66818e4c82 | ||
|
|
23d53d39b4 | ||
|
|
30ea5a5b69 | ||
|
|
e7a210dc06 | ||
|
|
497de9824a | ||
|
|
be74b50762 | ||
|
|
f2e06b56e7 | ||
|
|
f6aa20c300 | ||
|
|
5e16134f6f | ||
|
|
6165fcbb21 | ||
|
|
831e882db0 | ||
|
|
feb8bf4bd3 | ||
|
|
ce3ee866ca | ||
|
|
d29dd35689 | ||
|
|
3a0a89853f | ||
|
|
e7ca79d251 | ||
|
|
22426bab33 | ||
|
|
116094ea96 | ||
|
|
9df39a9545 | ||
|
|
b8f44df723 | ||
|
|
74f275eb69 | ||
|
|
1142cbcb2c | ||
|
|
37749e5829 | ||
|
|
f9025c7a51 | ||
|
|
c7bfc38477 | ||
|
|
7ca394d7b9 | ||
|
|
31884ea59d | ||
|
|
e79b7c7023 | ||
|
|
1fdb4e8ade | ||
|
|
53db8c5928 | ||
|
|
07514000a4 | ||
|
|
f28721e55a | ||
|
|
fc230291d3 | ||
|
|
89ff4cfa40 | ||
|
|
d786b6abb2 | ||
|
|
fb0e694155 | ||
|
|
cd6cac1fb6 | ||
|
|
ea07f05097 | ||
|
|
d84767af68 | ||
|
|
aab73a8d81 | ||
|
|
995fc2ccd8 | ||
|
|
60bcd5f643 | ||
|
|
ba04fb320b | ||
|
|
770b7dc282 | ||
|
|
ed85eee36c | ||
|
|
23df8a2df8 | ||
|
|
36cd388607 | ||
|
|
4d48ef1939 | ||
|
|
7970e2a1c6 | ||
|
|
cee96d7daa | ||
|
|
861c1ddd69 | ||
|
|
5dec5a54cb | ||
|
|
5c760aabd4 | ||
|
|
1a2fa5d8c3 | ||
|
|
ef0c53da82 | ||
|
|
3fd62a80e2 | ||
|
|
5c19dd8b15 | ||
|
|
1fc88e147f | ||
|
|
9b4bbe0500 | ||
|
|
b37fdd3619 | ||
|
|
ab00c41452 | ||
|
|
c15727377b | ||
|
|
1e6f32bdc4 | ||
|
|
42e69c98a7 | ||
|
|
a217727bb4 | ||
|
|
ba10b1c06e | ||
|
|
075ba33e8b | ||
|
|
19dbc7d90a | ||
|
|
ade70bb7ba | ||
|
|
4b67913eee | ||
|
|
75858c1555 | ||
|
|
659baaf5fb | ||
|
|
3c83c578eb | ||
|
|
3ddbf1da87 | ||
|
|
35cb5b81dc | ||
|
|
02d9b996a7 | ||
|
|
d4cf6a5ad7 | ||
|
|
9fdb4fa25f | ||
|
|
d5bc1cdf5d | ||
|
|
f5995c0afa | ||
|
|
2cc65160b4 | ||
|
|
57f5a7c4cd | ||
|
|
6aea3b53f3 | ||
|
|
9f5e194a6e | ||
|
|
0831585a27 | ||
|
|
b2cf6dce2d | ||
|
|
a3ebf86f6b | ||
|
|
2a305b1c55 | ||
|
|
2ea9b36c77 | ||
|
|
edaf174ebf | ||
|
|
c4497db06c | ||
|
|
9873415303 | ||
|
|
2b71476cfe | ||
|
|
44d14001e1 | ||
|
|
de5fda6a18 | ||
|
|
8b83a1d9a2 | ||
|
|
c0a0239eeb | ||
|
|
84f377451e | ||
|
|
21d0c9ab0e | ||
|
|
f9c1cdb4bd | ||
|
|
e89444141b | ||
|
|
9cd4e01d8e | ||
|
|
f7fa08d5e9 | ||
|
|
7a4135319f | ||
|
|
41fca40a36 | ||
|
|
9dbfa76b26 | ||
|
|
20eeade06f | ||
|
|
cd9f18ffdb | ||
|
|
f7baf67985 | ||
|
|
692bf30cf5 | ||
|
|
41b33fbd7a | ||
|
|
5dc551c05d | ||
|
|
dd7aee9d15 | ||
|
|
bbeed1e4ed | ||
|
|
471084a9ef | ||
|
|
6fc00976a0 | ||
|
|
4aa753515d | ||
|
|
7e933966cf | ||
|
|
b4d179f7b2 | ||
|
|
a51acdbc88 | ||
|
|
52e63a228d | ||
|
|
9424d2d2ba | ||
|
|
0c12eebe6f | ||
|
|
a15a0752f4 | ||
|
|
31cef46b56 | ||
|
|
bfe0126816 | ||
|
|
98b56691dd | ||
|
|
6451175d0e | ||
|
|
9b4319c42d | ||
|
|
e9e7d81ddf | ||
|
|
84afbf26f8 | ||
|
|
ca9037461a | ||
|
|
9a3eeca411 | ||
|
|
e216c235ce | ||
|
|
fbf062933f | ||
|
|
cf85f31da8 | ||
|
|
b70b6f8af1 | ||
|
|
90e074d3ab | ||
|
|
e14ea73626 | ||
|
|
e07b677632 | ||
|
|
4e7547c92e | ||
|
|
8483e78082 | ||
|
|
4ca1e26f0f | ||
|
|
d88657f369 | ||
|
|
caf03379f2 |
No files matched your search
@@ -0,0 +1 @@
|
||||
patreon: luckdev
|
||||
+74
-34
@@ -1,37 +1,77 @@
|
||||
# built application files
|
||||
*.jar
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
logs/
|
||||
|
||||
# Eclipse project files
|
||||
.classpath
|
||||
.project
|
||||
|
||||
# Intellij project files
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Gradle
|
||||
.gradletasknamecache
|
||||
### Gradle & IntelliJ ###
|
||||
.gradle/
|
||||
/.idea/
|
||||
build/
|
||||
bin/
|
||||
gradle/
|
||||
gradlew*
|
||||
out/
|
||||
run/
|
||||
*.iml
|
||||
.idea_modules/
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
|
||||
### Eclipse ###
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
.externalToolBuilders/
|
||||
*.launch
|
||||
.factorypath
|
||||
.recommenders/
|
||||
.apt_generated/
|
||||
.project
|
||||
.classpath
|
||||
|
||||
|
||||
### Linux ###
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
|
||||
|
||||
### macOS ###
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
._*
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.lnk
|
||||
@@ -0,0 +1,26 @@
|
||||
### :speech_balloon: Looking for support?
|
||||
|
||||
Details about support for the project can be found [here, on the Wiki Homepage](https://github.com/lucko/LuckPerms/wiki#support).
|
||||
|
||||
### :bug: Reporting bugs?
|
||||
|
||||
Before reporting a bug or issue, please make sure that the issue is actually being caused by or related to LuckPerms. We get a lot of reports which are caused by other software - please double check!
|
||||
|
||||
If you're unsure, feel free to ask using the above resources BEFORE making a report.
|
||||
|
||||
Bugs or issues should be reported using the [GitHub Issues tab](https://github.com/lucko/LuckPerms/issues).
|
||||
|
||||
### :pencil: Want to contribute code?
|
||||
#### Pull Requests
|
||||
If you make any changes or improvements to the plugin which you think would be beneficial to others, please consider making a pull request to merge your changes back into the upstream project. (especially if your changes are bug fixes!)
|
||||
|
||||
LuckPerms loosely follows the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Generally, try to copy the style of code found in the class you're editing.
|
||||
|
||||
If you're considering submitting a substantial pull request, please open an issue so we can discuss the change before starting work on the contribution. Most pull requests are happily accepted, but larger changes may have an inpact on the maintainability of the project, and require more consideration.
|
||||
|
||||
#### Project Layout
|
||||
The project is split up into a few seperate modules.
|
||||
|
||||
* **API** - The public, semantically versioned API used by other plugins wishing to integrate with and retrieve data from LuckPerms. This module (for the most part) does not contain any implementation itself, and is provided by the plugin.
|
||||
* **Common** - The common module contains most of the code which implements the respective LuckPerms plugins. This abstract module reduces duplicated code throughout the project.
|
||||
* **Bukkit, BungeeCord, Sponge, Nukkit & Velocity** - Each use the common module to implement plugins on the respective server platforms.
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
This file is part of LuckPerms, licensed under the MIT License.
|
||||
|
||||
Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
Copyright (c) contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,6 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Luck
|
||||
Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
Copyright (c) contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
@@ -1,182 +1,50 @@
|
||||
# LuckPerms [](https://ci.lucko.me/job/LuckPerms/)
|
||||
A permissions implementation for Bukkit/Spigot, BungeeCord and Sponge.
|
||||

|
||||
# LuckPerms
|
||||
[](https://ci.lucko.me/job/LuckPerms/)
|
||||
[](https://javadoc.io/doc/me.lucko.luckperms/luckperms-api)
|
||||
[](https://search.maven.org/artifact/me.lucko.luckperms/luckperms-api)
|
||||
[](https://discord.gg/luckperms)
|
||||
|
||||
## Links
|
||||
* **Development Builds** - <https://ci.lucko.me/job/LuckPerms>
|
||||
* **Javadocs** - <https://jd.lucko.me/LuckPerms>
|
||||
LuckPerms is an advanced permissions implementation aiming to be a fast, reliable and flexible alternative to existing permission plugins. The project's main goals are centered around high performance and a wide feature set, filling the gaps of functionality and building upon existing features found in other plugins.
|
||||
|
||||
## Features
|
||||
* **Group inheritance** - users can be members of multiple groups, groups can inherit other groups
|
||||
* **Temporary permissions** - users/groups can be given permissions that expire after a given time
|
||||
* **Temporary groups** - users/groups can be added to/inherit other groups temporarily
|
||||
* **Multi-server support** - data is synced across all servers/platforms
|
||||
* **Full offline-mode/mixed-mode support** - player permissions are synced properly over offline-mode or mixed online/offline-mode networks.
|
||||
* **Per-server permissions/groups** - define user/group permissions that only apply on certain servers
|
||||
* **Per-world permissions/groups** - define user/group permissions that only apply on certain worlds (on BungeeCord, a connected Bukkit/Spigot instance is treated as a world)
|
||||
* **Tracks / paths / ladders** - users can be promoted/demoted along multiple group tracks
|
||||
* **Vault Support** - hooks into Vault to integrate with other plugins
|
||||
* **Developer API** - easily integrate LuckPerms into your own projects
|
||||
* **Easy and simple setup and configuration using commands** - no editing yml files, yuck
|
||||
* **Negated permissions and groups** - define special rules for certain users/groups
|
||||
* **Full support for UUIDs, even in Offline Mode** - users can change their usernames without losing permissions. In offline mode, a single user has the same internal UUID across a network.
|
||||
* **Permission data stored within MySQL in a json format** - easily integrate the LuckPerms backend into your other projects
|
||||
* **Well documented** - API methods have comprehensive Java docs, it's clear what each method does.
|
||||
* **Efficient/lightweight** - maybe? Who knows, it might be.
|
||||
* **Open Sourced, Free...** - you shouldn't have to pay $10+ for a "powerful" permissions plugin.
|
||||
* **BungeeCord compatible** - permissions, users and groups are synced across all LuckPerms instances
|
||||
* **Sponge compatible** - permissions, users and groups are synced across all LuckPerms instances (bukkit --> sponge, for example)
|
||||
* **Support for MySQL, SQLite & Flatfile (JSON)** - other storage methods coming soon (maybe)
|
||||
LuckPerms also includes an extensive API for developers, and support for a variety of Minecraft server software & data storage options.
|
||||
|
||||
## Setup
|
||||
All configuration options are in the **config.yml/luckperms.conf** file, which is generated automagically when the plugin first starts.
|
||||
Still not convinced? More information can be found on the wiki, under: [Why LuckPerms?](https://github.com/lucko/LuckPerms/wiki/Why-LuckPerms)
|
||||
|
||||
You can define the settings for per-server permissions, the storage method and credentials within this file.
|
||||
## Useful Links
|
||||
|
||||
## Info
|
||||
### Permission Calculation
|
||||
Permissions are calculated based on a priority system as follows.
|
||||
The latest **downloads** can be found on the [project's homepage](https://luckperms.net/).
|
||||
|
||||
* Temporary permissions will override non-temporary permissions.
|
||||
More information about the project & how to use the plugin can be found in the [wiki](https://github.com/lucko/LuckPerms/wiki).
|
||||
|
||||
Example: if a user has a false permission set for "test.node", and a temporary true permission set for "test.node", the temporary permission will override the permanent one, and the user will be granted the true node.
|
||||
## Building
|
||||
LuckPerms uses Gradle to handle dependencies & building.
|
||||
|
||||
* World specific permissions will override generic permissions.
|
||||
#### Requirements
|
||||
* Java 8 JDK or newer
|
||||
* Git
|
||||
|
||||
Example: if a user has a global "fly.use" permission, and then has a negated "fly.use" permission in the "world_nether" world, the world specific permission will override the globally defined one, and the user will be granted the negated node (provided they're in that world, of course.).
|
||||
|
||||
* Server specific permissions will override generic/global permissions.
|
||||
|
||||
Example: if a user has a global "fly.use" permission, and then has a negated "fly.use" permission on the "factions" server, the server specific permission will override the globally defined one, and the user will be granted the negated node.
|
||||
|
||||
* Inherited permissions will be overridden by an objects own permissions.
|
||||
|
||||
Example: A user is a member of the default group, which grants "some.thing.perm", but the users own permissions has "some.thing.perm" set to false. The inherited permission will be overridden by the users own permissions, and the user will be granted the negative node (provided they're on that server).
|
||||
|
||||
### Temporary Permissions
|
||||
Temporary permissions are checked each time a user/group is loaded, and when the sync task runs. This means if you set a temporary permission to expire after 30 seconds, it won't actually be removed until the sync task runs.
|
||||
|
||||
The only way around this is to decrease the sync interval.
|
||||
|
||||
## API
|
||||
LuckPerms has an extensive API, allowing for easy integration with other projects. To use the Api, you need to obtain an instance of the `LuckPermsApi` interface. This can be done in a number of ways.
|
||||
|
||||
```java
|
||||
// On all platforms
|
||||
final LuckPermsApi api = LuckPerms.getApi();
|
||||
|
||||
// On Bukkit/Spigot
|
||||
final LuckPermsApi api = Bukkit.getServicesManager().getRegistration(LuckPermsApi.class).getProvider();
|
||||
|
||||
// On Sponge
|
||||
Optional<LuckPermsApi> provider = Sponge.getServiceManager().provide(LuckPermsApi.class);
|
||||
if (provider.isPresent()) {
|
||||
final LuckPermsApi api = provider.get();
|
||||
}
|
||||
#### Compiling from source
|
||||
```sh
|
||||
git clone https://github.com/lucko/LuckPerms.git
|
||||
cd LuckPerms/
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
If you want to use LuckPerms in your onEnable method, you need to add the following to your plugins `plugin.yml`.
|
||||
```yml
|
||||
depend: [LuckPerms]
|
||||
```
|
||||
All of the available methods can be seen in the various interfaces in the `luckperms-api` module.
|
||||
You can find the output jars in the `build/libs` directories.
|
||||
|
||||
You can add LuckPerms as a Maven dependency by adding the following to your projects `pom.xml`.
|
||||
````xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>luck-repo</id>
|
||||
<url>https://repo.lucko.me/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
## Contributing
|
||||
#### Pull Requests
|
||||
If you make any changes or improvements to the plugin which you think would be beneficial to others, please consider making a pull request to merge your changes back into the upstream project. (especially if your changes are bug fixes!)
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<artifactId>luckperms-api</artifactId>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
````
|
||||
LuckPerms loosely follows the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Generally, try to copy the style of code found in the class you're editing.
|
||||
|
||||
## Commands
|
||||
#### Project Layout
|
||||
The project is split up into a few separate modules.
|
||||
|
||||
Command usage is printed to the console/chat whenever invalid arguments are provided. Simply typing /perms will list all commands a user has permission to use.
|
||||
|
||||
### Aliases
|
||||
|
||||
| Bukkit | Bungee |
|
||||
|------------------|------------------|
|
||||
| /luckperms | /luckpermsbungee |
|
||||
| /perms | /bperms |
|
||||
| /permissions | /bpermissions |
|
||||
| /lp | /lpb |
|
||||
| /perm | /bperm |
|
||||
|
||||
Arguments: \<required\> [optional]
|
||||
|
||||
Users with OP have access to all commands.
|
||||
|
||||
Additionally, you can use wildcards to grant users access to a selection of commands.
|
||||
* **All commands** - luckperms.*
|
||||
* **All user commands** - luckperms.user.*
|
||||
* **All group commands** - luckperms.group.*
|
||||
* **All track commands** - luckperms.track.*
|
||||
|
||||
### General
|
||||
* /perms - n/a
|
||||
* /perms sync - luckperms.sync
|
||||
* /perms info - luckperms.info
|
||||
* /perms debug - luckperms.debug
|
||||
* /perms creategroup \<group\> - luckperms.creategroup
|
||||
* /perms deletegroup \<group\> - luckperms.deletegroup
|
||||
* /perms listgroups - luckperms.listgroups
|
||||
* /perms createtrack \<track\> - luckperms.createtrack
|
||||
* /perms deletetrack \<track\> - luckperms.deletetrack
|
||||
* /perms listtracks - luckperms.listtracks
|
||||
|
||||
### User
|
||||
* /perms user \<user\> info - luckperms.user.info
|
||||
* /perms user \<user\> getuuid - luckperms.user.getuuid
|
||||
* /perms user \<user\> listnodes - luckperms.user.listnodes
|
||||
* /perms user \<user\> haspermission \<node\> [server] [world] - luckperms.user.haspermission
|
||||
* /perms user \<user\> inheritspermission \<node\> [server] [world] - luckperms.user.inheritspermission
|
||||
* /perms user \<user\> set \<node\> \<true/false\> [server] [world] - luckperms.user.setpermission
|
||||
* /perms user \<user\> unset \<node\> [server] [world] - luckperms.user.unsetpermission
|
||||
* /perms user \<user\> addgroup \<group\> [server] [world] - luckperms.user.addgroup
|
||||
* /perms user \<user\> removegroup \<group\> [server] [world] - luckperms.user.removegroup
|
||||
* /perms user \<user\> settemp \<node\> \<true/false\> \<duration\> [server] [world] - luckperms.user.settemppermission
|
||||
* /perms user \<user\> unsettemp \<node\> [server] [world] - luckperms.user.unsettemppermission
|
||||
* /perms user \<user\> addtempgroup \<group\> \<duration\> [server] [world] - luckperms.user.addtempgroup
|
||||
* /perms user \<user\> removetempgroup \<group\> [server] [world] - luckperms.user.removetempgroup
|
||||
* /perms user \<user\> setprimarygroup \<group\> - luckperms.user.setprimarygroup
|
||||
* /perms user \<user\> showtracks - luckperms.user.showtracks
|
||||
* /perms user \<user\> promote \<track\> - luckperms.user.promote
|
||||
* /perms user \<user\> demote \<track\> - luckperms.user.demote
|
||||
* /perms user \<user\> showpos \<track\> - luckperms.user.showpos
|
||||
* /perms user \<user\> clear - luckperms.user.clear
|
||||
|
||||
### Group
|
||||
* /perms group \<group\> info - luckperms.group.info
|
||||
* /perms group \<group\> listnodes - luckperms.group.listnodes
|
||||
* /perms group \<group\> haspermission \<node\> [server] [world] - luckperms.group.haspermission
|
||||
* /perms group \<group\> inheritspermission \<node\> [server] [world] - luckperms.group.inheritspermission
|
||||
* /perms group \<group\> set \<node\> \<true/false\> [server] [world] - luckperms.group.setpermission
|
||||
* /perms group \<group\> unset \<node\> [server] [world] - luckperms.group.unsetpermission
|
||||
* /perms group \<group\> setinherit \<group\> [server] [world] - luckperms.group.setinherit
|
||||
* /perms group \<group\> unsetinherit \<group\> [server] [world] - luckperms.group.unsetinherit
|
||||
* /perms group \<group\> settemp \<node\> \<true/false\> \<duration\> [server] [world] - settemppermission
|
||||
* /perms group \<group\> unsettemp \<node\> [server] [world] - luckperms.group.unsettemppermission
|
||||
* /perms group \<group\> settempinherit \<group\> \<duration\> [server] [world] - luckperms.group.settempinherit
|
||||
* /perms group \<group\> unsettempinherit \<group\> [server] [world] - luckperms.group.unsettempinherit
|
||||
* /perms group \<group\> showtracks - luckperms.group.showtracks
|
||||
* /perms group \<group\> clear - luckperms.group.clear
|
||||
|
||||
### Track
|
||||
* /perms track \<track\> info - luckperms.track.info
|
||||
* /perms track \<track\> append \<group\> - luckperms.track.append
|
||||
* /perms track \<track\> insert \<group\> \<position\> - luckperms.track.insert
|
||||
* /perms track \<track\> remove \<group\> - luckperms.track.remove
|
||||
* /perms track \<track\> clear - luckperms.track.clear
|
||||
* **API** - The public, semantically versioned API used by other plugins wishing to integrate with and retrieve data from LuckPerms. This module (for the most part) does not contain any implementation itself, and is provided by the plugin.
|
||||
* **Common** - The common module contains most of the code which implements the respective LuckPerms plugins. This abstract module reduces duplicated code throughout the project.
|
||||
* **Bukkit, BungeeCord, Sponge, Nukkit & Velocity** - Each use the common module to implement plugins on the respective server platforms.
|
||||
|
||||
## License
|
||||
See LICENSE.md.
|
||||
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/lucko/LuckPerms/blob/master/LICENSE.txt) for more info.
|
||||
@@ -0,0 +1,98 @@
|
||||
group = 'net.luckperms'
|
||||
project.version = '5.0'
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.checkerframework:checker-qual:2.5.5'
|
||||
}
|
||||
|
||||
// Only used occasionally for deployment - not needed for normal builds.
|
||||
/*
|
||||
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
|
||||
apply plugin: 'signing'
|
||||
|
||||
javadoc {
|
||||
title = 'LuckPerms API (v' + project.ext.apiVersion + ')'
|
||||
options.encoding = 'UTF-8'
|
||||
options.charSet = 'UTF-8'
|
||||
options.links(
|
||||
'https://docs.oracle.com/javase/8/docs/api/'
|
||||
)
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
classifier 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
signing {
|
||||
useGpgCmd()
|
||||
sign configurations.archives
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||
|
||||
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
|
||||
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
||||
}
|
||||
|
||||
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
|
||||
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
||||
}
|
||||
|
||||
pom {
|
||||
project {
|
||||
name 'LuckPerms API'
|
||||
description 'An advanced permissions plugin for Bukkit/Spigot, BungeeCord, Sponge, Nukkit and Velocity.'
|
||||
url 'https://luckperms.net'
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'MIT'
|
||||
url 'https://opensource.org/licenses/MIT'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
name 'Luck'
|
||||
email 'git@lucko.me'
|
||||
url 'https://github.com/lucko'
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
connection 'scm:git:https://github.com/lucko/LuckPerms.git'
|
||||
developerConnection 'scm:git:git@github.com:lucko/LuckPerms.git'
|
||||
url 'https://github.com/lucko/LuckPerms'
|
||||
}
|
||||
|
||||
ciManagement {
|
||||
system 'Jenkins'
|
||||
url 'https://ci.lucko.me/job/LuckPerms'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system 'GitHub'
|
||||
url 'https://github.com/lucko/LuckPerms/issues'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>1.5</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<version>1.5</version>
|
||||
<artifactId>luckperms-api</artifactId>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,30 +0,0 @@
|
||||
package me.lucko.luckperms;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.lucko.luckperms.api.LuckPermsApi;
|
||||
|
||||
/**
|
||||
* Static access to LuckPerms
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class LuckPerms {
|
||||
|
||||
private static LuckPermsApi api = null;
|
||||
|
||||
public static LuckPermsApi getApi() {
|
||||
if (api == null) {
|
||||
throw new IllegalStateException("API is not loaded.");
|
||||
}
|
||||
return api;
|
||||
}
|
||||
|
||||
static void registerProvider(LuckPermsApi luckPermsApi) {
|
||||
api = luckPermsApi;
|
||||
}
|
||||
|
||||
static void unregisterProvider() {
|
||||
api = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.api.data.Callback;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Wrapper interface for the internal Datastore instance
|
||||
* The implementations of this interface limit access to the datastore and add parameter checks to further prevent
|
||||
* errors and ensure all API interactions to not damage the state of the plugin.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface Datastore {
|
||||
|
||||
String getName();
|
||||
boolean isAcceptingLogins();
|
||||
|
||||
Async async();
|
||||
Sync sync();
|
||||
|
||||
interface Async {
|
||||
void loadOrCreateUser(UUID uuid, String username, Callback<Boolean> callback);
|
||||
void loadUser(UUID uuid, Callback<Boolean> callback);
|
||||
void saveUser(User user, Callback<Boolean> callback);
|
||||
void createAndLoadGroup(String name, Callback<Boolean> callback);
|
||||
void loadGroup(String name, Callback<Boolean> callback);
|
||||
void loadAllGroups(Callback<Boolean> callback);
|
||||
void saveGroup(Group group, Callback<Boolean> callback);
|
||||
void deleteGroup(Group group, Callback<Boolean> callback);
|
||||
void createAndLoadTrack(String name, Callback<Boolean> callback);
|
||||
void loadTrack(String name, Callback<Boolean> callback);
|
||||
void loadAllTracks(Callback<Boolean> callback);
|
||||
void saveTrack(Track track, Callback<Boolean> callback);
|
||||
void deleteTrack(Track track, Callback<Boolean> callback);
|
||||
void saveUUIDData(String username, UUID uuid, Callback<Boolean> callback);
|
||||
void getUUID(String username, Callback<UUID> callback);
|
||||
}
|
||||
|
||||
interface Sync {
|
||||
boolean loadOrCreateUser(UUID uuid, String username);
|
||||
boolean loadUser(UUID uuid);
|
||||
boolean saveUser(User user);
|
||||
boolean createAndLoadGroup(String name);
|
||||
boolean loadGroup(String name);
|
||||
boolean loadAllGroups();
|
||||
boolean saveGroup(Group group);
|
||||
boolean deleteGroup(Group group);
|
||||
boolean createAndLoadTrack(String name);
|
||||
boolean loadTrack(String name);
|
||||
boolean loadAllTracks();
|
||||
boolean saveTrack(Track track);
|
||||
boolean deleteTrack(Track track);
|
||||
boolean saveUUIDData(String username, UUID uuid);
|
||||
UUID getUUID(String username);
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Wrapper interface for internal Group instances
|
||||
* The implementations of this interface limit access to the Group and add parameter checks to further prevent
|
||||
* errors and ensure all API interactions to not damage the state of the group.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface Group extends PermissionObject {
|
||||
|
||||
/**
|
||||
* @return the name of the group
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* check to see if a group inherits a group
|
||||
* @param group The group to check membership of
|
||||
* @return true if the user is a member of the group
|
||||
*/
|
||||
boolean inheritsGroup(Group group);
|
||||
|
||||
/**
|
||||
* check to see if the group inherits a group on a specific server
|
||||
* @param group The group to check membership of
|
||||
* @param server The server to check on
|
||||
* @return true if the group inherits the group
|
||||
*/
|
||||
boolean inheritsGroup(Group group, String server);
|
||||
|
||||
/**
|
||||
* check to see if the group inherits a group on a specific server
|
||||
* @param group The group to check membership of
|
||||
* @param server The server to check on
|
||||
* @param world The world to check on
|
||||
* @return true if the group inherits the group
|
||||
*/
|
||||
boolean inheritsGroup(Group group, String server, String world);
|
||||
|
||||
/**
|
||||
* Make this group inherit another group
|
||||
* @param group the group to be inherited
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group
|
||||
*/
|
||||
void setInheritGroup(Group group) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Make this group inherit another group on a specific server
|
||||
* @param group the group to be inherited
|
||||
* @param server The server to add the group on
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group on that server
|
||||
*/
|
||||
void setInheritGroup(Group group, String server) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Make this group inherit another group on a specific server
|
||||
* @param group the group to be inherited
|
||||
* @param server The server to add the group on
|
||||
* @param world The world to add the group on
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group on that server
|
||||
*/
|
||||
void setInheritGroup(Group group, String server, String world) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Make this group inherit another group on a specific server
|
||||
* @param group the group to be inherited
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group on that server
|
||||
*/
|
||||
void setInheritGroup(Group group, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Make this group inherit another group on a specific server
|
||||
* @param group the group to be inherited
|
||||
* @param server The server to add the group on
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group on that server
|
||||
*/
|
||||
void setInheritGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Make this group inherit another group on a specific server
|
||||
* @param group the group to be inherited
|
||||
* @param server The server to add the group on
|
||||
* @param world The world to add the group on
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group on that server
|
||||
*/
|
||||
void setInheritGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @param server The server to remove the group on
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group, String server) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @param server The server to remove the group on
|
||||
* @param world The world to remove the group on
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group, String server, String world) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @param server The server to remove the group on
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group, String server, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove a previously set inheritance
|
||||
* @param group the group to uninherit
|
||||
* @param server The server to remove the group on
|
||||
* @param world The world to remove the group on
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
*/
|
||||
void unsetInheritGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Clear all of the groups permission nodes
|
||||
*/
|
||||
void clearNodes();
|
||||
|
||||
/**
|
||||
* Get a {@link List} of all of the groups the group inherits, on all servers
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getGroupNames();
|
||||
|
||||
/**
|
||||
* Get a {@link List} of the groups the group inherits on a specific server
|
||||
* @param server the server to check
|
||||
* @param world the world to check
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getLocalGroups(String server, String world);
|
||||
|
||||
/**
|
||||
* Get a {@link List} of the groups the group inherits on a specific server
|
||||
* @param server the server to check
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getLocalGroups(String server);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
public interface Logger {
|
||||
|
||||
void info(String s);
|
||||
void warn(String s);
|
||||
void severe(String s);
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface LuckPermsApi {
|
||||
|
||||
void runUpdateTask();
|
||||
String getVersion();
|
||||
|
||||
Datastore getDatastore();
|
||||
Logger getLogger();
|
||||
|
||||
User getUser(UUID uuid);
|
||||
User getUser(String name);
|
||||
boolean isUserLoaded(UUID uuid);
|
||||
|
||||
Group getGroup(String name);
|
||||
boolean isGroupLoaded(String name);
|
||||
|
||||
Track getTrack(String name);
|
||||
boolean isTrackLoaded(String name);
|
||||
|
||||
}
|
||||
@@ -1,277 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Wrapper interface for internal PermissionObject (user/group) instances
|
||||
* The implementations of this interface limit access to the object and add parameter checks to further prevent
|
||||
* errors and ensure all API interactions to not damage the state of the object.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface PermissionObject {
|
||||
|
||||
String getObjectName();
|
||||
|
||||
Map<String, Boolean> getNodes();
|
||||
|
||||
/**
|
||||
* Checks to see if the object has a certain permission
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b);
|
||||
|
||||
/**
|
||||
* Checks to see the the object has a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b, String server);
|
||||
|
||||
/**
|
||||
* Checks to see the the object has a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @param world The world
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b, String server, String world);
|
||||
|
||||
/**
|
||||
* Checks to see the the object has a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b, boolean temporary);
|
||||
|
||||
/**
|
||||
* Checks to see the the object has a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server to check on
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b, String server, boolean temporary);
|
||||
|
||||
/**
|
||||
* Checks to see the the object has a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server to check on
|
||||
* @param world The world to check on
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user has the permission
|
||||
*/
|
||||
boolean hasPermission(String node, boolean b, String server, String world, boolean temporary);
|
||||
|
||||
/**
|
||||
* Checks to see if the object inherits a certain permission
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b);
|
||||
|
||||
/**
|
||||
* Checks to see the the object inherits a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b, String server);
|
||||
|
||||
/**
|
||||
* Checks to see the the object inherits a permission on a certain server
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @param world The world
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b, String server, String world);
|
||||
|
||||
/**
|
||||
* Checks to see if the object inherits a certain permission
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b, boolean temporary);
|
||||
|
||||
/**
|
||||
* Checks to see if the object inherits a certain permission
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b, String server, boolean temporary);
|
||||
|
||||
/**
|
||||
* Checks to see if the object inherits a certain permission
|
||||
* @param node The permission node
|
||||
* @param b If the node is true/false(negated)
|
||||
* @param server The server
|
||||
* @param world The world
|
||||
* @param temporary if the permission is temporary
|
||||
* @return true if the user inherits the permission
|
||||
*/
|
||||
boolean inheritsPermission(String node, boolean b, String server, String world, boolean temporary);
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to be set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @param server The server to set the permission on
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value, String server) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @param server The server to set the permission on
|
||||
* @param world The world to set the permission on
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value, String server, String world) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @param expireAt The time in unixtime when the permission will expire
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @param server The server to set the permission on
|
||||
* @param expireAt The time in unixtime when the permission will expire
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value, String server, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
* @param node The node to set
|
||||
* @param value What to set the node to - true/false(negated)
|
||||
* @param server The server to set the permission on
|
||||
* @param world The world to set the permission on
|
||||
* @param expireAt The time in unixtime when the permission will expire
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
*/
|
||||
void setPermission(String node, boolean value, String server, String world, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @param temporary if the permission being removed is temporary
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @param server The server to unset the node on
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node, String server) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @param server The server to unset the node on
|
||||
* @param world The world to unset the node on
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node, String server, String world) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @param server The server to unset the node on
|
||||
* @param temporary if the permission being unset is temporary
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node, String server, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
* @param node The node to be unset
|
||||
* @param server The server to unset the node on
|
||||
* @param world The world to unset the node on
|
||||
* @param temporary if the permission being unset is temporary
|
||||
* @throws ObjectLacksException if the node wasn't already set
|
||||
*/
|
||||
void unsetPermission(String node, String server, String world, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Gets the permissions and inherited permissions that apply to a specific server
|
||||
* @param server The server to get nodes for
|
||||
* @param world The world to get nodes for
|
||||
* @param excludedGroups Groups that shouldn't be inherited (to prevent circular inheritance issues)
|
||||
* @return a {@link Map} of the permissions
|
||||
*/
|
||||
Map<String, Boolean> getLocalPermissions(String server, String world, List<String> excludedGroups);
|
||||
|
||||
/**
|
||||
* Gets the permissions and inherited permissions that apply to a specific server
|
||||
* @param server The server to get nodes for (can be null)
|
||||
* @param excludedGroups Groups that shouldn't be inherited, can be null (to prevent circular inheritance issues)
|
||||
* @return a {@link Map} of the permissions
|
||||
*/
|
||||
Map<String, Boolean> getLocalPermissions(String server, List<String> excludedGroups);
|
||||
|
||||
/**
|
||||
* Processes the objects and returns the temporary ones.
|
||||
* @return a map of temporary nodes
|
||||
*/
|
||||
Map<Map.Entry<String, Boolean>, Long> getTemporaryNodes();
|
||||
|
||||
/**
|
||||
* Processes the objects and returns the non-temporary ones.
|
||||
* @return a map of permanent nodes
|
||||
*/
|
||||
Map<String, Boolean> getPermanentNodes();
|
||||
|
||||
/**
|
||||
* Removes temporary permissions that have expired
|
||||
*/
|
||||
void auditTemporaryPermissions();
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Wrapper interface for internal Track instances
|
||||
* The implementations of this interface limit access to the Track and add parameter checks to further prevent
|
||||
* errors and ensure all API interactions to not damage the state of the track.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface Track {
|
||||
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets an ordered list of the groups on this track
|
||||
* @return am ordered {@link List} of the groups on this track
|
||||
*/
|
||||
List<String> getGroups();
|
||||
|
||||
/**
|
||||
* Gets the number of groups on this track
|
||||
* @return the number of groups on this track
|
||||
*/
|
||||
int getSize();
|
||||
|
||||
/**
|
||||
* Gets the next group on the track, after the one provided
|
||||
* @param current the group before the group being requested
|
||||
* @return the group name, or null if the end of the track has been reached
|
||||
* @throws ObjectLacksException if the track does not contain the group given
|
||||
*/
|
||||
String getNext(Group current) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Gets the group before the group provided
|
||||
* @param current the group after the group being requested
|
||||
* @return the group name, or null if the start of the track has been reached
|
||||
* @throws ObjectLacksException if the track does not contain the group given
|
||||
*/
|
||||
String getPrevious(Group current) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Appends a group to the end of this track
|
||||
* @param group the group to append
|
||||
* @throws ObjectAlreadyHasException if the group is already on this track somewhere
|
||||
*/
|
||||
void appendGroup(Group group) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Inserts a group at a certain position on this track
|
||||
* @param group the group to be inserted
|
||||
* @param position the index position (a value of 0 inserts at the start)
|
||||
* @throws ObjectAlreadyHasException if the group is already on this track somewhere
|
||||
* @throws IndexOutOfBoundsException if the position is less than 0 or greater than the size of the track
|
||||
*/
|
||||
void insertGroup(Group group, int position) throws ObjectAlreadyHasException, IndexOutOfBoundsException;
|
||||
|
||||
/**
|
||||
* Removes a group from this track
|
||||
* @param group the group to remove
|
||||
* @throws ObjectLacksException if the group is not on this track
|
||||
*/
|
||||
void removeGroup(Group group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Removes a group from this track
|
||||
* @param group the group to remove
|
||||
* @throws ObjectLacksException if the group is not on this track
|
||||
*/
|
||||
void removeGroup(String group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Checks if a group features on this track
|
||||
* @param group the group to check
|
||||
* @return true if the group is on this track
|
||||
*/
|
||||
boolean containsGroup(Group group);
|
||||
|
||||
/**
|
||||
* Checks if a group features on this track
|
||||
* @param group the group to check
|
||||
* @return true if the group is on this track
|
||||
*/
|
||||
boolean containsGroup(String group);
|
||||
|
||||
/**
|
||||
* Clear all of the groups within this track
|
||||
*/
|
||||
void clearGroups();
|
||||
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Wrapper interface for internal User instances
|
||||
* The implementations of this interface limit access to the User and add parameter checks to further prevent
|
||||
* errors and ensure all API interactions to not damage the state of the user.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface User extends PermissionObject {
|
||||
|
||||
/**
|
||||
* @return the users Mojang assigned unique id
|
||||
*/
|
||||
UUID getUuid();
|
||||
|
||||
/**
|
||||
* @return the Users Username
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets the users primary group
|
||||
* @return the users primary group
|
||||
*/
|
||||
String getPrimaryGroup();
|
||||
|
||||
/**
|
||||
* Sets a users primary group
|
||||
* @param s the new primary group
|
||||
* @throws ObjectAlreadyHasException if the user already has this set as their primary group
|
||||
*/
|
||||
void setPrimaryGroup(String s) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Refresh and re-assign the users permissions
|
||||
*/
|
||||
void refreshPermissions();
|
||||
|
||||
/**
|
||||
* Check to see if the user is a member of a group
|
||||
* @param group The group to check membership of
|
||||
* @return true if the user is a member of the group
|
||||
*/
|
||||
boolean isInGroup(Group group);
|
||||
|
||||
/**
|
||||
* Check to see if a user is a member of a group on a specific server
|
||||
* @param group The group to check membership of
|
||||
* @param server The server to check on
|
||||
* @return true if the user is a member of the group
|
||||
*/
|
||||
boolean isInGroup(Group group, String server);
|
||||
|
||||
/**
|
||||
* Check to see if a user is a member of a group on a specific server
|
||||
* @param group The group to check membership of
|
||||
* @param server The server to check on
|
||||
* @param world The world to check on
|
||||
* @return true if the user is a member of the group
|
||||
*/
|
||||
boolean isInGroup(Group group, String server, String world);
|
||||
|
||||
/**
|
||||
* Add a user to a group
|
||||
* @param group The group to add the user to
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group
|
||||
*/
|
||||
void addGroup(Group group) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Add a user to a group on a specific server
|
||||
* @param group The group to add the user to
|
||||
* @param server The server to add the group on
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group on that server
|
||||
*/
|
||||
void addGroup(Group group, String server) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Add a user to a group on a specific server
|
||||
* @param group The group to add the user to
|
||||
* @param server The server to add the group on
|
||||
* @param world The world to add the group on
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group on that server
|
||||
*/
|
||||
void addGroup(Group group, String server, String world) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Add a user to a group on a specific server
|
||||
* @param group The group to add the user to
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group on that server
|
||||
*/
|
||||
void addGroup(Group group, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Add a user to a group on a specific server
|
||||
* @param group The group to add the user to
|
||||
* @param server The server to add the group on
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group on that server
|
||||
*/
|
||||
void addGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Add a user to a group on a specific server
|
||||
* @param group The group to add the user to
|
||||
* @param server The server to add the group on
|
||||
* @param world The world to add the group on
|
||||
* @param expireAt when the group should expire
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group on that server
|
||||
*/
|
||||
void addGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group the group to remove the user from
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group the group to remove the user from
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group The group to remove the user from
|
||||
* @param server The server to remove the group on
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group, String server) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group The group to remove the user from
|
||||
* @param server The server to remove the group on
|
||||
* @param world The world to remove the group on
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group, String server, String world) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group The group to remove the user from
|
||||
* @param server The server to remove the group on
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group, String server, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Remove the user from a group
|
||||
* @param group The group to remove the user from
|
||||
* @param server The server to remove the group on
|
||||
* @param world The world to remove the group on
|
||||
* @param temporary if the group being removed is temporary
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
*/
|
||||
void removeGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Clear all of the users permission nodes
|
||||
*/
|
||||
void clearNodes();
|
||||
|
||||
/**
|
||||
* Get a {@link List} of all of the groups the user is a member of, on all servers
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getGroupNames();
|
||||
|
||||
/**
|
||||
* Get a {@link List} of the groups the user is a member of on a specific server
|
||||
* @param server the server to check
|
||||
* @param world the world to check
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getLocalGroups(String server, String world);
|
||||
|
||||
/**
|
||||
* Get a {@link List} of the groups the user is a member of on a specific server
|
||||
* @param server the server to check
|
||||
* @return a {@link List} of group names
|
||||
*/
|
||||
List<String> getLocalGroups(String server);
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package me.lucko.luckperms.api.data;
|
||||
|
||||
public interface Callback<T> {
|
||||
|
||||
void onComplete(T t);
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package me.lucko.luckperms.exceptions;
|
||||
|
||||
public class ObjectAlreadyHasException extends Exception {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package me.lucko.luckperms.exceptions;
|
||||
|
||||
public class ObjectLacksException extends Exception {
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api;
|
||||
|
||||
import net.luckperms.api.actionlog.ActionLogger;
|
||||
import net.luckperms.api.context.ContextCalculator;
|
||||
import net.luckperms.api.context.ContextManager;
|
||||
import net.luckperms.api.event.EventBus;
|
||||
import net.luckperms.api.messaging.MessagingService;
|
||||
import net.luckperms.api.messenger.MessengerProvider;
|
||||
import net.luckperms.api.metastacking.MetaStackDefinition;
|
||||
import net.luckperms.api.metastacking.MetaStackElement;
|
||||
import net.luckperms.api.metastacking.MetaStackFactory;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import net.luckperms.api.model.group.GroupManager;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.model.user.UserManager;
|
||||
import net.luckperms.api.node.NodeBuilderRegistry;
|
||||
import net.luckperms.api.platform.Platform;
|
||||
import net.luckperms.api.platform.PluginMetadata;
|
||||
import net.luckperms.api.track.Track;
|
||||
import net.luckperms.api.track.TrackManager;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* The LuckPerms API.
|
||||
*
|
||||
* <p>The API allows other plugins on the server to read and modify LuckPerms
|
||||
* data, change behaviour of the plugin, listen to certain events, and integrate
|
||||
* LuckPerms into other plugins and systems.</p>
|
||||
*
|
||||
* <p>This interface represents the base of the API package. All functions are
|
||||
* accessed via this interface.</p>
|
||||
*
|
||||
* <p>To start using the API, you need to obtain an instance of this interface.
|
||||
* These are registered by the LuckPerms plugin to the platforms Services
|
||||
* Manager. This is the preferred method for obtaining an instance.</p>
|
||||
*
|
||||
* <p>For ease of use, and for platforms without a Service Manager, an instance
|
||||
* can also be obtained from the static singleton accessor in
|
||||
* {@link LuckPermsProvider}.</p>
|
||||
*/
|
||||
public interface LuckPerms {
|
||||
|
||||
/**
|
||||
* Gets the name of this server.
|
||||
*
|
||||
* <p>This is defined in the LuckPerms configuration file, and is used for
|
||||
* server specific permission handling.</p>
|
||||
*
|
||||
* <p>The default server name is "global".</p>
|
||||
*
|
||||
* @return the server name
|
||||
*/
|
||||
@NonNull String getServerName();
|
||||
|
||||
/**
|
||||
* Gets the {@link UserManager}, responsible for managing
|
||||
* {@link User} instances.
|
||||
*
|
||||
* <p>This manager can be used to retrieve instances of {@link User} by uuid
|
||||
* or name, or query all loaded users.</p>
|
||||
*
|
||||
* @return the user manager
|
||||
*/
|
||||
@NonNull UserManager getUserManager();
|
||||
|
||||
/**
|
||||
* Gets the {@link GroupManager}, responsible for managing
|
||||
* {@link Group} instances.
|
||||
*
|
||||
* <p>This manager can be used to retrieve instances of {@link Group} by
|
||||
* name, or query all loaded groups.</p>
|
||||
*
|
||||
* @return the group manager
|
||||
*/
|
||||
@NonNull GroupManager getGroupManager();
|
||||
|
||||
/**
|
||||
* Gets the {@link TrackManager}, responsible for managing
|
||||
* {@link Track} instances.
|
||||
*
|
||||
* <p>This manager can be used to retrieve instances of {@link Track} by
|
||||
* name, or query all loaded tracks.</p>
|
||||
*
|
||||
* @return the track manager
|
||||
*/
|
||||
@NonNull TrackManager getTrackManager();
|
||||
|
||||
/**
|
||||
* Gets the {@link Platform}, which represents the server platform the
|
||||
* plugin is running on.
|
||||
*
|
||||
* @return the platform
|
||||
*/
|
||||
@NonNull Platform getPlatform();
|
||||
|
||||
/**
|
||||
* Gets the {@link PluginMetadata}, responsible for providing metadata about
|
||||
* the LuckPerms plugin currently running.
|
||||
*
|
||||
* @return the plugin metadata
|
||||
*/
|
||||
@NonNull PluginMetadata getPluginMetadata();
|
||||
|
||||
/**
|
||||
* Gets the {@link EventBus}, used for subscribing to internal LuckPerms
|
||||
* events.
|
||||
*
|
||||
* @return the event bus
|
||||
*/
|
||||
@NonNull EventBus getEventBus();
|
||||
|
||||
/**
|
||||
* Gets the {@link MessagingService}, used to dispatch updates throughout a
|
||||
* network of servers running the plugin.
|
||||
*
|
||||
* <p>Not all instances of LuckPerms will have a messaging service setup and
|
||||
* configured.</p>
|
||||
*
|
||||
* @return the messaging service instance, if present.
|
||||
*/
|
||||
@NonNull Optional<MessagingService> getMessagingService();
|
||||
|
||||
/**
|
||||
* Gets the {@link ActionLogger}, responsible for saving and broadcasting
|
||||
* defined actions occurring on the platform.
|
||||
*
|
||||
* @return the action logger
|
||||
*/
|
||||
@NonNull ActionLogger getActionLogger();
|
||||
|
||||
/**
|
||||
* Gets the {@link ContextManager}, responsible for managing
|
||||
* {@link ContextCalculator}s, and calculating applicable contexts.
|
||||
*
|
||||
* @return the context manager
|
||||
*/
|
||||
@NonNull ContextManager getContextManager();
|
||||
|
||||
/**
|
||||
* Gets the {@link NodeBuilderRegistry}.
|
||||
*
|
||||
* @return the node builder registry
|
||||
*/
|
||||
@NonNull NodeBuilderRegistry getNodeBuilderRegistry();
|
||||
|
||||
/**
|
||||
* Gets the {@link MetaStackFactory}.
|
||||
*
|
||||
* <p>The metastack factory provides methods for retrieving
|
||||
* {@link MetaStackElement}s and constructing
|
||||
* {@link MetaStackDefinition}s.</p>
|
||||
*
|
||||
* @return the meta stack factory
|
||||
*/
|
||||
@NonNull MetaStackFactory getMetaStackFactory();
|
||||
|
||||
/**
|
||||
* Schedules the execution of an update task, and returns an encapsulation
|
||||
* of the task as a {@link CompletableFuture}.
|
||||
*
|
||||
* <p>The exact actions performed in an update task remains an
|
||||
* implementation detail of the plugin, however, as a minimum, it is
|
||||
* expected to perform a full reload of user, group and track data, and
|
||||
* ensure that any changes are fully applied and propagated.</p>
|
||||
*
|
||||
* @return a future
|
||||
*/
|
||||
@NonNull CompletableFuture<Void> runUpdateTask();
|
||||
|
||||
/**
|
||||
* Registers a {@link MessengerProvider} for use by the platform.
|
||||
*
|
||||
* <p>Note that the mere action of registering a provider doesn't
|
||||
* necessarily mean that it will be used.</p>
|
||||
*
|
||||
* @param messengerProvider the messenger provider.
|
||||
*/
|
||||
void registerMessengerProvider(@NonNull MessengerProvider messengerProvider);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Provides static access to the {@link LuckPerms} service.
|
||||
*
|
||||
* <p>Ideally, the ServiceManager for the platform should be used to obtain an
|
||||
* instance, however, this provider can be used if you need static access.</p>
|
||||
*/
|
||||
public final class LuckPermsProvider {
|
||||
private static LuckPerms instance = null;
|
||||
|
||||
/**
|
||||
* Gets an instance of the {@link LuckPerms} service,
|
||||
* throwing {@link IllegalStateException} if an instance is not yet loaded.
|
||||
*
|
||||
* <p>Will never return null.</p>
|
||||
*
|
||||
* @return an api instance
|
||||
* @throws IllegalStateException if the api is not loaded
|
||||
*/
|
||||
public static @NonNull LuckPerms get() {
|
||||
if (instance == null) {
|
||||
throw new IllegalStateException("The LuckPerms API is not loaded.");
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
static void register(LuckPerms instance) {
|
||||
LuckPermsProvider.instance = instance;
|
||||
}
|
||||
|
||||
static void unregister() {
|
||||
LuckPermsProvider.instance = null;
|
||||
}
|
||||
|
||||
private LuckPermsProvider() {
|
||||
throw new UnsupportedOperationException("This class cannot be instantiated.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.actionlog;
|
||||
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a logged action.
|
||||
*/
|
||||
public interface Action extends Comparable<Action> {
|
||||
|
||||
/**
|
||||
* Gets a {@link Action.Builder}
|
||||
*
|
||||
* @return a new builder
|
||||
*/
|
||||
static @NonNull Builder builder() {
|
||||
return LuckPermsProvider.get().getActionLogger().actionBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the time when the action occurred.
|
||||
*
|
||||
* @return the timestamp
|
||||
*/
|
||||
@NonNull Instant getTimestamp();
|
||||
|
||||
/**
|
||||
* Gets the source of the action.
|
||||
*
|
||||
* @return the source
|
||||
*/
|
||||
@NonNull Source getSource();
|
||||
|
||||
/**
|
||||
* Gets the target of the action.
|
||||
*
|
||||
* @return the target
|
||||
*/
|
||||
@NonNull Target getTarget();
|
||||
|
||||
/**
|
||||
* Returns a string describing the action which took place.
|
||||
*
|
||||
* <p>In most instances, this returns a variation of the command string which caused
|
||||
* the change.</p>
|
||||
*
|
||||
* @return the action
|
||||
*/
|
||||
@NonNull String getDescription();
|
||||
|
||||
/**
|
||||
* Represents the source of an action.
|
||||
*/
|
||||
interface Source {
|
||||
|
||||
/**
|
||||
* Gets the source unique id.
|
||||
*
|
||||
* @return the source unique id
|
||||
*/
|
||||
@NonNull UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Gets the source name.
|
||||
*
|
||||
* @return the source name
|
||||
*/
|
||||
@NonNull String getName();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the target of an action.
|
||||
*/
|
||||
interface Target {
|
||||
|
||||
/**
|
||||
* Gets the target unique id.
|
||||
*
|
||||
* @return the target unique id
|
||||
*/
|
||||
@NonNull Optional<UUID> getUniqueId();
|
||||
|
||||
/**
|
||||
* Gets the target name.
|
||||
*
|
||||
* @return the target name
|
||||
*/
|
||||
@NonNull String getName();
|
||||
|
||||
/**
|
||||
* Gets the target type.
|
||||
*
|
||||
* @return the target type
|
||||
*/
|
||||
@NonNull Type getType();
|
||||
|
||||
/**
|
||||
* Represents the type of a {@link Target}.
|
||||
*/
|
||||
enum Type {
|
||||
USER, GROUP, TRACK
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an {@link Action} instance
|
||||
*/
|
||||
interface Builder {
|
||||
|
||||
/**
|
||||
* Sets the timestamp of the entry.
|
||||
*
|
||||
* @param timestamp the timestamp
|
||||
* @return the builder
|
||||
* @see Action#getTimestamp()
|
||||
*/
|
||||
@NonNull Builder timestamp(@NonNull Instant timestamp);
|
||||
|
||||
/**
|
||||
* Sets the actor of the entry.
|
||||
*
|
||||
* @param actor the actor
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder source(@NonNull UUID actor);
|
||||
|
||||
/**
|
||||
* Sets the actor name of the entry.
|
||||
*
|
||||
* @param actorName the actor name
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder sourceName(@NonNull String actorName);
|
||||
|
||||
/**
|
||||
* Sets the type of the entry.
|
||||
*
|
||||
* @param type the type
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder targetType(Action.Target.Type type);
|
||||
|
||||
/**
|
||||
* Sets the acted object for the entry.
|
||||
*
|
||||
* @param acted the acted object
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder target(@Nullable UUID acted);
|
||||
|
||||
/**
|
||||
* Sets the acted name for the entry.
|
||||
*
|
||||
* @param actedName the acted name
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder targetName(@NonNull String actedName);
|
||||
|
||||
/**
|
||||
* Sets the action of the entry.
|
||||
*
|
||||
* @param action the action
|
||||
* @return the builder
|
||||
*/
|
||||
@NonNull Builder description(@NonNull String action);
|
||||
|
||||
/**
|
||||
* Creates a {@link Action} instance from the builder.
|
||||
*
|
||||
* @return a new log entry instance
|
||||
*/
|
||||
@NonNull Action build();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.actionlog;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.SortedSet;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents the internal LuckPerms log.
|
||||
*
|
||||
* <p>The returned instance provides a copy of the data at the time of retrieval.</p>
|
||||
*
|
||||
* <p>Any changes made to log entries will only apply to this instance of the log.
|
||||
* You can add to the log using the {@link ActionLogger}, and then request an updated copy.</p>
|
||||
*
|
||||
* <p>All methods are thread safe, and return immutable and thread safe collections.</p>
|
||||
*/
|
||||
public interface ActionLog {
|
||||
|
||||
/**
|
||||
* Gets the {@link Action}s that make up this log.
|
||||
*
|
||||
* @return the content
|
||||
*/
|
||||
@NonNull SortedSet<Action> getContent();
|
||||
|
||||
/**
|
||||
* Gets the entries in the log performed by the given actor.
|
||||
*
|
||||
* @param actor the uuid of the actor to filter by
|
||||
* @return the content for the given actor
|
||||
*/
|
||||
@NonNull SortedSet<Action> getContent(@NonNull UUID actor);
|
||||
|
||||
/**
|
||||
* Gets the log content for a given user
|
||||
*
|
||||
* @param uniqueId the uuid to filter by
|
||||
* @return all content in this log where the user = uuid
|
||||
*/
|
||||
@NonNull SortedSet<Action> getUserHistory(@NonNull UUID uniqueId);
|
||||
|
||||
/**
|
||||
* Gets the log content for a given group
|
||||
*
|
||||
* @param name the name to filter by
|
||||
* @return all content in this log where the group = name
|
||||
*/
|
||||
@NonNull SortedSet<Action> getGroupHistory(@NonNull String name);
|
||||
|
||||
/**
|
||||
* Gets the log content for a given track
|
||||
*
|
||||
* @param name the name to filter by
|
||||
* @return all content in this log where the track = name
|
||||
*/
|
||||
@NonNull SortedSet<Action> getTrackHistory(@NonNull String name);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.actionlog;
|
||||
|
||||
import net.luckperms.api.messaging.MessagingService;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Represents the object responsible for handling action logging.
|
||||
*/
|
||||
public interface ActionLogger {
|
||||
|
||||
/**
|
||||
* Returns a new {@link Action.Builder} instance
|
||||
*
|
||||
* @return a new builder
|
||||
*/
|
||||
Action.@NonNull Builder actionBuilder();
|
||||
|
||||
/**
|
||||
* Gets a {@link ActionLog} instance from the plugin storage.
|
||||
*
|
||||
* @return a log instance
|
||||
*/
|
||||
@NonNull CompletableFuture<ActionLog> getLog();
|
||||
|
||||
/**
|
||||
* Submits a log entry to the plugin to be handled.
|
||||
*
|
||||
* <p>This method submits the log to the storage provider and broadcasts
|
||||
* it.</p>
|
||||
*
|
||||
* <p>It is therefore roughly equivalent to calling
|
||||
* {@link #submitToStorage(Action)} and {@link #broadcastAction(Action)},
|
||||
* however, using this method is preferred to making the calls individually.</p>
|
||||
*
|
||||
* <p>If you want to submit a log entry but don't know which method to pick,
|
||||
* use this one.</p>
|
||||
*
|
||||
* @param entry the entry to submit
|
||||
* @return a future which will complete when the action is done
|
||||
*/
|
||||
@NonNull CompletableFuture<Void> submit(@NonNull Action entry);
|
||||
|
||||
/**
|
||||
* Submits a log entry to the plugins storage handler.
|
||||
*
|
||||
* @param entry the entry to submit
|
||||
* @return a future which will complete when the action is done
|
||||
*/
|
||||
@NonNull CompletableFuture<Void> submitToStorage(@NonNull Action entry);
|
||||
|
||||
/**
|
||||
* Submits a log entry to the plugins log broadcasting handler.
|
||||
*
|
||||
* <p>If enabled, this method will also dispatch the log entry via the
|
||||
* plugins {@link MessagingService}.</p>
|
||||
*
|
||||
* @param entry the entry to submit
|
||||
* @return a future which will complete when the action is done
|
||||
*/
|
||||
@NonNull CompletableFuture<Void> broadcastAction(@NonNull Action entry);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.cacheddata;
|
||||
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Holds cached lookup data for a given set of query options.
|
||||
*/
|
||||
public interface CachedData {
|
||||
|
||||
/**
|
||||
* Gets the query options this container is holding data for.
|
||||
*
|
||||
* @return the query options this container is caching
|
||||
*/
|
||||
@NonNull QueryOptions getQueryOptions();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.cacheddata;
|
||||
|
||||
import net.luckperms.api.model.PermissionHolder;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Holds cached permission and meta lookup data for a {@link PermissionHolder}.
|
||||
*
|
||||
* <p>All calls will account for inheritance, as well as any default data
|
||||
* provided by the platform. This calls are heavily cached and are therefore
|
||||
* fast.</p>
|
||||
*/
|
||||
public interface CachedDataManager {
|
||||
|
||||
/**
|
||||
* Gets the manager for {@link CachedPermissionData}.
|
||||
*
|
||||
* @return the permission data manager
|
||||
*/
|
||||
@NonNull Container<CachedPermissionData> permissionData();
|
||||
|
||||
/**
|
||||
* Gets the manager for {@link CachedMetaData}.
|
||||
*
|
||||
* @return the meta data manager
|
||||
*/
|
||||
@NonNull Container<CachedMetaData> metaData();
|
||||
|
||||
/**
|
||||
* Gets PermissionData from the cache, given a specified context.
|
||||
*
|
||||
* @param queryOptions the query options
|
||||
* @return a permission data instance
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
@NonNull CachedPermissionData getPermissionData(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* Gets MetaData from the cache, given a specified context.
|
||||
*
|
||||
* @param queryOptions the query options
|
||||
* @return a meta data instance
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
@NonNull CachedMetaData getMetaData(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* Invalidates all cached {@link CachedPermissionData} and {@link CachedMetaData}
|
||||
* instances.
|
||||
*/
|
||||
void invalidate();
|
||||
|
||||
/**
|
||||
* Invalidates all of the underlying Permission calculators.
|
||||
*
|
||||
* <p>Can be called to allow for an update in defaults.</p>
|
||||
*/
|
||||
void invalidatePermissionCalculators();
|
||||
|
||||
/**
|
||||
* Manages a specific type of {@link CachedData cached data} within
|
||||
* a {@link CachedDataManager} instance.
|
||||
*
|
||||
* @param <T> the data type
|
||||
*/
|
||||
interface Container<T extends CachedData> {
|
||||
|
||||
/**
|
||||
* Gets {@link T data} from the cache.
|
||||
*
|
||||
* @param queryOptions the query options
|
||||
* @return a data instance
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
@NonNull T get(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* Calculates {@link T data}, bypassing the cache.
|
||||
*
|
||||
* <p>The result of this operation is calculated each time the method is called.
|
||||
* The result is not added to the internal cache.</p>
|
||||
*
|
||||
* <p>It is therefore highly recommended to use {@link #get(QueryOptions)} instead.</p>
|
||||
*
|
||||
* <p>The use cases of this method are more around constructing one-time
|
||||
* instances of {@link T data}, without adding the result to the cache.</p>
|
||||
*
|
||||
* @param queryOptions the query options
|
||||
* @return a data instance
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
@NonNull T calculate(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* (Re)calculates data for a given context.
|
||||
*
|
||||
* <p>This method returns immediately in all cases. The (re)calculation is
|
||||
* performed asynchronously and applied to the cache in the background.</p>
|
||||
*
|
||||
* <p>If there was a previous data instance associated with
|
||||
* the given {@link QueryOptions}, then that instance will continue to be returned by
|
||||
* {@link #get(QueryOptions)} until the recalculation is completed.</p>
|
||||
*
|
||||
* <p>If there was no value calculated and cached prior to the call of this
|
||||
* method, then one will be calculated.</p>
|
||||
*
|
||||
* @param queryOptions the query options
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
void recalculate(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* (Re)loads permission data for a given context.
|
||||
*
|
||||
* <p>Unlike {@link #recalculate(QueryOptions)}, this method immediately
|
||||
* invalidates any previous data values contained within the cache,
|
||||
* and then schedules a task to reload a new data instance to
|
||||
* replace the one which was invalidated.</p>
|
||||
*
|
||||
* <p>The invalidation happens immediately during the execution of this method.
|
||||
* The result of the re-computation encapsulated by the future.</p>
|
||||
*
|
||||
* <p>Subsequent calls to {@link #get(QueryOptions)} will block until
|
||||
* the result of this operation is complete.</p>
|
||||
*
|
||||
* <p>If there was no value calculated and cached prior to the call of this
|
||||
* method, then one will be calculated.</p>
|
||||
*
|
||||
* <p>This method returns a Future so users can optionally choose to wait
|
||||
* until the recalculation has been performed.</p>
|
||||
*
|
||||
* @param queryOptions the query options.
|
||||
* @return a future
|
||||
* @throws NullPointerException if contexts is null
|
||||
*/
|
||||
@NonNull CompletableFuture<? extends T> reload(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* Recalculates data for all known contexts.
|
||||
*
|
||||
* <p>This method returns immediately. The recalculation is performed
|
||||
* asynchronously and applied to the cache in the background.</p>
|
||||
*
|
||||
* <p>The previous data instances will continue to be returned
|
||||
* by {@link #get(QueryOptions)} until the recalculation is completed.</p>
|
||||
*/
|
||||
void recalculate();
|
||||
|
||||
/**
|
||||
* Reloads permission data for all known contexts.
|
||||
*
|
||||
* <p>Unlike {@link #recalculate()}, this method immediately
|
||||
* invalidates all previous data values contained within the cache,
|
||||
* and then schedules a task to reload new data instances to
|
||||
* replace the ones which were invalidated.</p>
|
||||
*
|
||||
* <p>The invalidation happens immediately during the execution of this method.
|
||||
* The result of the re-computation encapsulated by the future.</p>
|
||||
*
|
||||
* <p>Subsequent calls to {@link #get(QueryOptions)} will block until
|
||||
* the result of this operation is complete.</p>
|
||||
*
|
||||
* <p>This method returns a Future so users can optionally choose to wait
|
||||
* until the recalculation has been performed.</p>
|
||||
*
|
||||
* @return a future
|
||||
*/
|
||||
@NonNull CompletableFuture<Void> reload();
|
||||
|
||||
/**
|
||||
* Invalidates any cached data instances mapped to the given context.
|
||||
*
|
||||
* @param queryOptions the queryOptions to invalidate for
|
||||
*/
|
||||
void invalidate(@NonNull QueryOptions queryOptions);
|
||||
|
||||
/**
|
||||
* Invalidates all cached data instances.
|
||||
*/
|
||||
void invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.cacheddata;
|
||||
|
||||
import net.luckperms.api.metastacking.MetaStackDefinition;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
|
||||
/**
|
||||
* Holds cached meta lookup data for a specific set of contexts.
|
||||
*/
|
||||
public interface CachedMetaData extends CachedData {
|
||||
|
||||
/**
|
||||
* Gets a value for the given meta key.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the value
|
||||
*/
|
||||
@Nullable String getMetaValue(String key);
|
||||
|
||||
/**
|
||||
* Gets the user's highest priority prefix, or null if the user has no prefixes
|
||||
*
|
||||
* @return a prefix string, or null
|
||||
*/
|
||||
@Nullable String getPrefix();
|
||||
|
||||
/**
|
||||
* Gets the user's highest priority suffix, or null if the user has no suffixes
|
||||
*
|
||||
* @return a suffix string, or null
|
||||
*/
|
||||
@Nullable String getSuffix();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the meta this user has.
|
||||
*
|
||||
* @return an immutable map of meta
|
||||
*/
|
||||
@NonNull Map<String, List<String>> getMeta();
|
||||
|
||||
/**
|
||||
* Gets an immutable sorted map of all of the prefixes the user has, whereby the first value is the highest priority
|
||||
* prefix.
|
||||
*
|
||||
* @return a sorted map of prefixes
|
||||
*/
|
||||
@NonNull SortedMap<Integer, String> getPrefixes();
|
||||
|
||||
/**
|
||||
* Gets an immutable sorted map of all of the suffixes the user has, whereby the first value is the highest priority
|
||||
* suffix.
|
||||
*
|
||||
* @return a sorted map of suffixes
|
||||
*/
|
||||
@NonNull SortedMap<Integer, String> getSuffixes();
|
||||
|
||||
/**
|
||||
* Gets the definition used for the prefix stack
|
||||
*
|
||||
* @return the definition used for the prefix stack
|
||||
*/
|
||||
@NonNull MetaStackDefinition getPrefixStackDefinition();
|
||||
|
||||
/**
|
||||
* Gets the definition used for the suffix stack
|
||||
*
|
||||
* @return the definition used for the suffix stack
|
||||
*/
|
||||
@NonNull MetaStackDefinition getSuffixStackDefinition();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.cacheddata;
|
||||
|
||||
import net.luckperms.api.util.Tristate;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Holds cached permission lookup data for a specific set of contexts.
|
||||
*/
|
||||
public interface CachedPermissionData extends CachedData {
|
||||
|
||||
/**
|
||||
* Gets a permission check result for the given permission node.
|
||||
*
|
||||
* @param permission the permission node
|
||||
* @return a tristate result
|
||||
* @throws NullPointerException if permission is null
|
||||
*/
|
||||
@NonNull Tristate checkPermission(@NonNull String permission);
|
||||
|
||||
/**
|
||||
* Invalidates the underlying permission calculator cache.
|
||||
*
|
||||
* <p>Can be called to allow for an update in defaults.</p>
|
||||
*/
|
||||
void invalidateCache();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the permission map backing the permission calculator
|
||||
*
|
||||
* @return an immutable set of permissions
|
||||
*/
|
||||
@NonNull Map<String, Boolean> getPermissionMap();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an individual context pair.
|
||||
*/
|
||||
public interface Context {
|
||||
|
||||
/**
|
||||
* Gets the context key.
|
||||
*
|
||||
* @return the key
|
||||
*/
|
||||
@NonNull String getKey();
|
||||
|
||||
/**
|
||||
* Gets the context value
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
@NonNull String getValue();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Calculates the contexts applicable for a contextual subject.
|
||||
*
|
||||
* <p>Implementations of this interface should satisfy the following
|
||||
* requirements:</p>
|
||||
* <ul>
|
||||
* <li>Context lookups should be <i>fast</i>: lookup methods are likely to
|
||||
* be invoked frequently, and should therefore be fast to execute. If
|
||||
* determining the current contexts involves a particularly time consuming
|
||||
* lookup (database queries, network requests, etc), then such results
|
||||
* should be cached ahead of time.</li>
|
||||
*
|
||||
* <li>Context lookups should be <i>thread-safe</i>: lookups will sometimes
|
||||
* be performed from "async" threads, and therefore should not access any
|
||||
* part of the server only safe for access from a sync context. If
|
||||
* necessary, such results should be determined ahead of time and stored in
|
||||
* a thread-safe collection for retrieval later.</li>
|
||||
*
|
||||
* <li>Context lookups should <i>not query active contexts</i>: doing so is
|
||||
* likely to result in a stack overflow, or thread deadlock. Care should be
|
||||
* taken to avoid (indirect) calls to the same calculator.</li>
|
||||
* </ul>
|
||||
* <p></p>
|
||||
*
|
||||
* <p>Calculators should be registered using
|
||||
* {@link ContextManager#registerCalculator(ContextCalculator)}.</p>
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ContextCalculator<T> {
|
||||
|
||||
/**
|
||||
* Creates a new {@link ContextCalculator} that provides a single context.
|
||||
*
|
||||
* @param key the key of the context provided by the calculator
|
||||
* @param valueFunction the function used to compute the corresponding value
|
||||
* for each query. A context will not be "accumulated"
|
||||
* if the value returned is null.
|
||||
* @param <T> the contextual type
|
||||
* @return the resultant calculator
|
||||
*/
|
||||
static <T> @NonNull ContextCalculator<T> forSingleContext(@NonNull String key, @NonNull Function<T, String> valueFunction) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(valueFunction, "valueFunction");
|
||||
return (target, consumer) -> {
|
||||
String value = valueFunction.apply(target);
|
||||
if (value != null) {
|
||||
consumer.accept(key, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits any contexts this calculator determines to be applicable to
|
||||
* the {@code target} contextual subject.
|
||||
*
|
||||
* <p>Care should be taken to ensure implementations of this method meet the
|
||||
* general requirements for {@link ContextCalculator}, defined in the class
|
||||
* doc.</p>
|
||||
*
|
||||
* @param target the target contextual subject for this operation
|
||||
* @param consumer the {@link ContextConsumer} to submit contexts to
|
||||
*/
|
||||
void calculate(@NonNull T target, @NonNull ContextConsumer consumer);
|
||||
|
||||
/**
|
||||
* Gets a {@link ContextSet}, containing some/all of the contexts this
|
||||
* calculator could potentially submit.
|
||||
*
|
||||
* <p>The result of this call is primarily intended on providing
|
||||
* suggestions to end users when defining permissions.</p>
|
||||
*
|
||||
* @return a set of potential contexts
|
||||
*/
|
||||
default ContextSet estimatePotentialContexts() {
|
||||
return ImmutableContextSet.empty();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Functional interface that accepts context key value pairs.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ContextConsumer {
|
||||
|
||||
/**
|
||||
* Accepts a context pair.
|
||||
*
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
*/
|
||||
void accept(@NonNull String key, @NonNull String value);
|
||||
|
||||
/**
|
||||
* Accepts a context pair.
|
||||
*
|
||||
* @param context the context
|
||||
*/
|
||||
default void accept(@NonNull Context context) {
|
||||
accept(context.getKey(), context.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a context set.
|
||||
*
|
||||
* @param contextSet the context set
|
||||
*/
|
||||
default void accept(@NonNull ContextSet contextSet) {
|
||||
for (Context entry : contextSet) {
|
||||
accept(entry);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.query.QueryMode;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Manages {@link ContextCalculator}s, and calculates applicable contexts for a
|
||||
* given type.
|
||||
*
|
||||
* This interface accepts {@link Object} types as a parameter to avoid having to depend
|
||||
* on specific server implementations. In all cases, the "player" or "subject" type for
|
||||
* the platform must be used.
|
||||
*
|
||||
* Specifically:
|
||||
*
|
||||
* <p></p>
|
||||
* <ul>
|
||||
* <li>{@code org.bukkit.entity.Player}</li>
|
||||
* <li>{@code net.md_5.bungee.api.connection.ProxiedPlayer}</li>
|
||||
* <li>{@code org.spongepowered.api.service.permission.Subject}</li>
|
||||
* <li>{@code cn.nukkit.Player}</li>
|
||||
* <li>{@code com.velocitypowered.api.proxy.Player}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public interface ContextManager {
|
||||
|
||||
/**
|
||||
* Queries the ContextManager for current context values for the subject.
|
||||
*
|
||||
* @param subject the subject
|
||||
* @return the applicable context for the subject
|
||||
*/
|
||||
@NonNull ImmutableContextSet getContext(@NonNull Object subject);
|
||||
|
||||
/**
|
||||
* Queries the ContextManager for current context values for the given User.
|
||||
*
|
||||
* <p>This will only return a value if the player corresponding to the
|
||||
* {@link User} is online.</p>
|
||||
*
|
||||
* <p>If you need to obtain a {@link ImmutableContextSet} instance
|
||||
* regardless, you should initially try this method, and then fallback on
|
||||
* {@link #getStaticContext()}.</p>
|
||||
*
|
||||
* @param user the user
|
||||
* @return the applicable context for the subject
|
||||
*/
|
||||
@NonNull Optional<ImmutableContextSet> getContext(@NonNull User user);
|
||||
|
||||
/**
|
||||
* Gets the contexts from the static calculators in this manager.
|
||||
*
|
||||
* <p>Static calculators provide the same context for all subjects, and are
|
||||
* marked as such when registered.</p>
|
||||
*
|
||||
* @return the current active static contexts
|
||||
*/
|
||||
@NonNull ImmutableContextSet getStaticContext();
|
||||
|
||||
/**
|
||||
* Creates a new {@link QueryOptions.Builder}.
|
||||
*
|
||||
* @param mode the mode
|
||||
* @return a new query options builder
|
||||
*/
|
||||
QueryOptions.@NonNull Builder queryOptionsBuilder(@NonNull QueryMode mode);
|
||||
|
||||
/**
|
||||
* Obtains current {@link QueryOptions} for the subject.
|
||||
*
|
||||
* @param subject the subject
|
||||
* @return the query options for the subject
|
||||
*/
|
||||
@NonNull QueryOptions getQueryOptions(@NonNull Object subject);
|
||||
|
||||
/**
|
||||
* Obtains current {@link QueryOptions} for the given User.
|
||||
*
|
||||
* <p>This will only return a value if the player corresponding to the
|
||||
* {@link User} is online.</p>
|
||||
*
|
||||
* <p>If you need to obtain a {@link QueryOptions} instance regardless, you should
|
||||
* initially try this method, and then fallback on {@link #getStaticQueryOptions()}.</p>
|
||||
*
|
||||
* @param user the user
|
||||
* @return the query options for the subject
|
||||
*/
|
||||
@NonNull Optional<QueryOptions> getQueryOptions(@NonNull User user);
|
||||
|
||||
/**
|
||||
* Gets the static query options, using the registered static context calculators.
|
||||
*
|
||||
* @return the current static query options
|
||||
*/
|
||||
@NonNull QueryOptions getStaticQueryOptions();
|
||||
|
||||
/**
|
||||
* Registers a context calculator with the manager.
|
||||
*
|
||||
* @param calculator the calculator
|
||||
*/
|
||||
void registerCalculator(@NonNull ContextCalculator<?> calculator);
|
||||
|
||||
/**
|
||||
* Unregisters a context calculator with the manager.
|
||||
*
|
||||
* @param calculator the calculator
|
||||
*/
|
||||
void unregisterCalculator(@NonNull ContextCalculator<?> calculator);
|
||||
|
||||
/**
|
||||
* Gets the {@link ContextSetFactory}, responsible for creating
|
||||
* {@link ContextSet} instances.
|
||||
*
|
||||
* @return the context set factory
|
||||
*/
|
||||
@NonNull ContextSetFactory getContextSetFactory();
|
||||
|
||||
/**
|
||||
* Invalidates the lookup cache for a given subject
|
||||
*
|
||||
* @param subject the subject
|
||||
*/
|
||||
void invalidateCache(@NonNull Object subject);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A set of contexts.
|
||||
*
|
||||
* <p>Context in the most basic sense simply means the circumstances where
|
||||
* something will apply.</p>
|
||||
*
|
||||
* <p>A single "context" consists of a key and a value, both strings. The key
|
||||
* represents the type of context, and the value represents the setting of the
|
||||
* context key.</p>
|
||||
*
|
||||
* <p>Contexts can be combined with each other to form so called
|
||||
* "context sets" - simply a collection of context pairs.</p>
|
||||
*
|
||||
* <p>Context keys and values are case-insensitive, and will be converted to
|
||||
* {@link String#toLowerCase() lowercase} by all implementations.</p>
|
||||
*
|
||||
* <p>Context keys and values may not be null or empty. A key/value will be
|
||||
* deemed empty if it's length is zero, or if it consists of only space
|
||||
* characters.</p>
|
||||
*
|
||||
* <p>Two default ContextSet implementations are provided.
|
||||
* {@link MutableContextSet} allows the addition and removal of context keys
|
||||
* after construction, and {@link ImmutableContextSet} does not.</p>
|
||||
*/
|
||||
public interface ContextSet extends Iterable<Context> {
|
||||
|
||||
/**
|
||||
* Gets if this {@link ContextSet} is immutable.
|
||||
*
|
||||
* <p>The state of immutable instances will never change.</p>
|
||||
*
|
||||
* @return true if the set is immutable
|
||||
*/
|
||||
boolean isImmutable();
|
||||
|
||||
/**
|
||||
* Returns an immutable representation of this {@link ContextSet}.
|
||||
*
|
||||
* <p>If the set is already immutable, the same object will be returned.
|
||||
* If the set is mutable, an immutable copy will be made.</p>
|
||||
*
|
||||
* @return an immutable representation of this set
|
||||
*/
|
||||
@NonNull ImmutableContextSet immutableCopy();
|
||||
|
||||
/**
|
||||
* Creates a mutable copy of this {@link ContextSet}.
|
||||
*
|
||||
* <p>A new copy is returned regardless of the
|
||||
* {@link #isImmutable() mutability} of this set.</p>
|
||||
*
|
||||
* @return a mutable ContextSet
|
||||
*/
|
||||
@NonNull MutableContextSet mutableCopy();
|
||||
|
||||
/**
|
||||
* Returns a {@link Set} of {@link Context}s representing the current
|
||||
* state of this {@link ContextSet}.
|
||||
*
|
||||
* <p>The returned set is immutable, and is a copy of the current set.
|
||||
* (will not update live)</p>
|
||||
*
|
||||
* @return an immutable set
|
||||
*/
|
||||
@NonNull Set<Context> toSet();
|
||||
|
||||
/**
|
||||
* Returns a {@link Map} representing the current state of this
|
||||
* {@link ContextSet}.
|
||||
*
|
||||
* <p>The returned set is immutable, and is a copy of the current set.
|
||||
* (will not update live)</p>
|
||||
*
|
||||
* @return a map
|
||||
*/
|
||||
@NonNull Map<String, Set<String>> toMap();
|
||||
|
||||
/**
|
||||
* Returns a {@link Map} <b>loosely</b> representing the current state of
|
||||
* this {@link ContextSet}.
|
||||
*
|
||||
* <p>The returned map is immutable, and is a copy of the current set.
|
||||
* (will not update live)</p>
|
||||
*
|
||||
* <p>As a single context key can be mapped to multiple values, this method
|
||||
* may not be a true representation of the set.</p>
|
||||
*
|
||||
* @return an immutable map
|
||||
* @deprecated because the resultant map may not contain all data in the ContextSet
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull Map<String, String> toFlattenedMap();
|
||||
|
||||
/**
|
||||
* Returns an {@link Iterator} over each of the context pairs in this set.
|
||||
*
|
||||
* <p>The returned iterator represents the state of the set at the time of creation. It is not
|
||||
* updated as the set changes.</p>
|
||||
*
|
||||
* <p>The iterator does not support {@link Iterator#remove()} calls.</p>
|
||||
*
|
||||
* @return an iterator
|
||||
*/
|
||||
@Override
|
||||
@NonNull Iterator<Context> iterator();
|
||||
|
||||
/**
|
||||
* Returns if the {@link ContextSet} contains at least one value for the
|
||||
* given key.
|
||||
*
|
||||
* @param key the key to check for
|
||||
* @return true if the set contains a value for the key
|
||||
* @throws NullPointerException if the key is null
|
||||
*/
|
||||
boolean containsKey(@NonNull String key);
|
||||
|
||||
/**
|
||||
* Returns a {@link Set} of the values mapped to the given key.
|
||||
*
|
||||
* <p>The returned set is immutable, and only represents the current state
|
||||
* of the {@link ContextSet}. (will not update live)</p>
|
||||
*
|
||||
* @param key the key to get values for
|
||||
* @return a set of values
|
||||
* @throws NullPointerException if the key is null
|
||||
*/
|
||||
@NonNull Set<String> getValues(@NonNull String key);
|
||||
|
||||
/**
|
||||
* Returns any value from this {@link ContextSet} matching the key, if present.
|
||||
*
|
||||
* <p>Note that context keys can be mapped to multiple values.
|
||||
* Use {@link #getValues(String)} to retrieve all associated values.</p>
|
||||
*
|
||||
* @param key the key to find values for
|
||||
* @return an optional containing any match
|
||||
*/
|
||||
default @NonNull Optional<String> getAnyValue(@NonNull String key) {
|
||||
return getValues(key).stream().findAny();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the {@link ContextSet} contains a given context pairing.
|
||||
*
|
||||
* @param key the key to look for
|
||||
* @param value the value to look for
|
||||
* @return true if the set contains the context pair
|
||||
* @throws NullPointerException if the key or value is null
|
||||
*/
|
||||
boolean contains(@NonNull String key, @NonNull String value);
|
||||
|
||||
/**
|
||||
* Returns if the {@link ContextSet} contains a given context pairing.
|
||||
*
|
||||
* @param entry the entry to look for
|
||||
* @return true if the set contains the context pair
|
||||
* @throws NullPointerException if the key or value is null
|
||||
*/
|
||||
default boolean contains(@NonNull Context entry) {
|
||||
Objects.requireNonNull(entry, "entry");
|
||||
return contains(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this {@link ContextSet} is fully "satisfied" by another set.
|
||||
*
|
||||
* <p>For a context set to "satisfy" another, it must itself contain all of
|
||||
* the context pairings in the other set.</p>
|
||||
*
|
||||
* <p>Mathematically, this method returns true if this set is a <b>subset</b> of the other.</p>
|
||||
*
|
||||
* @param other the other set to check
|
||||
* @return true if all entries in this set are also in the other set
|
||||
*/
|
||||
boolean isSatisfiedBy(@NonNull ContextSet other);
|
||||
|
||||
/**
|
||||
* Returns if the {@link ContextSet} is empty.
|
||||
*
|
||||
* @return true if the set is empty
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
/**
|
||||
* Gets the number of context pairs in the {@link ContextSet}.
|
||||
*
|
||||
* @return the size of the set
|
||||
*/
|
||||
int size();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A factory for creating {@link ContextSet}s.
|
||||
*/
|
||||
public interface ContextSetFactory {
|
||||
|
||||
ImmutableContextSet.@NonNull Builder immutableBuilder();
|
||||
|
||||
@NonNull ImmutableContextSet immutableOf(@NonNull String key, @NonNull String value);
|
||||
|
||||
@NonNull ImmutableContextSet immutableEmpty();
|
||||
|
||||
@NonNull MutableContextSet mutable();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
/**
|
||||
* Some default context keys used by the plugin.
|
||||
*/
|
||||
public final class DefaultContextKeys {
|
||||
private DefaultContextKeys() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* The context key used to denote the subjects server.
|
||||
*/
|
||||
public static final String SERVER_KEY = "server";
|
||||
|
||||
/**
|
||||
* The context key used to denote the subjects world.
|
||||
*/
|
||||
public static final String WORLD_KEY = "world";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* An immutable implementation of {@link ContextSet}.
|
||||
*/
|
||||
public interface ImmutableContextSet extends ContextSet {
|
||||
|
||||
/**
|
||||
* Creates an {@link ImmutableContextSet.Builder}.
|
||||
*
|
||||
* @return a new ImmutableContextSet builder
|
||||
*/
|
||||
static @NonNull Builder builder() {
|
||||
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an empty {@link ImmutableContextSet}.
|
||||
*
|
||||
* @return an empty ImmutableContextSet
|
||||
*/
|
||||
static @NonNull ImmutableContextSet empty() {
|
||||
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an {@link ImmutableContextSet} from a context pair.
|
||||
*
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
* @return a new ImmutableContextSet containing one context pair
|
||||
* @throws NullPointerException if key or value is null
|
||||
*/
|
||||
static @NonNull ImmutableContextSet of(@NonNull String key, @NonNull String value) {
|
||||
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableOf(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Already immutable!
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
@NonNull ImmutableContextSet immutableCopy();
|
||||
|
||||
/**
|
||||
* A builder for {@link ImmutableContextSet}.
|
||||
*/
|
||||
interface Builder {
|
||||
|
||||
/**
|
||||
* Adds a context to the set.
|
||||
*
|
||||
* @param key the key to add
|
||||
* @param value the value to add
|
||||
* @return the builder
|
||||
* @throws NullPointerException if the key or value is null
|
||||
* @see MutableContextSet#add(String, String)
|
||||
*/
|
||||
@NonNull Builder add(@NonNull String key, @NonNull String value);
|
||||
|
||||
/**
|
||||
* Adds a context to the set.
|
||||
*
|
||||
* @param entry the entry to add
|
||||
* @return the builder
|
||||
* @throws NullPointerException if the entry is null
|
||||
* @see MutableContextSet#add(Context)
|
||||
*/
|
||||
default @NonNull Builder add(@NonNull Context entry) {
|
||||
Objects.requireNonNull(entry, "entry");
|
||||
add(entry.getKey(), entry.getValue());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the contexts contained in the given {@link Iterable} to the set.
|
||||
*
|
||||
* @param iterable an iterable of key value context pairs
|
||||
* @return the builder
|
||||
* @throws NullPointerException if iterable is null
|
||||
* @see MutableContextSet#addAll(Iterable)
|
||||
*/
|
||||
default @NonNull Builder addAll(@NonNull Iterable<Context> iterable) {
|
||||
for (Context e : Objects.requireNonNull(iterable, "iterable")) {
|
||||
add(e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds of of the contexts in another {@link ContextSet} to the set.
|
||||
*
|
||||
* @param contextSet the set to add from
|
||||
* @return the builder
|
||||
* @throws NullPointerException if the contextSet is null
|
||||
* @see MutableContextSet#addAll(ContextSet)
|
||||
*/
|
||||
@NonNull Builder addAll(@NonNull ContextSet contextSet);
|
||||
|
||||
/**
|
||||
* Creates a {@link ImmutableContextSet} from the values previously
|
||||
* added to the builder.
|
||||
*
|
||||
* @return an {@link ImmutableContextSet} from the builder
|
||||
*/
|
||||
@NonNull ImmutableContextSet build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A mutable implementation of {@link ContextSet}.
|
||||
*/
|
||||
public interface MutableContextSet extends ContextSet {
|
||||
|
||||
/**
|
||||
* Creates a new empty MutableContextSet.
|
||||
*
|
||||
* @return a new MutableContextSet
|
||||
*/
|
||||
static @NonNull MutableContextSet create() {
|
||||
return LuckPermsProvider.get().getContextManager().getContextSetFactory().mutable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link MutableContextSet} from a context pair.
|
||||
*
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
* @return a new MutableContextSet containing one context pair
|
||||
* @throws NullPointerException if key or value is null
|
||||
*/
|
||||
static @NonNull MutableContextSet of(@NonNull String key, @NonNull String value) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(value, "value");
|
||||
MutableContextSet set = create();
|
||||
set.add(key, value);
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a context to this set.
|
||||
*
|
||||
* @param key the key to add
|
||||
* @param value the value to add
|
||||
* @throws NullPointerException if the key or value is null
|
||||
*/
|
||||
void add(@NonNull String key, @NonNull String value);
|
||||
|
||||
/**
|
||||
* Adds a context to this set.
|
||||
*
|
||||
* @param entry the entry to add
|
||||
* @throws NullPointerException if the entry is null
|
||||
*/
|
||||
default void add(@NonNull Context entry) {
|
||||
Objects.requireNonNull(entry, "entry");
|
||||
add(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the contexts contained in the given {@link Iterable} to this set.
|
||||
*
|
||||
* @param iterable an iterable of key value context pairs
|
||||
* @throws NullPointerException if iterable is null
|
||||
*/
|
||||
default void addAll(@NonNull Iterable<Context> iterable) {
|
||||
for (Context e : Objects.requireNonNull(iterable, "iterable")) {
|
||||
add(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds of of the contexts in another {@link ContextSet} to this set.
|
||||
*
|
||||
* @param contextSet the set to add from
|
||||
* @throws NullPointerException if the contextSet is null
|
||||
*/
|
||||
void addAll(@NonNull ContextSet contextSet);
|
||||
|
||||
/**
|
||||
* Removes a context from this set.
|
||||
*
|
||||
* @param key the key to remove
|
||||
* @param value the value to remove
|
||||
* @throws NullPointerException if the key or value is null
|
||||
*/
|
||||
void remove(@NonNull String key, @NonNull String value);
|
||||
|
||||
/**
|
||||
* Removes all contexts from this set with the given key.
|
||||
*
|
||||
* @param key the key to remove
|
||||
* @throws NullPointerException if the key is null
|
||||
*/
|
||||
void removeAll(@NonNull String key);
|
||||
|
||||
/**
|
||||
* Removes all contexts from the set.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Extension of {@link ContextCalculator} which provides the same context
|
||||
* regardless of the subject.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface StaticContextCalculator extends ContextCalculator<Object> {
|
||||
|
||||
/**
|
||||
* Creates a new {@link StaticContextCalculator} that provides a single context.
|
||||
*
|
||||
* @param key the key of the context provided by the calculator
|
||||
* @param valueFunction the function used to compute the corresponding value
|
||||
* for each query. A context will not be "accumulated"
|
||||
* if the value returned is null.
|
||||
* @return the resultant calculator
|
||||
*/
|
||||
static StaticContextCalculator forSingleContext(String key, Supplier<String> valueFunction) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(valueFunction, "valueFunction");
|
||||
return consumer -> {
|
||||
String value = valueFunction.get();
|
||||
if (value != null) {
|
||||
consumer.accept(key, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits any contexts this calculator determines to be applicable.
|
||||
*
|
||||
* <p>Care should be taken to ensure implementations of this method meet the
|
||||
* general requirements for {@link ContextCalculator}, defined in the class
|
||||
* doc.</p>
|
||||
*
|
||||
* @param consumer the {@link ContextConsumer} to submit contexts to
|
||||
*/
|
||||
void calculate(@NonNull ContextConsumer consumer);
|
||||
|
||||
@Override
|
||||
default void calculate(@NonNull Object target, @NonNull ContextConsumer consumer) {
|
||||
calculate(consumer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* The LuckPerms event bus.
|
||||
*
|
||||
* <p>Used to subscribe (or "listen") to LuckPerms events.</p>
|
||||
*/
|
||||
public interface EventBus {
|
||||
|
||||
/**
|
||||
* Registers a new subscription to the given event.
|
||||
*
|
||||
* <p>The returned {@link EventSubscription} instance encapsulates the subscription state. It has
|
||||
* methods which can be used to terminate the subscription, or view stats about the nature of
|
||||
* the subscription.</p>
|
||||
*
|
||||
* @param eventClass the event class
|
||||
* @param handler the event handler
|
||||
* @param <T> the event class
|
||||
* @return an event handler instance representing this subscription
|
||||
*/
|
||||
@NonNull <T extends LuckPermsEvent> EventSubscription<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler);
|
||||
|
||||
/**
|
||||
* Registers a new subscription to the given event.
|
||||
*
|
||||
* <p>The returned {@link EventSubscription} instance encapsulates the subscription state. It has
|
||||
* methods which can be used to terminate the subscription, or view stats about the nature of
|
||||
* the subscription.</p>
|
||||
*
|
||||
* <p>Unlike {@link #subscribe(Class, Consumer)}, this method accepts an additional parameter
|
||||
* for {@code plugin}. This object must be a "plugin" instance on the platform, and is used to
|
||||
* automatically {@link EventSubscription#close() unregister} the subscription when the
|
||||
* corresponding plugin is disabled.</p>
|
||||
*
|
||||
* @param <T> the event class
|
||||
* @param plugin a plugin instance to bind the subscription to.
|
||||
* @param eventClass the event class
|
||||
* @param handler the event handler
|
||||
* @return an event handler instance representing this subscription
|
||||
*/
|
||||
@NonNull <T extends LuckPermsEvent> EventSubscription<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler);
|
||||
|
||||
/**
|
||||
* Gets a set of all registered handlers for a given event.
|
||||
*
|
||||
* @param eventClass the event to find handlers for
|
||||
* @param <T> the event class
|
||||
* @return an immutable set of event handlers
|
||||
*/
|
||||
@NonNull <T extends LuckPermsEvent> Set<EventSubscription<T>> getSubscriptions(@NonNull Class<T> eventClass);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Represents a subscription to a {@link LuckPermsEvent}.
|
||||
*
|
||||
* @param <T> the event class
|
||||
*/
|
||||
public interface EventSubscription<T extends LuckPermsEvent> extends AutoCloseable {
|
||||
|
||||
/**
|
||||
* Gets the class this handler is listening to
|
||||
*
|
||||
* @return the event class
|
||||
*/
|
||||
@NonNull Class<T> getEventClass();
|
||||
|
||||
/**
|
||||
* Returns true if this handler is active
|
||||
*
|
||||
* @return true if this handler is still active
|
||||
*/
|
||||
boolean isActive();
|
||||
|
||||
/**
|
||||
* Unregisters this handler from the event bus.
|
||||
*/
|
||||
@Override
|
||||
void close();
|
||||
|
||||
/**
|
||||
* Gets the event consumer responsible for handling the event
|
||||
*
|
||||
* @return the event consumer
|
||||
*/
|
||||
@NonNull Consumer<? super T> getHandler();
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A superinterface for all LuckPerms events.
|
||||
*/
|
||||
public interface LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Get the API instance this event was dispatched from
|
||||
*
|
||||
* @return the api instance
|
||||
*/
|
||||
@NonNull LuckPerms getLuckPerms();
|
||||
|
||||
/**
|
||||
* Gets the type of the event.
|
||||
*
|
||||
* @return the type of the event
|
||||
*/
|
||||
@NonNull Class<? extends LuckPermsEvent> getEventType();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.cause;
|
||||
|
||||
/**
|
||||
* The cause of a group/track creation
|
||||
*/
|
||||
public enum CreationCause {
|
||||
|
||||
/**
|
||||
* The creation was caused by a command
|
||||
*/
|
||||
COMMAND,
|
||||
|
||||
/**
|
||||
* The creation was caused by the web editor
|
||||
*/
|
||||
WEB_EDITOR,
|
||||
|
||||
/**
|
||||
* The creation was caused by an API call
|
||||
*/
|
||||
API,
|
||||
|
||||
/**
|
||||
* The creation was caused by a LuckPerms internal
|
||||
*/
|
||||
INTERNAL
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.cause;
|
||||
|
||||
/**
|
||||
* The cause of a group/track deletion
|
||||
*/
|
||||
public enum DeletionCause {
|
||||
|
||||
/**
|
||||
* The deletion was caused by a command
|
||||
*/
|
||||
COMMAND,
|
||||
|
||||
/**
|
||||
* The deletion was caused by an API call
|
||||
*/
|
||||
API,
|
||||
|
||||
/**
|
||||
* The deletion was caused by a LuckPerms internal
|
||||
*/
|
||||
INTERNAL
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.extension;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.extension.Extension;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when an {@link Extension} is loaded.
|
||||
*/
|
||||
public interface ExtensionLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the extension that was loaded.
|
||||
*
|
||||
* @return the extension
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Extension getExtension();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.cacheddata.CachedDataManager;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a groups {@link CachedDataManager} is loaded.
|
||||
*/
|
||||
public interface GroupCacheLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the group whose data was loaded
|
||||
*
|
||||
* @return the group
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Group getGroup();
|
||||
|
||||
/**
|
||||
* Gets the data that was loaded
|
||||
*
|
||||
* @return the loaded data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CachedDataManager getLoadedData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.event.cause.CreationCause;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a group is created
|
||||
*/
|
||||
public interface GroupCreateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the new group
|
||||
*
|
||||
* @return the new group
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Group getGroup();
|
||||
|
||||
/**
|
||||
* Gets the cause of the creation
|
||||
*
|
||||
* @return the cause of the creation
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CreationCause getCause();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.cacheddata.CachedDataManager;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a groups cached data is refreshed
|
||||
*/
|
||||
public interface GroupDataRecalculateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the group whose data was recalculated
|
||||
*
|
||||
* @return the group
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Group getGroup();
|
||||
|
||||
/**
|
||||
* Gets the data that was recalculated
|
||||
*
|
||||
* @return the data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CachedDataManager getData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.event.cause.DeletionCause;
|
||||
import net.luckperms.api.node.Node;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Called when a group is deleted
|
||||
*/
|
||||
public interface GroupDeleteEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the name of the deleted group
|
||||
*
|
||||
* @return the name of the deleted group
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull String getGroupName();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the groups existing data
|
||||
*
|
||||
* @return a copy of the groups existing data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull Set<Node> getExistingData();
|
||||
|
||||
/**
|
||||
* Gets the cause of the deletion
|
||||
*
|
||||
* @return the cause of the deletion
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull DeletionCause getCause();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
|
||||
/**
|
||||
* Called when all groups have been loaded in from storage.
|
||||
*
|
||||
* <p>Usually only called on startup and in sync tasks.</p>
|
||||
*/
|
||||
public interface GroupLoadAllEvent extends LuckPermsEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.group;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a group is loaded into memory from the storage.
|
||||
*
|
||||
* Note that this event is not the same as {@link GroupCreateEvent}
|
||||
*/
|
||||
public interface GroupLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the group that was loaded
|
||||
*
|
||||
* @return the group that was loaded
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Group getGroup();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.log;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a log entry is about to be sent to notifiable players on the platform
|
||||
*/
|
||||
public interface LogBroadcastEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the log entry to be broadcasted
|
||||
*
|
||||
* @return the log entry to be broadcasted
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Action getEntry();
|
||||
|
||||
/**
|
||||
* Gets where the log entry originated from.
|
||||
*
|
||||
* @return the origin of the log
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull Origin getOrigin();
|
||||
|
||||
/**
|
||||
* Represents where a log entry is from
|
||||
*/
|
||||
enum Origin {
|
||||
|
||||
/**
|
||||
* Marks a log entry which originated from the current server instance
|
||||
*/
|
||||
LOCAL,
|
||||
|
||||
/**
|
||||
* Marks a log entry which originated from an API call on the current server instance
|
||||
*/
|
||||
LOCAL_API,
|
||||
|
||||
/**
|
||||
* Marks a log entry which was sent to this server via the messaging service
|
||||
*/
|
||||
REMOTE
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.log;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when a log is about to be published to the network via the MessagingService
|
||||
*/
|
||||
public interface LogNetworkPublishEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the ID of the log entry being published
|
||||
*
|
||||
* @return the id of the log entry being published
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getLogId();
|
||||
|
||||
/**
|
||||
* Gets the log entry to be published
|
||||
*
|
||||
* @return the log entry to be published
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull Action getEntry();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.log;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.platform.PlatformEntity;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a log entry is about to be sent to specific notifiable object on
|
||||
* the platform.
|
||||
*
|
||||
* <p>This event is not called for players without the notify permission,
|
||||
* but is called for objects which are ignoring log notifications (called with
|
||||
* the cancelled flag set to true).</p>
|
||||
*/
|
||||
public interface LogNotifyEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the log entry to be sent
|
||||
*
|
||||
* @return the log entry to be sent
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Action getEntry();
|
||||
|
||||
/**
|
||||
* Gets where the log entry originated from.
|
||||
*
|
||||
* @return the origin of the log
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull Origin getOrigin();
|
||||
|
||||
/**
|
||||
* Gets the object to be notified.
|
||||
*
|
||||
* @return the object to notify
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull PlatformEntity getNotifiable();
|
||||
|
||||
/**
|
||||
* Represents where a log entry is from
|
||||
*/
|
||||
enum Origin {
|
||||
|
||||
/**
|
||||
* Marks a log entry which originated from the current server instance
|
||||
*/
|
||||
LOCAL,
|
||||
|
||||
/**
|
||||
* Marks a log entry which originated from an API call on the current server instance
|
||||
*/
|
||||
LOCAL_API,
|
||||
|
||||
/**
|
||||
* Marks a log entry which was sent to this server via the messaging service
|
||||
*/
|
||||
REMOTE
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.log;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a log is about to be published to the storage file/table
|
||||
*/
|
||||
public interface LogPublishEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the log entry to be published
|
||||
*
|
||||
* @return the log entry to be published
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Action getEntry();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.log;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when a log entry is received via the MessagingService
|
||||
*/
|
||||
public interface LogReceiveEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the ID of the log entry being received
|
||||
*
|
||||
* @return the id of the log entry being received
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getLogId();
|
||||
|
||||
/**
|
||||
* Gets the log entry being received
|
||||
*
|
||||
* @return the log entry being received
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull Action getEntry();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.node;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.node.Node;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a node is added to a holder
|
||||
*/
|
||||
public interface NodeAddEvent extends NodeMutateEvent {
|
||||
|
||||
/**
|
||||
* Gets the node that was added
|
||||
*
|
||||
* @return the node that was added
|
||||
*/
|
||||
@Param(4)
|
||||
@NonNull Node getNode();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.node;
|
||||
|
||||
/**
|
||||
* Called when a holder has their nodes cleared
|
||||
*/
|
||||
public interface NodeClearEvent extends NodeMutateEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.node;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.PermissionHolder;
|
||||
import net.luckperms.api.model.data.DataType;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.node.Node;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Called when a node is added to/removed from a user/group
|
||||
*/
|
||||
public interface NodeMutateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the target of the event
|
||||
*
|
||||
* @return the event target
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull PermissionHolder getTarget();
|
||||
|
||||
/**
|
||||
* Gets the data type that was mutated.
|
||||
*
|
||||
* @return the data type
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull DataType getDataType();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the holders data before the change
|
||||
*
|
||||
* @return the data before the change
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull Set<Node> getDataBefore();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the holders data after the change
|
||||
*
|
||||
* @return the data after the change
|
||||
*/
|
||||
@Param(3)
|
||||
@NonNull Set<Node> getDataAfter();
|
||||
|
||||
/**
|
||||
* Gets whether the target of this event is a {@link User}
|
||||
*
|
||||
* <p>This is equivalent to checking if getTarget() instanceof User</p>
|
||||
*
|
||||
* @return if the event is targeting a user
|
||||
*/
|
||||
default boolean isUser() {
|
||||
return getTarget() instanceof User;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the target of this event is a {@link Group}
|
||||
*
|
||||
* <p>This is equivalent to checking if getTarget() instanceof Group</p>
|
||||
*
|
||||
* @return if the event is targeting a group
|
||||
*/
|
||||
default boolean isGroup() {
|
||||
return getTarget() instanceof Group;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.node;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.node.Node;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a node is removed from a holder
|
||||
*/
|
||||
public interface NodeRemoveEvent extends NodeMutateEvent {
|
||||
|
||||
/**
|
||||
* Gets the node that was removed
|
||||
*
|
||||
* @return the node that was removed
|
||||
*/
|
||||
@Param(4)
|
||||
@NonNull Node getNode();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.player;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.PlayerSaveResult;
|
||||
import net.luckperms.api.model.user.UserManager;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when player data is saved to the storage.
|
||||
*
|
||||
* <p>Data can be saved using {@link UserManager#savePlayerData(UUID, String)}.</p>
|
||||
*/
|
||||
public interface PlayerDataSaveEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the unique ID that was saved.
|
||||
*
|
||||
* @return the uuid
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Gets the username that was saved.
|
||||
*
|
||||
* @return the username
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull String getUsername();
|
||||
|
||||
/**
|
||||
* Gets the result of the operation.
|
||||
*
|
||||
* @return the result
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull PlayerSaveResult getResult();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.player;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.util.Result;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when LuckPerms has finished processing a Player's initial connection.
|
||||
*
|
||||
* <p>This event will always execute during the platforms async connection
|
||||
* event. The LuckPerms platform listener processing the connection will block
|
||||
* while this event is posted.</p>
|
||||
*
|
||||
* <p>This, among other things, allows you to wait until permission data is
|
||||
* loaded for a User during the BungeeCord 'LoginEvent', as event priorities are
|
||||
* ignored by the current implementation.</p>
|
||||
*
|
||||
* <p>The implementation will make an attempt to ensure this event is called
|
||||
* for all connections, even if the operation to load User data was not
|
||||
* successful. Note that LuckPerms will usually cancel the platform connection
|
||||
* event if data could not be loaded.</p>
|
||||
*/
|
||||
public interface PlayerLoginProcessEvent extends LuckPermsEvent, Result {
|
||||
|
||||
/**
|
||||
* Gets the UUID of the connection which was processed
|
||||
*
|
||||
* @return the uuid of the connection which was processed
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Gets the username of the connection which was processed
|
||||
*
|
||||
* @return the username of the connection which was processed
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull String getUsername();
|
||||
|
||||
/**
|
||||
* Gets if the login was processed successfully.
|
||||
*
|
||||
* @return true if the login was successful
|
||||
*/
|
||||
@Override
|
||||
default boolean wasSuccessful() {
|
||||
return getUser() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the resultant User instance which was loaded.
|
||||
*
|
||||
* <p>Returns {@code null} if the login was not processed
|
||||
* {@link #wasSuccessful() successfully.}</p>
|
||||
*
|
||||
* @return the user instance
|
||||
*/
|
||||
@Param(2)
|
||||
@Nullable User getUser();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.source;
|
||||
|
||||
import net.luckperms.api.platform.PlatformEntity;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an {@link PlatformEntity} which was the {@link Source} of something.
|
||||
*/
|
||||
public interface EntitySource extends Source {
|
||||
|
||||
/**
|
||||
* Gets the entity.
|
||||
*
|
||||
* @return the entity
|
||||
*/
|
||||
@NonNull PlatformEntity getEntity();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.source;
|
||||
|
||||
import net.luckperms.api.platform.PlatformEntity;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents the source of an event.
|
||||
*
|
||||
* <p>Could also be described as the "thing" that caused an event to occur.</p>
|
||||
*/
|
||||
public interface Source {
|
||||
|
||||
/**
|
||||
* Gets the source type
|
||||
*
|
||||
* @return the type
|
||||
*/
|
||||
@NonNull Type getType();
|
||||
|
||||
/**
|
||||
* Represents a type of source
|
||||
*/
|
||||
enum Type {
|
||||
|
||||
/**
|
||||
* Represents an {@link PlatformEntity} source
|
||||
*
|
||||
* @see EntitySource
|
||||
*/
|
||||
ENTITY,
|
||||
|
||||
/**
|
||||
* Represents an unknown source
|
||||
*/
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.sync;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
|
||||
/**
|
||||
* Called when the configuration is reloaded
|
||||
*/
|
||||
public interface ConfigReloadEvent extends LuckPermsEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.sync;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
|
||||
/**
|
||||
* Called when an sync task has been completed
|
||||
*/
|
||||
public interface PostSyncEvent extends LuckPermsEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.sync;
|
||||
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called before a received network sync task runs
|
||||
*/
|
||||
public interface PreNetworkSyncEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the ID of the sync request
|
||||
*
|
||||
* @return the id of the sync request
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getSyncId();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.sync;
|
||||
|
||||
import net.luckperms.api.event.type.Cancellable;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
|
||||
/**
|
||||
* Called before a sync task runs
|
||||
*/
|
||||
public interface PreSyncEvent extends LuckPermsEvent, Cancellable {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.event.cause.CreationCause;
|
||||
import net.luckperms.api.track.Track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a track is created
|
||||
*/
|
||||
public interface TrackCreateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the new track
|
||||
*
|
||||
* @return the new track
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Track getTrack();
|
||||
|
||||
/**
|
||||
* Gets the cause of the creation
|
||||
*
|
||||
* @return the cause of the creation
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CreationCause getCause();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.event.cause.DeletionCause;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Called when a track is deleted
|
||||
*/
|
||||
public interface TrackDeleteEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the name of the deleted track
|
||||
*
|
||||
* @return the name of the deleted track
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull String getTrackName();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the tracks existing data
|
||||
*
|
||||
* @return a copy of the tracks existing data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull List<String> getExistingData();
|
||||
|
||||
/**
|
||||
* Gets the cause of the deletion
|
||||
*
|
||||
* @return the cause of the deletion
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull DeletionCause getCause();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
|
||||
/**
|
||||
* Called when all tracks have been loaded in from storage.
|
||||
*
|
||||
* <p>Usually only called on startup and in sync tasks.</p>
|
||||
*/
|
||||
public interface TrackLoadAllEvent extends LuckPermsEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.track.Track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a track is loaded into memory from the storage.
|
||||
*
|
||||
* Note that this event is not the same as {@link TrackCreateEvent}
|
||||
*/
|
||||
public interface TrackLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the track that was loaded
|
||||
*
|
||||
* @return the track that was loaded
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Track getTrack();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track.mutate;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a group is added to a track
|
||||
*/
|
||||
public interface TrackAddGroupEvent extends TrackMutateEvent {
|
||||
|
||||
/**
|
||||
* Gets the group that was added
|
||||
*
|
||||
* @return the group that was added
|
||||
*/
|
||||
@Param(3)
|
||||
@NonNull String getGroup();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track.mutate;
|
||||
|
||||
/**
|
||||
* Called when a track is cleared
|
||||
*/
|
||||
public interface TrackClearEvent extends TrackMutateEvent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track.mutate;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.track.Track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Called when a track is changed
|
||||
*/
|
||||
public interface TrackMutateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the track that was mutated
|
||||
*
|
||||
* @return the track that was mutated
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Track getTrack();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the tracks data before the change
|
||||
*
|
||||
* @return the data before the change
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull List<String> getStateBefore();
|
||||
|
||||
/**
|
||||
* Gets an immutable copy of the tracks data after the change
|
||||
*
|
||||
* @return the data after the change
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull List<String> getStateAfter();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.track.mutate;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a group is removed from a track
|
||||
*/
|
||||
public interface TrackRemoveGroupEvent extends TrackMutateEvent {
|
||||
|
||||
/**
|
||||
* Gets the group that was removed
|
||||
*
|
||||
* @return the group that was removed
|
||||
*/
|
||||
@Param(3)
|
||||
@NonNull String getGroup();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.type;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Represents an event that can be cancelled
|
||||
*/
|
||||
public interface Cancellable {
|
||||
|
||||
/**
|
||||
* Gets an {@link AtomicBoolean} holding the cancellation state of the event
|
||||
*
|
||||
* @return the cancellation
|
||||
*/
|
||||
@Param(-1)
|
||||
@NonNull AtomicBoolean cancellationState();
|
||||
|
||||
/**
|
||||
* Returns true if the event is currently cancelled.
|
||||
*
|
||||
* @return if the event is cancelled
|
||||
*/
|
||||
default boolean isCancelled() {
|
||||
return cancellationState().get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the event is not currently cancelled.
|
||||
*
|
||||
* @return if the event is not cancelled
|
||||
*/
|
||||
default boolean isNotCancelled() {
|
||||
return !isCancelled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of the event.
|
||||
*
|
||||
* @param cancelled the new state
|
||||
* @return the previous state
|
||||
*/
|
||||
default boolean setCancelled(boolean cancelled) {
|
||||
return cancellationState().getAndSet(cancelled);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.type;
|
||||
|
||||
import net.luckperms.api.event.source.Source;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an event with a {@link Source}.
|
||||
*/
|
||||
public interface Sourced {
|
||||
|
||||
/**
|
||||
* Gets the events source.
|
||||
*
|
||||
* <p>Never returns null. In situations where the source is unknown, a
|
||||
* {@link Source} with type {@link Source.Type#UNKNOWN} is returned.</p>
|
||||
*
|
||||
* @return the source
|
||||
*/
|
||||
@NonNull @Param(-1) Source getSource();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user;
|
||||
|
||||
import net.luckperms.api.cacheddata.CachedDataManager;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.user.User;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a users {@link CachedDataManager} is loaded.
|
||||
*/
|
||||
public interface UserCacheLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the user whose data was loaded
|
||||
*
|
||||
* @return the user
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull User getUser();
|
||||
|
||||
/**
|
||||
* Gets the data that was loaded
|
||||
*
|
||||
* @return the loaded data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CachedDataManager getLoadedData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user;
|
||||
|
||||
import net.luckperms.api.cacheddata.CachedDataManager;
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.user.User;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a users cached data is refreshed
|
||||
*/
|
||||
public interface UserDataRecalculateEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the user whose data was recalculated
|
||||
*
|
||||
* @return the user
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull User getUser();
|
||||
|
||||
/**
|
||||
* Gets the data that was recalculated
|
||||
*
|
||||
* @return the data
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull CachedDataManager getData();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when the user logs into the network for the first time.
|
||||
*
|
||||
* <p>Particularly useful for networks with multiple
|
||||
* lobbies, who want to welcome a user when they join for the first time.</p>
|
||||
*
|
||||
* <p>This event is fired before the player has actually joined the game on the async login / auth event. If you want to
|
||||
* do something with the user, store the UUID in a set, and then check the set in the PlayerJoinEvent o.e.</p>
|
||||
*
|
||||
* <p>The users data will not be loaded when this event is called.</p>
|
||||
*/
|
||||
public interface UserFirstLoginEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the UUID of the user
|
||||
*
|
||||
* @return the uuid of the user
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Gets the username of the user
|
||||
*
|
||||
* @return the username of the user
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull String getUsername();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.model.user.User;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a user is loaded into memory from the storage.
|
||||
*/
|
||||
public interface UserLoadEvent extends LuckPermsEvent {
|
||||
|
||||
/**
|
||||
* Gets the user that was loaded
|
||||
*
|
||||
* @return the user that was loaded
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull User getUser();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
/**
|
||||
* Represents the type of action performed in a {@link UserTrackEvent}
|
||||
*/
|
||||
public enum TrackAction {
|
||||
|
||||
/**
|
||||
* The user was promoted up a track
|
||||
*/
|
||||
PROMOTION,
|
||||
|
||||
/**
|
||||
* The user was demoted down a track
|
||||
*/
|
||||
DEMOTION
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a user is demoted down a track.
|
||||
*
|
||||
* <p>{@link #getAction()} is always {@link TrackAction#DEMOTION}</p>
|
||||
*/
|
||||
public interface UserDemoteEvent extends UserTrackEvent {
|
||||
|
||||
@Override
|
||||
default @NonNull TrackAction getAction() {
|
||||
return TrackAction.DEMOTION;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Called when a user is promoted up a track.
|
||||
*
|
||||
* <p>{@link #getAction()} is always {@link TrackAction#PROMOTION}</p>
|
||||
*/
|
||||
public interface UserPromoteEvent extends UserTrackEvent {
|
||||
|
||||
@Override
|
||||
default @NonNull TrackAction getAction() {
|
||||
return TrackAction.PROMOTION;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
import net.luckperms.api.event.LuckPermsEvent;
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import net.luckperms.api.event.type.Sourced;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.track.Track;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Called when a user interacts with a track through a promotion or demotion
|
||||
*/
|
||||
public interface UserTrackEvent extends LuckPermsEvent, Sourced {
|
||||
|
||||
/**
|
||||
* Gets the track involved in the event
|
||||
*
|
||||
* @return the track involved in the event
|
||||
*/
|
||||
@Param(0)
|
||||
@NonNull Track getTrack();
|
||||
|
||||
/**
|
||||
* Gets the user who was promoted or demoted
|
||||
*
|
||||
* @return the user involved in the event
|
||||
*/
|
||||
@Param(1)
|
||||
@NonNull User getUser();
|
||||
|
||||
/**
|
||||
* Gets the action performed
|
||||
*
|
||||
* @return the action performed
|
||||
*/
|
||||
@NonNull TrackAction getAction();
|
||||
|
||||
/**
|
||||
* Gets the group the user was promoted/demoted from.
|
||||
*
|
||||
* <p>May be {@link Optional#empty()} if the user wasn't already placed on the track.</p>
|
||||
*
|
||||
* @return the group the user was promoted/demoted from
|
||||
*/
|
||||
@Param(2)
|
||||
@NonNull Optional<String> getGroupFrom();
|
||||
|
||||
/**
|
||||
* Gets the group the user was promoted/demoted to
|
||||
*
|
||||
* @return the group the user was promoted/demoted to
|
||||
*/
|
||||
@Param(3)
|
||||
@NonNull Optional<String> getGroupTo();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.event.util;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Represents the position of a parameter within an event.
|
||||
*
|
||||
* <p>This is an implementation detail and should not be relied upon.</p>
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Param {
|
||||
|
||||
/**
|
||||
* Gets the index of the parameter.
|
||||
*
|
||||
* @return the index
|
||||
*/
|
||||
int value();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.extension;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
|
||||
/**
|
||||
* Represents a simple extension "plugin" for LuckPerms.
|
||||
*
|
||||
* <p>Yes, that's right. A plugin for a plugin.</p>
|
||||
*
|
||||
* <p>Extensions should either declare a no-arg constructor, or a constructor
|
||||
* that accepts a single {@link LuckPerms} parameter as it's only argument.</p>
|
||||
*/
|
||||
public interface Extension {
|
||||
|
||||
/**
|
||||
* Loads the extension.
|
||||
*/
|
||||
void load();
|
||||
|
||||
/**
|
||||
* Unloads the extension.
|
||||
*/
|
||||
void unload();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.extension;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Manages extensions.
|
||||
*/
|
||||
public interface ExtensionManager {
|
||||
|
||||
/**
|
||||
* Loads the given extension.
|
||||
*
|
||||
* @param extension the extension to load
|
||||
*/
|
||||
void loadExtension(Extension extension);
|
||||
|
||||
/**
|
||||
* Loads the extension at the given path.
|
||||
*
|
||||
* @param path the path to the extension
|
||||
* @return the extension
|
||||
* @throws IOException if the extension could not be loaded
|
||||
*/
|
||||
@NonNull Extension loadExtension(Path path) throws IOException;
|
||||
|
||||
/**
|
||||
* Gets a collection of all loaded extensions.
|
||||
*
|
||||
* @return the loaded extensions
|
||||
*/
|
||||
@NonNull Collection<Extension> getLoadedExtensions();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messaging;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.model.user.User;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A means to push changes to other servers using the platforms networking
|
||||
*/
|
||||
public interface MessagingService {
|
||||
|
||||
/**
|
||||
* Gets the name of this messaging service
|
||||
*
|
||||
* @return the name of this messaging service
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Uses the messaging service to inform other servers about a general
|
||||
* change.
|
||||
*
|
||||
* <p>The standard response by other servers will be to execute a overall
|
||||
* sync of all live data, equivalent to calling
|
||||
* {@link LuckPerms#runUpdateTask()}.</p>
|
||||
*
|
||||
* <p>This will push the update asynchronously, and this method will return
|
||||
* immediately. Note that this method will not cause an update to be
|
||||
* processed on the local server.</p>
|
||||
*/
|
||||
void pushUpdate();
|
||||
|
||||
/**
|
||||
* Uses the messaging service to inform other servers about a change to a
|
||||
* specific user.
|
||||
*
|
||||
* <p>The standard response by other servers is undefined, however the
|
||||
* current implementation will reload the corresponding users data if they
|
||||
* are online.</p>
|
||||
*
|
||||
* <p>This will push the update asynchronously, and this method will return
|
||||
* immediately. Note that this method will not cause an update to be
|
||||
* processed on the local server.</p>
|
||||
*
|
||||
* @param user the user to push the update for
|
||||
*/
|
||||
void pushUserUpdate(@NonNull User user);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger;
|
||||
|
||||
import net.luckperms.api.messenger.message.Message;
|
||||
import net.luckperms.api.messenger.message.OutgoingMessage;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Encapsulates the LuckPerms system which accepts incoming {@link Message}s
|
||||
* from implementations of {@link Messenger}.
|
||||
*/
|
||||
public interface IncomingMessageConsumer {
|
||||
|
||||
/**
|
||||
* Consumes a message instance.
|
||||
*
|
||||
* <p>The boolean returned from this method indicates whether or not the
|
||||
* platform accepted the message. Some implementations which have multiple
|
||||
* distribution channels may wish to use this result to dispatch the same
|
||||
* message back to additional receivers.</p>
|
||||
*
|
||||
* <p>The implementation will usually return <code>false</code> if a message
|
||||
* with the same ping id has already been processed.</p>
|
||||
*
|
||||
* @param message the message
|
||||
* @return true if the message was accepted by the plugin
|
||||
*/
|
||||
boolean consumeIncomingMessage(@NonNull Message message);
|
||||
|
||||
/**
|
||||
* Consumes a message in an encoded string format.
|
||||
*
|
||||
* <p>This method will decode strings obtained by calling
|
||||
* {@link OutgoingMessage#asEncodedString()}. This means that basic
|
||||
* implementations can successfully implement {@link Messenger} without
|
||||
* providing their own serialisation.</p>
|
||||
*
|
||||
* <p>The boolean returned from this method indicates whether or not the
|
||||
* platform accepted the message. Some implementations which have multiple
|
||||
* distribution channels may wish to use this result to dispatch the same
|
||||
* message back to additional receivers.</p>
|
||||
*
|
||||
* <p>The implementation will usually return <code>false</code> if a message
|
||||
* with the same ping id has already been processed.</p>
|
||||
*
|
||||
* @param encodedString the encoded string
|
||||
* @return true if the message was accepted by the plugin
|
||||
*/
|
||||
boolean consumeIncomingMessageAsString(@NonNull String encodedString);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger;
|
||||
|
||||
import net.luckperms.api.messenger.message.Message;
|
||||
import net.luckperms.api.messenger.message.OutgoingMessage;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an object which dispatches {@link OutgoingMessage}s.
|
||||
*/
|
||||
public interface Messenger extends AutoCloseable {
|
||||
|
||||
/**
|
||||
* Performs the necessary action to dispatch the message using the means
|
||||
* of the messenger.
|
||||
*
|
||||
* <p>The outgoing message instance is guaranteed to be an instance of one
|
||||
* of the interfaces extending {@link Message} in the
|
||||
* 'api.messenger.message.type' package.</p>
|
||||
*
|
||||
* <p>3rd party implementations are encouraged to implement this method with consideration
|
||||
* that new types may be added in the future.</p>
|
||||
*
|
||||
* <p>This call is always made async.</p>
|
||||
*
|
||||
* @param outgoingMessage the outgoing message
|
||||
*/
|
||||
void sendOutgoingMessage(@NonNull OutgoingMessage outgoingMessage);
|
||||
|
||||
/**
|
||||
* Performs the necessary action to gracefully shutdown the messenger.
|
||||
*/
|
||||
@Override
|
||||
default void close() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents a provider for {@link Messenger} instances.
|
||||
*
|
||||
* <p>Users wishing to provide their own implementation for the plugins
|
||||
* "Messaging Service" should implement and register this interface.</p>
|
||||
*
|
||||
* @see LuckPerms#registerMessengerProvider(MessengerProvider)
|
||||
*/
|
||||
public interface MessengerProvider {
|
||||
|
||||
/**
|
||||
* Gets the name of this provider.
|
||||
*
|
||||
* @return the provider name
|
||||
*/
|
||||
@NonNull String getName();
|
||||
|
||||
/**
|
||||
* Creates and returns a new {@link Messenger} instance, which passes
|
||||
* incoming messages to the provided {@link IncomingMessageConsumer}.
|
||||
*
|
||||
* <p>As the agent should pass incoming messages to the given consumer,
|
||||
* this method should always return a new object.</p>
|
||||
*
|
||||
* @param incomingMessageConsumer the consumer the new instance should pass
|
||||
* incoming messages to
|
||||
* @return a new messenger agent instance
|
||||
*/
|
||||
@NonNull Messenger obtain(@NonNull IncomingMessageConsumer incomingMessageConsumer);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger.message;
|
||||
|
||||
import net.luckperms.api.messenger.Messenger;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a message sent received via a {@link Messenger}.
|
||||
*/
|
||||
public interface Message {
|
||||
|
||||
/**
|
||||
* Gets the unique id associated with this message.
|
||||
*
|
||||
* <p>This ID is used to ensure a single server instance doesn't process
|
||||
* the same message twice.</p>
|
||||
*
|
||||
* @return the id of the message
|
||||
*/
|
||||
@NonNull UUID getId();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger.message;
|
||||
|
||||
import net.luckperms.api.messenger.IncomingMessageConsumer;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an outgoing {@link Message}.
|
||||
*
|
||||
* <p>Outgoing messages are ones which have been generated by this instance.
|
||||
* (in other words, they are implemented by LuckPerms)</p>
|
||||
*
|
||||
* <p>Note that all implementations of this interface are guaranteed to be an
|
||||
* instance of one of the interfaces extending {@link Message} in the
|
||||
* 'api.messenger.message.type' package.</p>
|
||||
*/
|
||||
public interface OutgoingMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets an encoded string form of this message.
|
||||
*
|
||||
* <p>The format of this string is likely to change between versions and
|
||||
* should not be depended on.</p>
|
||||
*
|
||||
* <p>Implementations which want to use a standard method of serialisation
|
||||
* can send outgoing messages using the string returned by this method, and
|
||||
* pass on the message on the "other side" using
|
||||
* {@link IncomingMessageConsumer#consumeIncomingMessageAsString(String)}.</p>
|
||||
*
|
||||
* @return an encoded string form of the message
|
||||
*/
|
||||
@NonNull String asEncodedString();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger.message.type;
|
||||
|
||||
import net.luckperms.api.actionlog.Action;
|
||||
import net.luckperms.api.messenger.message.Message;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Represents an "action log" message.
|
||||
*
|
||||
* <p>Used to dispatch live action log updates to other servers.</p>
|
||||
*/
|
||||
public interface ActionLogMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the action being sent
|
||||
*
|
||||
* @return the action
|
||||
*/
|
||||
@NonNull Action getAction();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger.message.type;
|
||||
|
||||
import net.luckperms.api.messenger.message.Message;
|
||||
|
||||
/**
|
||||
* Represents an "update" message.
|
||||
*
|
||||
* <p>Used to notify other servers of general changes.</p>
|
||||
*/
|
||||
public interface UpdateMessage extends Message {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.messenger.message.type;
|
||||
|
||||
import net.luckperms.api.messenger.message.Message;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents an "user update" message.
|
||||
*
|
||||
* <p>Used to notify other servers of a change to a specific user.</p>
|
||||
*/
|
||||
public interface UserUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the user the message is for.
|
||||
*
|
||||
* @return the user
|
||||
*/
|
||||
@NonNull UUID getUserUniqueId();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.metastacking;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Functional interface which removes duplicate entries from a list.
|
||||
*
|
||||
* <p>Used by LuckPerms to remove duplicate entries from a MetaStack.</p>
|
||||
*/
|
||||
public interface DuplicateRemovalFunction {
|
||||
|
||||
/**
|
||||
* Removes duplicates from the given list, according to the behaviour
|
||||
* of the function.
|
||||
*
|
||||
* @param list the entries
|
||||
* @param <T> the type of entries
|
||||
*/
|
||||
<T> void processDuplicates(@NonNull List<T> list);
|
||||
|
||||
/**
|
||||
* A {@link DuplicateRemovalFunction} that does not remove duplicates.
|
||||
*/
|
||||
DuplicateRemovalFunction RETAIN_ALL = new DuplicateRemovalFunction() {
|
||||
@Override
|
||||
public <T> void processDuplicates(@NonNull List<T> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DuplicateRemovalFunction#RETAIN_ALL";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A {@link DuplicateRemovalFunction} that retains only the first occurrence.
|
||||
*/
|
||||
DuplicateRemovalFunction FIRST_ONLY = new DuplicateRemovalFunction() {
|
||||
@SuppressWarnings("Java8CollectionRemoveIf")
|
||||
@Override
|
||||
public <T> void processDuplicates(@NonNull List<T> list) {
|
||||
Set<T> seen = new HashSet<>(list.size());
|
||||
for (ListIterator<T> it = list.listIterator(); it.hasNext(); ) {
|
||||
T next = it.next();
|
||||
if (!seen.add(next)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DuplicateRemovalFunction#FIRST_ONLY";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A {@link DuplicateRemovalFunction} that retains only the last occurrence.
|
||||
*/
|
||||
DuplicateRemovalFunction LAST_ONLY = new DuplicateRemovalFunction() {
|
||||
@Override
|
||||
public <T> void processDuplicates(@NonNull List<T> list) {
|
||||
Set<T> seen = new HashSet<>(list.size());
|
||||
for (ListIterator<T> it = list.listIterator(list.size()); it.hasPrevious(); ) {
|
||||
T next = it.previous();
|
||||
if (!seen.add(next)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DuplicateRemovalFunction#LAST_ONLY";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.metastacking;
|
||||
|
||||
import net.luckperms.api.query.OptionKey;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a meta stack model, consisting of a chain of elements, separated by spacers.
|
||||
*
|
||||
* <p>The resultant string is constructed as:
|
||||
* [start spacer] [element] [middle spacer] [element] [middle spacer] [element] [end spacer]</p>
|
||||
*
|
||||
* <p>Definitions can be passed to a users UserData instance using MetaContexts, and the result of this stack can be
|
||||
* retrieved from the returned MetaData instance.</p>
|
||||
*/
|
||||
public interface MetaStackDefinition {
|
||||
|
||||
/**
|
||||
* The {@link OptionKey} for the prefix {@link MetaStackDefinition}.
|
||||
*/
|
||||
OptionKey<MetaStackDefinition> PREFIX_STACK_KEY = OptionKey.of("prefixstack", MetaStackDefinition.class);
|
||||
|
||||
/**
|
||||
* The {@link OptionKey} for the suffix {@link MetaStackDefinition}.
|
||||
*/
|
||||
OptionKey<MetaStackDefinition> SUFFIX_STACK_KEY = OptionKey.of("suffixstack", MetaStackDefinition.class);
|
||||
|
||||
/**
|
||||
* Gets an immutable list of the elements in this stack definition
|
||||
*
|
||||
* @return the elements in this stack
|
||||
*/
|
||||
@NonNull List<MetaStackElement> getElements();
|
||||
|
||||
/**
|
||||
* Gets the duplicate removal function, applied to the entries before
|
||||
* formatting takes place.
|
||||
*
|
||||
* @return the duplicate removal function
|
||||
*/
|
||||
@NonNull DuplicateRemovalFunction getDuplicateRemovalFunction();
|
||||
|
||||
/**
|
||||
* Gets the spacer string added before any stack elements
|
||||
*
|
||||
* @return the start spacer
|
||||
*/
|
||||
@NonNull String getStartSpacer();
|
||||
|
||||
/**
|
||||
* Gets the spacer added between stack elements
|
||||
*
|
||||
* @return the middle spacer
|
||||
*/
|
||||
@NonNull String getMiddleSpacer();
|
||||
|
||||
/**
|
||||
* Gets the spacer added after any stack elements
|
||||
*
|
||||
* @return the end spacer
|
||||
*/
|
||||
@NonNull String getEndSpacer();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.luckperms.api.metastacking;
|
||||
|
||||
import net.luckperms.api.node.ChatMetaType;
|
||||
import net.luckperms.api.node.types.ChatMetaNode;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Represents an element within a {@link MetaStackDefinition}.
|
||||
*
|
||||
* <p>The element itself does not contain any mutable state.</p>
|
||||
*/
|
||||
public interface MetaStackElement {
|
||||
|
||||
/**
|
||||
* Returns if the given node should be accumulated onto the stack.
|
||||
*
|
||||
* @param type the type of entry being accumulated
|
||||
* @param node the node being considered
|
||||
* @param current the current value being used. If this returns true, the current value will be replaced by this entry
|
||||
* @return true if the node should be accumulated into this element, replacing the current value
|
||||
*/
|
||||
boolean shouldAccumulate(@NonNull ChatMetaType type, @NonNull ChatMetaNode<?, ?> node, @Nullable ChatMetaNode<?, ?> current);
|
||||
|
||||
}
|
||||
Loaded 100 of 851 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user