Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4074352a53 | ||
|
|
f909b55a84 | ||
|
|
593aa7564a | ||
|
|
24efb48004 | ||
|
|
38b3f40f7d | ||
|
|
d89f916546 | ||
|
|
62278f287c | ||
|
|
72be978f8e | ||
|
|
666f3d6c92 | ||
|
|
8e7606ea1b | ||
|
|
2b8c5082ed | ||
|
|
05f9fc1ddc | ||
|
|
fc1450fe38 | ||
|
|
e1072a8dc7 | ||
|
|
3290d4ae24 | ||
|
|
b2855c2cd4 | ||
|
|
fec777b349 | ||
|
|
7b1f9c199a | ||
|
|
a8b3444ff5 | ||
|
|
6839334c1a | ||
|
|
d7e3aa7143 | ||
|
|
48436e7caf | ||
|
|
eaa58affd1 | ||
|
|
57cf1803f3 | ||
|
|
104fa4e29f | ||
|
|
4011aee280 | ||
|
|
37fd69fa86 | ||
|
|
3fb125592b | ||
|
|
7925fd2d8f | ||
|
|
199324ee9d | ||
|
|
d5cac99b5f | ||
|
|
3618914ce9 | ||
|
|
ff140c421a | ||
|
|
016b8f1dbc | ||
|
|
0d31054903 | ||
|
|
8beedffea2 | ||
|
|
4ef862e06d | ||
|
|
53642e9a3c | ||
|
|
fd9dab8aa1 | ||
|
|
703978e227 | ||
|
|
7195319eb5 | ||
|
|
2d0a597f74 | ||
|
|
bc89f57088 | ||
|
|
57769c5671 | ||
|
|
a6b4b16fd3 | ||
|
|
3a1e364d4a | ||
|
|
03638028cd | ||
|
|
d5f56784e2 | ||
|
|
cbf71e2289 | ||
|
|
e2d9e44be3 | ||
|
|
2d2a5fa79c | ||
|
|
605331963d | ||
|
|
15a5d51248 | ||
|
|
8bcd8fd995 | ||
|
|
9484526d39 | ||
|
|
ab1cc791b7 | ||
|
|
1fe76dbb77 | ||
|
|
cf2adab728 | ||
|
|
04fedd2892 | ||
|
|
c172091944 | ||
|
|
16ba5aa4f9 | ||
|
|
5fa2c788e0 | ||
|
|
c5a338137e | ||
|
|
01d79e2681 | ||
|
|
576682ef9f | ||
|
|
54b0345017 | ||
|
|
4f9f3254be | ||
|
|
1538ff5201 | ||
|
|
f17fb833a0 | ||
|
|
84c064fc11 | ||
|
|
7b5b79f510 | ||
|
|
2588c6ecc8 | ||
|
|
2df57bc37c | ||
|
|
efeaef3e4e | ||
|
|
cb7a7254a6 | ||
|
|
fe3f247eb1 | ||
|
|
096415cf8e | ||
|
|
af0cf1d3f2 | ||
|
|
d183d76c47 | ||
|
|
44e928d53c | ||
|
|
89127cad8a | ||
|
|
ab93e0877c | ||
|
|
96b5051c75 | ||
|
|
9e59ef4c4a | ||
|
|
00746833ac | ||
|
|
8e15b6d42b | ||
|
|
cad358322d | ||
|
|
a2b3906c9e | ||
|
|
cadb5ec64c | ||
|
|
95e20677fd | ||
|
|
f1c8d271b1 | ||
|
|
318c49cf30 | ||
|
|
d4bc31d11e | ||
|
|
30d122e7fa | ||
|
|
49d386063d | ||
|
|
deec4b521e | ||
|
|
dbf6a110f2 | ||
|
|
a25a5634de | ||
|
|
a3b1ce817e | ||
|
|
c02047aaf8 | ||
|
|
f18e2b3875 | ||
|
|
ad0842c107 | ||
|
|
2b19a98809 | ||
|
|
d40ce9fc4a | ||
|
|
144c24c276 | ||
|
|
2c884dc241 | ||
|
|
d0882cf02c | ||
|
|
cfec0cc25f | ||
|
|
d3a3e366b1 | ||
|
|
f1eef0294f | ||
|
|
4df70de312 | ||
|
|
898521de9a | ||
|
|
87d54f1103 | ||
|
|
c7e5b4a297 | ||
|
|
458279d111 | ||
|
|
7300a69817 | ||
|
|
76e739e4f0 | ||
|
|
0ee80dc41f | ||
|
|
4473f863c6 | ||
|
|
9f380a7598 | ||
|
|
3c7d481a39 | ||
|
|
b23c01c44b | ||
|
|
00b8289c61 | ||
|
|
e9fa5b49ca | ||
|
|
ef8cb05703 | ||
|
|
e83686d6fc | ||
|
|
26bbc92f94 | ||
|
|
9ccd8bff33 | ||
|
|
29d6b55592 | ||
|
|
1251d43709 | ||
|
|
070c7f5808 | ||
|
|
d79bd00f58 | ||
|
|
df7a644479 | ||
|
|
956492bca6 | ||
|
|
1d311284fd | ||
|
|
b251170c22 | ||
|
|
ab376dc562 | ||
|
|
fd9442b077 | ||
|
|
a63f2ab6fe | ||
|
|
d918fd27b6 | ||
|
|
63356207a3 | ||
|
|
210cae70fd | ||
|
|
0ab2c626aa | ||
|
|
b8072aad86 | ||
|
|
00b4c9b1f8 | ||
|
|
2f45de2f6a | ||
|
|
f60c0165e3 | ||
|
|
bfcfb4340e | ||
|
|
9b4d50b214 | ||
|
|
bdeb5acae9 | ||
|
|
81b9f1b4cd | ||
|
|
0552863f28 | ||
|
|
0986e174a2 | ||
|
|
b589561932 | ||
|
|
388eb73782 | ||
|
|
2f7de53e9b | ||
|
|
f7afe84982 | ||
|
|
ea014656bc | ||
|
|
72de597544 | ||
|
|
d7c8f3a594 | ||
|
|
6cc761e3b2 | ||
|
|
2723302f56 | ||
|
|
6497cca8bd | ||
|
|
ec188db247 | ||
|
|
b84bc7668a | ||
|
|
cf8d11d530 | ||
|
|
7f8052c3cd | ||
|
|
08763a92ab | ||
|
|
6e9e757294 | ||
|
|
5e227cb4a5 | ||
|
|
3c73d70f63 | ||
|
|
9fbadc0ad5 | ||
|
|
6b7818e6f1 | ||
|
|
16208b2a7f | ||
|
|
a0351b8168 | ||
|
|
35ac41e1fa | ||
|
|
46a01cb0f0 | ||
|
|
e437c656c5 | ||
|
|
f5b8937a70 | ||
|
|
8e069812e0 | ||
|
|
b6bee8f4cc | ||
|
|
aaaa97f781 | ||
|
|
5b0d98f639 | ||
|
|
68985141f1 | ||
|
|
a48f717396 | ||
|
|
a7a00e9f67 | ||
|
|
c719b98ab3 | ||
|
|
c059e57771 | ||
|
|
5fde8c25a3 | ||
|
|
02f1ab1752 | ||
|
|
024c36c584 | ||
|
|
ef6c347194 | ||
|
|
c0dabfe097 | ||
|
|
0a41d36220 | ||
|
|
37004d8c4f | ||
|
|
01277d147e | ||
|
|
1da0b38849 | ||
|
|
84f8e019c8 | ||
|
|
64b7e74d80 | ||
|
|
a141f871a9 | ||
|
|
69609d536b | ||
|
|
b21de03710 | ||
|
|
e7b489f66e | ||
|
|
7493c8d7b7 | ||
|
|
4ff98256f6 | ||
|
|
d1a0d629df | ||
|
|
50bfc86706 | ||
|
|
76c83da382 | ||
|
|
f04a748e54 | ||
|
|
d39193400f | ||
|
|
628979f923 | ||
|
|
24b4cd8dbd | ||
|
|
727c575a1c | ||
|
|
ac877d0b1a | ||
|
|
37d57af6ec | ||
|
|
e09c3b0159 | ||
|
|
22793dbac4 | ||
|
|
1998eca6c8 | ||
|
|
100ae1c680 | ||
|
|
6941b48038 | ||
|
|
59c9018250 | ||
|
|
bdfaf9a621 | ||
|
|
54488341bf | ||
|
|
59e05e3096 | ||
|
|
554fbb49c5 | ||
|
|
7faf4cf81a | ||
|
|
ee2959ac5d | ||
|
|
e679a0c2b0 | ||
|
|
14bfb8d147 | ||
|
|
3a9dd5c86d | ||
|
|
c8c54786fc | ||
|
|
4cc8a3f092 | ||
|
|
2beed20f1b | ||
|
|
91319402f3 | ||
|
|
ee147a4b37 | ||
|
|
127cae80bd | ||
|
|
55a2a0a779 | ||
|
|
ed4d0bc134 | ||
|
|
6298eb42c5 | ||
|
|
823ac0e173 | ||
|
|
6622b7dcff | ||
|
|
4858d75439 | ||
|
|
4355f8987f | ||
|
|
c0fb81946e | ||
|
|
6c440513ba | ||
|
|
2da0e1cad7 | ||
|
|
3d777bdcda | ||
|
|
e22975cec4 | ||
|
|
f35c48bed2 | ||
|
|
965814d833 | ||
|
|
459e3e68b8 | ||
|
|
72205a5414 | ||
|
|
e7ad3970cc | ||
|
|
4714a3f03a | ||
|
|
f08db2d234 | ||
|
|
5954c16f62 | ||
|
|
a4d1ac3b95 | ||
|
|
52b95eab28 | ||
|
|
24c56a239e | ||
|
|
7858b998ca | ||
|
|
d75420a35b | ||
|
|
137680ed9f | ||
|
|
e56ff898eb | ||
|
|
3aa35395f4 | ||
|
|
ff91dd7082 | ||
|
|
8a11b577eb | ||
|
|
6882678bc4 | ||
|
|
4555c5dbf3 | ||
|
|
4cc0d2c1a2 | ||
|
|
c671a6deed | ||
|
|
8de26a0ad3 | ||
|
|
e128f6a7ed | ||
|
|
9c0b187f31 | ||
|
|
6a12f8139c | ||
|
|
e85f9e7510 | ||
|
|
0b256d15b2 | ||
|
|
7abff77c51 | ||
|
|
78972a5345 | ||
|
|
7a6e45008b | ||
|
|
a041610fe2 | ||
|
|
ba776e5f88 | ||
|
|
67fda72bdd | ||
|
|
721c52e3f5 | ||
|
|
424e855d72 | ||
|
|
88a1a42625 | ||
|
|
0d3f729679 | ||
|
|
692e53427b | ||
|
|
3b5aaa1ff5 | ||
|
|
95e0cff03c | ||
|
|
91f3d0fdb7 | ||
|
|
b3e8ad9164 | ||
|
|
c3501a831e | ||
|
|
9821cb1b16 | ||
|
|
bba1f2acf0 | ||
|
|
1afbff18ef | ||
|
|
56ec689841 | ||
|
|
3189501b78 | ||
|
|
1c23103517 | ||
|
|
06e1b90f29 | ||
|
|
acd79fc661 | ||
|
|
18bde6ee37 | ||
|
|
72f8052e58 | ||
|
|
0343be6915 | ||
|
|
000a034836 | ||
|
|
2d33447fc1 | ||
|
|
bcb76350a1 | ||
|
|
485f4fa070 | ||
|
|
b1e60f5f1b | ||
|
|
6c3479e739 | ||
|
|
4813cc3077 | ||
|
|
69c8cf8ffb | ||
|
|
510ff4e6a1 | ||
|
|
a6043c14cd | ||
|
|
1a4c34afcf | ||
|
|
2f9ec6f2aa | ||
|
|
bc2f6a423f | ||
|
|
0986b0982c | ||
|
|
9a24129e49 | ||
|
|
c8029bdbdf | ||
|
|
1129c17489 | ||
|
|
f313b5b617 | ||
|
|
765f92bfe5 | ||
|
|
edd71bf8ab | ||
|
|
7d96efc645 | ||
|
|
6cb2837d77 | ||
|
|
08a8268852 | ||
|
|
54b6d1c21c | ||
|
|
71341a9381 | ||
|
|
5eccc2e3cd | ||
|
|
0015682fe4 | ||
|
|
107892fb24 | ||
|
|
6371b77b94 | ||
|
|
03ba058a9b | ||
|
|
750c5ed9a7 | ||
|
|
14afb884ad | ||
|
|
ab788554bf | ||
|
|
b8c204b306 | ||
|
|
52f542774f | ||
|
|
e502f2c96d | ||
|
|
8d904ca010 | ||
|
|
9a6b0664e3 | ||
|
|
5f1472a18d | ||
|
|
9dff193c09 | ||
|
|
9b2c3320ee | ||
|
|
df9508ff3c | ||
|
|
414f561673 | ||
|
|
074edf1b48 | ||
|
|
a0a229fa29 | ||
|
|
ebdadf0774 | ||
|
|
5b09536dcf | ||
|
|
1ea548f05d | ||
|
|
b7bf993795 | ||
|
|
a709382d25 | ||
|
|
d36def89e1 | ||
|
|
074af0e282 | ||
|
|
b6358cf83c | ||
|
|
f53a6928f2 | ||
|
|
78bb5f171f | ||
|
|
28219a3993 | ||
|
|
cae5122d04 | ||
|
|
0070485d2e | ||
|
|
4b6b904361 | ||
|
|
7e03da66d4 | ||
|
|
b209eb3c8b | ||
|
|
be31c705b5 | ||
|
|
13ee674d96 | ||
|
|
d31310ace8 | ||
|
|
1afed864b1 | ||
|
|
95d56c970c | ||
|
|
2dcd832a29 | ||
|
|
f54bb7923b | ||
|
|
1b862d084b | ||
|
|
fc7a7396ef | ||
|
|
be6e086aac | ||
|
|
5e70b54f08 | ||
|
|
f3d8b47add | ||
|
|
d3cadaf90f | ||
|
|
83a49a686a | ||
|
|
a4920a2c74 | ||
|
|
37170a2180 | ||
|
|
c6c5b9430e | ||
|
|
338b8792a9 | ||
|
|
7163d38ddf | ||
|
|
b0fc931ecd | ||
|
|
0ec1116a9e | ||
|
|
e45c82ee87 | ||
|
|
cb4c4b2141 | ||
|
|
acfdbc5494 | ||
|
|
70d08dfc6f | ||
|
|
dfc4652da7 | ||
|
|
a2ac867269 | ||
|
|
9c61135a73 | ||
|
|
f7951e7ef9 | ||
|
|
d37509224d | ||
|
|
7d0b7288dc | ||
|
|
53d22dcff7 | ||
|
|
6060954f87 | ||
|
|
ff8a27d92a | ||
|
|
617abe2d8c | ||
|
|
93c84b1912 | ||
|
|
0b17b81b63 | ||
|
|
6a7a92a97b | ||
|
|
31f7bde35f | ||
|
|
da77c32a0d | ||
|
|
421453d25e | ||
|
|
fa4d44b929 | ||
|
|
7c8b56b3cb | ||
|
|
f6fec5b93b | ||
|
|
ea0f91136e | ||
|
|
cf7d49aec5 | ||
|
|
03733d274a | ||
|
|
2dd688fa0e | ||
|
|
8165e55514 | ||
|
|
e5464c8e4b | ||
|
|
f70b9a8322 | ||
|
|
c31f728a37 | ||
|
|
0a519379a1 | ||
|
|
2b50f6c713 | ||
|
|
be2ba2b1b9 | ||
|
|
5051e7ea48 | ||
|
|
a42aa4b202 | ||
|
|
3d22258321 | ||
|
|
8fe1648d6b | ||
|
|
49211240a3 | ||
|
|
89c503dd92 | ||
|
|
c326bb7b51 | ||
|
|
50024b0602 | ||
|
|
5503a338fa | ||
|
|
076c5e5265 | ||
|
|
01d534391d | ||
|
|
48f8412440 | ||
|
|
2c9ce50312 | ||
|
|
601a6eb808 | ||
|
|
647230a996 | ||
|
|
5047aaff0c | ||
|
|
a981adf7a3 | ||
|
|
a16a085f75 | ||
|
|
37f5948b0a | ||
|
|
7fa80e1759 | ||
|
|
e1464044a7 | ||
|
|
42167394e0 | ||
|
|
3ef1912267 | ||
|
|
3c20b79573 | ||
|
|
7171802b78 | ||
|
|
58e7455cd9 | ||
|
|
a613edcb42 | ||
|
|
5ce1e850c8 | ||
|
|
4f392ba361 | ||
|
|
61fb1c249c | ||
|
|
dae83d0e36 | ||
|
|
67c5e78e7b | ||
|
|
1ec2551fcc | ||
|
|
d4a299501a | ||
|
|
3fbeb3e902 | ||
|
|
7f2023176f | ||
|
|
3ddd289b49 | ||
|
|
f16ff65933 | ||
|
|
96485c444e | ||
|
|
b99b79f44a | ||
|
|
3ba2191829 | ||
|
|
26de3fe573 | ||
|
|
d59749fb03 | ||
|
|
a0195c59cc | ||
|
|
26b90b6d71 | ||
|
|
ed0db721dd | ||
|
|
b203db3ce5 | ||
|
|
e386f7cf45 | ||
|
|
c1c542cc5a | ||
|
|
642d427783 | ||
|
|
b2514a9e50 | ||
|
|
a942d3aad5 | ||
|
|
7a25645ed5 | ||
|
|
3c23bd41dd | ||
|
|
e5ba76e006 | ||
|
|
7a03feeccc | ||
|
|
67ef4700c7 | ||
|
|
790a9d0058 | ||
|
|
002ad95cad | ||
|
|
7ff42400c0 | ||
|
|
3df7f760a6 | ||
|
|
3a48e54e52 | ||
|
|
73eef1727a | ||
|
|
1ab0cd07af | ||
|
|
9df545483c | ||
|
|
3f93bb051d | ||
|
|
8bd982a412 | ||
|
|
7b200ad264 | ||
|
|
5d2a4e2ef3 | ||
|
|
d414106d5a | ||
|
|
d86ac64ac9 | ||
|
|
6761489ebf | ||
|
|
dd0ec0033a | ||
|
|
f91ddb2521 | ||
|
|
3ee94415a9 | ||
|
|
1a7ce908b8 | ||
|
|
d3fb7cd91b | ||
|
|
8b61d168f7 | ||
|
|
50cb30b4fc | ||
|
|
5b807a9f17 | ||
|
|
f671a4fa5c | ||
|
|
0b1c210f77 | ||
|
|
9220c5ae40 | ||
|
|
f391cc6185 | ||
|
|
b0fe7d9c6d | ||
|
|
3d39f0d304 | ||
|
|
42029770a2 | ||
|
|
cf00b9ee7c | ||
|
|
b0816b1ce6 | ||
|
|
67cce53b72 | ||
|
|
0c097d7467 | ||
|
|
70e142e4c4 | ||
|
|
9f104866b2 | ||
|
|
7ec9eb08d9 | ||
|
|
2ea3d60307 | ||
|
|
7595ca0c40 | ||
|
|
5a15d34d9e | ||
|
|
cc500e4681 | ||
|
|
4c7cf56655 | ||
|
|
f570e77325 | ||
|
|
9785878d87 | ||
|
|
6cd6c87127 | ||
|
|
8d7c7743b8 | ||
|
|
b9889d2c45 | ||
|
|
a58257bc38 | ||
|
|
7924dfeab2 | ||
|
|
989c0bf55f | ||
|
|
064c7a3cd0 | ||
|
|
e1b2702231 | ||
|
|
029f399a14 | ||
|
|
7588609c56 | ||
|
|
6513df10e7 | ||
|
|
d14a74f29e | ||
|
|
2f9c66eafb | ||
|
|
ad1707f0ee | ||
|
|
aa59ed112a | ||
|
|
7be8c9d8aa | ||
|
|
f408a5d4c6 | ||
|
|
5d8084986f | ||
|
|
5bd1ef882e | ||
|
|
6167c3b526 | ||
|
|
8188ae09f5 | ||
|
|
9c81ba368f | ||
|
|
39cb8fd554 | ||
|
|
623cdaf881 | ||
|
|
1ad559212e | ||
|
|
30e10bb645 | ||
|
|
df495f8131 | ||
|
|
529da10615 | ||
|
|
f2d6691af7 | ||
|
|
a8a1e9448e | ||
|
|
d58959fcca | ||
|
|
5fca206b8d | ||
|
|
67993364b4 | ||
|
|
25652eab15 | ||
|
|
f117239184 | ||
|
|
cc3dae127b | ||
|
|
137050be16 | ||
|
|
baf1b851c4 | ||
|
|
545ab2de79 | ||
|
|
38f845bb7e | ||
|
|
9f80553749 | ||
|
|
d7d4e58106 | ||
|
|
5293417900 | ||
|
|
9a59c40ce1 | ||
|
|
8a00e260f6 | ||
|
|
1285a0c6bf | ||
|
|
eb9d913cb6 | ||
|
|
a60340f330 | ||
|
|
796a42c981 | ||
|
|
63a81b939d | ||
|
|
a9e2544188 | ||
|
|
bea01bc794 | ||
|
|
3db74c79ab | ||
|
|
799c933d95 | ||
|
|
6b9e67f96b | ||
|
|
062d846c37 | ||
|
|
af3023562d | ||
|
|
92f4e3dd81 | ||
|
|
f7eb445d61 | ||
|
|
98b77278cd | ||
|
|
60461b9cff | ||
|
|
1394c70981 | ||
|
|
595b8c3b56 | ||
|
|
27cbd844f0 | ||
|
|
5c5c1ed402 | ||
|
|
245c7e8219 | ||
|
|
3079663ba9 | ||
|
|
25d54ae229 | ||
|
|
045c35243f | ||
|
|
5009ffbb5a | ||
|
|
47b43402f5 | ||
|
|
a5dbec5303 | ||
|
|
f3f82c4f1a | ||
|
|
653ca4b322 | ||
|
|
b57800c2e2 | ||
|
|
222c03aa67 | ||
|
|
d5ff2b5b63 | ||
|
|
0a95488146 | ||
|
|
93d21efd3d | ||
|
|
d71cd20a39 | ||
|
|
19201134a8 | ||
|
|
da2f153a43 | ||
|
|
d96b88b967 | ||
|
|
d33482e200 | ||
|
|
24ebb77860 | ||
|
|
e4bac5f81a | ||
|
|
4b9a15b003 | ||
|
|
32826467d3 | ||
|
|
886ac734f9 | ||
|
|
762c66ff42 | ||
|
|
53b8c2328e | ||
|
|
578c661730 | ||
|
|
a82bbc4e66 | ||
|
|
867cd4ee39 | ||
|
|
f7b841faf3 | ||
|
|
b80902ec10 | ||
|
|
90386cd0de | ||
|
|
e22bba0360 | ||
|
|
f82b52b017 | ||
|
|
2734b18d07 | ||
|
|
3a5a47aaa2 | ||
|
|
c7bc9aa43c | ||
|
|
c956f23def | ||
|
|
0f90efa05f | ||
|
|
e3821e1741 | ||
|
|
8bf9a910d5 | ||
|
|
83a6346a8d | ||
|
|
d9291e6457 | ||
|
|
2bd2fa3228 | ||
|
|
b03dfa9951 | ||
|
|
dd5cbb0e4c | ||
|
|
18034a334c | ||
|
|
17881b342a | ||
|
|
47e50d035f | ||
|
|
5af9f025d8 | ||
|
|
c12c43e79a | ||
|
|
9e4ed56384 | ||
|
|
8f08a32c5a | ||
|
|
fdb6137339 | ||
|
|
f173cf73d4 | ||
|
|
a91c72fb44 | ||
|
|
99abe3994c | ||
|
|
a0e3d70a3f | ||
|
|
ee7eaecdb3 | ||
|
|
a105c5cb11 | ||
|
|
4d30cc2309 | ||
|
|
ca78bf9851 | ||
|
|
d7027cc0e3 | ||
|
|
f8def524aa | ||
|
|
14532bfa9a | ||
|
|
721808d71d | ||
|
|
3c9c61056d | ||
|
|
19f7800173 | ||
|
|
df702736bf | ||
|
|
3737242226 | ||
|
|
ebff5e2f4d | ||
|
|
081781f223 | ||
|
|
c570f4a972 | ||
|
|
563c5f830d | ||
|
|
248fd92f6e | ||
|
|
757654aa9d | ||
|
|
e658304405 | ||
|
|
b5e5118450 | ||
|
|
95db675de5 | ||
|
|
cae6addf26 | ||
|
|
ed26971724 | ||
|
|
7cdcdfa3c9 | ||
|
|
8314f6c1db | ||
|
|
297fe0a538 | ||
|
|
b6592b38ad | ||
|
|
8ef0221d43 | ||
|
|
b1d6a49a82 | ||
|
|
0fcba4f4ec | ||
|
|
0ee6369884 | ||
|
|
b941a6a422 | ||
|
|
2d05d601a0 | ||
|
|
90f363a2be | ||
|
|
875b85b0fc | ||
|
|
29c1623aab | ||
|
|
a914bc349a | ||
|
|
88e20e2eb6 | ||
|
|
9d343a3f29 | ||
|
|
6b7f00ef76 | ||
|
|
c2a1d289e1 | ||
|
|
20ce8cc288 | ||
|
|
6eaeb5a201 | ||
|
|
f245bb8263 | ||
|
|
f746fda5a8 | ||
|
|
a7ab4153ef | ||
|
|
5057ac3d3d | ||
|
|
4b9d3e34ea | ||
|
|
7887e10bb6 | ||
|
|
ef88be547b | ||
|
|
dd73ba4f72 | ||
|
|
467adbd3ed | ||
|
|
2bf69c2df2 | ||
|
|
7ccc0eb488 | ||
|
|
97db997473 | ||
|
|
efbc246a72 | ||
|
|
9ce209ef42 | ||
|
|
df7ef32677 | ||
|
|
1a4945eecd | ||
|
|
e3e88d449d | ||
|
|
529f9a0e01 | ||
|
|
b5add583c9 | ||
|
|
c2d8b43eab | ||
|
|
6d823263ac | ||
|
|
a9b3640b69 | ||
|
|
17323c715d | ||
|
|
2420b8052e | ||
|
|
5c54e8a08d | ||
|
|
fa220a93eb | ||
|
|
7e164b40c7 | ||
|
|
323ceb9ced | ||
|
|
681a0dc0e4 | ||
|
|
7cbd20a038 | ||
|
|
3f5500c637 | ||
|
|
7513b0499d | ||
|
|
c4b447f7b6 | ||
|
|
177b0fbf33 | ||
|
|
7f5e53782b | ||
|
|
2184ef19ca | ||
|
|
712aa0dbf0 | ||
|
|
c33611d2d3 | ||
|
|
bf15415185 | ||
|
|
7a38e8ceb9 | ||
|
|
7f6c429a55 | ||
|
|
6eeecb271b | ||
|
|
109d5afcf5 | ||
|
|
116706c09f | ||
|
|
598b51a4bf | ||
|
|
b06b9c69ca | ||
|
|
704f946cf7 | ||
|
|
1ef9dc8de6 | ||
|
|
f9d10a9571 | ||
|
|
379c5791e6 | ||
|
|
8569f47627 | ||
|
|
555bbb550f | ||
|
|
4cf09f2e34 | ||
|
|
c9abd745c5 | ||
|
|
5d1b8dbb85 | ||
|
|
ebeb1905b3 | ||
|
|
605b217ba4 | ||
|
|
814bd9d85e | ||
|
|
8d16ebf6ae | ||
|
|
7f0af23f96 | ||
|
|
060370f356 | ||
|
|
ab384df279 | ||
|
|
9a0cc02b86 | ||
|
|
5fb86d8df3 | ||
|
|
c64c27331a | ||
|
|
cd2ca76236 | ||
|
|
9598e0e4f8 | ||
|
|
d29c2bdfb7 | ||
|
|
538b467fa6 | ||
|
|
7deca33374 | ||
|
|
c704813a6c | ||
|
|
86af7f054a | ||
|
|
a6932bb71f | ||
|
|
3384b6bc17 | ||
|
|
4bdb566fb5 | ||
|
|
5ad62a03ed | ||
|
|
280b6fae2a | ||
|
|
e07c994ddc | ||
|
|
5d974858fe | ||
|
|
5cb5992d44 | ||
|
|
fddbeda81e | ||
|
|
1c1ec10a0a | ||
|
|
cd9566fbc8 | ||
|
|
90b88f3cbf | ||
|
|
faf86b2439 | ||
|
|
5a1dadf476 | ||
|
|
6eabb17f67 | ||
|
|
4f72edeaee | ||
|
|
b0f3d04439 | ||
|
|
33a34fc149 | ||
|
|
679f573444 | ||
|
|
f35b931004 | ||
|
|
7ca50291e3 | ||
|
|
9c8a8e2e9c | ||
|
|
d45a370a4d | ||
|
|
d5907711e1 | ||
|
|
437463f1b4 | ||
|
|
d6b52bcc54 | ||
|
|
3738459fa6 | ||
|
|
be4d071250 | ||
|
|
91a2aa6781 | ||
|
|
ba08c3ad2f | ||
|
|
220c45b800 | ||
|
|
a42e724f50 | ||
|
|
1002ca4016 | ||
|
|
c1b11a55d5 | ||
|
|
a21a2079c6 | ||
|
|
07d219c77b | ||
|
|
b7b8bdc841 | ||
|
|
dd5c1bb1a4 | ||
|
|
5f46dcbab0 | ||
|
|
66b9bfbbd5 | ||
|
|
dfbe2e9739 | ||
|
|
3d10c56aac | ||
|
|
84624a4884 | ||
|
|
68ac978d45 | ||
|
|
8136eb15e1 | ||
|
|
2c95a1e71c | ||
|
|
c85d4224ad | ||
|
|
a74bee5bed | ||
|
|
9dae40f455 | ||
|
|
fe7a5a2ae5 | ||
|
|
44a3108982 | ||
|
|
c0beee9189 | ||
|
|
ea045e6c34 | ||
|
|
7c38a77f60 | ||
|
|
9174ad854c | ||
|
|
2960f2a3bb | ||
|
|
cfe073cd20 | ||
|
|
459871257e | ||
|
|
4bb4b96a10 | ||
|
|
68a18df969 | ||
|
|
8c921f427c | ||
|
|
90e1d7236e | ||
|
|
decb20d2d1 | ||
|
|
ff7cb4bbbe | ||
|
|
a68fca9dda | ||
|
|
944bfe2b06 | ||
|
|
762151f067 | ||
|
|
0327b66a1d | ||
|
|
2c95229cfc | ||
|
|
18fa4062e6 | ||
|
|
5c7520f552 | ||
|
|
875d2392b5 | ||
|
|
a68eac7cd2 | ||
|
|
42efec6e2b | ||
|
|
bcb953a45a | ||
|
|
bca5b43a2a | ||
|
|
da704539f0 | ||
|
|
bd9a1dda88 | ||
|
|
915258169e | ||
|
|
1b207251e8 | ||
|
|
b7a0829e76 | ||
|
|
48feee2bfc | ||
|
|
08e145f831 | ||
|
|
a44e28bbab | ||
|
|
21cad97f3f | ||
|
|
de97b5b15f | ||
|
|
1e8d04a07d | ||
|
|
a8a33a3a2b | ||
|
|
adafcda13d | ||
|
|
c478492227 | ||
|
|
07b11b4f4a | ||
|
|
beed8437a4 | ||
|
|
501adc503c | ||
|
|
907516eb71 | ||
|
|
9308fc7712 | ||
|
|
062d3759be | ||
|
|
c699baaa41 | ||
|
|
582e4a11d4 | ||
|
|
285744a274 | ||
|
|
faaa252fa8 | ||
|
|
b01fd89373 | ||
|
|
ed5702188c | ||
|
|
f9165a1b64 | ||
|
|
bd0ce3dd71 | ||
|
|
385a483a29 | ||
|
|
3b97f843cd | ||
|
|
3766da5a3a | ||
|
|
c3fa950a9f | ||
|
|
a114e56e06 | ||
|
|
04e60d95e4 | ||
|
|
000313ee9a | ||
|
|
dc54551d0c | ||
|
|
b3dc05e5ce | ||
|
|
3c57127a6c | ||
|
|
d16a760466 | ||
|
|
3761ebf8c7 | ||
|
|
a7d78f7f69 | ||
|
|
f59c0722e0 | ||
|
|
1735f48f23 | ||
|
|
a280c1ad39 | ||
|
|
ce4ae73f55 | ||
|
|
fd065fb7c5 | ||
|
|
5ad2511e17 | ||
|
|
8fe47391bf | ||
|
|
12279731ad | ||
|
|
a13c417352 | ||
|
|
a8d0a4dd14 | ||
|
|
f8b4a6e28a | ||
|
|
85e048f22a | ||
|
|
3257c79e69 | ||
|
|
ee54e153bf | ||
|
|
9ea6c34543 | ||
|
|
005c91eb4d | ||
|
|
806312e248 | ||
|
|
bd805bfdc4 | ||
|
|
98a8f7f072 | ||
|
|
28b7f6febc | ||
|
|
d2ad3aea44 | ||
|
|
3ffc55b539 | ||
|
|
96c58e7b1c | ||
|
|
c8171b3f43 | ||
|
|
857ae523cf | ||
|
|
232f2494e3 | ||
|
|
626eb14960 | ||
|
|
c131672870 | ||
|
|
10a2e6b959 | ||
|
|
a9c49d948a | ||
|
|
79a2304728 | ||
|
|
48edd01461 | ||
|
|
3adffdc438 | ||
|
|
655ef137c1 | ||
|
|
b11456d86b | ||
|
|
abb5e27358 | ||
|
|
42a7b5a1b2 | ||
|
|
7ba2630dd2 | ||
|
|
bbeabd20b8 | ||
|
|
7e323bc497 | ||
|
|
7e008226ec | ||
|
|
4e7c520abe | ||
|
|
dce64a0b34 | ||
|
|
aa9a1df1ab | ||
|
|
4537aaf339 | ||
|
|
44a4ffb26a | ||
|
|
9408946b36 | ||
|
|
cad6e7604d | ||
|
|
e452289603 | ||
|
|
0c95eaa1c3 | ||
|
|
c1cce6be9a | ||
|
|
0afcb893e3 | ||
|
|
c7050565b8 | ||
|
|
3c436c0259 | ||
|
|
8b6b3c77e4 | ||
|
|
5eb3771704 | ||
|
|
9fd4795cb3 | ||
|
|
23eadaeaee | ||
|
|
8ccba70788 | ||
|
|
91c2987cfe | ||
|
|
5b403da966 | ||
|
|
e6e7da89cc | ||
|
|
64e0b6c711 | ||
|
|
238c0e8d40 | ||
|
|
f35eb3054c | ||
|
|
ea25b559ed | ||
|
|
ad8e723005 | ||
|
|
4542e9511b | ||
|
|
c4b23b8c87 | ||
|
|
6f19d2d6d1 | ||
|
|
7cb4e1d00e | ||
|
|
28e8339a32 | ||
|
|
99ac42c168 | ||
|
|
8d97391bf3 | ||
|
|
2836184de3 | ||
|
|
196ff53927 | ||
|
|
aaba566b1e | ||
|
|
7191dcaa15 | ||
|
|
437b16ccd5 | ||
|
|
e4b0a99141 | ||
|
|
3e5300f03c | ||
|
|
abb09153f0 | ||
|
|
05437a3e70 | ||
|
|
c697704d04 | ||
|
|
bc09187dc1 | ||
|
|
fd53881221 | ||
|
|
2024614b68 | ||
|
|
3521f9ac36 | ||
|
|
d6973a301b | ||
|
|
ae7fcbc8ad | ||
|
|
b675018acf | ||
|
|
10984cbeb7 | ||
|
|
bae0cd5e3e | ||
|
|
e4750249e9 | ||
|
|
662bae45b7 | ||
|
|
c0e56c7c19 | ||
|
|
390653a9a6 | ||
|
|
0cd04381a4 | ||
|
|
dcefaa6b19 | ||
|
|
3063538ad0 | ||
|
|
604b694709 | ||
|
|
1c9309ac98 | ||
|
|
e7c89f28ba | ||
|
|
97a8f41e12 | ||
|
|
be5bf7961e | ||
|
|
318db58be1 | ||
|
|
0deed6e00d | ||
|
|
5ad9d51fb0 | ||
|
|
907b5e020c | ||
|
|
a8d13fadb3 | ||
|
|
0137105a6d | ||
|
|
5364d89ca8 | ||
|
|
744fa25349 | ||
|
|
3027490256 | ||
|
|
89dfcaf626 | ||
|
|
4fb0738c1a | ||
|
|
e8f4f7049b | ||
|
|
0087e382ed | ||
|
|
eb9e48ecdc | ||
|
|
34f8451ac5 | ||
|
|
894503d56b | ||
|
|
ee8c3d609f | ||
|
|
b2c1c24902 | ||
|
|
6e8ea8689b | ||
|
|
7fcb489f38 | ||
|
|
10b0a6fbb6 | ||
|
|
ecc1cce033 | ||
|
|
10d8ce86b3 | ||
|
|
b0fc69c308 | ||
|
|
5cc421cff9 | ||
|
|
ca1ba4f422 | ||
|
|
a2d9489ad5 | ||
|
|
232ee9b63b | ||
|
|
7861c76730 | ||
|
|
d7aa23681b | ||
|
|
b75016a186 | ||
|
|
6882b7074c | ||
|
|
83bca3c23f | ||
|
|
a075e31a4e | ||
|
|
bdd32688fa | ||
|
|
cb857d828f | ||
|
|
440d469fa2 | ||
|
|
82da5e5a60 | ||
|
|
a191d0de16 | ||
|
|
ae6cff5325 | ||
|
|
eb9520cdc3 | ||
|
|
f8f20097a9 | ||
|
|
cbb0f87676 | ||
|
|
a6e1488545 | ||
|
|
34c009e4e5 | ||
|
|
b67242c609 | ||
|
|
6e4516272b | ||
|
|
08383c9141 | ||
|
|
2e37175dc2 | ||
|
|
f25442337d | ||
|
|
56a34ec2f8 | ||
|
|
362962dfb3 | ||
|
|
77d572190e | ||
|
|
18f7459070 | ||
|
|
e71b08de3f | ||
|
|
e8f8473e1c | ||
|
|
1d0d032431 | ||
|
|
fac7dafca5 | ||
|
|
fbebf2d75e | ||
|
|
a51f347371 | ||
|
|
6cee137780 | ||
|
|
56b48a803a | ||
|
|
3318d682fd | ||
|
|
1fe3c337e1 | ||
|
|
2442520ef3 | ||
|
|
44183f19cd | ||
|
|
23b68a867c | ||
|
|
4d16dbf76f | ||
|
|
6911d061a7 | ||
|
|
ab9c0434e1 | ||
|
|
3b932bd6b3 | ||
|
|
256839765a | ||
|
|
46f9967dba | ||
|
|
d91d47a755 | ||
|
|
5a2c047e7a | ||
|
|
5ca8b0aef8 | ||
|
|
e249ea1f0a | ||
|
|
e1b06d3872 | ||
|
|
a4ed1644f3 | ||
|
|
ad12866bf4 | ||
|
|
b04acf98c7 | ||
|
|
6b58d86248 | ||
|
|
7f6069e76b | ||
|
|
04d5ae074a | ||
|
|
85067b2574 | ||
|
|
06340e593d | ||
|
|
a896961fc4 | ||
|
|
73a62b8123 | ||
|
|
6d8a763f4c | ||
|
|
61b5c90aa7 | ||
|
|
d7eff51805 | ||
|
|
da7a57026d | ||
|
|
643e3dc2da | ||
|
|
13086c7cac | ||
|
|
41b22e8951 | ||
|
|
d76e70b1f7 | ||
|
|
c7c5c79365 | ||
|
|
87eceb5264 | ||
|
|
7b29972af0 | ||
|
|
4258f52f86 | ||
|
|
c3a7abd5f2 | ||
|
|
a5f5472853 | ||
|
|
63fc733c88 | ||
|
|
b5944f66a7 | ||
|
|
c8a19a1d83 | ||
|
|
6ab525be7b | ||
|
|
fd1932cfd8 | ||
|
|
2eb9fe7e62 | ||
|
|
ac1943758d | ||
|
|
1f86c6ab21 | ||
|
|
44f8f5e66d | ||
|
|
0be8a56ba3 | ||
|
|
0b4d49d760 | ||
|
|
2bd266cd69 | ||
|
|
0380d80138 | ||
|
|
e297d825e3 | ||
|
|
53a639e7ae | ||
|
|
a23b6feb46 | ||
|
|
603fe9cbd8 | ||
|
|
17d61b51e9 | ||
|
|
8d85106ee8 | ||
|
|
0834610f8e | ||
|
|
2e289a1d18 | ||
|
|
b4418c02ca | ||
|
|
52b46a17cd | ||
|
|
05e056a28b | ||
|
|
7b1eefb115 | ||
|
|
d50ceaa172 | ||
|
|
34b0db57ae | ||
|
|
0c9de82e99 | ||
|
|
11ce8524ac | ||
|
|
4a8534c164 | ||
|
|
593b6fc3ac | ||
|
|
33315bc271 | ||
|
|
c3e406e95b | ||
|
|
dad71f1179 | ||
|
|
03382ea987 | ||
|
|
54eed43f94 | ||
|
|
404bc6725b | ||
|
|
1b7b3d1d28 | ||
|
|
d3662d226b | ||
|
|
d699000dc3 | ||
|
|
a18a1875d3 | ||
|
|
bf523c93d1 | ||
|
|
b58cbf85e5 | ||
|
|
e38bdffc84 | ||
|
|
89a01b3997 | ||
|
|
a4085c1a5a | ||
|
|
4fa57fd642 | ||
|
|
5f670a88a4 | ||
|
|
2cadde1187 | ||
|
|
bd7e36e38c | ||
|
|
4eb69eac66 | ||
|
|
8b5f6d1e67 | ||
|
|
3a4db0a675 | ||
|
|
b2352105e6 | ||
|
|
70cb461c32 | ||
|
|
f2628097ce | ||
|
|
49e85e2b8a | ||
|
|
d7353e01b0 | ||
|
|
6674423ea4 | ||
|
|
918ee46ecc | ||
|
|
e34c291bd6 | ||
|
|
6c39966fef | ||
|
|
32d6fd5386 | ||
|
|
f64d5446a4 | ||
|
|
ed17f1bb50 | ||
|
|
8c27ead19e | ||
|
|
247cc1ebe8 | ||
|
|
ea5ab1c2f5 | ||
|
|
1e53803353 | ||
|
|
6d1464d3f4 | ||
|
|
2d6defba11 | ||
|
|
658822166a | ||
|
|
4c6ee807a7 | ||
|
|
32b7d37861 | ||
|
|
afe767c6db | ||
|
|
b37430994d | ||
|
|
c51373dc9a | ||
|
|
421a5e8141 | ||
|
|
9fe19e763a | ||
|
|
6731ade5d9 | ||
|
|
cf3eb8b993 | ||
|
|
5333c38972 | ||
|
|
d9e057eb4f | ||
|
|
33cd80da7e | ||
|
|
8231b3aebe | ||
|
|
7fbbc5f4b8 | ||
|
|
91687339bf | ||
|
|
b3181d1429 | ||
|
|
3ef8aa9e7f | ||
|
|
1a7195386c | ||
|
|
77acdc1a17 | ||
|
|
aecf9fb9b1 | ||
|
|
c8d1304e7f | ||
|
|
796a508af0 | ||
|
|
6751acb6c4 | ||
|
|
475fb97730 | ||
|
|
acee33aae6 | ||
|
|
65f60098c8 | ||
|
|
19a75abaf3 | ||
|
|
fa36de2c78 | ||
|
|
0f49ce2f9d | ||
|
|
73b24657f5 | ||
|
|
e03db26530 | ||
|
|
3fd3777e8c | ||
|
|
7ad73cd476 | ||
|
|
c5e0fcae9a | ||
|
|
4ca25df410 | ||
|
|
56b5986fc5 | ||
|
|
05c1a31f00 | ||
|
|
e0b88b750d | ||
|
|
b0c2d6f71c | ||
|
|
4e28a10aaa | ||
|
|
49205f0361 | ||
|
|
47819180c4 | ||
|
|
be3fa19c0a | ||
|
|
32a2734082 | ||
|
|
b28b0c3018 | ||
|
|
ee5eb59e42 | ||
|
|
d3f4d8dd41 | ||
|
|
d44ecaabf7 | ||
|
|
d133ca4a0f | ||
|
|
f8df3239d5 | ||
|
|
f9d957a827 | ||
|
|
bef3e3d18f | ||
|
|
aca764c288 | ||
|
|
3c0282b04f | ||
|
|
d8c081b8d3 | ||
|
|
53ca96f158 | ||
|
|
f8895c7c78 | ||
|
|
12b45d95e0 | ||
|
|
1cdfeadd86 | ||
|
|
15fec93bf1 | ||
|
|
64d2de010d | ||
|
|
ad1cd2c993 | ||
|
|
687de97fcd | ||
|
|
9d0331e190 | ||
|
|
ca863ba8c6 | ||
|
|
b9a2279966 | ||
|
|
9a91250af7 | ||
|
|
05d01e70b7 | ||
|
|
6b313cb65e | ||
|
|
a4de84b6da | ||
|
|
31550bd010 | ||
|
|
5d63c359b3 | ||
|
|
8283816418 | ||
|
|
44be8b3791 | ||
|
|
f46a2bb618 | ||
|
|
96366aae42 | ||
|
|
fd8879b46d | ||
|
|
d962ef09ff | ||
|
|
b26d2ef906 | ||
|
|
0613886659 | ||
|
|
75d7ffb447 | ||
|
|
0b5c173945 | ||
|
|
f170aed1b9 | ||
|
|
1921b46a66 | ||
|
|
bccf90b093 | ||
|
|
deebc83f1e | ||
|
|
a319df630d | ||
|
|
ab5eb2c7ef | ||
|
|
3de06c269d | ||
|
|
876839348c | ||
|
|
755e8a007a | ||
|
|
6a2e1a8114 | ||
|
|
11b25151f7 | ||
|
|
35bb80d67a | ||
|
|
7859f5ebd6 | ||
|
|
f38d753341 | ||
|
|
d1007bbb38 | ||
|
|
0886fdabd3 | ||
|
|
891f8b143f | ||
|
|
7856716a3a | ||
|
|
4eb4b2c37f | ||
|
|
1be617c110 | ||
|
|
f1743e5912 | ||
|
|
102c1f99a7 | ||
|
|
ae3434cb89 | ||
|
|
63b743f85b | ||
|
|
73f6418db3 | ||
|
|
d9c25b1acc | ||
|
|
6c18fdb175 | ||
|
|
cd009388a4 | ||
|
|
d66c2f2f5d | ||
|
|
7534904737 | ||
|
|
bce3593110 | ||
|
|
9a92d180d0 | ||
|
|
a203c17e06 | ||
|
|
69b5134b5f | ||
|
|
8c543ee97f | ||
|
|
bafa6edd28 | ||
|
|
799567579b | ||
|
|
c10e61a165 | ||
|
|
a27e439c99 | ||
|
|
e224d9daa2 | ||
|
|
91d9f99c70 | ||
|
|
c57f0d90bb | ||
|
|
e9198e7946 | ||
|
|
25d1b08a6f | ||
|
|
50395da626 | ||
|
|
2d0209b221 | ||
|
|
44330c98b7 | ||
|
|
b7f72bf55d | ||
|
|
f6d7976eff | ||
|
|
f45a727396 | ||
|
|
d5f65eceb0 | ||
|
|
2285c453da | ||
|
|
193084927b | ||
|
|
1325d53950 | ||
|
|
fa1b56a7cf | ||
|
|
de11f1f90b | ||
|
|
9ba70424e8 | ||
|
|
c5ba5b4647 | ||
|
|
8e47497edb | ||
|
|
7f7dcffdf0 | ||
|
|
9d8a2a9680 | ||
|
|
880df7a482 | ||
|
|
a016eade01 | ||
|
|
b3167c450e | ||
|
|
6ea37c1f17 | ||
|
|
17c5849f33 | ||
|
|
7e8bd606fe | ||
|
|
51e4076084 | ||
|
|
ff0ec98a27 | ||
|
|
bbe4e5e7f5 | ||
|
|
47c25a0e5e | ||
|
|
553e56fe4c | ||
|
|
bea5d39ed5 | ||
|
|
f6932e09f7 | ||
|
|
44ca95bf85 | ||
|
|
5ba7c4ba2c | ||
|
|
605e63e1df | ||
|
|
bf34ea11bd | ||
|
|
7102214c9e | ||
|
|
e60447ecd2 | ||
|
|
77a57d2243 | ||
|
|
b129ef04f3 | ||
|
|
1f41893aab | ||
|
|
c8e8f39f9d | ||
|
|
4a79e23485 | ||
|
|
20654b0a77 | ||
|
|
8d77891f76 | ||
|
|
bea74661d1 | ||
|
|
6b7bf843a1 | ||
|
|
200ccfd092 | ||
|
|
67a0a47778 | ||
|
|
933e8cbaed | ||
|
|
daac2baf8e | ||
|
|
4a2bcf6fde | ||
|
|
cd7774f056 | ||
|
|
452fb4f990 | ||
|
|
1f72ddb8a1 | ||
|
|
9af078bb8c | ||
|
|
c88655a2a0 | ||
|
|
a27efd94c8 | ||
|
|
9a26ac380a | ||
|
|
240653c429 | ||
|
|
bac3a76d9a | ||
|
|
3a4aed0b34 | ||
|
|
7f5073476c | ||
|
|
1abc3ebea6 | ||
|
|
c21003e1b7 | ||
|
|
1fd0211725 | ||
|
|
1932c7af4f | ||
|
|
94422dab77 | ||
|
|
b10ca3ebcf | ||
|
|
aa2ff4b741 | ||
|
|
284a462936 | ||
|
|
858e0a5b21 | ||
|
|
eaa8e05373 | ||
|
|
3e3d338ed0 | ||
|
|
0c5f5c6e3f | ||
|
|
7c6118bd6f | ||
|
|
7fe99c98f0 | ||
|
|
d6c4c18d35 | ||
|
|
649676e811 | ||
|
|
98c0985657 | ||
|
|
43e93e74b1 | ||
|
|
ba7817170b | ||
|
|
88279906b5 | ||
|
|
134987cb20 | ||
|
|
7b880ae967 | ||
|
|
7e8e3fef61 | ||
|
|
c1147cb9f7 | ||
|
|
54b35ef075 | ||
|
|
fba0a59324 | ||
|
|
c5c7d36bd1 | ||
|
|
83ba55dda5 | ||
|
|
000fff210a | ||
|
|
8965b22f6d | ||
|
|
4023f2412d | ||
|
|
27d56caa48 | ||
|
|
0cc1146f0e | ||
|
|
8aa7b749ca | ||
|
|
55fad45a6c | ||
|
|
22cc12e7a9 | ||
|
|
2812b121ab | ||
|
|
ad3465f0d3 | ||
|
|
fc8b55dce7 | ||
|
|
62d67e9a38 | ||
|
|
079cd7210b | ||
|
|
b60c56f464 | ||
|
|
eb1571d3e4 | ||
|
|
9a13eb36b3 | ||
|
|
9ba5cc1f98 | ||
|
|
2778ec0d9d | ||
|
|
20b0954f8c | ||
|
|
69aa7be6c5 | ||
|
|
73dccbaf24 | ||
|
|
66d836739c | ||
|
|
ab1c44c4fb | ||
|
|
8549c22567 | ||
|
|
d0300de136 | ||
|
|
34c701e039 | ||
|
|
cf0bd6f021 | ||
|
|
3b14dd3b04 | ||
|
|
9a87adf51b | ||
|
|
ce65c7f583 | ||
|
|
82013d5737 | ||
|
|
14377ca354 | ||
|
|
75664961b8 | ||
|
|
c5969c303e | ||
|
|
f4b6b1795e | ||
|
|
b86950d0e7 | ||
|
|
3ef1ac06df | ||
|
|
4c07b6d28d | ||
|
|
7f77cbfd74 | ||
|
|
ca716a65d2 | ||
|
|
4be46cd51d | ||
|
|
bb2b8bc538 | ||
|
|
41ef4f6284 | ||
|
|
cfd3179cb8 | ||
|
|
1a3170c7db | ||
|
|
25463a929a | ||
|
|
408bd49120 | ||
|
|
3fc2d28b95 | ||
|
|
d9eff7bb5c | ||
|
|
4b1c291fca | ||
|
|
0b34b65f76 | ||
|
|
ccb5ceb9b3 | ||
|
|
9fac4f9de4 | ||
|
|
d84c4365c9 | ||
|
|
bec27e0fa6 | ||
|
|
437b02c961 | ||
|
|
e6922eae46 | ||
|
|
b92f4070d4 | ||
|
|
b9750be745 | ||
|
|
973b473100 | ||
|
|
b7606aece0 | ||
|
|
3f62730404 | ||
|
|
c58b28fd00 | ||
|
|
149b3c2e29 | ||
|
|
a412df00c4 | ||
|
|
aa067d4073 | ||
|
|
4c8917c6a0 | ||
|
|
78aefa936f | ||
|
|
2c18adf202 | ||
|
|
083f401ee5 | ||
|
|
6652a7fd83 | ||
|
|
d1b22b0f82 | ||
|
|
0fb08be6e9 | ||
|
|
2da9b99789 | ||
|
|
28bb60244f | ||
|
|
928cd9de94 | ||
|
|
0046fea684 | ||
|
|
864715af40 | ||
|
|
3684d3f9a2 | ||
|
|
69c52c48ab | ||
|
|
9cf5a66e2f | ||
|
|
ae73ef1a33 | ||
|
|
4e2ba4f810 | ||
|
|
aef88cd82f | ||
|
|
9cd40f3ec2 | ||
|
|
a368f0babc | ||
|
|
9565a47c22 | ||
|
|
0df089b3cb | ||
|
|
58efd6158f | ||
|
|
99bd1a52fb | ||
|
|
8ba1725eae | ||
|
|
0a2524fec8 | ||
|
|
162d6aa33a | ||
|
|
fdcdd0fe40 | ||
|
|
8532d388f8 | ||
|
|
ccc144556b | ||
|
|
0b7e438128 | ||
|
|
2f11268dcc | ||
|
|
81514e4192 | ||
|
|
7d5c59aa34 | ||
|
|
dc6d9367b0 | ||
|
|
6c609a6b23 | ||
|
|
b7a3c8568f | ||
|
|
80f84d4001 | ||
|
|
5cecfd14d9 | ||
|
|
8bfcc550f7 | ||
|
|
e40be243de | ||
|
|
033d3bcd4d | ||
|
|
449ec15309 | ||
|
|
8b0ccd81e2 | ||
|
|
a206fd7541 | ||
|
|
77472cb9f4 | ||
|
|
5372d4b8e7 | ||
|
|
0255f3c42f | ||
|
|
eb5c10d375 | ||
|
|
9f6766fb82 | ||
|
|
ab77eb98c0 | ||
|
|
85ab5d7741 | ||
|
|
6457ff315f | ||
|
|
c09a9c88b4 | ||
|
|
e8dc4c893f | ||
|
|
b61edb0d8e | ||
|
|
94b3b51602 | ||
|
|
5415a24f4e | ||
|
|
048ae2fcd0 | ||
|
|
3a4d425a1c | ||
|
|
0a8fc31be1 | ||
|
|
f6ae076731 | ||
|
|
76296d8d41 | ||
|
|
5024375466 | ||
|
|
527b5e6f99 | ||
|
|
17115460b7 | ||
|
|
84aaec6bff | ||
|
|
0a8f740a14 | ||
|
|
8bf230e057 | ||
|
|
1f51ee7233 | ||
|
|
4cd70ee711 | ||
|
|
3d1d73a81a | ||
|
|
ad4d142e94 | ||
|
|
0f77da15ff | ||
|
|
a05ea7c1ce | ||
|
|
8945fc27d7 | ||
|
|
ac91ecc5f6 | ||
|
|
925aaf345c | ||
|
|
2510751fdf | ||
|
|
83e94dbf4a | ||
|
|
41ab131a4d | ||
|
|
252c996abf | ||
|
|
acf5fc1ee4 | ||
|
|
c141d6efc7 | ||
|
|
3b48f11f7b | ||
|
|
9ec8e2daf7 | ||
|
|
4f84200a47 | ||
|
|
e4a99c4a3d | ||
|
|
75adf7c9d4 | ||
|
|
5fc693da22 | ||
|
|
12e2f8b35a | ||
|
|
1e7dbac34e | ||
|
|
e39876ae67 | ||
|
|
ff3bc9a0cd | ||
|
|
dfe1850b93 | ||
|
|
6f50fdc026 | ||
|
|
5c490be861 | ||
|
|
849c7b4fcf | ||
|
|
fd5bb94cb5 | ||
|
|
647bbbedb0 | ||
|
|
6cfb21f660 | ||
|
|
c709b019e1 | ||
|
|
faabe5afb2 | ||
|
|
798bf15155 | ||
|
|
543daa2628 | ||
|
|
3bdf81158a | ||
|
|
9b42094273 | ||
|
|
94f3fcba12 | ||
|
|
58b30341ee | ||
|
|
741e0f8fda | ||
|
|
d8885f9156 | ||
|
|
e9aa18fd6b | ||
|
|
7518f8b98b | ||
|
|
c9dab5402e | ||
|
|
e5169378fc | ||
|
|
ca23750c28 | ||
|
|
446fd84035 | ||
|
|
fc264d0b0f | ||
|
|
e9ad372039 | ||
|
|
b1e8efb00b | ||
|
|
73ee2498e8 | ||
|
|
6608877ef0 | ||
|
|
e9159cb2de | ||
|
|
a403c7424c | ||
|
|
de2abdcab0 | ||
|
|
088ce93701 | ||
|
|
b5a7c92c8d | ||
|
|
d4144264d5 | ||
|
|
b221530276 | ||
|
|
8476c83d62 | ||
|
|
9d624bc822 | ||
|
|
f15c841b99 | ||
|
|
019bccd24a | ||
|
|
584c0709e8 | ||
|
|
d577088b8c | ||
|
|
72f5d8addc | ||
|
|
6d959169fa | ||
|
|
076d05c103 | ||
|
|
1e91b21537 | ||
|
|
b64a0b065c | ||
|
|
faf7e5d25f | ||
|
|
fd37c6b040 | ||
|
|
bb4b5d3080 | ||
|
|
d27f17f74b | ||
|
|
3646fad197 | ||
|
|
34491967e2 | ||
|
|
3df70055b0 | ||
|
|
7c0c4ee74d | ||
|
|
ca415cc719 | ||
|
|
6c17615ecb | ||
|
|
9a1376dcb3 | ||
|
|
32161333dd | ||
|
|
a2f5120069 | ||
|
|
e067492cca | ||
|
|
1cdf2ed1ef | ||
|
|
dc90652853 | ||
|
|
459de30e9a | ||
|
|
4fe68c2c93 | ||
|
|
8b0eb9c9d0 | ||
|
|
a2fce6f4a5 | ||
|
|
78b9e5d833 | ||
|
|
4e2156bd2b | ||
|
|
fdc4d2c5d2 | ||
|
|
7a331bdb09 | ||
|
|
5f50b4522c | ||
|
|
2a630bbc7d | ||
|
|
df32569af6 | ||
|
|
361c36349b | ||
|
|
ddbbb14c72 | ||
|
|
a0899d4776 | ||
|
|
4c8761b17b | ||
|
|
7eb446d528 | ||
|
|
d0230af5c9 | ||
|
|
17564506b5 | ||
|
|
dfd18d64c2 | ||
|
|
c3eaf5a1b0 | ||
|
|
152ef7fe38 | ||
|
|
7ad59b7cb0 | ||
|
|
5d19697004 | ||
|
|
8f7c090a23 | ||
|
|
d39c59663a | ||
|
|
9232ea4fd6 | ||
|
|
cd9ff95226 | ||
|
|
54ad8606dc | ||
|
|
4e1ab821e1 | ||
|
|
3016e774ff | ||
|
|
666779b012 | ||
|
|
ba9198bd45 | ||
|
|
29460a310b | ||
|
|
3507c2016a | ||
|
|
6d996a93c8 | ||
|
|
7cd1563805 | ||
|
|
4ad51649cc | ||
|
|
17023d6afd | ||
|
|
ca85c9739a | ||
|
|
b83b7ee2bc | ||
|
|
c47d5dcba6 | ||
|
|
7335c8ea98 | ||
|
|
8d7ef29d3e | ||
|
|
31a1bf35d9 | ||
|
|
051df7401e | ||
|
|
e8cb0f561e | ||
|
|
24f0eb1a2e | ||
|
|
5f1fba0276 | ||
|
|
c88face33e | ||
|
|
c4eedca28b | ||
|
|
9ac3110d3e | ||
|
|
251f8bccaa | ||
|
|
84d3c0d3e8 | ||
|
|
074aa302bc | ||
|
|
638165aad5 | ||
|
|
65798d17ac | ||
|
|
aacce4f77b | ||
|
|
2153377c0e | ||
|
|
006fb177e6 | ||
|
|
cabc010582 | ||
|
|
ae693ed438 | ||
|
|
4c7b2bbb4e | ||
|
|
314af6d000 | ||
|
|
697e883649 | ||
|
|
f81892ea74 | ||
|
|
4e9a253cfa | ||
|
|
2c62cc37e7 | ||
|
|
2fe0ed2ca1 | ||
|
|
b5e7434c9a | ||
|
|
e3f71c26e7 | ||
|
|
7fda025c0d | ||
|
|
383cbe15a6 | ||
|
|
7cace1ee32 | ||
|
|
1be25079d4 | ||
|
|
16cc07c020 | ||
|
|
7d671c2908 | ||
|
|
df2d9ba3d8 | ||
|
|
ffa696b963 | ||
|
|
6f98e35dec | ||
|
|
39419f4ca3 | ||
|
|
e26b6d08e1 | ||
|
|
cb4fcde6f4 | ||
|
|
f12a210665 | ||
|
|
684c25dc2c | ||
|
|
b20dad57fe | ||
|
|
a41cbdde7f | ||
|
|
32ce40e19e | ||
|
|
fe71654f5b | ||
|
|
bef1f76e45 | ||
|
|
752f039411 | ||
|
|
047bbe0edb | ||
|
|
f022a57b23 | ||
|
|
235948a001 | ||
|
|
c650b5c0bb | ||
|
|
81f9f5ec60 | ||
|
|
870a9ba68f | ||
|
|
e334486e96 | ||
|
|
e9633c6522 | ||
|
|
2ea42eab62 | ||
|
|
06056de6bb | ||
|
|
067da7e1d9 | ||
|
|
8c02947c05 | ||
|
|
9d39bb2d62 | ||
|
|
6a4f2f6830 | ||
|
|
120b12feeb | ||
|
|
40853ae92b | ||
|
|
bb64329b07 | ||
|
|
5878c53aa4 | ||
|
|
f4d1c3fcf2 | ||
|
|
136adaebd5 | ||
|
|
188cc5019f | ||
|
|
e41f445e92 | ||
|
|
bd283910fc | ||
|
|
1e0113a58a | ||
|
|
8bf43648ce | ||
|
|
7d5451558d | ||
|
|
c61d5d480e | ||
|
|
960f8ddce7 | ||
|
|
dc758b767f | ||
|
|
3176d892dd | ||
|
|
495d162ef2 | ||
|
|
b61b52c57e | ||
|
|
f2f485731f | ||
|
|
1aad25776c | ||
|
|
07fa0f3e55 | ||
|
|
45105d8c6a | ||
|
|
613001a600 | ||
|
|
0ec5777f12 | ||
|
|
d066c2596b | ||
|
|
c0c1a6bbcf | ||
|
|
b7fde6390e | ||
|
|
feba8785d7 | ||
|
|
4a172a27ad | ||
|
|
ace9c2d9ec | ||
|
|
70e106eeab | ||
|
|
4d38ca1b3c | ||
|
|
576bee40fc | ||
|
|
0efb17af83 | ||
|
|
0228a2849d | ||
|
|
af53a96f67 | ||
|
|
7eab459195 | ||
|
|
5801cd1e0f | ||
|
|
6bb0f2145e | ||
|
|
15f67392dc | ||
|
|
6571c42c39 | ||
|
|
851fa4ca54 | ||
|
|
39dea80d9c | ||
|
|
c102ca7f15 | ||
|
|
9fe187c049 | ||
|
|
f56971e5ac | ||
|
|
fbaaa78b81 | ||
|
|
acb960bfdf | ||
|
|
0ada2496de | ||
|
|
b7ca30efe8 | ||
|
|
db57916af4 | ||
|
|
4f3074eca8 | ||
|
|
a6af99fdbc | ||
|
|
d6df48430b | ||
|
|
7a01376144 | ||
|
|
2fb9533575 | ||
|
|
66a4d7c2ee | ||
|
|
c66c277221 | ||
|
|
98a731e5df | ||
|
|
74cb0d5167 | ||
|
|
478812d648 | ||
|
|
e759fbb5db | ||
|
|
c24485b5f9 | ||
|
|
8eae83f218 | ||
|
|
09495695f2 | ||
|
|
14a86160d6 | ||
|
|
f59f178cec | ||
|
|
6498c010f8 | ||
|
|
909bbc43d0 | ||
|
|
ce326e24e6 | ||
|
|
4de081efda | ||
|
|
8848758578 | ||
|
|
326c6cb158 | ||
|
|
4e4b35b2e7 | ||
|
|
d7caf2ae3c | ||
|
|
700f0c293e | ||
|
|
00dedaa1ff | ||
|
|
34cba80fd8 | ||
|
|
172ac19585 | ||
|
|
05617a95b7 | ||
|
|
c46bdcf42b | ||
|
|
f739060ebb | ||
|
|
b9e4466ef0 | ||
|
|
be4af60ad1 | ||
|
|
721297bf21 | ||
|
|
9ff20f3fea | ||
|
|
566c9dbda0 | ||
|
|
ff5bb8acc6 | ||
|
|
195b89f24c | ||
|
|
012aac97ee | ||
|
|
ba70dae9ad | ||
|
|
c43e702ed9 | ||
|
|
9dfbe3b263 | ||
|
|
444eabcebf | ||
|
|
ede4fa5a5d | ||
|
|
cc4ae6eb80 | ||
|
|
0a37031418 | ||
|
|
bd9096ef6d | ||
|
|
246dc34835 | ||
|
|
f90029319e | ||
|
|
18dc323f7f | ||
|
|
a948503895 | ||
|
|
616c9474ce | ||
|
|
77dc403bb9 | ||
|
|
6fd1ee227f | ||
|
|
19eb478067 | ||
|
|
54540fb8ef | ||
|
|
5a74e129a4 | ||
|
|
12c21c9b0a | ||
|
|
61836895b0 | ||
|
|
5f36302057 | ||
|
|
1b9bf4b36e | ||
|
|
9b9cdf8b8f | ||
|
|
ab1a586b4c | ||
|
|
030a3fe4ac | ||
|
|
fd01b9a6d2 | ||
|
|
11be597d11 | ||
|
|
875e5d7252 | ||
|
|
e372a56827 | ||
|
|
471f1ae71d | ||
|
|
a27808ade1 | ||
|
|
2703e849cb | ||
|
|
d57ef2b303 | ||
|
|
5a7626f280 | ||
|
|
1c4e0051a0 | ||
|
|
b3d3921f6e | ||
|
|
976c418c9e | ||
|
|
b2669129f2 | ||
|
|
343e316e4c | ||
|
|
ce219e208c | ||
|
|
358267d6e3 | ||
|
|
786788aa23 | ||
|
|
49b20e37cb | ||
|
|
3f5362a857 | ||
|
|
c7c61df0b8 | ||
|
|
298835be42 | ||
|
|
4a51958da4 | ||
|
|
cff23db7d3 | ||
|
|
f70059b4b6 | ||
|
|
757d22da23 | ||
|
|
4bc4aa26a4 | ||
|
|
cbc0a12dd6 | ||
|
|
100a147a4a | ||
|
|
c405424500 | ||
|
|
23091d60ff | ||
|
|
f0968408b6 | ||
|
|
2bf2be071d | ||
|
|
c502e2cf7e | ||
|
|
2d8446b4e3 | ||
|
|
279162d720 | ||
|
|
a64c21da8b | ||
|
|
4d58c717cd | ||
|
|
634f92b5cd | ||
|
|
24c4af486c | ||
|
|
280fe1aed0 | ||
|
|
7cfa78557e | ||
|
|
f599583856 | ||
|
|
10688a7067 | ||
|
|
188419feb0 | ||
|
|
fd44e2e9bd | ||
|
|
e19d7e88bd | ||
|
|
2446577188 | ||
|
|
fef435b9fb | ||
|
|
1cb3b985a7 | ||
|
|
2292175e9a | ||
|
|
ef04346019 | ||
|
|
381ff1e5d3 | ||
|
|
079f8df6e0 | ||
|
|
56637f50bc | ||
|
|
914888dade | ||
|
|
8e20df57a9 | ||
|
|
7d5191fa2f | ||
|
|
08528a1745 | ||
|
|
a8e3d9ec95 | ||
|
|
e5dd9b61a4 | ||
|
|
6ee2d0574f | ||
|
|
91b5a8036c | ||
|
|
24ab0d8590 | ||
|
|
d8f55006ff | ||
|
|
0817d28b88 | ||
|
|
577c8b4eaf | ||
|
|
5b5f0dce24 | ||
|
|
a818b9a9d4 | ||
|
|
3160c076f0 | ||
|
|
6d0b28fac4 | ||
|
|
ce286cf322 | ||
|
|
7d001c61a8 | ||
|
|
a09e8b9f4d | ||
|
|
395d020411 | ||
|
|
ece4455130 | ||
|
|
cc64ffff98 | ||
|
|
dd332420e5 | ||
|
|
ce8ba6a5af | ||
|
|
21eb824395 | ||
|
|
246e5ca742 | ||
|
|
2bd03ad92c | ||
|
|
7971dc797b | ||
|
|
36c047bfa0 | ||
|
|
d7daab7e64 | ||
|
|
b925e91bbb | ||
|
|
3b1341f2b3 | ||
|
|
667ad0d059 | ||
|
|
da98722470 | ||
|
|
c92fcc9f9a | ||
|
|
8d66ce776c | ||
|
|
412202e105 | ||
|
|
35c9e4e268 | ||
|
|
81ea78e003 | ||
|
|
833698fe8a | ||
|
|
70964e9ba9 | ||
|
|
255a4d516e | ||
|
|
11d26c13b8 | ||
|
|
00b4396f86 | ||
|
|
1d5d0012e6 | ||
|
|
18c706ab8a | ||
|
|
6a65a35dee | ||
|
|
37aab2c759 | ||
|
|
18ad5da081 | ||
|
|
9f65e727c9 | ||
|
|
efa6e8ec31 | ||
|
|
a7df7715b1 | ||
|
|
a9831c842c | ||
|
|
439a5f90c1 | ||
|
|
a6491cf792 | ||
|
|
e1025afb54 | ||
|
|
a5dddf371d | ||
|
|
fe95bbf312 | ||
|
|
0bab4f62de | ||
|
|
981b5cf3bf | ||
|
|
89f47c6a6a | ||
|
|
9fd1687348 | ||
|
|
899eac0e7e | ||
|
|
efad8f41a1 | ||
|
|
ee81935a74 | ||
|
|
e3c4253c13 | ||
|
|
9d991cdd26 | ||
|
|
3fdbf5b062 | ||
|
|
40937acfa0 | ||
|
|
99e4ab22e3 | ||
|
|
8da0c4310c | ||
|
|
280da6b8e9 | ||
|
|
71ff8a773b | ||
|
|
e3c1b9bf64 | ||
|
|
a52552dcb4 | ||
|
|
e8039e158f | ||
|
|
c37ef71f72 | ||
|
|
0388f340cc | ||
|
|
5e437d26d9 | ||
|
|
c10c3547b9 | ||
|
|
528a8e5587 | ||
|
|
ea4487e33f | ||
|
|
c2578bd212 | ||
|
|
a1347dd669 | ||
|
|
3228ba65ae | ||
|
|
08b2d5b7e8 | ||
|
|
2b89dbce0e | ||
|
|
f256309487 | ||
|
|
462abb1ef9 | ||
|
|
a35408d14f | ||
|
|
81d4deaea7 | ||
|
|
9103f89aff | ||
|
|
8e4c2648a3 | ||
|
|
ad020ec329 | ||
|
|
df3be302af | ||
|
|
8e3b8cb572 | ||
|
|
ff1554556e | ||
|
|
b15c93c416 | ||
|
|
071b42c9e0 | ||
|
|
304f9b34fd | ||
|
|
c817a0e9cb | ||
|
|
744252d492 | ||
|
|
9186361a29 | ||
|
|
bf01c9ea0e | ||
|
|
bee260e2b4 | ||
|
|
21811991f1 | ||
|
|
a2809f8d5c | ||
|
|
95f2b597da | ||
|
|
fa348fbc23 | ||
|
|
d277701caa | ||
|
|
9b7f68a888 | ||
|
|
7e837ef9db | ||
|
|
eb78fe4bfc | ||
|
|
689f0fd5db | ||
|
|
32316cf3ab | ||
|
|
d450c9b4d6 | ||
|
|
622673d1d3 | ||
|
|
1209beb47d | ||
|
|
f4eeb94a2e | ||
|
|
fac7eab59e | ||
|
|
e430bfce06 | ||
|
|
dd55cc3cf2 | ||
|
|
9937a173d1 | ||
|
|
1c584040ca | ||
|
|
10a2df5a7d | ||
|
|
1bec3cf1d0 | ||
|
|
4142797380 | ||
|
|
68fc884d2a | ||
|
|
2872bdd1c3 | ||
|
|
7d29a0c0af | ||
|
|
dd6423de06 | ||
|
|
52bbf1affe | ||
|
|
cfaded6cf8 | ||
|
|
69e444f83d | ||
|
|
c896ed5f63 | ||
|
|
9f8456a336 | ||
|
|
bd11c98e45 | ||
|
|
55fccba711 | ||
|
|
783542401b | ||
|
|
2424057536 | ||
|
|
b6dbe82d16 | ||
|
|
f92b7e5b80 | ||
|
|
8093c424e2 | ||
|
|
839d46f5ed | ||
|
|
de0b9a2a68 | ||
|
|
c3bd45cd58 | ||
|
|
c4bab6c9af | ||
|
|
f33d22531b | ||
|
|
9ccbdb69c5 | ||
|
|
e9008923eb | ||
|
|
301e84d698 | ||
|
|
5aad3306eb | ||
|
|
d30bbcd4a3 | ||
|
|
003197b476 | ||
|
|
a3e15bce4d | ||
|
|
e43026231e | ||
|
|
f100f6e3f0 | ||
|
|
8ae2842e5f | ||
|
|
54be03bf77 | ||
|
|
27fc4dd684 | ||
|
|
2a1f0f812b | ||
|
|
64cde13ea7 | ||
|
|
7d23b12f85 | ||
|
|
4b3f757881 | ||
|
|
d0e7f05d50 | ||
|
|
21c957b8d5 | ||
|
|
3fe25f68b1 | ||
|
|
3354a46283 | ||
|
|
975743c76f | ||
|
|
d3b214965b | ||
|
|
eb8065ad20 | ||
|
|
7d3548956e | ||
|
|
3de961f641 | ||
|
|
59620f7f93 | ||
|
|
ba3aa4566e | ||
|
|
8445a6d9db | ||
|
|
f53c8c67e2 | ||
|
|
b4976bd302 | ||
|
|
ec848d7201 | ||
|
|
8c03a296c2 | ||
|
|
65a6e25f1b | ||
|
|
178b625ca0 | ||
|
|
152993f749 | ||
|
|
ca246f9d95 | ||
|
|
f1d53bb7ac | ||
|
|
30950a7d74 | ||
|
|
305f6b7ce2 | ||
|
|
313b794285 | ||
|
|
7031d431da | ||
|
|
655e14b36e | ||
|
|
f881f3d484 | ||
|
|
4d3302a926 | ||
|
|
b2df970af5 | ||
|
|
b7b322a525 | ||
|
|
771c00b146 | ||
|
|
23f1589c28 | ||
|
|
eb72db9a5f | ||
|
|
10fc8f846d | ||
|
|
31c9332e56 | ||
|
|
b0d64bfebd | ||
|
|
ffbd399993 | ||
|
|
aeec7e5f95 | ||
|
|
36301a595b | ||
|
|
a864bf7c18 | ||
|
|
0454169588 | ||
|
|
8ea3623a79 | ||
|
|
866e494d3c | ||
|
|
d5108061c1 | ||
|
|
396998c7fc | ||
|
|
ff3d76a387 | ||
|
|
51c469882b | ||
|
|
8b9a1750de | ||
|
|
3411c3d144 | ||
|
|
cdab5b3f5b | ||
|
|
42edffb309 | ||
|
|
42efc736c3 | ||
|
|
30bb91fc8a | ||
|
|
14daca5fea | ||
|
|
8396c5a3e3 | ||
|
|
e136d1db94 | ||
|
|
90dabce0d2 | ||
|
|
9a8a6e5b16 | ||
|
|
4840db095c | ||
|
|
b371c14a27 | ||
|
|
a1fbca11f0 | ||
|
|
0fe9ccf4a8 | ||
|
|
08713947b7 | ||
|
|
e56bce2f31 | ||
|
|
573374866b | ||
|
|
32afa2a9a3 | ||
|
|
669cbcd142 | ||
|
|
471076cbe1 | ||
|
|
79d353d458 | ||
|
|
30d477c6d2 | ||
|
|
d3f5ebdba7 | ||
|
|
4b94c8ad02 | ||
|
|
7a7c3f15d8 | ||
|
|
52610f7c66 | ||
|
|
84ee4410a6 | ||
|
|
49d51de263 | ||
|
|
848b0cf113 | ||
|
|
c4ffdc1b7c | ||
|
|
49b602994a | ||
|
|
05930ad791 | ||
|
|
e7ab232b28 | ||
|
|
3f88a16c6c | ||
|
|
1a6b98deca | ||
|
|
598863d43a | ||
|
|
b146257b1a | ||
|
|
dc01fb59b8 | ||
|
|
58ed2c0d9e | ||
|
|
3762a9d3b1 | ||
|
|
5a88963929 | ||
|
|
1b69243326 | ||
|
|
3e2a391348 | ||
|
|
a330d2b148 | ||
|
|
573f769825 | ||
|
|
9de49176fb | ||
|
|
e6220f39e5 | ||
|
|
8f656d9dac | ||
|
|
15bcf3f065 | ||
|
|
536e2e33e0 | ||
|
|
ae58f0c1ab | ||
|
|
7d9cd5bfbf | ||
|
|
25a7915c7f | ||
|
|
822d582074 | ||
|
|
d815c0e682 | ||
|
|
f8a73d5fc2 | ||
|
|
a0ad97947d | ||
|
|
6ea5d0849d | ||
|
|
eba512ef0b | ||
|
|
725ab0f713 | ||
|
|
0f96c24c78 | ||
|
|
f2e4c37cd9 | ||
|
|
f159a2250c | ||
|
|
ed311e4059 | ||
|
|
6aae98a8a9 | ||
|
|
99f9cf3340 | ||
|
|
2074039285 | ||
|
|
b438ff61a2 | ||
|
|
c36e43b573 | ||
|
|
be383a524c | ||
|
|
9c6cd22817 | ||
|
|
85de7c35ea | ||
|
|
0dd8c33aa9 | ||
|
|
8cc2538e6c | ||
|
|
04d87ebba7 | ||
|
|
8c4b5b613c | ||
|
|
6add512fe1 | ||
|
|
73b8a2fc9a | ||
|
|
03cc48c991 | ||
|
|
44544925a1 | ||
|
|
7cadf832f5 | ||
|
|
0f3daa5dc4 | ||
|
|
f258cf8c89 | ||
|
|
ca759c056e | ||
|
|
d715607826 | ||
|
|
afca92d122 | ||
|
|
ae37b34692 | ||
|
|
9e42a368e0 | ||
|
|
27982efd29 | ||
|
|
c3b343fbc8 | ||
|
|
9bedb6c741 | ||
|
|
873f4dd298 | ||
|
|
693990644f | ||
|
|
b2680d76a6 | ||
|
|
db935b454f | ||
|
|
c207a9bfff | ||
|
|
f5bd041c7b | ||
|
|
07d89b24af | ||
|
|
1d0c0c527c | ||
|
|
7a9cb86563 | ||
|
|
87b1919863 | ||
|
|
d164e413c2 | ||
|
|
76d7db044f | ||
|
|
046ebb8ecc | ||
|
|
bccde04ace | ||
|
|
9385f03722 | ||
|
|
b48fc17ead | ||
|
|
b50d0075ca | ||
|
|
84d006c71d | ||
|
|
212da9c46c | ||
|
|
8edb7048a1 | ||
|
|
abe3c4b0c9 | ||
|
|
c6d3c97c65 | ||
|
|
13c6a9d612 | ||
|
|
7d2ef743ac | ||
|
|
598d0f96d8 | ||
|
|
cbc22922d3 | ||
|
|
49783d36c2 | ||
|
|
70d91b4f87 | ||
|
|
17f3d13267 | ||
|
|
559674bf58 | ||
|
|
fbc298bc30 | ||
|
|
e36902c441 | ||
|
|
805c78989a | ||
|
|
85e416171c | ||
|
|
b55c0d0783 | ||
|
|
33b4b3835f | ||
|
|
8ccd772105 | ||
|
|
8677c632df | ||
|
|
560476c56f | ||
|
|
20bbe7cec6 | ||
|
|
1a002486d0 | ||
|
|
26fcdfe3bc | ||
|
|
4af98b220c | ||
|
|
f91fcb4ea8 | ||
|
|
b3060e0dc8 | ||
|
|
808a9a7d82 | ||
|
|
32c43e6023 | ||
|
|
4c9c50f939 | ||
|
|
ac1b35379e | ||
|
|
b743589d77 | ||
|
|
9dad0a0d5e | ||
|
|
f5b49bc9ce | ||
|
|
b3612a68b0 | ||
|
|
7385db02c2 | ||
|
|
501d2ec3a2 | ||
|
|
1217a9b7e2 | ||
|
|
6740c5c6dc | ||
|
|
44e8056fb3 | ||
|
|
d1da412cf7 | ||
|
|
6534a5414e | ||
|
|
91344a0b50 | ||
|
|
cdd9ff4469 | ||
|
|
d88b76db85 | ||
|
|
bc1d57853c | ||
|
|
27d6c12556 | ||
|
|
a76dd1ba49 | ||
|
|
1a4388b3e7 | ||
|
|
f1b81f77d6 | ||
|
|
d6edec3a55 | ||
|
|
094f4c6d58 | ||
|
|
c57d0f60f9 | ||
|
|
dd5cd1ca48 | ||
|
|
ab4a565700 | ||
|
|
f8ac54e237 | ||
|
|
089e07fe49 | ||
|
|
1d3b8f802c | ||
|
|
27283e48a2 | ||
|
|
d22584afbc | ||
|
|
249ab01425 | ||
|
|
851097de44 | ||
|
|
c095a51f7c | ||
|
|
5e62b7001e | ||
|
|
a79533bf72 | ||
|
|
e3510d01d6 | ||
|
|
8cc4ba168a | ||
|
|
264a21d092 | ||
|
|
e2585db350 | ||
|
|
a2f7a52d31 | ||
|
|
d04121202d | ||
|
|
95517ade2c | ||
|
|
c9441de7e4 | ||
|
|
dc946cb845 | ||
|
|
5fa30d9adb | ||
|
|
a7043424ec | ||
|
|
e1b3d21732 | ||
|
|
8ffc056a7e | ||
|
|
7c274fb03d | ||
|
|
3b533b5138 | ||
|
|
5665510f7e | ||
|
|
47faa21ef4 | ||
|
|
575f457830 | ||
|
|
d5bf7909e8 | ||
|
|
fdf90b7931 | ||
|
|
e3305e4eae | ||
|
|
15fe8d394e | ||
|
|
082db38c40 | ||
|
|
be54dc41d1 | ||
|
|
487e79c043 | ||
|
|
ef6390a0b8 | ||
|
|
9d9fc65633 | ||
|
|
6eac61c912 | ||
|
|
d89362a271 | ||
|
|
0a407069fa | ||
|
|
661fdb1127 | ||
|
|
9e6c0f72a8 | ||
|
|
70ad2613f1 | ||
|
|
9052946c45 | ||
|
|
3ddc43bf7b | ||
|
|
cdb757eae5 | ||
|
|
50a3e03649 | ||
|
|
957284930e | ||
|
|
198a24371c | ||
|
|
bcc994b0dd | ||
|
|
f870bd5a32 | ||
|
|
a14abd6f4f | ||
|
|
2456c3cf17 | ||
|
|
9828e4ae1d | ||
|
|
030aa887c7 | ||
|
|
ba624a2b48 | ||
|
|
e7582cb1ec | ||
|
|
82bf11fcbc | ||
|
|
ac6e8b1709 | ||
|
|
00cc545795 | ||
|
|
c7ee816aba | ||
|
|
e7f85e67f6 | ||
|
|
d239d2f967 | ||
|
|
63970c6d82 | ||
|
|
4cffdd4f64 | ||
|
|
cb3f0291b7 | ||
|
|
edaffad045 | ||
|
|
172f89940a | ||
|
|
fb4bc397c6 | ||
|
|
e595344941 | ||
|
|
05dbc53fd0 | ||
|
|
0374da573b | ||
|
|
8e64fb8c21 | ||
|
|
0f55402171 | ||
|
|
acb7372eb7 | ||
|
|
057ab050ea | ||
|
|
a01997fe53 | ||
|
|
e4adbf4a1a | ||
|
|
261d68c58e | ||
|
|
38617d1f61 | ||
|
|
cc5bcb8a64 | ||
|
|
b6794f5597 | ||
|
|
18f77308f5 | ||
|
|
6bb473ea8d | ||
|
|
7984f6400c | ||
|
|
3498d093b0 | ||
|
|
a3db32758c | ||
|
|
45952d3759 | ||
|
|
c552b12696 | ||
|
|
0ae9d9dbbf | ||
|
|
8852e3b3a3 | ||
|
|
a496b2d3a8 | ||
|
|
6198dbfe70 | ||
|
|
a81d52a54f | ||
|
|
cf20e8ac5f | ||
|
|
4f8a248c6b | ||
|
|
57d58db35e | ||
|
|
c214ca02e8 | ||
|
|
6b8b0e1771 | ||
|
|
e6671513f2 | ||
|
|
4c7b50d6fb | ||
|
|
1c9229a2fc | ||
|
|
d11c18c024 | ||
|
|
dc4b5b4d35 | ||
|
|
517299d673 | ||
|
|
a8baa7af50 | ||
|
|
a1f847c905 | ||
|
|
f3ea43b1eb | ||
|
|
551b5d0654 | ||
|
|
9f39662df6 | ||
|
|
7ea2156f37 | ||
|
|
5032e7d07e | ||
|
|
c7c6ee9fbc | ||
|
|
4431ca63c2 | ||
|
|
1fa7211cf0 | ||
|
|
de576795dc | ||
|
|
f6286bcc25 | ||
|
|
8276b212e9 | ||
|
|
aabd9247a6 | ||
|
|
997c2ad6a1 | ||
|
|
233a2ba5df | ||
|
|
ed0d5a7cfb | ||
|
|
87f083460c | ||
|
|
2d6dedefb8 | ||
|
|
8adbf36a3a | ||
|
|
8c706b665c | ||
|
|
2e3677a592 | ||
|
|
3602c5087b | ||
|
|
5c84b3d8cc | ||
|
|
7defe7129f | ||
|
|
995dc135b8 | ||
|
|
3f64fb7d5f | ||
|
|
ac8f7a00ae | ||
|
|
6893f34289 | ||
|
|
0a69d62cbe | ||
|
|
5e0096aa2c | ||
|
|
7326205495 | ||
|
|
a8212db7f2 | ||
|
|
2905d77206 | ||
|
|
cb8ec2ce20 | ||
|
|
09f484f956 | ||
|
|
c48922eb3e | ||
|
|
b701a0ef67 | ||
|
|
eb50f4e907 | ||
|
|
6480ea34fc | ||
|
|
511941462f | ||
|
|
34cc783cac | ||
|
|
ecc79b4f49 | ||
|
|
76f10c463f | ||
|
|
41d5144b57 | ||
|
|
de196f2e4f | ||
|
|
0acc2f95fb | ||
|
|
d16eb9b27e | ||
|
|
8760b53a0a | ||
|
|
a40182186f | ||
|
|
ef2b173749 | ||
|
|
75c9284cda | ||
|
|
2abecba7bf | ||
|
|
fb6055cbfe | ||
|
|
639c9ea8c1 | ||
|
|
1872845d2b | ||
|
|
93755c6732 | ||
|
|
68973fd136 | ||
|
|
1a0bd37a01 | ||
|
|
3551779600 | ||
|
|
b8deddcd2c | ||
|
|
c49bf89ead | ||
|
|
4ff4fe2ab2 | ||
|
|
1b99e2cf57 | ||
|
|
55830b0dfb | ||
|
|
e61f56b2e0 | ||
|
|
95ea95be13 | ||
|
|
d72b7fc4df | ||
|
|
0992c74351 | ||
|
|
081c23ad8b | ||
|
|
258f0fc636 | ||
|
|
c4e3864fc0 | ||
|
|
405b6e8047 | ||
|
|
9847912128 | ||
|
|
d89a34cca3 | ||
|
|
6197138380 | ||
|
|
f5f4876182 | ||
|
|
293c1229ff | ||
|
|
ba60f10744 | ||
|
|
c0493de4df | ||
|
|
46b2f69b01 | ||
|
|
f926113c66 | ||
|
|
0e4df51613 | ||
|
|
c5f72dc728 | ||
|
|
cee5b1ee42 | ||
|
|
f1b9cd2e56 | ||
|
|
7807e6d9c4 | ||
|
|
4b354f806d | ||
|
|
41707ca867 | ||
|
|
5bca3a97ec | ||
|
|
3679aa618f | ||
|
|
e9d96f2daf | ||
|
|
f371419396 | ||
|
|
f32d3211ed | ||
|
|
45f99d4c31 | ||
|
|
71a9c90fe9 | ||
|
|
406500b0bd | ||
|
|
9257298e17 | ||
|
|
0376602894 | ||
|
|
95ceabb495 | ||
|
|
6c8ccb1b1e | ||
|
|
f351dd03e7 | ||
|
|
c1e77a49b6 | ||
|
|
9adf6040fa | ||
|
|
3e320618f9 | ||
|
|
6c1de57d32 | ||
|
|
7694d311d1 | ||
|
|
eee1fd941e | ||
|
|
9c5c181389 | ||
|
|
b4b85b1602 | ||
|
|
f6bb1b48f5 | ||
|
|
4ce846a899 | ||
|
|
ef08117f34 | ||
|
|
4b582a7279 | ||
|
|
ad53c1ed7f | ||
|
|
6e46d018a4 | ||
|
|
6beacf9804 | ||
|
|
e15c8d7257 | ||
|
|
3518804cbf | ||
|
|
101f86c8cd | ||
|
|
22c2435656 | ||
|
|
af53275ab9 | ||
|
|
eccbb567e8 | ||
|
|
bae3599388 | ||
|
|
88ab4e53a7 | ||
|
|
25fa2eabbb | ||
|
|
e12d8ec466 | ||
|
|
a7022bddf8 | ||
|
|
523c27237d | ||
|
|
147891f76b | ||
|
|
a5ba52ce05 | ||
|
|
ccb2a4756f | ||
|
|
f5a96b791d | ||
|
|
c628a8a23f | ||
|
|
80f63d79ef | ||
|
|
b225afe6ef | ||
|
|
4e1625b017 | ||
|
|
5c4867365e | ||
|
|
3549a823cb | ||
|
|
23a00d2555 | ||
|
|
57931e7231 | ||
|
|
9e19e0c8af | ||
|
|
74461609c1 | ||
|
|
7d3e6bc7cb | ||
|
|
175606f320 | ||
|
|
b226e94981 | ||
|
|
7d0687aa4a | ||
|
|
d152b8b9e1 | ||
|
|
1fbd561aec | ||
|
|
a8295c9de0 | ||
|
|
e894a3c733 | ||
|
|
a2f8f28010 | ||
|
|
704c876772 | ||
|
|
0233e2ab27 | ||
|
|
5ae8a35740 | ||
|
|
ed766eb656 | ||
|
|
b1b35fe025 | ||
|
|
9b6a9fca3d | ||
|
|
615128eba2 | ||
|
|
8f3b938e39 | ||
|
|
625a1d2191 | ||
|
|
8a35c0235e | ||
|
|
69e8ddcbf6 | ||
|
|
ce8a504750 | ||
|
|
11f3844d63 | ||
|
|
56d5f8eec6 | ||
|
|
7a98cdd28f | ||
|
|
d40c5851e9 | ||
|
|
ccda9f11c8 | ||
|
|
7e133a0be8 | ||
|
|
d0e573613b | ||
|
|
2197b938f8 | ||
|
|
0d3ba67233 | ||
|
|
9d57521b29 | ||
|
|
d98d4ff466 | ||
|
|
71e27b4799 | ||
|
|
f1354edf20 | ||
|
|
4d82112286 | ||
|
|
ba5a44d2d2 | ||
|
|
597ddc7f82 | ||
|
|
6a7bd209a3 | ||
|
|
722f28f086 | ||
|
|
daed15d61f | ||
|
|
c300c47a14 | ||
|
|
89427cb2da | ||
|
|
fce7f1740e | ||
|
|
0357d8e6aa | ||
|
|
55335944e3 | ||
|
|
c0b2985343 | ||
|
|
91ae5990b1 | ||
|
|
33f1a8975c | ||
|
|
7cfba0b602 | ||
|
|
9b28129187 | ||
|
|
78ab7c840a | ||
|
|
669ec3f453 | ||
|
|
dd32b46055 | ||
|
|
7daa43146e | ||
|
|
89d5f2cc4f | ||
|
|
53fb753284 | ||
|
|
81d89d3839 | ||
|
|
469d81df72 | ||
|
|
7d7f5a0bda | ||
|
|
9954195a8f | ||
|
|
62d210de68 | ||
|
|
e19a2920b9 | ||
|
|
8d2189cb8e | ||
|
|
44a044848f | ||
|
|
4f133366e1 | ||
|
|
7c66507960 | ||
|
|
e436988303 | ||
|
|
8b65efc4bd | ||
|
|
7cff20f218 | ||
|
|
131517105e | ||
|
|
ae2592f3d1 | ||
|
|
c009827622 | ||
|
|
afe18379e0 | ||
|
|
5ac61fa71d | ||
|
|
3511f9a7b2 | ||
|
|
e3f7493616 | ||
|
|
a769599448 | ||
|
|
5df8a1e8e7 | ||
|
|
a3d124b552 | ||
|
|
6d95af3963 | ||
|
|
c08a38ff21 | ||
|
|
4a804bae7c | ||
|
|
fd42c7eba6 | ||
|
|
1af86d1354 | ||
|
|
1b77e1c89f | ||
|
|
c42b9351b8 | ||
|
|
ab8c8cd7c8 | ||
|
|
83518b92fe | ||
|
|
1bf1e8981c | ||
|
|
b1f076936d | ||
|
|
319e793cd6 | ||
|
|
c9e1360951 | ||
|
|
c11ad7930f | ||
|
|
7b36a9de51 | ||
|
|
d5e9170109 | ||
|
|
47b447f195 | ||
|
|
e2d27df1a8 | ||
|
|
9a781d940f | ||
|
|
fed36c9487 | ||
|
|
463327c2a7 | ||
|
|
b0050d4a8d | ||
|
|
a743895c3f | ||
|
|
f65666b7a6 | ||
|
|
3a217503fc | ||
|
|
c71b75e13b | ||
|
|
0c890c3a30 | ||
|
|
f38bb0ca22 | ||
|
|
2144fa1837 | ||
|
|
fc4a617da7 | ||
|
|
126ee6e03f | ||
|
|
498867032f | ||
|
|
aef8eca790 | ||
|
|
d8bbb51721 | ||
|
|
6e4fd5a63b | ||
|
|
e7bd6245c2 | ||
|
|
6242cb0b47 | ||
|
|
bf5072e1cf | ||
|
|
c24b673550 | ||
|
|
dfc1e1cf51 | ||
|
|
c600ab6dd1 | ||
|
|
29754c0787 | ||
|
|
9144980474 | ||
|
|
6a449f8db1 | ||
|
|
3780210f76 | ||
|
|
67bad0dec8 | ||
|
|
79291fd7d9 | ||
|
|
ee9d8d6365 | ||
|
|
cc354db464 | ||
|
|
2b29d27b0d | ||
|
|
75db62ee6f | ||
|
|
7cd7b5ba24 | ||
|
|
a3bfcefdca | ||
|
|
098b787355 | ||
|
|
abb9665813 | ||
|
|
012eec47b5 | ||
|
|
2d40afa3a1 | ||
|
|
a92a7d6e02 | ||
|
|
fc7cdb4244 | ||
|
|
d5b375b264 | ||
|
|
99eadbe343 | ||
|
|
38d33dba16 | ||
|
|
b3de4de0cd | ||
|
|
6b5c166a22 | ||
|
|
1aea00036f | ||
|
|
1262847a0e | ||
|
|
21cfb1297f | ||
|
|
0b1cb61986 | ||
|
|
44907b3e8d | ||
|
|
dac616d72c | ||
|
|
528b234d5a | ||
|
|
e4288383f4 | ||
|
|
bb17eb01b8 | ||
|
|
ca6638c740 | ||
|
|
d8ce66ce29 | ||
|
|
8460c157a5 | ||
|
|
0b807569ad | ||
|
|
75d001d09b | ||
|
|
2118379cf7 | ||
|
|
cd2441ee52 | ||
|
|
ffb4fb5c5a | ||
|
|
c404f2206c | ||
|
|
aec5aa48da | ||
|
|
b63051a796 | ||
|
|
ea4650000e | ||
|
|
2d2018b8d0 | ||
|
|
736a853a85 | ||
|
|
dfd4c5f93e | ||
|
|
2ac87acc8a | ||
|
|
3c5a6a3b7b | ||
|
|
6efb5c1b64 | ||
|
|
91de7e5a22 | ||
|
|
1c42ae1ee8 | ||
|
|
c5ac3c9b3d | ||
|
|
0ea32b3318 | ||
|
|
8afc850ed3 | ||
|
|
3c6dcfe5bf | ||
|
|
59d637e0f5 | ||
|
|
923f3088c0 | ||
|
|
4f8aff9c01 | ||
|
|
99ceb9ae79 | ||
|
|
6e0554f4a4 | ||
|
|
36879f8d02 | ||
|
|
fe77df1434 | ||
|
|
713361f973 | ||
|
|
a314b86f57 | ||
|
|
840c90f871 | ||
|
|
2a247595c8 | ||
|
|
4124c3454e | ||
|
|
c4185e3056 | ||
|
|
d6403d495d | ||
|
|
d7f54048ff | ||
|
|
e487eeb395 | ||
|
|
0d0e1c16ea | ||
|
|
f462ff9e8a | ||
|
|
5582556d8a | ||
|
|
ef6214a442 | ||
|
|
369710333c | ||
|
|
30c4fea044 | ||
|
|
eccc5091b5 | ||
|
|
65770d7c5b | ||
|
|
715e873bae | ||
|
|
eced599818 | ||
|
|
6db7755633 | ||
|
|
653c3d3984 | ||
|
|
5ca841837d | ||
|
|
554e037044 | ||
|
|
457d7e4777 | ||
|
|
b3dc465498 | ||
|
|
c56109a64c | ||
|
|
d5e720fe09 | ||
|
|
a42526bb88 | ||
|
|
bd5f44b477 | ||
|
|
d5d8881677 | ||
|
|
ac2178a247 | ||
|
|
24fa8aec35 | ||
|
|
2ba92a0d47 | ||
|
|
ace178834e | ||
|
|
9c88d0a37f | ||
|
|
bafc1b6799 | ||
|
|
c9a575f45d | ||
|
|
c071c895e7 | ||
|
|
a8799bd493 | ||
|
|
20d4a94792 | ||
|
|
89e0948f97 | ||
|
|
6fe3c15f7d | ||
|
|
fb5dace6a6 | ||
|
|
f71e51c85e | ||
|
|
0dd530a593 | ||
|
|
12df86a142 | ||
|
|
963f021226 | ||
|
|
cb4a8b24d4 | ||
|
|
76c908b132 | ||
|
|
89311af76a | ||
|
|
1ecf515006 | ||
|
|
5c18028577 | ||
|
|
678a7de664 | ||
|
|
0aa190353e | ||
|
|
a42b113618 | ||
|
|
2704611977 | ||
|
|
be6245e693 | ||
|
|
d7b7c4916a | ||
|
|
caae4e4cca | ||
|
|
ee58fbedbe | ||
|
|
a84b45f5dd | ||
|
|
c2edf45846 | ||
|
|
88ff4ee9ca | ||
|
|
fd704f6a29 | ||
|
|
c97b443cf2 | ||
|
|
00df80e6fd | ||
|
|
64c2ba243f | ||
|
|
0ad2e6478d | ||
|
|
ab9f786999 | ||
|
|
e826b339f6 | ||
|
|
f06851f57a | ||
|
|
1a90f0eb28 | ||
|
|
fee986d215 | ||
|
|
9108e78491 | ||
|
|
1b75526892 | ||
|
|
5930a83765 | ||
|
|
ef118a3a64 | ||
|
|
bb42cda4a8 | ||
|
|
121bc9de6c | ||
|
|
1e873c123c | ||
|
|
c704b3709a | ||
|
|
618e09b202 | ||
|
|
fd0bd53826 | ||
|
|
e11c8320f0 | ||
|
|
624595e9f6 | ||
|
|
cc813545d8 | ||
|
|
e1ba6e07c2 | ||
|
|
1bf49b1f0b | ||
|
|
5e34fda7e4 | ||
|
|
aa70ab8b78 | ||
|
|
186ba22dc8 | ||
|
|
b10aa30d9b | ||
|
|
615b9f847c | ||
|
|
8f132fed14 | ||
|
|
854e24f8fc | ||
|
|
ff0544f29a | ||
|
|
72ae12bc77 | ||
|
|
29d2334ef0 | ||
|
|
afb96c4878 | ||
|
|
e4346611c9 | ||
|
|
f15e11272a | ||
|
|
8764d24a16 | ||
|
|
86d543d700 | ||
|
|
99fd01c359 | ||
|
|
573dcc10b1 | ||
|
|
3e30d989a0 | ||
|
|
fc00dd2b38 | ||
|
|
2e9987373d | ||
|
|
27c2f4c076 | ||
|
|
e9b61a8e91 | ||
|
|
222dee6fda | ||
|
|
e8cc25baad | ||
|
|
785f0664da | ||
|
|
ea6c648e4f | ||
|
|
4cdfd72700 | ||
|
|
ccd6987f11 | ||
|
|
6c96271925 | ||
|
|
318db73f3c | ||
|
|
b5b0117fa9 | ||
|
|
79e5555d42 | ||
|
|
b6c2a46a86 | ||
|
|
114a7b6bd6 | ||
|
|
8e6d76296d | ||
|
|
153a68bf06 | ||
|
|
6199e1d8ce | ||
|
|
0db43e612e | ||
|
|
06296ead77 | ||
|
|
dac9bd58e5 | ||
|
|
8e0833ca6b | ||
|
|
88086e00d0 | ||
|
|
9368347b56 | ||
|
|
6828425d72 | ||
|
|
f9da275358 | ||
|
|
1445bd37c3 | ||
|
|
2de176e55c | ||
|
|
b785fe0515 | ||
|
|
984176d53b | ||
|
|
bd46c3f5a0 | ||
|
|
0209c51d10 | ||
|
|
3425ed94e0 | ||
|
|
8ceee31299 | ||
|
|
db9cd296ee | ||
|
|
6b3fb6424c | ||
|
|
e43968c142 | ||
|
|
5c0ba593da | ||
|
|
1f51cf8416 | ||
|
|
442d4de74b | ||
|
|
2a67301642 | ||
|
|
46ec24a686 | ||
|
|
6f25090c01 | ||
|
|
dd36686f1c | ||
|
|
2b980a3cfc | ||
|
|
43aaa728b5 | ||
|
|
45dfe7261b | ||
|
|
7831dc0082 | ||
|
|
ba4e6e5d2f | ||
|
|
68bfaf6d23 | ||
|
|
954dfb74e5 | ||
|
|
f95e7f98b7 | ||
|
|
aabd79e6c7 | ||
|
|
db7daaa6ca | ||
|
|
b66ea090c2 | ||
|
|
ad3317f8d8 | ||
|
|
3b480a61bd | ||
|
|
c0296f04a1 | ||
|
|
6f605e8d6c | ||
|
|
a6cfcac675 | ||
|
|
8e717bb023 | ||
|
|
e885a1cec2 | ||
|
|
e2de17e221 | ||
|
|
5738a992e5 | ||
|
|
122a7e05f6 | ||
|
|
546fdf95d4 | ||
|
|
e6a9cc4776 | ||
|
|
c641f02d7e | ||
|
|
bf11edfaa9 | ||
|
|
3cc6bf4c51 | ||
|
|
156f42318c | ||
|
|
1a1ffe4265 | ||
|
|
3fa4b7a7b2 | ||
|
|
59b270beda | ||
|
|
135942c033 | ||
|
|
0930420844 | ||
|
|
16e546803c | ||
|
|
f6b297fea4 | ||
|
|
3f0b5c8a2b | ||
|
|
dff7d98dd5 |
No files matched your search
@@ -0,0 +1,91 @@
|
||||
name: Bug Report
|
||||
description: Report a bug or console error
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Before reporting a bug, please see if using master/dev builds from https://ci.viaversion.com/ fixes your issue.**
|
||||
Whenever you see fit, you can upload images or video to any of the textfields.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "`/viaversion dump` Output"
|
||||
description: |
|
||||
Run `/viaversion dump` in the console or in the chat, then copy and paste the given link here.
|
||||
placeholder: |
|
||||
https://dump.viaversion.com/...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Console Error
|
||||
description: |
|
||||
If you encounter warnings/errors in your console, **paste them with https://paste.gg/ and put the paste link here**.
|
||||
If the error is small/less than 10 lines, you may put it directly into this field.
|
||||
value: |
|
||||
```
|
||||
Put the paste.gg link or text here.
|
||||
```
|
||||
placeholder: Please do not remove the grave accents; simply replace the line of text in the middle.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Bug Description
|
||||
description: |
|
||||
Describe the unexpected behavior.
|
||||
If you want to attach screenshots, use the comment field at the bottom of the page.
|
||||
placeholder: |
|
||||
Example: "Placing signs on 1.13.2 causes text to disappear."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: |
|
||||
List the steps on how we can reproduce the issue. Make sure we can easily understand what you mean with each step.
|
||||
placeholder: |
|
||||
Example:
|
||||
1. Login with a 1.13.2 client
|
||||
2. Place a sign
|
||||
3. The sign text is displayed wrong
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: |
|
||||
Describe what exactly you expected to happen.
|
||||
placeholder: |
|
||||
Example: "Placed sign text should not disappear."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Server Info
|
||||
description: |
|
||||
Do you use a proxy (eg. BungeeCord)? What software do you use and what plugins?
|
||||
placeholder: |
|
||||
Example: "I also use BungeeCord with the following plugins: x, y, z"
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
description: Make sure you have followed each of the steps outlined here.
|
||||
options:
|
||||
- label: Via plugins are only running on **EITHER** the backend servers (e.g. Paper) **OR** the proxy (e.g. BungeeCord), **not on both**.
|
||||
required: true
|
||||
- label: I have included a ViaVersion dump.
|
||||
required: true
|
||||
- label: If applicable, I have included a paste (**not a screenshot**) of the error.
|
||||
required: true
|
||||
- label: I have tried a build from https://ci.viaversion.com/ and the issue still persists.
|
||||
required: true
|
||||
@@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Dev builds
|
||||
url: https://ci.viaversion.com/
|
||||
about: Before reporting a bug, please check if using master/dev builds from our ci fixes your issue.
|
||||
- name: ViaVersion Discord
|
||||
url: https://discord.gg/viaversion
|
||||
about: For smaller issues or questions, you can also join our Discord server.
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Feature Request
|
||||
description: Suggest a feature to be added
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Problem Description
|
||||
description: |
|
||||
Describe the issue you are facing or why you need the feature to be added.
|
||||
placeholder: |
|
||||
I am always frustrated with...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Solution Description
|
||||
description: |
|
||||
Describe the solution you would like to see.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Alternatives
|
||||
description: |
|
||||
Describe alternatives you have considered.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Info
|
||||
description: |
|
||||
Does the feature apply to any specific version or environment?
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,28 @@
|
||||
# This workflow will build a Java project with Gradle
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Only run on PRs if the source branch is on a different repo. We do not need run everything twice.
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 11
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifact
|
||||
path: build/libs
|
||||
+112
-2
@@ -1,3 +1,113 @@
|
||||
target/
|
||||
.idea/
|
||||
### Java files ###
|
||||
*.class
|
||||
|
||||
# Package Files
|
||||
#*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
||||
# Ignore project files
|
||||
*.iml
|
||||
|
||||
# Ignore IDEA directory
|
||||
.idea/*
|
||||
|
||||
# Include the project's dictionary
|
||||
!.idea/dictionaries/
|
||||
!.idea/dictionaries/*
|
||||
|
||||
# File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
### Plugin-specific files: ###
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
|
||||
### Eclipse ###
|
||||
*.pydevproject
|
||||
.metadata
|
||||
.gradle
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
|
||||
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
.nb-gradle/
|
||||
|
||||
|
||||
|
||||
### Git ###
|
||||
# Don't exclude the .gitignore itself
|
||||
!.gitignore
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,79 @@
|
||||
# ViaVersion - Spigot, Sponge, BungeeCord, Velocity
|
||||
|
||||
[](https://viaversion.com)
|
||||
[](https://github.com/ViaVersion/ViaVersion/actions)
|
||||
[](https://viaversion.com/discord)
|
||||
|
||||
**Allows the connection of higher client versions to lower server versions**
|
||||
|
||||
Supported Versions:
|
||||
|
||||

|
||||
|
||||
On Paper you may also use ProtocolSupport, but ensure you have the right build for your server version.
|
||||
|
||||
**User Docs:** https://docs.viaversion.com/display/VIAVERSION/
|
||||
|
||||
|
||||
Sources:
|
||||
--------
|
||||
**[wiki.vg](https://wiki.vg)** (Used for information regarding packet structure, we also contribute back)
|
||||
|
||||
**[Burger](https://github.com/Pokechu22/Burger)** (See [PAaaS](https://github.com/Matsv/Paaas))
|
||||
|
||||
**[OpenNBT](https://github.com/ViaVersion/OpenNBT)**
|
||||
|
||||
|
||||
Releases / Dev Builds:
|
||||
--------
|
||||
You can find official releases here:
|
||||
|
||||
https://www.spigotmc.org/resources/viaversion.19254/history
|
||||
|
||||
----------
|
||||
|
||||
You can find official dev builds here:
|
||||
|
||||
**Jenkins:** https://ci.viaversion.com
|
||||
|
||||
**JavaDocs:** https://jd.viaversion.com
|
||||
|
||||
**Maven Repository:**
|
||||
```xml
|
||||
<repository>
|
||||
<id>viaversion-repo</id>
|
||||
<url>https://repo.viaversion.com</url>
|
||||
</repository>
|
||||
```
|
||||
|
||||
**API-artifact:**
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.viaversion</groupId>
|
||||
<artifactId>viaversion-api</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Replace the version depending on your needs.
|
||||
|
||||
If you need access to the existing protocol or platform implementations, use the parent artifact `viaversion`.
|
||||
Please note the [differences in licensing](#license).
|
||||
|
||||
|
||||
Building:
|
||||
--------
|
||||
After cloning this repository, build the project with Gradle by running `./gradlew build` and take the created jar out of
|
||||
the `build/libs` directory.
|
||||
|
||||
|
||||
License:
|
||||
--------
|
||||
The entirety of the [API directory](api) (including the legacy API directory) is licensed under the MIT License; see [licenses/MIT.md](licenses/MIT.md) for
|
||||
details.
|
||||
|
||||
Everything else, unless explicitly stated otherwise, is licensed under the GNU General Public License, including the end
|
||||
product as a whole; see [licenses/GPL.md](licenses/GPL.md) for details.
|
||||
|
||||
Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaVersion/graphs/contributors).
|
||||
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
// Shade and relocate adventure in an extra module, so that common/the rest can directly depend on a
|
||||
// relocated adventure without breaking native platform's adventure usage with project wide relocation
|
||||
tasks {
|
||||
shadowJar {
|
||||
relocate("net.kyori", "com.viaversion.viaversion.libs.kyori")
|
||||
}
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(libs.bundles.adventure) {
|
||||
exclude("org.checkerframework")
|
||||
exclude("net.kyori", "adventure-api")
|
||||
exclude("net.kyori", "adventure-bom")
|
||||
exclude("com.google.code.gson", "gson")
|
||||
}
|
||||
}
|
||||
|
||||
publishShadowJar()
|
||||
@@ -0,0 +1,3 @@
|
||||
dependencies {
|
||||
compileOnly(projects.viaversionApi)
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import us.myles.ViaVersion.api.boss.BossBar;
|
||||
import us.myles.ViaVersion.api.boss.BossColor;
|
||||
import us.myles.ViaVersion.api.boss.BossStyle;
|
||||
|
||||
import java.util.SortedSet;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @deprecated may be removed at some point, use {@link com.viaversion.viaversion.api.Via}
|
||||
*/
|
||||
@Deprecated
|
||||
public class Via<T> implements ViaAPI<T> {
|
||||
|
||||
private static final ViaAPI INSTANCE = new Via();
|
||||
|
||||
private Via() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static ViaAPI getAPI() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlayerVersion(T player) {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().getPlayerVersion(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlayerVersion(UUID uuid) {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().getPlayerVersion(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInjected(UUID playerUUID) {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().isInjected(playerUUID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendRawPacket(T player, ByteBuf packet) {
|
||||
com.viaversion.viaversion.api.Via.getAPI().sendRawPacket(player, packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendRawPacket(UUID uuid, ByteBuf packet) {
|
||||
com.viaversion.viaversion.api.Via.getAPI().sendRawPacket(uuid, packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BossBar createBossBar(String title, BossColor color, BossStyle style) {
|
||||
return new BossBar(com.viaversion.viaversion.api.Via.getAPI().legacyAPI().createLegacyBossBar(title,
|
||||
com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()],
|
||||
com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BossBar createBossBar(String title, float health, BossColor color, BossStyle style) {
|
||||
return new BossBar(com.viaversion.viaversion.api.Via.getAPI().legacyAPI().createLegacyBossBar(title, health,
|
||||
com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()],
|
||||
com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<Integer> getSupportedVersions() {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().getSupportedVersions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<Integer> getFullSupportedVersions() {
|
||||
return com.viaversion.viaversion.api.Via.getAPI().getFullSupportedVersions();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import us.myles.ViaVersion.api.boss.BossBar;
|
||||
import us.myles.ViaVersion.api.boss.BossColor;
|
||||
import us.myles.ViaVersion.api.boss.BossStyle;
|
||||
|
||||
import java.util.SortedSet;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @deprecated may be removed at some point, use {@link Via#getAPI()}
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ViaAPI<T> {
|
||||
|
||||
int getPlayerVersion(T player);
|
||||
|
||||
int getPlayerVersion(UUID uuid);
|
||||
|
||||
default boolean isPorted(UUID playerUUID) {
|
||||
return isInjected(playerUUID);
|
||||
}
|
||||
|
||||
boolean isInjected(UUID playerUUID);
|
||||
|
||||
String getVersion();
|
||||
|
||||
void sendRawPacket(T player, ByteBuf packet);
|
||||
|
||||
void sendRawPacket(UUID uuid, ByteBuf packet);
|
||||
|
||||
BossBar createBossBar(String title, BossColor color, BossStyle style);
|
||||
|
||||
BossBar createBossBar(String title, float health, BossColor color, BossStyle style);
|
||||
|
||||
SortedSet<Integer> getSupportedVersions();
|
||||
|
||||
SortedSet<Integer> getFullSupportedVersions();
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.boss;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Deprecated
|
||||
public class BossBar<T> {
|
||||
|
||||
private final com.viaversion.viaversion.api.legacy.bossbar.BossBar bossBar;
|
||||
|
||||
public BossBar(com.viaversion.viaversion.api.legacy.bossbar.BossBar bossBar) {
|
||||
this.bossBar = bossBar;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return bossBar.getTitle();
|
||||
}
|
||||
|
||||
public BossBar setTitle(String title) {
|
||||
bossBar.setTitle(title);
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getHealth() {
|
||||
return bossBar.getHealth();
|
||||
}
|
||||
|
||||
public BossBar setHealth(float health) {
|
||||
bossBar.setHealth(health);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossColor getColor() {
|
||||
return BossColor.values()[bossBar.getColor().ordinal()];
|
||||
}
|
||||
|
||||
public BossBar setColor(BossColor color) {
|
||||
bossBar.setColor(com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()]);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossStyle getStyle() {
|
||||
return BossStyle.values()[bossBar.getStyle().ordinal()];
|
||||
}
|
||||
|
||||
public BossBar setStyle(BossStyle style) {
|
||||
bossBar.setStyle(com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public BossBar addPlayer(T player) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossBar addPlayer(UUID player) {
|
||||
bossBar.addPlayer(player);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public BossBar addPlayers(T... players) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public BossBar removePlayer(T player) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossBar removePlayer(UUID uuid) {
|
||||
bossBar.removePlayer(uuid);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossBar addFlag(BossFlag flag) {
|
||||
bossBar.addFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossBar removeFlag(BossFlag flag) {
|
||||
bossBar.removeFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean hasFlag(BossFlag flag) {
|
||||
return bossBar.hasFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
|
||||
}
|
||||
|
||||
public Set<UUID> getPlayers() {
|
||||
return bossBar.getPlayers();
|
||||
}
|
||||
|
||||
public BossBar show() {
|
||||
bossBar.show();
|
||||
return this;
|
||||
}
|
||||
|
||||
public BossBar hide() {
|
||||
bossBar.hide();
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return bossBar.isVisible();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return bossBar.getId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.boss;
|
||||
|
||||
@Deprecated
|
||||
public enum BossColor {
|
||||
|
||||
PINK(0),
|
||||
BLUE(1),
|
||||
RED(2),
|
||||
GREEN(3),
|
||||
YELLOW(4),
|
||||
PURPLE(5),
|
||||
WHITE(6);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossColor(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.boss;
|
||||
|
||||
@Deprecated
|
||||
public enum BossFlag {
|
||||
|
||||
DARKEN_SKY(1),
|
||||
PLAY_BOSS_MUSIC(2);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossFlag(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.boss;
|
||||
|
||||
@Deprecated
|
||||
public enum BossStyle {
|
||||
|
||||
SOLID(0),
|
||||
SEGMENTED_6(1),
|
||||
SEGMENTED_10(2),
|
||||
SEGMENTED_12(3),
|
||||
SEGMENTED_20(4);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossStyle(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.protocol;
|
||||
|
||||
/**
|
||||
* @deprecated may be removed at some point, use {@link com.viaversion.viaversion.api.protocol.ProtocolManager}
|
||||
*/
|
||||
@Deprecated
|
||||
public class ProtocolRegistry {
|
||||
|
||||
@Deprecated
|
||||
public static int SERVER_PROTOCOL = -1;
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 us.myles.ViaVersion.api.protocol;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.version.VersionRange;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @deprecated will no longer be updated and may be removed at some point, use {@link com.viaversion.viaversion.api.protocol.version.ProtocolVersion}
|
||||
*/
|
||||
@Deprecated
|
||||
public class ProtocolVersion {
|
||||
private static final Int2ObjectMap<ProtocolVersion> versions = new Int2ObjectOpenHashMap<>();
|
||||
private static final List<ProtocolVersion> versionList = new ArrayList<>();
|
||||
|
||||
public static final ProtocolVersion v1_4_6 = register(51, "1.4.6/7", new VersionRange("1.4", 6, 7));
|
||||
public static final ProtocolVersion v1_5_1 = register(60, "1.5.1");
|
||||
public static final ProtocolVersion v1_5_2 = register(61, "1.5.2");
|
||||
public static final ProtocolVersion v_1_6_1 = register(73, "1.6.1");
|
||||
public static final ProtocolVersion v_1_6_2 = register(74, "1.6.2");
|
||||
public static final ProtocolVersion v_1_6_3 = register(77, "1.6.3");
|
||||
public static final ProtocolVersion v_1_6_4 = register(78, "1.6.4");
|
||||
public static final ProtocolVersion v1_7_1 = register(4, "1.7-1.7.5", new VersionRange("1.7", 0, 5));
|
||||
public static final ProtocolVersion v1_7_6 = register(5, "1.7.6-1.7.10", new VersionRange("1.7", 6, 10));
|
||||
public static final ProtocolVersion v1_8 = register(47, "1.8.x");
|
||||
public static final ProtocolVersion v1_9 = register(107, "1.9");
|
||||
public static final ProtocolVersion v1_9_1 = register(108, "1.9.1");
|
||||
public static final ProtocolVersion v1_9_2 = register(109, "1.9.2");
|
||||
public static final ProtocolVersion v1_9_3 = register(110, "1.9.3/4", new VersionRange("1.9", 3, 4));
|
||||
public static final ProtocolVersion v1_10 = register(210, "1.10.x");
|
||||
public static final ProtocolVersion v1_11 = register(315, "1.11");
|
||||
public static final ProtocolVersion v1_11_1 = register(316, "1.11.1/2", new VersionRange("1.11", 1, 2));
|
||||
public static final ProtocolVersion v1_12 = register(335, "1.12");
|
||||
public static final ProtocolVersion v1_12_1 = register(338, "1.12.1");
|
||||
public static final ProtocolVersion v1_12_2 = register(340, "1.12.2");
|
||||
public static final ProtocolVersion v1_13 = register(393, "1.13");
|
||||
public static final ProtocolVersion v1_13_1 = register(401, "1.13.1");
|
||||
public static final ProtocolVersion v1_13_2 = register(404, "1.13.2");
|
||||
public static final ProtocolVersion v1_14 = register(477, "1.14");
|
||||
public static final ProtocolVersion v1_14_1 = register(480, "1.14.1");
|
||||
public static final ProtocolVersion v1_14_2 = register(485, "1.14.2");
|
||||
public static final ProtocolVersion v1_14_3 = register(490, "1.14.3");
|
||||
public static final ProtocolVersion v1_14_4 = register(498, "1.14.4");
|
||||
public static final ProtocolVersion v1_15 = register(573, "1.15");
|
||||
public static final ProtocolVersion v1_15_1 = register(575, "1.15.1");
|
||||
public static final ProtocolVersion v1_15_2 = register(578, "1.15.2");
|
||||
public static final ProtocolVersion v1_16 = register(735, "1.16");
|
||||
public static final ProtocolVersion v1_16_1 = register(736, "1.16.1");
|
||||
public static final ProtocolVersion v1_16_2 = register(751, "1.16.2");
|
||||
public static final ProtocolVersion v1_16_3 = register(753, "1.16.3");
|
||||
public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5));
|
||||
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
|
||||
|
||||
public static ProtocolVersion register(int version, String name) {
|
||||
return register(version, -1, name);
|
||||
}
|
||||
|
||||
public static ProtocolVersion register(int version, int snapshotVersion, String name) {
|
||||
return register(version, snapshotVersion, name, null);
|
||||
}
|
||||
|
||||
public static ProtocolVersion register(int version, String name, @Nullable VersionRange versionRange) {
|
||||
return register(version, -1, name, versionRange);
|
||||
}
|
||||
|
||||
public static ProtocolVersion register(int version, int snapshotVersion, String name, @Nullable VersionRange versionRange) {
|
||||
ProtocolVersion protocol = new ProtocolVersion(version, snapshotVersion, name, versionRange);
|
||||
versionList.add(protocol);
|
||||
versions.put(protocol.getVersion(), protocol);
|
||||
if (protocol.isSnapshot()) {
|
||||
versions.put(protocol.getFullSnapshotVersion(), protocol);
|
||||
}
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public static boolean isRegistered(int id) {
|
||||
return versions.containsKey(id);
|
||||
}
|
||||
|
||||
public static @NonNull ProtocolVersion getProtocol(int id) {
|
||||
ProtocolVersion protocolVersion = versions.get(id);
|
||||
if (protocolVersion != null) {
|
||||
return protocolVersion;
|
||||
} else {
|
||||
return new ProtocolVersion(id, "Unknown (" + id + ")");
|
||||
}
|
||||
}
|
||||
|
||||
public static int getIndex(ProtocolVersion version) {
|
||||
return versionList.indexOf(version);
|
||||
}
|
||||
|
||||
public static List<ProtocolVersion> getProtocols() {
|
||||
return Collections.unmodifiableList(new ArrayList<>(versions.values()));
|
||||
}
|
||||
|
||||
public static @Nullable ProtocolVersion getClosest(String protocol) {
|
||||
for (ProtocolVersion version : versions.values()) {
|
||||
String name = version.getName();
|
||||
if (name.equals(protocol)) {
|
||||
return version;
|
||||
}
|
||||
|
||||
if (version.isVersionWildcard()) {
|
||||
// Test against the major version with and without a minor version
|
||||
String majorVersion = name.substring(0, name.length() - 2);
|
||||
if (majorVersion.equals(protocol) || (protocol.startsWith(name.substring(0, name.length() - 1)))) {
|
||||
return version;
|
||||
}
|
||||
} else if (version.isRange()) {
|
||||
if (version.getIncludedVersions().contains(protocol)) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private final int version;
|
||||
private final int snapshotVersion;
|
||||
private final String name;
|
||||
private final boolean versionWildcard;
|
||||
private final Set<String> includedVersions;
|
||||
|
||||
public ProtocolVersion(int version, String name) {
|
||||
this(version, -1, name, null);
|
||||
}
|
||||
|
||||
public ProtocolVersion(int version, int snapshotVersion, String name, @Nullable VersionRange versionRange) {
|
||||
this.version = version;
|
||||
this.snapshotVersion = snapshotVersion;
|
||||
this.name = name;
|
||||
this.versionWildcard = name.endsWith(".x");
|
||||
|
||||
Preconditions.checkArgument(!versionWildcard || versionRange == null, "A version cannot be a wildcard and a range at the same time!");
|
||||
if (versionRange != null) {
|
||||
includedVersions = new LinkedHashSet<>();
|
||||
for (int i = versionRange.getRangeFrom(); i <= versionRange.getRangeTo(); i++) {
|
||||
if (i == 0) {
|
||||
includedVersions.add(versionRange.getBaseVersion()); // Keep both the base version and with ".0" appended
|
||||
}
|
||||
|
||||
includedVersions.add(versionRange.getBaseVersion() + "." + i);
|
||||
}
|
||||
} else {
|
||||
includedVersions = Collections.singleton(name);
|
||||
}
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public int getSnapshotVersion() {
|
||||
Preconditions.checkArgument(isSnapshot());
|
||||
return snapshotVersion;
|
||||
}
|
||||
|
||||
public int getFullSnapshotVersion() {
|
||||
Preconditions.checkArgument(isSnapshot());
|
||||
return (1 << 30) | snapshotVersion; // Bit indicating snapshot versions
|
||||
}
|
||||
|
||||
public int getOriginalVersion() {
|
||||
return snapshotVersion == -1 ? version : ((1 << 30) | snapshotVersion);
|
||||
}
|
||||
|
||||
public boolean isKnown() {
|
||||
return version != -1;
|
||||
}
|
||||
|
||||
public boolean isRange() {
|
||||
return includedVersions.size() != 1;
|
||||
}
|
||||
|
||||
public Set<String> getIncludedVersions() {
|
||||
return Collections.unmodifiableSet(includedVersions);
|
||||
}
|
||||
|
||||
public boolean isVersionWildcard() {
|
||||
return versionWildcard;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean isSnapshot() {
|
||||
return snapshotVersion != -1;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
ProtocolVersion that = (ProtocolVersion) o;
|
||||
return version == that.version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s (%d)", this.name, this.version);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
id("net.kyori.blossom")
|
||||
id("via.shadow-conventions")
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceToken("\$VERSION", project.version)
|
||||
replaceToken("\$IMPL_VERSION", "git-ViaVersion-${project.version}:${rootProject.latestCommitHash()}")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(projects.adventure) {
|
||||
targetConfiguration = "shadow"
|
||||
}
|
||||
api(libs.fastutil)
|
||||
api(libs.openNBT)
|
||||
api(libs.gson)
|
||||
|
||||
compileOnlyApi(libs.snakeYaml)
|
||||
compileOnlyApi(libs.netty)
|
||||
compileOnlyApi(libs.guava)
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
}
|
||||
|
||||
java {
|
||||
withJavadocJar()
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
|
||||
import com.viaversion.viaversion.api.platform.ViaPlatform;
|
||||
|
||||
public final class Via {
|
||||
private static ViaManager manager;
|
||||
|
||||
/**
|
||||
* Returns the API associated with the current platform.
|
||||
*
|
||||
* @return API instance
|
||||
* @throws IllegalArgumentException if the platform has not loaded yet
|
||||
*/
|
||||
public static ViaAPI getAPI() {
|
||||
return manager().getPlatform().getApi();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ViaManager with methods beyond the simple API {@link ViaAPI} provides.
|
||||
*
|
||||
* @return manager to interact with various Via parts
|
||||
* @throws IllegalArgumentException if the platform has not loaded yet
|
||||
*/
|
||||
public static ViaManager getManager() {
|
||||
return manager();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the config associated with the current platform.
|
||||
*
|
||||
* @return config instance
|
||||
* @throws IllegalArgumentException if the platform has not loaded yet
|
||||
*/
|
||||
public static ViaVersionConfig getConfig() {
|
||||
return manager().getPlatform().getConf();
|
||||
}
|
||||
|
||||
public static ViaPlatform getPlatform() {
|
||||
return manager().getPlatform();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the ViaManager associated with the platform.
|
||||
*
|
||||
* @param viaManager The ViaManager
|
||||
* @throws IllegalArgumentException if the manager has already been set
|
||||
*/
|
||||
public static void init(ViaManager viaManager) {
|
||||
Preconditions.checkArgument(manager == null, "ViaManager is already set");
|
||||
Via.manager = viaManager;
|
||||
}
|
||||
|
||||
private static ViaManager manager() {
|
||||
Preconditions.checkArgument(manager != null, "ViaVersion has not loaded the platform yet");
|
||||
return manager;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.ConnectionManager;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.legacy.LegacyViaAPI;
|
||||
import com.viaversion.viaversion.api.platform.ViaPlatform;
|
||||
import com.viaversion.viaversion.api.protocol.ProtocolManager;
|
||||
import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.SortedSet;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* General api point. For more specialized api methods, see {@link Via#getManager()}.
|
||||
*
|
||||
* @param <T> player type for the specific platform
|
||||
* @see ViaManager
|
||||
* @see ProtocolManager
|
||||
* @see ConnectionManager
|
||||
* @see ViaPlatform
|
||||
*/
|
||||
public interface ViaAPI<T> {
|
||||
|
||||
/**
|
||||
* Returns the API version incremented with meaningful API changes.
|
||||
* This includes breaking changes to existing API and larger additions.
|
||||
*
|
||||
* @return API version incremented with meaningful API changes
|
||||
*/
|
||||
default int apiVersion() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the server's protocol version info.
|
||||
*
|
||||
* @return the server's protocol version info
|
||||
*/
|
||||
ServerProtocolVersion getServerVersion();
|
||||
|
||||
/**
|
||||
* Returns the protocol version of a player.
|
||||
* This will also retrieve the version from ProtocolSupport if it's being used.
|
||||
*
|
||||
* @param player the platform's player object, e.g. Bukkit this is Player
|
||||
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if no longer connected
|
||||
*/
|
||||
int getPlayerVersion(T player);
|
||||
|
||||
/**
|
||||
* Returns the protocol version of a player.
|
||||
*
|
||||
* @param uuid UUID of a player
|
||||
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if not connected
|
||||
*/
|
||||
int getPlayerVersion(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns whether Via injected into this player connection.
|
||||
*
|
||||
* @param uuid uuid of the player
|
||||
* @return whether Via has a cached a UserConnection for this player
|
||||
*/
|
||||
boolean isInjected(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns the Via injected UserConnection if present.
|
||||
*
|
||||
* @param uuid uuid of the player
|
||||
* @return user connection if present
|
||||
*/
|
||||
@Nullable UserConnection getConnection(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns the version of the plugin.
|
||||
*
|
||||
* @return plugin version
|
||||
*/
|
||||
String getVersion();
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the player.
|
||||
*
|
||||
* @param player the platform's player object, e.g. for Bukkit this is Player
|
||||
* @param packet the packet; you need a VarInt Id, then the packet contents
|
||||
* @throws IllegalArgumentException if the player is not injected by Via
|
||||
*/
|
||||
void sendRawPacket(T player, ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the player.
|
||||
*
|
||||
* @param uuid the uuid from the player to send packet
|
||||
* @param packet the packet; you need a VarInt Id, then the packet contents
|
||||
* @throws IllegalArgumentException if the player is not injected by Via
|
||||
*/
|
||||
void sendRawPacket(UUID uuid, ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Returns the supported protocol versions.
|
||||
* This method removes any blocked protocol versions.
|
||||
*
|
||||
* @return a list of protocol versions
|
||||
* @see #getFullSupportedVersions() for a full list
|
||||
*/
|
||||
SortedSet<Integer> getSupportedVersions();
|
||||
|
||||
/**
|
||||
* Returns the supported protocol versions, including blocked protocols.
|
||||
*
|
||||
* @return a list of protocol versions
|
||||
*/
|
||||
SortedSet<Integer> getFullSupportedVersions();
|
||||
|
||||
/**
|
||||
* Returns legacy api only applicable on/to legacy versions.
|
||||
* <p>
|
||||
* These methods are safe to use and are unlikely to be removed,
|
||||
* but it is important to be aware of their limited use.
|
||||
*
|
||||
* @return legacy api only applicable on/to legacy versions
|
||||
*/
|
||||
LegacyViaAPI<T> legacyAPI();
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api;
|
||||
|
||||
import com.viaversion.viaversion.api.command.ViaVersionCommand;
|
||||
import com.viaversion.viaversion.api.connection.ConnectionManager;
|
||||
import com.viaversion.viaversion.api.platform.ViaInjector;
|
||||
import com.viaversion.viaversion.api.platform.ViaPlatform;
|
||||
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
|
||||
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
|
||||
import com.viaversion.viaversion.api.protocol.ProtocolManager;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface ViaManager {
|
||||
|
||||
/**
|
||||
* Returns the protocol manager for registering/getting protocols and their mapping data loading.
|
||||
*
|
||||
* @return protocol manager
|
||||
*/
|
||||
ProtocolManager getProtocolManager();
|
||||
|
||||
/**
|
||||
* Returns platform for handling platform specific configuration, tasks, and plugin data.
|
||||
*
|
||||
* @return platform
|
||||
*/
|
||||
ViaPlatform<?> getPlatform();
|
||||
|
||||
/**
|
||||
* Returns the userconnection manager for handling clients connected to the server.
|
||||
*
|
||||
* @return userconnection manager
|
||||
*/
|
||||
ConnectionManager getConnectionManager();
|
||||
|
||||
/**
|
||||
* Returns the manager for Via providers.
|
||||
*
|
||||
* @return provider manager
|
||||
*/
|
||||
ViaProviders getProviders();
|
||||
|
||||
/**
|
||||
* Returns the injector for injecting netty handlers and initially getting the server protocol version.
|
||||
*
|
||||
* @return injector
|
||||
*/
|
||||
ViaInjector getInjector();
|
||||
|
||||
/**
|
||||
* Returns the command handler for managing ViaVersion subcommands.
|
||||
*
|
||||
* @return command handler
|
||||
*/
|
||||
ViaVersionCommand getCommandHandler();
|
||||
|
||||
/**
|
||||
* Returns the platform loader responsible for registering listeners, providers and such.
|
||||
*
|
||||
* @return platform loader
|
||||
*/
|
||||
ViaPlatformLoader getLoader();
|
||||
|
||||
/**
|
||||
* If debug is enabled, packets and other otherwise suppressed warnings will be logged.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isDebug();
|
||||
|
||||
/**
|
||||
* Sets the debug mode. If enabled, packets and other otherwise suppressed warnings will be logged.
|
||||
*
|
||||
* @param debug whether debug should be enabled
|
||||
*/
|
||||
void setDebug(boolean debug);
|
||||
|
||||
/**
|
||||
* Returns a mutable set of self-added subplatform version strings.
|
||||
* This set is expanded by the subplatform itself (e.g. ViaBackwards), and may not contain all running ones.
|
||||
*
|
||||
* @return mutable set of subplatform versions
|
||||
*/
|
||||
Set<String> getSubPlatforms();
|
||||
|
||||
/**
|
||||
* Adds a runnable to be executed when ViaVersion has finished its init before the full server load.
|
||||
*
|
||||
* @param runnable runnable to be executed
|
||||
*/
|
||||
void addEnableListener(Runnable runnable);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.command;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ViaCommandSender {
|
||||
/**
|
||||
* Check if the sender has a permission.
|
||||
*
|
||||
* @param permission Permission string eg. viaversion.admin
|
||||
* @return True if the sender has the permission
|
||||
*/
|
||||
boolean hasPermission(String permission);
|
||||
|
||||
/**
|
||||
* Send a message to the sender
|
||||
*
|
||||
* @param msg The message to send
|
||||
*/
|
||||
void sendMessage(String msg);
|
||||
|
||||
/**
|
||||
* Get the senders UUID.
|
||||
*
|
||||
* @return The senders UUID
|
||||
*/
|
||||
UUID getUUID();
|
||||
|
||||
/**
|
||||
* Get the senders name.
|
||||
*
|
||||
* @return The senders name
|
||||
*/
|
||||
String getName();
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.command;
|
||||
|
||||
import com.viaversion.viaversion.util.ChatColorUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ViaSubCommand {
|
||||
|
||||
/**
|
||||
* Subcommand name
|
||||
*
|
||||
* @return The commands name
|
||||
*/
|
||||
public abstract String name();
|
||||
|
||||
/**
|
||||
* subcommand description, this'll show in /viaversion list
|
||||
*
|
||||
* @return The commands description
|
||||
*/
|
||||
public abstract String description();
|
||||
|
||||
/**
|
||||
* Usage example:
|
||||
* "playerversion [name]"
|
||||
*
|
||||
* @return The commands usage
|
||||
*/
|
||||
public String usage() {
|
||||
return name();
|
||||
}
|
||||
|
||||
/**
|
||||
* Permission, null for everyone
|
||||
*
|
||||
* @return The permission required to use the commands
|
||||
*/
|
||||
public String permission() {
|
||||
return "viaversion.admin";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets triggered on execution
|
||||
*
|
||||
* @param sender Command sender
|
||||
* @param args Arguments
|
||||
* @return commands executed succesfully if false, show usage
|
||||
*/
|
||||
public abstract boolean execute(ViaCommandSender sender, String[] args);
|
||||
|
||||
/**
|
||||
* Yay, possibility to implement tab-completion
|
||||
*
|
||||
* @param sender Command sender
|
||||
* @param args args
|
||||
* @return tab complete possibilities
|
||||
*/
|
||||
public List<String> onTabComplete(ViaCommandSender sender, String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces color codes in a string.
|
||||
*
|
||||
* @param s string to replace
|
||||
* @return output String
|
||||
*/
|
||||
public static String color(String s) {
|
||||
return ChatColorUtil.translateAlternateColorCodes(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a color coded string with replacements to a user.
|
||||
*
|
||||
* @param sender target to send the message to
|
||||
* @param message message
|
||||
* @param args objects to replace
|
||||
*/
|
||||
public static void sendMessage(ViaCommandSender sender, String message, Object... args) {
|
||||
sender.sendMessage(color(args == null ? message : String.format(message, args)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.command;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ViaVersionCommand {
|
||||
/**
|
||||
* Register your own subcommand inside ViaVersion
|
||||
*
|
||||
* @param command Your own SubCommand instance to handle it.
|
||||
* @throws Exception throws an exception when the subcommand already exists or if it's not valid, example: spacee
|
||||
*/
|
||||
void registerSubCommand(ViaSubCommand command) throws Exception;
|
||||
|
||||
/**
|
||||
* Check if a subcommand is registered.
|
||||
*
|
||||
* @param name Subcommand name
|
||||
* @return true if it exists
|
||||
*/
|
||||
boolean hasSubCommand(String name);
|
||||
|
||||
/**
|
||||
* Get subcommand instance by name
|
||||
*
|
||||
* @param name subcommand name
|
||||
* @return ViaSubCommand instance
|
||||
*/
|
||||
@Nullable ViaSubCommand getSubCommand(String name);
|
||||
|
||||
/**
|
||||
* Executed when the Command sender executes the commands
|
||||
*
|
||||
* @param sender Sender object
|
||||
* @param args arguments provided
|
||||
* @return was successful
|
||||
*/
|
||||
boolean onCommand(ViaCommandSender sender, String[] args);
|
||||
|
||||
/**
|
||||
* Executed when the Command sender tab-completes
|
||||
*
|
||||
* @param sender Sender object
|
||||
* @param args arguments provided
|
||||
* @return was successful
|
||||
*/
|
||||
List<String> onTabComplete(ViaCommandSender sender, String[] args);
|
||||
|
||||
void showHelp(ViaCommandSender sender);
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.configuration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ConfigurationProvider {
|
||||
|
||||
/**
|
||||
* Sets the specified path to the given value.
|
||||
*
|
||||
* @param path Path of the object to set.
|
||||
* @param value New value to set the path to
|
||||
*/
|
||||
void set(String path, Object value);
|
||||
|
||||
/**
|
||||
* Saves the config
|
||||
*/
|
||||
void saveConfig();
|
||||
|
||||
/**
|
||||
* Reloads the config
|
||||
*/
|
||||
void reloadConfig();
|
||||
|
||||
/**
|
||||
* Get all the configuration values
|
||||
*
|
||||
* @return Map with key-values
|
||||
*/
|
||||
Map<String, Object> getValues();
|
||||
}
|
||||
@@ -0,0 +1,417 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.configuration;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
|
||||
public interface ViaVersionConfig {
|
||||
|
||||
/**
|
||||
* Get if the plugin should check for updates
|
||||
*
|
||||
* @return true if update checking is enabled
|
||||
*/
|
||||
boolean isCheckForUpdates();
|
||||
|
||||
/**
|
||||
* Sets whether to check for updates. This updates the internally cached value
|
||||
* as well as the config, but does not save the config to disk.
|
||||
*
|
||||
* @param checkForUpdates true to check for updates on server start and joins
|
||||
*/
|
||||
void setCheckForUpdates(boolean checkForUpdates);
|
||||
|
||||
/**
|
||||
* Get if collision preventing for players is enabled
|
||||
*
|
||||
* @return true if collision preventing is enabled
|
||||
*/
|
||||
boolean isPreventCollision();
|
||||
|
||||
/**
|
||||
* Get if 1.9 & 1.10 clients are shown the new effect indicator in the top-right corner
|
||||
*
|
||||
* @return true if the using of the new effect indicator is enabled
|
||||
*/
|
||||
boolean isNewEffectIndicator();
|
||||
|
||||
/**
|
||||
* Get if 1.9 & 1.10 clients are shown the new death message on the death screen
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isShowNewDeathMessages();
|
||||
|
||||
/**
|
||||
* Get if metadata errors will be suppressed
|
||||
*
|
||||
* @return true if metadata errors suppression is enabled
|
||||
*/
|
||||
boolean isSuppressMetadataErrors();
|
||||
|
||||
/**
|
||||
* Get if blocking in 1.9 & 1.10 appears as a player holding a shield
|
||||
*
|
||||
* @return true if shield blocking is enabled
|
||||
*/
|
||||
boolean isShieldBlocking();
|
||||
|
||||
/**
|
||||
* Whether the player can block with the shield without a delay.
|
||||
* <p>
|
||||
* This option requires {@link #isShowShieldWhenSwordInHand()} to be disabled
|
||||
*
|
||||
* @return {@code true} if non delayed shield blocking is enabled.
|
||||
*/
|
||||
boolean isNoDelayShieldBlocking();
|
||||
|
||||
/**
|
||||
* Puts the shield into the second hand when holding a sword.
|
||||
* The shield will disappear when switching to another item.
|
||||
* <p>
|
||||
* This option requires {@link #isShieldBlocking()} to be enabled
|
||||
*
|
||||
* @return {@code true} if the shield should appear when holding a sword
|
||||
*/
|
||||
boolean isShowShieldWhenSwordInHand();
|
||||
|
||||
/**
|
||||
* Get if armor stand positions are fixed so holograms show up at the correct height in 1.9 & 1.10
|
||||
*
|
||||
* @return true if hologram patching is enabled
|
||||
*/
|
||||
boolean isHologramPatch();
|
||||
|
||||
/**
|
||||
* Get if the 1.11 piston animation patch is enabled
|
||||
*
|
||||
* @return true if the piston patch is enabled.
|
||||
*/
|
||||
boolean isPistonAnimationPatch();
|
||||
|
||||
/**
|
||||
* Get if boss bars are fixed for 1.9 & 1.10 clients
|
||||
*
|
||||
* @return true if boss bar patching is enabled
|
||||
*/
|
||||
boolean isBossbarPatch();
|
||||
|
||||
/**
|
||||
* Get if the boss bars for 1.9 & 1.10 clients are being stopped from flickering
|
||||
* This will keep all boss bars on 100% (not recommended)
|
||||
*
|
||||
* @return true if boss bar anti flickering is enabled
|
||||
*/
|
||||
boolean isBossbarAntiflicker();
|
||||
|
||||
/**
|
||||
* Get the vertical offset armor stands are being moved with when the hologram patch is enabled
|
||||
*
|
||||
* @return the vertical offset holograms will be moved with
|
||||
*/
|
||||
double getHologramYOffset();
|
||||
|
||||
/**
|
||||
* Get if players will be automatically put in the same team when collision preventing is enabled
|
||||
*
|
||||
* @return true if automatic teaming is enabled
|
||||
*/
|
||||
boolean isAutoTeam();
|
||||
|
||||
/**
|
||||
* Get the maximum number of packets a client can send per second.
|
||||
*
|
||||
* @return The number of packets a client can send per second.
|
||||
*/
|
||||
int getMaxPPS();
|
||||
|
||||
/**
|
||||
* Get the kick message sent if the user hits the max packets per second.
|
||||
*
|
||||
* @return Kick message, with colour codes using '&amp;'
|
||||
*/
|
||||
String getMaxPPSKickMessage();
|
||||
|
||||
/**
|
||||
* The time in seconds that should be tracked for warnings
|
||||
*
|
||||
* @return Time in seconds that should be tracked for warnings
|
||||
*/
|
||||
int getTrackingPeriod();
|
||||
|
||||
/**
|
||||
* The number of packets per second to count as a warning
|
||||
*
|
||||
* @return The number of packets per second to count as a warning.
|
||||
*/
|
||||
int getWarningPPS();
|
||||
|
||||
/**
|
||||
* Get the maximum number of warnings the client can have in the interval
|
||||
*
|
||||
* @return The number of packets a client can send per second.
|
||||
*/
|
||||
int getMaxWarnings();
|
||||
|
||||
/**
|
||||
* Get the kick message sent if the user goes over the warnings in the interval
|
||||
*
|
||||
* @return Kick message, with colour codes using '&amp;'
|
||||
*/
|
||||
String getMaxWarningsKickMessage();
|
||||
|
||||
/**
|
||||
* Is anti-xray enabled?
|
||||
*
|
||||
* @return A boolean
|
||||
*/
|
||||
boolean isAntiXRay();
|
||||
|
||||
/**
|
||||
* Send supported versions in the status response packet
|
||||
*
|
||||
* @return If true, enabled
|
||||
*/
|
||||
boolean isSendSupportedVersions();
|
||||
|
||||
/**
|
||||
* Stimulate the player tick
|
||||
*
|
||||
* @return if true, enabled
|
||||
*/
|
||||
boolean isSimulatePlayerTick();
|
||||
|
||||
/**
|
||||
* Use the item cache to prevent high resource usage
|
||||
*
|
||||
* @return if true, enabled
|
||||
*/
|
||||
boolean isItemCache();
|
||||
|
||||
/**
|
||||
* Use the NMS player ticking
|
||||
*
|
||||
* @return if true, enabled
|
||||
*/
|
||||
boolean isNMSPlayerTicking();
|
||||
|
||||
/**
|
||||
* Replace extended pistons on 1.10 chunk loading.
|
||||
*
|
||||
* @return true if to replace them
|
||||
*/
|
||||
boolean isReplacePistons();
|
||||
|
||||
/**
|
||||
* Get the id for replacing extended pistons.
|
||||
*
|
||||
* @return The integer id
|
||||
*/
|
||||
int getPistonReplacementId();
|
||||
|
||||
/**
|
||||
* Force json transform
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isForceJsonTransform();
|
||||
|
||||
/**
|
||||
* Should we fix nbt array's in json chat messages for 1.12 clients
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_12NBTArrayFix();
|
||||
|
||||
/**
|
||||
* Should we make team colours based on the last colour in team prefix
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_13TeamColourFix();
|
||||
|
||||
/**
|
||||
* Should we fix shift quick move action for 1.12 clients
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_12QuickMoveActionFix();
|
||||
|
||||
/**
|
||||
* Get the blocked protocols
|
||||
*
|
||||
* @return An Integer list
|
||||
*/
|
||||
IntSet getBlockedProtocols();
|
||||
|
||||
/**
|
||||
* Get the custom disconnect message
|
||||
*
|
||||
* @return Disconnect message
|
||||
*/
|
||||
String getBlockedDisconnectMsg();
|
||||
|
||||
/**
|
||||
* Get the message sent to players being kicked on reload.
|
||||
* Players are kicked to stop the server crashing
|
||||
*
|
||||
* @return Disconnect message
|
||||
*/
|
||||
String getReloadDisconnectMsg();
|
||||
|
||||
/**
|
||||
* Should we hide errors that occur when trying to convert block and item data over versions?
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isSuppressConversionWarnings();
|
||||
|
||||
/**
|
||||
* Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13)
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isDisable1_13AutoComplete();
|
||||
|
||||
/**
|
||||
* Tries to minimize cooldown animation.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isMinimizeCooldown();
|
||||
|
||||
/**
|
||||
* Enable the serverside blockconnections for 1.13+ clients
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isServersideBlockConnections();
|
||||
|
||||
/**
|
||||
* Get the type of block-connection provider which should be used
|
||||
*
|
||||
* @return String world for world-level or packet for packet-level
|
||||
*/
|
||||
String getBlockConnectionMethod();
|
||||
|
||||
/**
|
||||
* When activated, only the most important blocks are saved in the BlockStorage.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isReduceBlockStorageMemory();
|
||||
|
||||
/**
|
||||
* When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems.
|
||||
* Useful for lobbyservers where users can't build and those stems are used decoratively.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isStemWhenBlockAbove();
|
||||
|
||||
/**
|
||||
* Vines not connected to any blocks will be mapped to air for 1.13+ clients to prevent them from climbing up.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isVineClimbFix();
|
||||
|
||||
/**
|
||||
* When activated, the 1-layer snow will be sent as 2-layer snow to 1.13+ clients to have collision.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isSnowCollisionFix();
|
||||
|
||||
/**
|
||||
* When activated, infested blocks will be mapped to their normal stone variants for 1.13+ clients.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isInfestedBlocksFix();
|
||||
|
||||
/**
|
||||
* When greater than 0, enables tab complete request delaying by x ticks
|
||||
*
|
||||
* @return the delay in ticks
|
||||
*/
|
||||
int get1_13TabCompleteDelay();
|
||||
|
||||
/**
|
||||
* When activated, edited books with more than 50 pages will be shortened to 50.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isTruncate1_14Books();
|
||||
|
||||
/**
|
||||
* Handles left handed info by using unused bit 7 on Client Settings packet
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isLeftHandedHandling();
|
||||
|
||||
/**
|
||||
* Fixes velocity bugs due to different hitbox for 1.9-1.13 clients on 1.8 servers.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_9HitboxFix();
|
||||
|
||||
/**
|
||||
* Fixes velocity bugs due to different hitbox for 1.14+ clients on sub 1.14 servers.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_14HitboxFix();
|
||||
|
||||
/**
|
||||
* Fixes non full blocks having 0 light for 1.14+ clients on sub 1.14 servers.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isNonFullBlockLightFix();
|
||||
|
||||
boolean is1_14HealthNaNFix();
|
||||
|
||||
/**
|
||||
* Should 1.15 clients respawn instantly / without showing the death screen.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean is1_15InstantRespawn();
|
||||
|
||||
/**
|
||||
* Ignores incoming plugin channel messages of 1.16+ clients with channel names longer than 32 charatcers.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isIgnoreLong1_16ChannelNames();
|
||||
|
||||
/**
|
||||
* Force 1.17+ client to accept the server resource pack.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isForcedUse1_17ResourcePack();
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.connection;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Handles injected UserConnections
|
||||
*/
|
||||
public interface ConnectionManager {
|
||||
|
||||
/**
|
||||
* Returns if Via injected into this player connection.
|
||||
*
|
||||
* @param playerId player uuid
|
||||
* @return true if the player is handled by Via
|
||||
*/
|
||||
boolean isClientConnected(UUID playerId);
|
||||
|
||||
/**
|
||||
* Frontend connections will have the UUID stored. Override this if your platform isn't always frontend.
|
||||
* UUIDs can't be duplicate between frontend connections.
|
||||
*
|
||||
* @return true if the user is a frontend connection
|
||||
*/
|
||||
default boolean isFrontEnd(UserConnection connection) {
|
||||
return !connection.isClientSide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frontend UserConnection from the player connected to this proxy server
|
||||
* Returns null when there isn't a server or connection was not found
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
* May not return ProtocolSupport players.
|
||||
* <p>
|
||||
* Note that connections are removed as soon as their channel is closed,
|
||||
* so avoid using this method during player quits for example.
|
||||
*
|
||||
* @return frontend UserConnection of the player connected to this proxy server
|
||||
*/
|
||||
@Nullable UserConnection getConnectedClient(UUID clientIdentifier);
|
||||
|
||||
/**
|
||||
* Returns the UUID from the frontend connection to this proxy server
|
||||
* Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
* May not return ProtocolSupport players.
|
||||
* <p>
|
||||
* Note that connections are removed as soon as their channel is closed,
|
||||
* so avoid using this method during player quits for example.
|
||||
*
|
||||
* @return UUID of the frontend connection to this proxy server
|
||||
*/
|
||||
@Nullable UUID getConnectedClientId(UserConnection connection);
|
||||
|
||||
/**
|
||||
* Returns all UserConnections which are registered
|
||||
* May contain duplicated UUIDs on multiple ProtocolInfo.
|
||||
* May contain frontend, backend and/or client-sided connections.
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
* May not contain ProtocolSupport players.
|
||||
*
|
||||
* @return connected UserConnections
|
||||
*/
|
||||
Set<UserConnection> getConnections();
|
||||
|
||||
/**
|
||||
* Returns a map containing the UUIDs and frontend UserConnections from players connected to this proxy server
|
||||
* Returns empty list when there isn't a server
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
* May not contain ProtocolSupport players.
|
||||
*
|
||||
* @return map containing the UUIDs and frontend UserConnections from players connected to this proxy server
|
||||
*/
|
||||
Map<UUID, UserConnection> getConnectedClients();
|
||||
|
||||
void onLoginSuccess(UserConnection connection);
|
||||
|
||||
void onDisconnect(UserConnection connection);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.connection;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ProtocolInfo {
|
||||
|
||||
/**
|
||||
* Returns the protocol state the user is currently in.
|
||||
*
|
||||
* @return protocol state
|
||||
*/
|
||||
State getState();
|
||||
|
||||
void setState(State state);
|
||||
|
||||
/**
|
||||
* Returns the user's protocol version, or -1 if not set.
|
||||
* This is set during the {@link State#HANDSHAKE} state.
|
||||
*
|
||||
* @return protocol version, or -1 if not set
|
||||
*/
|
||||
int getProtocolVersion();
|
||||
|
||||
void setProtocolVersion(int protocolVersion);
|
||||
|
||||
/**
|
||||
* Returns the server protocol version the user is connected to, or -1 if not set.
|
||||
* This is set during the {@link State#HANDSHAKE} state.
|
||||
*
|
||||
* @return server protocol version, or -1 if not set
|
||||
*/
|
||||
int getServerProtocolVersion();
|
||||
|
||||
void setServerProtocolVersion(int serverProtocolVersion);
|
||||
|
||||
/**
|
||||
* Returns the username associated with this connection.
|
||||
* This is set once the connection enters the {@link State#PLAY} state.
|
||||
*
|
||||
* @return username, set when entering the {@link State#PLAY} state
|
||||
*/
|
||||
@Nullable String getUsername();
|
||||
|
||||
void setUsername(String username);
|
||||
|
||||
/**
|
||||
* Returns the uuid associated with this connection.
|
||||
* This is set once the connection enters the {@link State#PLAY} state.
|
||||
*
|
||||
* @return uuid, set when entering the {@link State#PLAY} state
|
||||
*/
|
||||
@Nullable UUID getUuid();
|
||||
|
||||
void setUuid(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns the user's pipeline.
|
||||
*
|
||||
* @return protocol pipeline
|
||||
*/
|
||||
ProtocolPipeline getPipeline();
|
||||
|
||||
void setPipeline(ProtocolPipeline pipeline);
|
||||
|
||||
/**
|
||||
* Returns the user connection this info represents.
|
||||
*
|
||||
* @return user connection
|
||||
*/
|
||||
UserConnection getUser();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.connection;
|
||||
|
||||
/**
|
||||
* Dummy interface used to explicitly identify objects storable in user connections.
|
||||
*
|
||||
* @see UserConnection#get(Class)
|
||||
* @see UserConnection#put(StorableObject)
|
||||
*/
|
||||
public interface StorableObject {
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.connection;
|
||||
|
||||
public abstract class StoredObject implements StorableObject {
|
||||
private final UserConnection user;
|
||||
|
||||
protected StoredObject(UserConnection user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public UserConnection getUser() {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.connection;
|
||||
|
||||
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketTracker;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.exception.CancelException;
|
||||
import com.viaversion.viaversion.exception.InformativeException;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface UserConnection {
|
||||
|
||||
/**
|
||||
* Get an object from the storage.
|
||||
*
|
||||
* @param objectClass The class of the object to get
|
||||
* @param <T> The type of the class you want to get.
|
||||
* @return The requested object
|
||||
*/
|
||||
@Nullable <T extends StorableObject> T get(Class<T> objectClass);
|
||||
|
||||
/**
|
||||
* Check if the storage has an object.
|
||||
*
|
||||
* @param objectClass The object class to check
|
||||
* @return True if the object is in the storage
|
||||
*/
|
||||
boolean has(Class<? extends StorableObject> objectClass);
|
||||
|
||||
/**
|
||||
* Put an object into the stored objects based on class.
|
||||
*
|
||||
* @param object The object to store.
|
||||
*/
|
||||
void put(StorableObject object);
|
||||
|
||||
/**
|
||||
* Returns a collection of entity trackers currently registered.
|
||||
*
|
||||
* @return collection of entity trackers currently registered
|
||||
*/
|
||||
Collection<EntityTracker> getEntityTrackers();
|
||||
|
||||
/**
|
||||
* Returns the entity tracker by the given protocol class if present.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param <T> entity tracker type
|
||||
* @return entity tracker if present
|
||||
*/
|
||||
@Nullable <T extends EntityTracker> T getEntityTracker(Class<? extends Protocol> protocolClass);
|
||||
|
||||
/**
|
||||
* Adds an entity tracker to the user connection.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param tracker entity tracker
|
||||
*/
|
||||
void addEntityTracker(Class<? extends Protocol> protocolClass, EntityTracker tracker);
|
||||
|
||||
/**
|
||||
* Clear all the stored objects.
|
||||
* Used for bungee when switching servers.
|
||||
*/
|
||||
void clearStoredObjects();
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the connection on the current thread.
|
||||
*
|
||||
* @param packet raw packet to send
|
||||
*/
|
||||
void sendRawPacket(ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Send a raw packet to the player, submitted to the netty event loop.
|
||||
*
|
||||
* @param packet raw packet to send
|
||||
*/
|
||||
void scheduleSendRawPacket(ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Send a raw packet to the player with returning the future.
|
||||
*
|
||||
* @param packet The raw packet to send
|
||||
* @return ChannelFuture of the packet being sent
|
||||
*/
|
||||
ChannelFuture sendRawPacketFuture(ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Returns the user's packet tracker used for the inbuilt packet-limiter.
|
||||
*
|
||||
* @return packet tracker
|
||||
*/
|
||||
PacketTracker getPacketTracker();
|
||||
|
||||
/**
|
||||
* Disconnect a connection.
|
||||
*
|
||||
* @param reason The reason to use, not used if player is not active.
|
||||
*/
|
||||
void disconnect(String reason);
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the server on the current thread.
|
||||
*
|
||||
* @param packet raw packet to be sent
|
||||
*/
|
||||
void sendRawPacketToServer(ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the server, submitted to the netty event loop.
|
||||
*
|
||||
* @param packet raw packet to be sent
|
||||
*/
|
||||
void scheduleSendRawPacketToServer(ByteBuf packet);
|
||||
|
||||
/**
|
||||
* Monitors serverbound packets and returns whether a packet can/should be processed.
|
||||
*
|
||||
* @return false if this packet should be cancelled
|
||||
*/
|
||||
boolean checkServerboundPacket();
|
||||
|
||||
/**
|
||||
* Monitors clientbound packets and returns whether a packet can/should be processed.
|
||||
*
|
||||
* @return false if this packet should be cancelled
|
||||
*/
|
||||
boolean checkClientboundPacket();
|
||||
|
||||
/**
|
||||
* @see #checkClientboundPacket()
|
||||
* @see #checkServerboundPacket()
|
||||
*/
|
||||
default boolean checkIncomingPacket() {
|
||||
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #checkClientboundPacket()
|
||||
* @see #checkServerboundPacket()
|
||||
*/
|
||||
default boolean checkOutgoingPacket() {
|
||||
return isClientSide() ? checkServerboundPacket() : checkClientboundPacket();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if packets needs transforming.
|
||||
*
|
||||
* @return whether packets should be passed through
|
||||
*/
|
||||
boolean shouldTransformPacket();
|
||||
|
||||
/**
|
||||
* Transforms the clientbound packet contained in ByteBuf.
|
||||
*
|
||||
* @param buf ByteBuf with packet id and packet contents
|
||||
* @param cancelSupplier function called with original CancelException for generating the Exception when the packet is cancelled
|
||||
* @throws CancelException if the packet should be cancelled
|
||||
* @throws InformativeException if packet transforming failed
|
||||
* @throws Exception if any other processing outside of transforming fails
|
||||
*/
|
||||
void transformClientbound(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception;
|
||||
|
||||
/**
|
||||
* Transforms the serverbound packet contained in ByteBuf.
|
||||
*
|
||||
* @param buf ByteBuf with packet id and packet contents
|
||||
* @param cancelSupplier Function called with original CancelException for generating the Exception used when
|
||||
* packet is cancelled
|
||||
* @throws CancelException if the packet should be cancelled
|
||||
* @throws InformativeException if packet transforming failed
|
||||
* @throws Exception if any other processing outside of transforming fails
|
||||
*/
|
||||
void transformServerbound(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception;
|
||||
|
||||
/**
|
||||
* Transforms the packet depending on whether the connection is clientside or not.
|
||||
*
|
||||
* @see #transformClientbound(ByteBuf, Function)
|
||||
* @see #transformServerbound(ByteBuf, Function)
|
||||
*/
|
||||
default void transformOutgoing(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception {
|
||||
if (isClientSide()) {
|
||||
transformServerbound(buf, cancelSupplier);
|
||||
} else {
|
||||
transformClientbound(buf, cancelSupplier);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the packet depending on whether the connection is clientside or not.
|
||||
*
|
||||
* @see #transformClientbound(ByteBuf, Function)
|
||||
* @see #transformServerbound(ByteBuf, Function)
|
||||
*/
|
||||
default void transformIncoming(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception {
|
||||
if (isClientSide()) {
|
||||
transformClientbound(buf, cancelSupplier);
|
||||
} else {
|
||||
transformServerbound(buf, cancelSupplier);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the internal id incremented for each new connection.
|
||||
*
|
||||
* @return internal id
|
||||
*/
|
||||
long getId();
|
||||
|
||||
/**
|
||||
* Returns the netty channel if present.
|
||||
*
|
||||
* @return netty channel if present
|
||||
*/
|
||||
@Nullable Channel getChannel();
|
||||
|
||||
/**
|
||||
* Returns info containing the current protocol state and userdata.
|
||||
*
|
||||
* @return info containing the current protocol state and userdata
|
||||
*/
|
||||
ProtocolInfo getProtocolInfo();
|
||||
|
||||
/**
|
||||
* Returns a map of stored objects.
|
||||
*
|
||||
* @return map of stored objects
|
||||
* @see #has(Class)
|
||||
* @see #get(Class)
|
||||
* @see #put(StorableObject)
|
||||
*/
|
||||
Map<Class<?>, StorableObject> getStoredObjects();
|
||||
|
||||
/**
|
||||
* Returns whether the connection has protocols other than the base protocol applied.
|
||||
*
|
||||
* @return whether the connection is active
|
||||
*/
|
||||
boolean isActive();
|
||||
|
||||
void setActive(boolean active);
|
||||
|
||||
/**
|
||||
* Returns whether the connection is pending a disconnect, initiated through {@link #disconnect(String)}.
|
||||
*
|
||||
* @return whether the connection is pending a disconnect
|
||||
*/
|
||||
boolean isPendingDisconnect();
|
||||
|
||||
void setPendingDisconnect(boolean pendingDisconnect);
|
||||
|
||||
/**
|
||||
* Returns whether this is a client-side connection.
|
||||
* This is a mod integrated into the client itself, or for example a backend Velocity connection.
|
||||
*
|
||||
* @return whether this is a client-side connection
|
||||
*/
|
||||
boolean isClientSide();
|
||||
|
||||
/**
|
||||
* Returns whether {@link ViaVersionConfig#getBlockedProtocols()} should be checked for this connection.
|
||||
*
|
||||
* @return whether blocked protocols should be applied
|
||||
*/
|
||||
boolean shouldApplyBlockProtocol();
|
||||
|
||||
/**
|
||||
* Returns a newly generated uuid that will let a packet be passed through without
|
||||
* transformig its contents if used together with {@link PacketWrapper#PASSTHROUGH_ID}.
|
||||
*
|
||||
* @return generated passthrough token
|
||||
*/
|
||||
UUID generatePassthroughToken();
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class IntArrayMappings implements Mappings {
|
||||
protected final int[] oldToNew;
|
||||
|
||||
public IntArrayMappings(int[] oldToNew) {
|
||||
this.oldToNew = oldToNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps old identifiers to the new ones.
|
||||
* If an old value cannot be found in the new mappings, the diffmapping will be checked for the given entry.
|
||||
*
|
||||
* @param size set size of the underlying short array
|
||||
* @param oldMapping mappings to map from
|
||||
* @param newMapping mappings to map to
|
||||
* @param diffMapping extra mappings that will be used/scanned when an entry cannot be found
|
||||
*/
|
||||
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping);
|
||||
}
|
||||
|
||||
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
|
||||
this(oldMapping.entrySet().size(), oldMapping, newMapping, diffMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps old identifiers to the new ones.
|
||||
*
|
||||
* @param size set size of the underlying short array
|
||||
* @param oldMapping mappings to map from
|
||||
* @param newMapping mappings to map to
|
||||
*/
|
||||
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping);
|
||||
}
|
||||
|
||||
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping) {
|
||||
this(oldMapping.entrySet().size(), oldMapping, newMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps old identifiers to the new ones.
|
||||
*
|
||||
* @param size set size of the underlying short array
|
||||
* @param oldMapping mappings to map from
|
||||
* @param newMapping mappings to map to
|
||||
* @param diffMapping extra mappings that will be used/scanned when an entry cannot be found
|
||||
* @param warnOnMissing should "No key for x" be printed if there is no matching identifier
|
||||
*/
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping, boolean warnOnMissing) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping, warnOnMissing);
|
||||
}
|
||||
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
|
||||
this(size, oldMapping, newMapping, null, warnOnMissing);
|
||||
}
|
||||
|
||||
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
|
||||
this(oldMapping.size(), oldMapping, newMapping, warnOnMissing);
|
||||
}
|
||||
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping) {
|
||||
this(size, oldMapping, newMapping, true);
|
||||
}
|
||||
|
||||
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping) {
|
||||
this(oldMapping.size(), oldMapping, newMapping, diffMapping, true);
|
||||
}
|
||||
|
||||
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping) {
|
||||
this(oldMapping.size(), oldMapping, newMapping, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewId(int id) {
|
||||
return id >= 0 && id < oldToNew.length ? oldToNew[id] : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewId(int id, int newId) {
|
||||
oldToNew[id] = newId;
|
||||
}
|
||||
|
||||
public int[] getOldToNew() {
|
||||
return oldToNew;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.TagData;
|
||||
import com.viaversion.viaversion.util.Int2IntBiMap;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MappingData {
|
||||
|
||||
/**
|
||||
* Loads the mapping data.
|
||||
*/
|
||||
void load();
|
||||
|
||||
/**
|
||||
* Returns the mapped block state id, or -1 if unmapped.
|
||||
*
|
||||
* @param id unmapped block state id
|
||||
* @return mapped block state id, or -1 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold block state mappings
|
||||
*/
|
||||
int getNewBlockStateId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped block id, or -1 if unmapped.
|
||||
*
|
||||
* @param id unmapped block id
|
||||
* @return mapped block id, or -1 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold block mappings
|
||||
*/
|
||||
int getNewBlockId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped item id, or -1 if unmapped.
|
||||
*
|
||||
* @param id unmapped item id
|
||||
* @return mapped item id, or -1 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold item mappings
|
||||
*/
|
||||
int getNewItemId(int id);
|
||||
|
||||
/**
|
||||
* Returns the backwards mapped item id, or -1 if unmapped.
|
||||
*
|
||||
* @param id mapped item id
|
||||
* @return backwards mapped item id, or -1 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold item mappings
|
||||
*/
|
||||
int getOldItemId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped particle id, or -1 if unmapped.
|
||||
*
|
||||
* @param id unmapped particle id
|
||||
* @return mapped particle id, or -1 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold particle mappings
|
||||
*/
|
||||
int getNewParticleId(int id);
|
||||
|
||||
/**
|
||||
* Returns a list of tags to send if present.
|
||||
*
|
||||
* @param type registry tag type
|
||||
* @return list of tags to send if present, else null
|
||||
*/
|
||||
@Nullable List<TagData> getTags(RegistryType type);
|
||||
|
||||
@Nullable Int2IntBiMap getItemMappings();
|
||||
|
||||
@Nullable ParticleMappings getParticleMappings();
|
||||
|
||||
@Nullable Mappings getBlockMappings();
|
||||
|
||||
@Nullable Mappings getBlockStateMappings();
|
||||
|
||||
@Nullable Mappings getSoundMappings();
|
||||
|
||||
@Nullable Mappings getStatisticsMappings();
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.TagData;
|
||||
import com.viaversion.viaversion.util.Int2IntBiHashMap;
|
||||
import com.viaversion.viaversion.util.Int2IntBiMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class MappingDataBase implements MappingData {
|
||||
protected final String oldVersion;
|
||||
protected final String newVersion;
|
||||
protected final boolean hasDiffFile;
|
||||
protected Int2IntBiMap itemMappings;
|
||||
protected ParticleMappings particleMappings;
|
||||
protected Mappings blockMappings;
|
||||
protected Mappings blockStateMappings;
|
||||
protected Mappings soundMappings;
|
||||
protected Mappings statisticsMappings;
|
||||
protected Map<RegistryType, List<TagData>> tags;
|
||||
protected boolean loadItems = true;
|
||||
|
||||
public MappingDataBase(String oldVersion, String newVersion) {
|
||||
this(oldVersion, newVersion, false);
|
||||
}
|
||||
|
||||
public MappingDataBase(String oldVersion, String newVersion, boolean hasDiffFile) {
|
||||
this.oldVersion = oldVersion;
|
||||
this.newVersion = newVersion;
|
||||
this.hasDiffFile = hasDiffFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
getLogger().info("Loading " + oldVersion + " -> " + newVersion + " mappings...");
|
||||
JsonObject diffmapping = hasDiffFile ? loadDiffFile() : null;
|
||||
JsonObject oldMappings = MappingDataLoader.loadData("mapping-" + oldVersion + ".json", true);
|
||||
JsonObject newMappings = MappingDataLoader.loadData("mapping-" + newVersion + ".json", true);
|
||||
|
||||
blockMappings = loadFromObject(oldMappings, newMappings, diffmapping, "blocks");
|
||||
blockStateMappings = loadFromObject(oldMappings, newMappings, diffmapping, "blockstates");
|
||||
soundMappings = loadFromArray(oldMappings, newMappings, diffmapping, "sounds");
|
||||
statisticsMappings = loadFromArray(oldMappings, newMappings, diffmapping, "statistics");
|
||||
|
||||
Mappings particles = loadFromArray(oldMappings, newMappings, diffmapping, "particles");
|
||||
if (particles != null) {
|
||||
particleMappings = new ParticleMappings(oldMappings.getAsJsonArray("particles"), particles);
|
||||
}
|
||||
|
||||
if (loadItems && newMappings.has("items")) {
|
||||
itemMappings = new Int2IntBiHashMap();
|
||||
itemMappings.defaultReturnValue(-1);
|
||||
MappingDataLoader.mapIdentifiers(itemMappings, oldMappings.getAsJsonObject("items"), newMappings.getAsJsonObject("items"),
|
||||
diffmapping != null ? diffmapping.getAsJsonObject("items") : null);
|
||||
}
|
||||
|
||||
if (diffmapping != null && diffmapping.has("tags")) {
|
||||
this.tags = new EnumMap<>(RegistryType.class);
|
||||
JsonObject tags = diffmapping.getAsJsonObject("tags");
|
||||
if (tags.has(RegistryType.ITEM.getResourceLocation())) {
|
||||
loadTags(RegistryType.ITEM, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("items")));
|
||||
}
|
||||
if (tags.has(RegistryType.BLOCK.getResourceLocation())) {
|
||||
loadTags(RegistryType.BLOCK, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("blocks")));
|
||||
}
|
||||
}
|
||||
|
||||
loadExtras(oldMappings, newMappings, diffmapping);
|
||||
}
|
||||
|
||||
private void loadTags(RegistryType type, JsonObject object, Object2IntMap<String> typeMapping) {
|
||||
JsonObject tags = object.getAsJsonObject(type.getResourceLocation());
|
||||
List<TagData> tagsList = new ArrayList<>(tags.size());
|
||||
for (Map.Entry<String, JsonElement> entry : tags.entrySet()) {
|
||||
JsonArray array = entry.getValue().getAsJsonArray();
|
||||
int[] entries = new int[array.size()];
|
||||
int i = 0;
|
||||
for (JsonElement element : array) {
|
||||
String stringId = element.getAsString();
|
||||
if (!typeMapping.containsKey(stringId) && !typeMapping.containsKey(stringId = stringId.replace("minecraft:", ""))) { // aaa
|
||||
getLogger().warning(type + " Tags contains invalid type identifier " + stringId + " in tag " + entry.getKey());
|
||||
continue;
|
||||
}
|
||||
|
||||
entries[i++] = typeMapping.getInt(stringId);
|
||||
}
|
||||
tagsList.add(new TagData(entry.getKey(), entries));
|
||||
}
|
||||
|
||||
this.tags.put(type, tagsList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewBlockStateId(int id) {
|
||||
return checkValidity(id, blockStateMappings.getNewId(id), "blockstate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewBlockId(int id) {
|
||||
return checkValidity(id, blockMappings.getNewId(id), "block");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewItemId(int id) {
|
||||
return checkValidity(id, itemMappings.get(id), "item");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldItemId(int id) {
|
||||
int oldId = itemMappings.inverse().get(id);
|
||||
// Remap new items to stone
|
||||
return oldId != -1 ? oldId : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewParticleId(int id) {
|
||||
return checkValidity(id, particleMappings.getMappings().getNewId(id), "particles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable List<TagData> getTags(RegistryType type) {
|
||||
return tags != null ? tags.get(type) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Int2IntBiMap getItemMappings() {
|
||||
return itemMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ParticleMappings getParticleMappings() {
|
||||
return particleMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getBlockMappings() {
|
||||
return blockMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getBlockStateMappings() {
|
||||
return blockStateMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getSoundMappings() {
|
||||
return soundMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getStatisticsMappings() {
|
||||
return statisticsMappings;
|
||||
}
|
||||
|
||||
protected @Nullable Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
||||
|
||||
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
|
||||
return new IntArrayMappings(oldMappings.getAsJsonArray(key), newMappings.getAsJsonArray(key), diff);
|
||||
}
|
||||
|
||||
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
||||
|
||||
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
|
||||
return new IntArrayMappings(oldMappings.getAsJsonObject(key), newMappings.getAsJsonObject(key), diff);
|
||||
}
|
||||
|
||||
protected @Nullable JsonObject loadDiffFile() {
|
||||
return MappingDataLoader.loadData("mappingdiff-" + oldVersion + "to" + newVersion + ".json");
|
||||
}
|
||||
|
||||
protected Logger getLogger() {
|
||||
return Via.getPlatform().getLogger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the given mapped id if valid, else 0 with a warning logged to the console.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @param mappedId mapped id
|
||||
* @param type mapping type (e.g. "item")
|
||||
* @return the given mapped id if valid, else 0
|
||||
*/
|
||||
protected int checkValidity(int id, int mappedId, String type) {
|
||||
if (mappedId == -1) {
|
||||
getLogger().warning(String.format("Missing %s %s for %s %s %d", newVersion, type, oldVersion, type, id));
|
||||
return 0;
|
||||
}
|
||||
return mappedId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To be overridden.
|
||||
*
|
||||
* @param oldMappings old mappings
|
||||
* @param newMappings new mappings
|
||||
* @param diffMappings diff mappings if present
|
||||
*/
|
||||
protected void loadExtras(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.util.GsonUtil;
|
||||
import com.viaversion.viaversion.util.Int2IntBiMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class MappingDataLoader {
|
||||
|
||||
private static final Map<String, JsonObject> MAPPINGS_CACHE = new ConcurrentHashMap<>();
|
||||
private static boolean cacheJsonMappings;
|
||||
|
||||
/**
|
||||
* Returns true if a selected number of mappings should be cached.
|
||||
* If enabled, cleanup should be done after the cache is no longer needed.
|
||||
*
|
||||
* @return true if mappings should be cached
|
||||
*/
|
||||
public static boolean isCacheJsonMappings() {
|
||||
return cacheJsonMappings;
|
||||
}
|
||||
|
||||
public static void enableMappingsCache() {
|
||||
cacheJsonMappings = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cached mappings. Cleared after ViaVersion has been fully loaded.
|
||||
*
|
||||
* @return cached mapping file json objects
|
||||
* @see #isCacheJsonMappings()
|
||||
*/
|
||||
public static Map<String, JsonObject> getMappingsCache() {
|
||||
return MAPPINGS_CACHE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the file from the plugin folder if present, else from the bundled resources.
|
||||
*
|
||||
* @return loaded json object, or null if not found or invalid
|
||||
*/
|
||||
public static @Nullable JsonObject loadFromDataDir(String name) {
|
||||
File file = new File(Via.getPlatform().getDataFolder(), name);
|
||||
if (!file.exists()) return loadData(name);
|
||||
|
||||
// Load the file from the platform's directory if present
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
return GsonUtil.getGson().fromJson(reader, JsonObject.class);
|
||||
} catch (JsonSyntaxException e) {
|
||||
// Users might mess up the format, so let's catch the syntax error
|
||||
Via.getPlatform().getLogger().warning(name + " is badly formatted!");
|
||||
e.printStackTrace();
|
||||
} catch (IOException | JsonIOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the file from the bundled resources. Uses the cache if enabled.
|
||||
*
|
||||
* @return loaded json object from bundled resources if present
|
||||
*/
|
||||
public static @Nullable JsonObject loadData(String name) {
|
||||
return loadData(name, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the file from the bundled resources. Uses the cache if enabled.
|
||||
*
|
||||
* @param cacheIfEnabled whether loaded files should be cached
|
||||
* @return loaded json object from bundled resources if present
|
||||
*/
|
||||
public static @Nullable JsonObject loadData(String name, boolean cacheIfEnabled) {
|
||||
if (cacheJsonMappings) {
|
||||
JsonObject cached = MAPPINGS_CACHE.get(name);
|
||||
if (cached != null) {
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
|
||||
InputStream stream = getResource(name);
|
||||
if (stream == null) return null;
|
||||
|
||||
InputStreamReader reader = new InputStreamReader(stream);
|
||||
try {
|
||||
JsonObject object = GsonUtil.getGson().fromJson(reader, JsonObject.class);
|
||||
if (cacheIfEnabled && cacheJsonMappings) {
|
||||
MAPPINGS_CACHE.put(name, object);
|
||||
}
|
||||
return object;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException ignored) {
|
||||
// Ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(Int2IntBiMap output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers) {
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
|
||||
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
|
||||
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers);
|
||||
if (value != -1) {
|
||||
output.put(Integer.parseInt(entry.getKey()), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers) {
|
||||
MappingDataLoader.mapIdentifiers(output, oldIdentifiers, newIdentifiers, null);
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers) {
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
|
||||
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
|
||||
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers);
|
||||
if (value != -1) {
|
||||
output[Integer.parseInt(entry.getKey())] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int mapIdentifierEntry(Map.Entry<String, JsonElement> entry, Object2IntMap newIdentifierMap, @Nullable JsonObject diffIdentifiers) {
|
||||
int value = newIdentifierMap.getInt(entry.getValue().getAsString());
|
||||
if (value == -1) {
|
||||
// Search in diff mappings
|
||||
if (diffIdentifiers != null) {
|
||||
JsonElement diffElement = diffIdentifiers.get(entry.getKey());
|
||||
if (diffElement != null) {
|
||||
value = newIdentifierMap.getInt(diffElement.getAsString());
|
||||
}
|
||||
}
|
||||
if (value == -1) {
|
||||
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
Via.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( ");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers, boolean warnOnMissing) {
|
||||
mapIdentifiers(output, oldIdentifiers, newIdentifiers, null, warnOnMissing);
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.arrayToMap(newIdentifiers);
|
||||
for (int i = 0; i < oldIdentifiers.size(); i++) {
|
||||
JsonElement oldIdentifier = oldIdentifiers.get(i);
|
||||
int mappedId = newIdentifierMap.getInt(oldIdentifier.getAsString());
|
||||
if (mappedId == -1) {
|
||||
// Search in diff mappings
|
||||
if (diffIdentifiers != null) {
|
||||
JsonElement diffElement = diffIdentifiers.get(oldIdentifier.getAsString());
|
||||
if (diffElement != null) {
|
||||
String mappedName = diffElement.getAsString();
|
||||
if (mappedName.isEmpty()) continue; // "empty" remaps
|
||||
|
||||
mappedId = newIdentifierMap.getInt(mappedName);
|
||||
}
|
||||
}
|
||||
if (mappedId == -1) {
|
||||
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
Via.getPlatform().getLogger().warning("No key for " + oldIdentifier + " :( ");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
output[i] = mappedId;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map of the object entries hashed by their id value.
|
||||
*
|
||||
* @param object json object
|
||||
* @return map with indexes hashed by their id value
|
||||
*/
|
||||
public static Object2IntMap<String> indexedObjectToMap(JsonObject object) {
|
||||
Object2IntMap<String> map = new Object2IntOpenHashMap<>(object.size(), 1F);
|
||||
map.defaultReturnValue(-1);
|
||||
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
|
||||
map.put(entry.getValue().getAsString(), Integer.parseInt(entry.getKey()));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map of the array entries hashed by their id value.
|
||||
*
|
||||
* @param array json array
|
||||
* @return map with indexes hashed by their id value
|
||||
*/
|
||||
public static Object2IntMap<String> arrayToMap(JsonArray array) {
|
||||
Object2IntMap<String> map = new Object2IntOpenHashMap<>(array.size(), 1F);
|
||||
map.defaultReturnValue(-1);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
map.put(array.get(i).getAsString(), i);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static @Nullable InputStream getResource(String name) {
|
||||
return MappingDataLoader.class.getClassLoader().getResourceAsStream("assets/viaversion/data/" + name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
public interface Mappings {
|
||||
|
||||
/**
|
||||
* Returns the mapped id from the given id, or -1 if invalid/out of bounds.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @return mapped id, or -1 if invalid/out of bounds
|
||||
*/
|
||||
int getNewId(int id);
|
||||
|
||||
/**
|
||||
* Manually maps a specific id.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @param newId mapped id
|
||||
* @throws IndexOutOfBoundsException if the unmapped id is invalid
|
||||
*/
|
||||
void setNewId(int id, int newId);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
|
||||
public class ParticleMappings {
|
||||
private final Mappings mappings;
|
||||
private final int blockId;
|
||||
private final int fallingDustId;
|
||||
private final int itemId;
|
||||
|
||||
public ParticleMappings(JsonArray oldMappings, Mappings mappings) {
|
||||
this.mappings = mappings;
|
||||
|
||||
Object2IntMap<String> map = MappingDataLoader.arrayToMap(oldMappings);
|
||||
blockId = map.getInt("block");
|
||||
fallingDustId = map.getInt("falling_dust");
|
||||
itemId = map.getInt("item");
|
||||
}
|
||||
|
||||
public Mappings getMappings() {
|
||||
return mappings;
|
||||
}
|
||||
|
||||
public int getBlockId() {
|
||||
return blockId;
|
||||
}
|
||||
|
||||
public int getFallingDustId() {
|
||||
return fallingDustId;
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data.entity;
|
||||
|
||||
public interface ClientEntityIdChangeListener {
|
||||
|
||||
void setClientEntityId(int entityId);
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data.entity;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface EntityTracker {
|
||||
|
||||
/**
|
||||
* User connection the tracker belongs to.
|
||||
*
|
||||
* @return user connection
|
||||
*/
|
||||
UserConnection user();
|
||||
|
||||
/**
|
||||
* Tracks an entity.
|
||||
*
|
||||
* @param id entity id
|
||||
* @param type entity type
|
||||
*/
|
||||
void addEntity(int id, EntityType type);
|
||||
|
||||
/**
|
||||
* Returns whether the entity is currently tracked.
|
||||
*
|
||||
* @param id entity id
|
||||
* @return whether the entity is tracked
|
||||
*/
|
||||
boolean hasEntity(int id);
|
||||
|
||||
/**
|
||||
* Entity type of the entity if tracked.
|
||||
* This returning null does not necessarily mean no entity by the id exists.
|
||||
*
|
||||
* @param id entity id
|
||||
* @return entity type of the entity if tracked
|
||||
*/
|
||||
@Nullable EntityType entityType(int id);
|
||||
|
||||
/**
|
||||
* Untracks an entity.
|
||||
*
|
||||
* @param id entity id
|
||||
*/
|
||||
void removeEntity(int id);
|
||||
|
||||
/**
|
||||
* Returns the stored entity data if an entity with the id is tracked, else null.
|
||||
* If no data has been initialized yet, it will be done and returned by this method.
|
||||
*
|
||||
* @param id entity id
|
||||
* @return stored entity data if an entity with the id is tracked, else null
|
||||
*/
|
||||
@Nullable StoredEntityData entityData(int id);
|
||||
|
||||
/**
|
||||
* Returns stored entity data if it has previously been initialized by {@link #entityData(int)}, else null.
|
||||
*
|
||||
* @param id entity id
|
||||
* @return stored entity data if it has previously been initialized by {@link #entityData(int)}
|
||||
*/
|
||||
@Nullable StoredEntityData entityDataIfPresent(int id);
|
||||
|
||||
/**
|
||||
* Returns the client entity id or -1 if unset.
|
||||
*
|
||||
* @return client entity id or -1 if unset
|
||||
*/
|
||||
int clientEntityId();
|
||||
|
||||
/**
|
||||
* Sets the client entity id.
|
||||
*
|
||||
* @param clientEntityId client entity id
|
||||
*/
|
||||
void setClientEntityId(int clientEntityId);
|
||||
|
||||
/**
|
||||
* Returns the current world section height.
|
||||
* Always 16 for sub 1.17 worlds.
|
||||
*
|
||||
* @return current world section height
|
||||
*/
|
||||
int currentWorldSectionHeight();
|
||||
|
||||
/**
|
||||
* Sets the current world section height.
|
||||
*
|
||||
* @param currentWorldSectionHeight world section height
|
||||
*/
|
||||
void setCurrentWorldSectionHeight(int currentWorldSectionHeight);
|
||||
|
||||
/**
|
||||
* Returns the minimum y of the current player world.
|
||||
*
|
||||
* @return minimum y of the current world
|
||||
*/
|
||||
int currentMinY();
|
||||
|
||||
/**
|
||||
* Sets the minimum y of the current player world.
|
||||
*
|
||||
* @param currentMinY minimum y of the current world
|
||||
*/
|
||||
void setCurrentMinY(int currentMinY);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.data.entity;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface StoredEntityData {
|
||||
|
||||
/**
|
||||
* Returns the entity type of the stored entity.
|
||||
*
|
||||
* @return entity type
|
||||
*/
|
||||
EntityType type();
|
||||
|
||||
/**
|
||||
* Checks if the storage contains an object of the given type.
|
||||
*
|
||||
* @param objectClass object class to check
|
||||
* @return whether an object of the given type is in the storage
|
||||
*/
|
||||
boolean has(Class<?> objectClass);
|
||||
|
||||
/**
|
||||
* Returns an object from the storage if present.
|
||||
*
|
||||
* @param objectClass class of the object to get
|
||||
* @param <T> object type
|
||||
* @return object if present
|
||||
*/
|
||||
@Nullable <T> T get(Class<T> objectClass);
|
||||
|
||||
/**
|
||||
* Stores an object based on its class.
|
||||
*
|
||||
* @param object object to store
|
||||
*/
|
||||
void put(Object object);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.legacy;
|
||||
|
||||
import com.viaversion.viaversion.api.legacy.bossbar.BossBar;
|
||||
import com.viaversion.viaversion.api.legacy.bossbar.BossColor;
|
||||
import com.viaversion.viaversion.api.legacy.bossbar.BossStyle;
|
||||
|
||||
/**
|
||||
* API only applicable on or to legacy versions of Minecraft.
|
||||
*
|
||||
* @param <T> player type
|
||||
*/
|
||||
public interface LegacyViaAPI<T> {
|
||||
|
||||
/**
|
||||
* Creates a new bossbar instance. This only works on pre 1.9 servers for 1.9+ clients.
|
||||
*
|
||||
* @param title title
|
||||
* @param health health, between 0 and 1 (inclusive)
|
||||
* @param color color
|
||||
* @param style style
|
||||
* @return new bossbar instance
|
||||
*/
|
||||
BossBar createLegacyBossBar(String title, float health, BossColor color, BossStyle style);
|
||||
|
||||
/**
|
||||
* Creates a new bossbar instance with full health. This only works on pre 1.9 servers for 1.9+ clients.
|
||||
*
|
||||
* @param title title
|
||||
* @param color color
|
||||
* @param style style
|
||||
* @return new bossbar instance
|
||||
*/
|
||||
default BossBar createLegacyBossBar(String title, BossColor color, BossStyle style) {
|
||||
return createLegacyBossBar(title, 1F, color, style);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.legacy.bossbar;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface BossBar {
|
||||
|
||||
/**
|
||||
* Get the current title
|
||||
*
|
||||
* @return the title
|
||||
*/
|
||||
String getTitle();
|
||||
|
||||
/**
|
||||
* Change the title
|
||||
*
|
||||
* @param title Title can be in either JSON or just text
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar setTitle(String title);
|
||||
|
||||
/**
|
||||
* Get the health
|
||||
*
|
||||
* @return float between 0F - 1F
|
||||
*/
|
||||
float getHealth();
|
||||
|
||||
/**
|
||||
* Change the health
|
||||
*
|
||||
* @param health this float has to be between 0F - 1F
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar setHealth(float health);
|
||||
|
||||
/**
|
||||
* Get the bossbar color
|
||||
*
|
||||
* @return The colour
|
||||
*/
|
||||
BossColor getColor();
|
||||
|
||||
/**
|
||||
* Yay colors!
|
||||
*
|
||||
* @param color Whatever color you want!
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar setColor(BossColor color);
|
||||
|
||||
/**
|
||||
* Get the bosbar style
|
||||
*
|
||||
* @return BossStyle
|
||||
*/
|
||||
BossStyle getStyle();
|
||||
|
||||
/**
|
||||
* Change the bosbar style
|
||||
*
|
||||
* @param style BossStyle
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar setStyle(BossStyle style);
|
||||
|
||||
/**
|
||||
* Show the bossbar to a player (uuid). This only works for frontend connections. Use #addConnection(UserConnection) for other types.
|
||||
*
|
||||
* @param player uuid of the player
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar addPlayer(UUID player);
|
||||
|
||||
/**
|
||||
* Show the bossbar to a player connection.
|
||||
*
|
||||
* @param conn UserConnection of the connection
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar addConnection(UserConnection conn);
|
||||
|
||||
/**
|
||||
* Removes the bossbar from a player. This only works for frontend connections. For others types, use #removeConnection(UserConnection)
|
||||
*
|
||||
* @param uuid The players UUID
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar removePlayer(UUID uuid);
|
||||
|
||||
/**
|
||||
* Removes the bossbar from a player connection.
|
||||
*
|
||||
* @param conn The UserConnection
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar removeConnection(UserConnection conn);
|
||||
|
||||
/**
|
||||
* Add flags
|
||||
*
|
||||
* @param flag The flag to add
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar addFlag(BossFlag flag);
|
||||
|
||||
/**
|
||||
* Remove flags.
|
||||
*
|
||||
* @param flag The flag to remove
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar removeFlag(BossFlag flag);
|
||||
|
||||
/**
|
||||
* @param flag The flag to check against
|
||||
* @return True if it has the flag
|
||||
*/
|
||||
boolean hasFlag(BossFlag flag);
|
||||
|
||||
/**
|
||||
* Get players. Only returns UUIDs which are front-end. For all connections, use #getConnections()
|
||||
*
|
||||
* @return UUIDS from players (sorry I lied)
|
||||
*/
|
||||
Set<UUID> getPlayers();
|
||||
|
||||
/**
|
||||
* Get UserConnections.
|
||||
*
|
||||
* @return UserConnection from players
|
||||
*/
|
||||
Set<UserConnection> getConnections();
|
||||
|
||||
/**
|
||||
* Show the bossbar to everyone (In the getPlayer set)
|
||||
*
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar show();
|
||||
|
||||
/**
|
||||
* Hide the bossbar from everyone (In the getPlayer set)
|
||||
*
|
||||
* @return The BossBar object
|
||||
*/
|
||||
BossBar hide();
|
||||
|
||||
/**
|
||||
* Is it visible?
|
||||
*
|
||||
* @return visibility changable with show() and hide()
|
||||
*/
|
||||
boolean isVisible();
|
||||
|
||||
/**
|
||||
* Get the UUID of this bossbar
|
||||
*
|
||||
* @return Unique Id for this bossbar
|
||||
*/
|
||||
UUID getId();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.legacy.bossbar;
|
||||
|
||||
public enum BossColor {
|
||||
|
||||
PINK(0),
|
||||
BLUE(1),
|
||||
RED(2),
|
||||
GREEN(3),
|
||||
YELLOW(4),
|
||||
PURPLE(5),
|
||||
WHITE(6);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossColor(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.legacy.bossbar;
|
||||
|
||||
public enum BossFlag {
|
||||
|
||||
DARKEN_SKY(1),
|
||||
PLAY_BOSS_MUSIC(2);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossFlag(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.legacy.bossbar;
|
||||
|
||||
public enum BossStyle {
|
||||
|
||||
SOLID(0),
|
||||
SEGMENTED_6(1),
|
||||
SEGMENTED_10(2),
|
||||
SEGMENTED_12(3),
|
||||
SEGMENTED_20(4);
|
||||
|
||||
private final int id;
|
||||
|
||||
BossStyle(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public interface BlockChangeRecord {
|
||||
|
||||
/**
|
||||
* Returns the relative x coordinate within the chunk section.
|
||||
*
|
||||
* @return relative x coordinate within the chunk section
|
||||
*/
|
||||
byte getSectionX();
|
||||
|
||||
/**
|
||||
* Returns the relative y coordinate within the chunk section.
|
||||
*
|
||||
* @return relative y coordinate within the chunk section
|
||||
*/
|
||||
byte getSectionY();
|
||||
|
||||
/**
|
||||
* Returns the relative z coordinate within the chunk section.
|
||||
*
|
||||
* @return relative z coordinate within the chunk section
|
||||
*/
|
||||
byte getSectionZ();
|
||||
|
||||
/**
|
||||
* Returns the absolute y coordinate based on the given chunk section y.
|
||||
*
|
||||
* @param chunkSectionY chunk section
|
||||
* @return absolute y coordinate
|
||||
*/
|
||||
short getY(int chunkSectionY);
|
||||
|
||||
/**
|
||||
* @return absolute y coordinate
|
||||
* @deprecated 1.16+ stores the relative y coordinate
|
||||
*/
|
||||
@Deprecated
|
||||
default short getY() {
|
||||
return getY(-1);
|
||||
}
|
||||
|
||||
int getBlockId();
|
||||
|
||||
void setBlockId(int blockId);
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
public class BlockChangeRecord1_16_2 implements BlockChangeRecord {
|
||||
private final byte sectionX;
|
||||
private final byte sectionY;
|
||||
private final byte sectionZ;
|
||||
private int blockId;
|
||||
|
||||
public BlockChangeRecord1_16_2(byte sectionX, byte sectionY, byte sectionZ, int blockId) {
|
||||
this.sectionX = sectionX;
|
||||
this.sectionY = sectionY;
|
||||
this.sectionZ = sectionZ;
|
||||
this.blockId = blockId;
|
||||
}
|
||||
|
||||
public BlockChangeRecord1_16_2(int sectionX, int sectionY, int sectionZ, int blockId) {
|
||||
this((byte) sectionX, (byte) sectionY, (byte) sectionZ, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getSectionX() {
|
||||
return sectionX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getSectionY() {
|
||||
return sectionY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getSectionZ() {
|
||||
return sectionZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getY(int chunkSectionY) {
|
||||
Preconditions.checkArgument(chunkSectionY >= 0 && chunkSectionY < 16, "Invalid chunkSectionY: " + chunkSectionY);
|
||||
return (short) ((chunkSectionY << 4) + sectionY);
|
||||
}
|
||||
|
||||
public int getBlockId() {
|
||||
return blockId;
|
||||
}
|
||||
|
||||
public void setBlockId(int blockId) {
|
||||
this.blockId = blockId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public class BlockChangeRecord1_8 implements BlockChangeRecord {
|
||||
private final byte sectionX;
|
||||
private final short y;
|
||||
private final byte sectionZ;
|
||||
private int blockId;
|
||||
|
||||
public BlockChangeRecord1_8(byte sectionX, short y, byte sectionZ, int blockId) {
|
||||
this.sectionX = sectionX;
|
||||
this.y = y;
|
||||
this.sectionZ = sectionZ;
|
||||
this.blockId = blockId;
|
||||
}
|
||||
|
||||
public BlockChangeRecord1_8(int sectionX, int y, int sectionZ, int blockId) {
|
||||
this((byte) sectionX, (short) y, (byte) sectionZ, blockId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return x coordinate within the chunk section
|
||||
*/
|
||||
public byte getSectionX() {
|
||||
return sectionX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getSectionY() {
|
||||
return (byte) (y & 0xF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return y coordinate
|
||||
*/
|
||||
@Override
|
||||
public short getY(int chunkSectionY) {
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return z coordinate within the chunk section
|
||||
*/
|
||||
public byte getSectionZ() {
|
||||
return sectionZ;
|
||||
}
|
||||
|
||||
public int getBlockId() {
|
||||
return blockId;
|
||||
}
|
||||
|
||||
public void setBlockId(int blockId) {
|
||||
this.blockId = blockId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum BlockFace {
|
||||
NORTH((byte) 0, (byte) 0, (byte) -1, EnumAxis.Z),
|
||||
SOUTH((byte) 0, (byte) 0, (byte) 1, EnumAxis.Z),
|
||||
EAST((byte) 1, (byte) 0, (byte) 0, EnumAxis.X),
|
||||
WEST((byte) -1, (byte) 0, (byte) 0, EnumAxis.X),
|
||||
TOP((byte) 0, (byte) 1, (byte) 0, EnumAxis.Y),
|
||||
BOTTOM((byte) 0, (byte) -1, (byte) 0, EnumAxis.Y);
|
||||
|
||||
private static final Map<BlockFace, BlockFace> opposites = new HashMap<>();
|
||||
|
||||
static {
|
||||
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
|
||||
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);
|
||||
opposites.put(BlockFace.EAST, BlockFace.WEST);
|
||||
opposites.put(BlockFace.WEST, BlockFace.EAST);
|
||||
opposites.put(BlockFace.TOP, BlockFace.BOTTOM);
|
||||
opposites.put(BlockFace.BOTTOM, BlockFace.TOP);
|
||||
}
|
||||
|
||||
private final byte modX;
|
||||
private final byte modY;
|
||||
private final byte modZ;
|
||||
private final EnumAxis axis;
|
||||
|
||||
BlockFace(byte modX, byte modY, byte modZ, EnumAxis axis) {
|
||||
this.modX = modX;
|
||||
this.modY = modY;
|
||||
this.modZ = modZ;
|
||||
this.axis = axis;
|
||||
}
|
||||
|
||||
public BlockFace opposite() {
|
||||
return opposites.get(this);
|
||||
}
|
||||
|
||||
public byte getModX() {
|
||||
return modX;
|
||||
}
|
||||
|
||||
public byte getModY() {
|
||||
return modY;
|
||||
}
|
||||
|
||||
public byte getModZ() {
|
||||
return modZ;
|
||||
}
|
||||
|
||||
public EnumAxis getAxis() {
|
||||
return axis;
|
||||
}
|
||||
|
||||
public enum EnumAxis {
|
||||
X, Y, Z
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public enum Environment {
|
||||
|
||||
NORMAL(0),
|
||||
NETHER(-1),
|
||||
END(1);
|
||||
|
||||
private final int id;
|
||||
|
||||
Environment(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static Environment getEnvironmentById(int id) {
|
||||
switch (id) {
|
||||
default:
|
||||
case -1:
|
||||
return NETHER;
|
||||
case 0:
|
||||
return NORMAL;
|
||||
case 1:
|
||||
return END;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public class EulerAngle {
|
||||
private final float x;
|
||||
private final float y;
|
||||
private final float z;
|
||||
|
||||
public EulerAngle(final float x, final float y, final float z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public float getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public float getZ() {
|
||||
return z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public class Position {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
|
||||
public Position(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Position(int x, short y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Position(Position toCopy) {
|
||||
this(toCopy.getX(), toCopy.getY(), toCopy.getZ());
|
||||
}
|
||||
|
||||
public Position getRelative(BlockFace face) {
|
||||
return new Position(x + face.getModX(), (short) (y + face.getModY()), z + face.getModZ());
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Position position = (Position) o;
|
||||
if (x != position.x) return false;
|
||||
if (y != position.y) return false;
|
||||
return z == position.z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = x;
|
||||
result = 31 * result + y;
|
||||
result = 31 * result + z;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Position{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
", z=" + z +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum RegistryType {
|
||||
|
||||
BLOCK("block"),
|
||||
ITEM("item"),
|
||||
FLUID("fluid"),
|
||||
ENTITY("entity_type"),
|
||||
GAME_EVENT("game_event");
|
||||
|
||||
private static final Map<String, RegistryType> MAP = new HashMap<>();
|
||||
private static final RegistryType[] VALUES = values();
|
||||
|
||||
static {
|
||||
for (RegistryType type : getValues()) {
|
||||
MAP.put(type.resourceLocation, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static RegistryType[] getValues() {
|
||||
return VALUES;
|
||||
}
|
||||
|
||||
public static @Nullable RegistryType getByKey(String resourceKey) {
|
||||
return MAP.get(resourceKey);
|
||||
}
|
||||
|
||||
private final String resourceLocation;
|
||||
|
||||
RegistryType(final String resourceLocation) {
|
||||
this.resourceLocation = resourceLocation;
|
||||
}
|
||||
|
||||
public String getResourceLocation() {
|
||||
return resourceLocation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public final class TagData {
|
||||
private final String identifier;
|
||||
private final int[] entries;
|
||||
|
||||
public TagData(String identifier, int[] entries) {
|
||||
this.identifier = identifier;
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
public String identifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public int[] entries() {
|
||||
return entries;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public class Vector {
|
||||
private int blockX;
|
||||
private int blockY;
|
||||
private int blockZ;
|
||||
|
||||
public Vector(int blockX, int blockY, int blockZ) {
|
||||
this.blockX = blockX;
|
||||
this.blockY = blockY;
|
||||
this.blockZ = blockZ;
|
||||
}
|
||||
|
||||
public int getBlockX() {
|
||||
return blockX;
|
||||
}
|
||||
|
||||
public void setBlockX(int blockX) {
|
||||
this.blockX = blockX;
|
||||
}
|
||||
|
||||
public int getBlockY() {
|
||||
return blockY;
|
||||
}
|
||||
|
||||
public void setBlockY(int blockY) {
|
||||
this.blockY = blockY;
|
||||
}
|
||||
|
||||
public int getBlockZ() {
|
||||
return blockZ;
|
||||
}
|
||||
|
||||
public void setBlockZ(int blockZ) {
|
||||
this.blockZ = blockZ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public class VillagerData {
|
||||
private final int type;
|
||||
private final int profession;
|
||||
private final int level;
|
||||
|
||||
public VillagerData(final int type, final int profession, final int level) {
|
||||
this.type = type;
|
||||
this.profession = profession;
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
//TODO Move methods from distinctly different versions to different objects/interfaces
|
||||
public class BaseChunk implements Chunk {
|
||||
protected final int x;
|
||||
protected final int z;
|
||||
protected final boolean fullChunk;
|
||||
protected boolean ignoreOldLightData;
|
||||
protected BitSet chunkSectionBitSet;
|
||||
protected int bitmask;
|
||||
protected ChunkSection[] sections;
|
||||
protected int[] biomeData;
|
||||
protected CompoundTag heightMap;
|
||||
protected final List<CompoundTag> blockEntities;
|
||||
|
||||
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, @Nullable BitSet chunkSectionBitSet,
|
||||
ChunkSection[] sections, int @Nullable [] biomeData, @Nullable CompoundTag heightMap, List<CompoundTag> blockEntities) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.fullChunk = fullChunk;
|
||||
this.ignoreOldLightData = ignoreOldLightData;
|
||||
this.chunkSectionBitSet = chunkSectionBitSet;
|
||||
this.sections = sections;
|
||||
this.biomeData = biomeData;
|
||||
this.heightMap = heightMap;
|
||||
this.blockEntities = blockEntities;
|
||||
}
|
||||
|
||||
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, CompoundTag heightMap, List<CompoundTag> blockEntities) {
|
||||
this(x, z, fullChunk, ignoreOldLightData, null, sections, biomeData, heightMap, blockEntities);
|
||||
this.bitmask = bitmask;
|
||||
}
|
||||
|
||||
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, List<CompoundTag> blockEntities) {
|
||||
this(x, z, fullChunk, ignoreOldLightData, bitmask, sections, biomeData, null, blockEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBiomeData() {
|
||||
return biomeData != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullChunk() {
|
||||
return fullChunk;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreOldLightData() {
|
||||
return ignoreOldLightData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIgnoreOldLightData(boolean ignoreOldLightData) {
|
||||
this.ignoreOldLightData = ignoreOldLightData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBitmask() {
|
||||
return bitmask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBitmask(int bitmask) {
|
||||
this.bitmask = bitmask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable BitSet getChunkMask() {
|
||||
return chunkSectionBitSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChunkMask(BitSet chunkSectionMask) {
|
||||
this.chunkSectionBitSet = chunkSectionMask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkSection[] getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSections(ChunkSection[] sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int @Nullable [] getBiomeData() {
|
||||
return biomeData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiomeData(int @Nullable [] biomeData) {
|
||||
this.biomeData = biomeData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable CompoundTag getHeightMap() {
|
||||
return heightMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeightMap(final CompoundTag heightMap) {
|
||||
this.heightMap = heightMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompoundTag> getBlockEntities() {
|
||||
return blockEntities;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
public interface Chunk {
|
||||
|
||||
/**
|
||||
* Returns the chunk x coordinate.
|
||||
*
|
||||
* @return chunk x coordinate
|
||||
*/
|
||||
int getX();
|
||||
|
||||
/**
|
||||
* Returns the chunk z coordinate.
|
||||
*
|
||||
* @return chunk z coordinate
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
/**
|
||||
* Returns whether this chunk holds biome data, always true for 1.17+ chunks.
|
||||
*
|
||||
* @return true if this chunk holds biome data
|
||||
*/
|
||||
boolean isBiomeData();
|
||||
|
||||
/**
|
||||
* Returns whether this is a full chunk, always true for 1.17+ chunks.
|
||||
*
|
||||
* @return true if this is a full chunk
|
||||
*/
|
||||
boolean isFullChunk();
|
||||
|
||||
boolean isIgnoreOldLightData();
|
||||
|
||||
void setIgnoreOldLightData(boolean ignoreOldLightData);
|
||||
|
||||
/**
|
||||
* Returns the chunk section bit mask for chunks < 1.17.
|
||||
*
|
||||
* @return chunk section bit mask for chunks < 1.17
|
||||
* @see #getChunkMask()
|
||||
*/
|
||||
int getBitmask();
|
||||
|
||||
void setBitmask(int bitmask);
|
||||
|
||||
/**
|
||||
* Returns the chunk section bit mask, only non-null for 1.17+ chunks.
|
||||
*
|
||||
* @return chunk section bit mask, only non-null for 1.17+ chunks
|
||||
* @see #getBitmask()
|
||||
*/
|
||||
@Nullable BitSet getChunkMask();
|
||||
|
||||
void setChunkMask(BitSet chunkSectionMask);
|
||||
|
||||
/**
|
||||
* Returns an array of nullable chunk section entries.
|
||||
*
|
||||
* @return array of nullable chunk sections
|
||||
*/
|
||||
@Nullable ChunkSection[] getSections();
|
||||
|
||||
void setSections(ChunkSection[] sections);
|
||||
|
||||
/**
|
||||
* Returns the chunk's raw biome data. The format the biomes are stored may vary.
|
||||
*
|
||||
* @return raw biome data
|
||||
*/
|
||||
int @Nullable [] getBiomeData();
|
||||
|
||||
void setBiomeData(int @Nullable [] biomeData);
|
||||
|
||||
/**
|
||||
* Returns a compoundtag containing the chunk's heightmaps if present.
|
||||
*
|
||||
* @return compoundtag containing heightmaps if present
|
||||
*/
|
||||
@Nullable CompoundTag getHeightMap();
|
||||
|
||||
void setHeightMap(@Nullable CompoundTag heightMap);
|
||||
|
||||
/**
|
||||
* Returns a list of block entities.
|
||||
*
|
||||
* @return list of block entities
|
||||
*/
|
||||
List<CompoundTag> getBlockEntities();
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Chunk1_8 extends BaseChunk {
|
||||
private boolean unloadPacket;
|
||||
|
||||
public Chunk1_8(int x, int z, boolean groundUp, int bitmask, ChunkSection[] sections, int[] biomeData, List<CompoundTag> blockEntities) {
|
||||
super(x, z, groundUp, false, bitmask, sections, biomeData, blockEntities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Chunk unload.
|
||||
*
|
||||
* @param x coord
|
||||
* @param z coord
|
||||
*/
|
||||
public Chunk1_8(int x, int z) {
|
||||
this(x, z, true, 0, new ChunkSection[16], null, new ArrayList<>());
|
||||
this.unloadPacket = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this chunks have biome data
|
||||
*
|
||||
* @return True if the chunks has biome data
|
||||
*/
|
||||
public boolean hasBiomeData() {
|
||||
return biomeData != null && fullChunk;
|
||||
}
|
||||
|
||||
public boolean isUnloadPacket() {
|
||||
return unloadPacket;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface ChunkSection {
|
||||
|
||||
/**
|
||||
* Size (dimensions) of blocks in a chunks section.
|
||||
*/
|
||||
int SIZE = 16 * 16 * 16; // width * depth * height
|
||||
|
||||
/**
|
||||
* Returns the block index of the given coordinates within a section.
|
||||
*
|
||||
* @param x section x
|
||||
* @param y section y
|
||||
* @param z section z
|
||||
* @return section block index
|
||||
*/
|
||||
static int index(int x, int y, int z) {
|
||||
return y << 8 | z << 4 | x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the block state of the given index.
|
||||
*
|
||||
* @param idx block index within the section
|
||||
* @return block state of the given index
|
||||
*/
|
||||
int getFlatBlock(int idx);
|
||||
|
||||
/**
|
||||
* Returns the block state of the section coordinate.
|
||||
*
|
||||
* @param x section x
|
||||
* @param y section y
|
||||
* @param z section z
|
||||
* @return block state of the given section coordinate
|
||||
*/
|
||||
default int getFlatBlock(int x, int y, int z) {
|
||||
return getFlatBlock(index(x, y, z));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a block state in the chunk section.
|
||||
* This method will not update non-air blocks count.
|
||||
*
|
||||
* @param idx block index within the section
|
||||
* @param id raw or flat id of the block state
|
||||
*/
|
||||
void setFlatBlock(int idx, int id);
|
||||
|
||||
/**
|
||||
* Set a block state in the chunk section.
|
||||
* This method will not update non-air blocks count.
|
||||
*
|
||||
* @param x section x
|
||||
* @param y section y
|
||||
* @param z section z
|
||||
* @param id raw or flat id of the block state
|
||||
*/
|
||||
default void setFlatBlock(int x, int y, int z, int id) {
|
||||
setFlatBlock(index(x, y, z), id);
|
||||
}
|
||||
|
||||
default int getBlockWithoutData(int x, int y, int z) {
|
||||
return getFlatBlock(x, y, z) >> 4;
|
||||
}
|
||||
|
||||
default int getBlockData(int x, int y, int z) {
|
||||
return getFlatBlock(x, y, z) & 0xF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a block in the chunks.
|
||||
* This method will not update non-air blocks count.
|
||||
*
|
||||
* @param x Block X
|
||||
* @param y Block Y
|
||||
* @param z Block Z
|
||||
* @param type The type of the block
|
||||
* @param data The data value of the block
|
||||
*/
|
||||
default void setBlockWithData(int x, int y, int z, int type, int data) {
|
||||
setFlatBlock(index(x, y, z), type << 4 | (data & 0xF));
|
||||
}
|
||||
|
||||
default void setBlockWithData(int idx, int type, int data) {
|
||||
setFlatBlock(idx, type << 4 | (data & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a block to the given palette index.
|
||||
*
|
||||
* @param idx block index
|
||||
* @param index palette index
|
||||
*/
|
||||
void setPaletteIndex(int idx, int index);
|
||||
|
||||
/**
|
||||
* Returns the palette index of the given block index.
|
||||
*
|
||||
* @param idx block index
|
||||
* @return palette index of the given block index
|
||||
*/
|
||||
int getPaletteIndex(int idx);
|
||||
|
||||
/**
|
||||
* Returns the size of the palette.
|
||||
*
|
||||
* @return palette size
|
||||
*/
|
||||
int getPaletteSize();
|
||||
|
||||
/**
|
||||
* Returns the block state assigned to the given palette index.
|
||||
*
|
||||
* @param index palette index
|
||||
* @return block state assigned to the given palette index
|
||||
*/
|
||||
int getPaletteEntry(int index);
|
||||
|
||||
/**
|
||||
* Assigns a block state assigned to the given palette index.
|
||||
*
|
||||
* @param index palette index
|
||||
* @param id block state
|
||||
*/
|
||||
void setPaletteEntry(int index, int id);
|
||||
|
||||
/**
|
||||
* Replaces a block state in the palette.
|
||||
*
|
||||
* @param oldId old block state
|
||||
* @param newId new block state
|
||||
*/
|
||||
void replacePaletteEntry(int oldId, int newId);
|
||||
|
||||
/**
|
||||
* Adds a new block state to the palette.
|
||||
*
|
||||
* @param id block state
|
||||
*/
|
||||
void addPaletteEntry(int id);
|
||||
|
||||
/**
|
||||
* Clears the palette.
|
||||
*/
|
||||
void clearPalette();
|
||||
|
||||
/**
|
||||
* Returns the number of non-air blocks in this section.
|
||||
*
|
||||
* @return non-air blocks in this section
|
||||
*/
|
||||
int getNonAirBlocksCount();
|
||||
|
||||
void setNonAirBlocksCount(int nonAirBlocksCount);
|
||||
|
||||
/**
|
||||
* Returns whether this section holds light data.
|
||||
* Only true for < 1.14 chunks.
|
||||
*
|
||||
* @return whether this section holds light data
|
||||
*/
|
||||
default boolean hasLight() {
|
||||
return getLight() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the light of the chunk section.
|
||||
* Only present for < 1.14 chunks, otherwise sent separately.
|
||||
*
|
||||
* @return chunk section light if present
|
||||
*/
|
||||
@Nullable ChunkSectionLight getLight();
|
||||
|
||||
void setLight(@Nullable ChunkSectionLight light);
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class ChunkSectionImpl implements ChunkSection {
|
||||
|
||||
private final IntList palette;
|
||||
private final Int2IntMap inversePalette;
|
||||
private final int[] blocks;
|
||||
private ChunkSectionLight light;
|
||||
private int nonAirBlocksCount;
|
||||
|
||||
public ChunkSectionImpl(boolean holdsLight) {
|
||||
this.blocks = new int[SIZE];
|
||||
palette = new IntArrayList();
|
||||
inversePalette = new Int2IntOpenHashMap();
|
||||
inversePalette.defaultReturnValue(-1);
|
||||
if (holdsLight) {
|
||||
this.light = new ChunkSectionLightImpl();
|
||||
}
|
||||
}
|
||||
|
||||
public ChunkSectionImpl(boolean holdsLight, int expectedPaletteLength) {
|
||||
this.blocks = new int[SIZE];
|
||||
if (holdsLight) {
|
||||
this.light = new ChunkSectionLightImpl();
|
||||
}
|
||||
|
||||
// Pre-size the palette array/map
|
||||
palette = new IntArrayList(expectedPaletteLength);
|
||||
inversePalette = new Int2IntOpenHashMap(expectedPaletteLength);
|
||||
inversePalette.defaultReturnValue(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlatBlock(int idx) {
|
||||
int index = blocks[idx];
|
||||
return palette.getInt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlatBlock(int idx, int id) {
|
||||
int index = inversePalette.get(id);
|
||||
if (index == -1) {
|
||||
index = palette.size();
|
||||
palette.add(id);
|
||||
inversePalette.put(id, index);
|
||||
}
|
||||
|
||||
blocks[idx] = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPaletteIndex(int idx) {
|
||||
return blocks[idx];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPaletteIndex(int idx, int index) {
|
||||
blocks[idx] = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPaletteSize() {
|
||||
return palette.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPaletteEntry(int index) {
|
||||
return palette.getInt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPaletteEntry(int index, int id) {
|
||||
int oldId = palette.set(index, id);
|
||||
if (oldId == id) return;
|
||||
|
||||
inversePalette.put(id, index);
|
||||
if (inversePalette.get(oldId) == index) {
|
||||
inversePalette.remove(oldId);
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
if (palette.getInt(i) == oldId) {
|
||||
inversePalette.put(oldId, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replacePaletteEntry(int oldId, int newId) {
|
||||
int index = inversePalette.remove(oldId);
|
||||
if (index == -1) return;
|
||||
|
||||
inversePalette.put(newId, index);
|
||||
for (int i = 0; i < palette.size(); i++) {
|
||||
if (palette.getInt(i) == oldId) {
|
||||
palette.set(i, newId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPaletteEntry(int id) {
|
||||
inversePalette.put(id, palette.size());
|
||||
palette.add(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPalette() {
|
||||
palette.clear();
|
||||
inversePalette.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNonAirBlocksCount() {
|
||||
return nonAirBlocksCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNonAirBlocksCount(int nonAirBlocksCount) {
|
||||
this.nonAirBlocksCount = nonAirBlocksCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ChunkSectionLight getLight() {
|
||||
return light;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLight(@Nullable ChunkSectionLight light) {
|
||||
this.light = light;
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface ChunkSectionLight {
|
||||
|
||||
/**
|
||||
* Length of the sky and block light nibble arrays.
|
||||
*/
|
||||
int LIGHT_LENGTH = 16 * 16 * 16 / 2; // Dimensions / 2 (nibble bit count)
|
||||
|
||||
/**
|
||||
* Returns whether the section has sky light.
|
||||
*
|
||||
* @return true if skylight is present
|
||||
*/
|
||||
boolean hasSkyLight();
|
||||
|
||||
/**
|
||||
* Returns whether the section has block light.
|
||||
* This returns true unless specifically set to null.
|
||||
*
|
||||
* @return true if skylight is present
|
||||
*/
|
||||
boolean hasBlockLight();
|
||||
|
||||
/**
|
||||
* Returns the nibblearray's raw sky light byte array if present.
|
||||
*
|
||||
* @return the nibblearray's raw sky light byte array if present
|
||||
* @see #hasSkyLight()
|
||||
*/
|
||||
byte @Nullable [] getSkyLight();
|
||||
|
||||
/**
|
||||
* Returns the nibblearray's raw block light byte array if present.
|
||||
*
|
||||
* @return the nibblearray's raw block light byte array if present
|
||||
* @see #hasBlockLight()
|
||||
*/
|
||||
byte @Nullable [] getBlockLight();
|
||||
|
||||
/**
|
||||
* Set the sky light array.
|
||||
*
|
||||
* @param data raw sky light data
|
||||
*/
|
||||
void setSkyLight(byte[] data);
|
||||
|
||||
/**
|
||||
* Set the block light array.
|
||||
*
|
||||
* @param data raw block light data
|
||||
*/
|
||||
void setBlockLight(byte[] data);
|
||||
|
||||
/**
|
||||
* Returns the sky light nibblearray.
|
||||
*
|
||||
* @return sky light nibblearray
|
||||
* @see #hasSkyLight()
|
||||
*/
|
||||
@Nullable NibbleArray getSkyLightNibbleArray();
|
||||
|
||||
/**
|
||||
* Returns the block light nibblearray.
|
||||
*
|
||||
* @return block light nibblearray
|
||||
* @see #hasBlockLight()
|
||||
*/
|
||||
@Nullable NibbleArray getBlockLightNibbleArray();
|
||||
|
||||
void readSkyLight(ByteBuf input);
|
||||
|
||||
void readBlockLight(ByteBuf input);
|
||||
|
||||
/**
|
||||
* Write the sky light to a buffer.
|
||||
*
|
||||
* @param output buffer to write to
|
||||
*/
|
||||
void writeSkyLight(ByteBuf output);
|
||||
|
||||
/**
|
||||
* Write the block light to a buffer.
|
||||
*
|
||||
* @param output buffer to write to
|
||||
*/
|
||||
void writeBlockLight(ByteBuf output);
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class ChunkSectionLightImpl implements ChunkSectionLight {
|
||||
|
||||
private NibbleArray blockLight;
|
||||
private NibbleArray skyLight;
|
||||
|
||||
public ChunkSectionLightImpl() {
|
||||
// Block light is always written
|
||||
this.blockLight = new NibbleArray(ChunkSection.SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockLight(byte[] data) {
|
||||
if (data.length != LIGHT_LENGTH) throw new IllegalArgumentException("Data length != " + LIGHT_LENGTH);
|
||||
if (this.blockLight == null) {
|
||||
this.blockLight = new NibbleArray(data);
|
||||
} else {
|
||||
this.blockLight.setHandle(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSkyLight(byte[] data) {
|
||||
if (data.length != LIGHT_LENGTH) throw new IllegalArgumentException("Data length != " + LIGHT_LENGTH);
|
||||
if (this.skyLight == null) {
|
||||
this.skyLight = new NibbleArray(data);
|
||||
} else {
|
||||
this.skyLight.setHandle(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte @Nullable [] getBlockLight() {
|
||||
return blockLight == null ? null : blockLight.getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable NibbleArray getBlockLightNibbleArray() {
|
||||
return blockLight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte @Nullable [] getSkyLight() {
|
||||
return skyLight == null ? null : skyLight.getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable NibbleArray getSkyLightNibbleArray() {
|
||||
return skyLight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readBlockLight(ByteBuf input) {
|
||||
if (this.blockLight == null) {
|
||||
this.blockLight = new NibbleArray(LIGHT_LENGTH * 2);
|
||||
}
|
||||
input.readBytes(this.blockLight.getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSkyLight(ByteBuf input) {
|
||||
if (this.skyLight == null) {
|
||||
this.skyLight = new NibbleArray(LIGHT_LENGTH * 2);
|
||||
}
|
||||
input.readBytes(this.skyLight.getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeBlockLight(ByteBuf output) {
|
||||
output.writeBytes(blockLight.getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSkyLight(ByteBuf output) {
|
||||
output.writeBytes(skyLight.getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSkyLight() {
|
||||
return skyLight != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBlockLight() {
|
||||
return blockLight != null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.chunks;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class NibbleArray {
|
||||
private final byte[] handle;
|
||||
|
||||
public NibbleArray(int length) {
|
||||
if (length == 0 || length % 2 != 0) {
|
||||
throw new IllegalArgumentException("Length of nibble array must be a positive number dividable by 2!");
|
||||
}
|
||||
|
||||
this.handle = new byte[length / 2];
|
||||
}
|
||||
|
||||
public NibbleArray(byte[] handle) {
|
||||
if (handle.length == 0 || handle.length % 2 != 0) {
|
||||
throw new IllegalArgumentException("Length of nibble array must be a positive number dividable by 2!");
|
||||
}
|
||||
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value at a desired X, Y, Z
|
||||
*
|
||||
* @param x Block X
|
||||
* @param y Block Y
|
||||
* @param z Block Z
|
||||
* @return The value at the given XYZ
|
||||
*/
|
||||
public byte get(int x, int y, int z) {
|
||||
return get(ChunkSection.index(x, y, z));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value at an index
|
||||
*
|
||||
* @param index The index to lookup
|
||||
* @return The value at that index.
|
||||
*/
|
||||
public byte get(int index) {
|
||||
byte value = handle[index / 2];
|
||||
if (index % 2 == 0) {
|
||||
return (byte) (value & 0xF);
|
||||
} else {
|
||||
return (byte) ((value >> 4) & 0xF);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value based on an x, y, z
|
||||
*
|
||||
* @param x Block X
|
||||
* @param y Block Y
|
||||
* @param z Block Z
|
||||
* @param value Desired Value
|
||||
*/
|
||||
public void set(int x, int y, int z, int value) {
|
||||
set(ChunkSection.index(x, y, z), value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a value at an index
|
||||
*
|
||||
* @param index The index to set the value at.
|
||||
* @param value The desired value
|
||||
*/
|
||||
public void set(int index, int value) {
|
||||
if (index % 2 == 0) {
|
||||
index /= 2;
|
||||
handle[index] = (byte) ((handle[index] & 0xF0) | (value & 0xF));
|
||||
} else {
|
||||
index /= 2;
|
||||
handle[index] = (byte) ((handle[index] & 0xF) | ((value & 0xF) << 4));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The size of this nibble
|
||||
*
|
||||
* @return The size as an int of the nibble
|
||||
*/
|
||||
public int size() {
|
||||
return handle.length * 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual number of bytes
|
||||
*
|
||||
* @return The number of bytes based on the handle.
|
||||
*/
|
||||
public int actualSize() {
|
||||
return handle.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the array with a value
|
||||
*
|
||||
* @param value Value to fill with
|
||||
*/
|
||||
public void fill(byte value) {
|
||||
value &= 0xF; // Max nibble size (= 16)
|
||||
Arrays.fill(handle, (byte) ((value << 4) | value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the byte array behind this nibble
|
||||
*
|
||||
* @return The byte array
|
||||
*/
|
||||
public byte[] getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a byte array into this nibble
|
||||
*
|
||||
* @param handle The byte array to copy in.
|
||||
*/
|
||||
public void setHandle(byte[] handle) {
|
||||
if (handle.length != this.handle.length) {
|
||||
throw new IllegalArgumentException("Length of handle must equal to size of nibble array!");
|
||||
}
|
||||
|
||||
System.arraycopy(handle, 0, this.handle, 0, handle.length);
|
||||
}
|
||||
}
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
// 1.10 Entity / Object ids
|
||||
public class Entity1_10Types {
|
||||
|
||||
public static EntityType getTypeFromId(int typeID, boolean isObject) {
|
||||
Optional<EntityType> type;
|
||||
|
||||
if (isObject)
|
||||
type = ObjectType.getPCEntity(typeID);
|
||||
else
|
||||
type = EntityType.findById(typeID);
|
||||
|
||||
if (!type.isPresent()) {
|
||||
Via.getPlatform().getLogger().severe("Could not find 1.10 type id " + typeID + " isObject=" + isObject);
|
||||
return EntityType.ENTITY; // Fall back to the basic ENTITY
|
||||
}
|
||||
|
||||
return type.get();
|
||||
}
|
||||
|
||||
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
|
||||
ENTITY(-1),
|
||||
DROPPED_ITEM(1, ENTITY),
|
||||
EXPERIENCE_ORB(2, ENTITY),
|
||||
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
ARROW(10, ENTITY),
|
||||
SNOWBALL(11, ENTITY), // Actually EntityProjectile
|
||||
FIREBALL(12, ENTITY),
|
||||
SMALL_FIREBALL(13, ENTITY),
|
||||
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
|
||||
ENDER_SIGNAL(15, ENTITY),
|
||||
THROWN_EXP_BOTTLE(17, ENTITY),
|
||||
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
|
||||
WITHER_SKULL(19, ENTITY),
|
||||
PRIMED_TNT(20, ENTITY),
|
||||
FALLING_BLOCK(21, ENTITY),
|
||||
FIREWORK(22, ENTITY),
|
||||
TIPPED_ARROW(23, ARROW),
|
||||
SPECTRAL_ARROW(24, ARROW),
|
||||
SHULKER_BULLET(25, ENTITY),
|
||||
DRAGON_FIREBALL(26, FIREBALL),
|
||||
|
||||
ENTITY_LIVING(-1, ENTITY),
|
||||
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
|
||||
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
|
||||
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
|
||||
ENTITY_HUMAN(-1, ENTITY_LIVING),
|
||||
|
||||
ARMOR_STAND(30, ENTITY_LIVING),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
MINECART_COMMAND(40, MINECART_ABSTRACT),
|
||||
BOAT(41, ENTITY),
|
||||
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
|
||||
MINECART_CHEST(43, MINECART_ABSTRACT),
|
||||
MINECART_FURNACE(44, MINECART_ABSTRACT),
|
||||
MINECART_TNT(45, MINECART_ABSTRACT),
|
||||
MINECART_HOPPER(46, MINECART_ABSTRACT),
|
||||
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
|
||||
|
||||
CREEPER(50, ENTITY_INSENTIENT),
|
||||
SKELETON(51, ENTITY_INSENTIENT),
|
||||
SPIDER(52, ENTITY_INSENTIENT),
|
||||
GIANT(53, ENTITY_INSENTIENT),
|
||||
ZOMBIE(54, ENTITY_INSENTIENT),
|
||||
SLIME(55, ENTITY_INSENTIENT),
|
||||
GHAST(56, ENTITY_INSENTIENT),
|
||||
PIG_ZOMBIE(57, ZOMBIE),
|
||||
ENDERMAN(58, ENTITY_INSENTIENT),
|
||||
CAVE_SPIDER(59, SPIDER),
|
||||
SILVERFISH(60, ENTITY_INSENTIENT),
|
||||
BLAZE(61, ENTITY_INSENTIENT),
|
||||
MAGMA_CUBE(62, SLIME),
|
||||
ENDER_DRAGON(63, ENTITY_INSENTIENT),
|
||||
WITHER(64, ENTITY_INSENTIENT),
|
||||
BAT(65, ENTITY_INSENTIENT),
|
||||
WITCH(66, ENTITY_INSENTIENT),
|
||||
ENDERMITE(67, ENTITY_INSENTIENT),
|
||||
GUARDIAN(68, ENTITY_INSENTIENT),
|
||||
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
|
||||
SHULKER(69, IRON_GOLEM),
|
||||
PIG(90, ENTITY_AGEABLE),
|
||||
SHEEP(91, ENTITY_AGEABLE),
|
||||
COW(92, ENTITY_AGEABLE),
|
||||
CHICKEN(93, ENTITY_AGEABLE),
|
||||
SQUID(94, ENTITY_INSENTIENT),
|
||||
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
|
||||
MUSHROOM_COW(96, COW),
|
||||
SNOWMAN(97, IRON_GOLEM),
|
||||
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
|
||||
HORSE(100, ENTITY_AGEABLE),
|
||||
RABBIT(101, ENTITY_AGEABLE),
|
||||
POLAR_BEAR(102, ENTITY_AGEABLE),
|
||||
VILLAGER(120, ENTITY_AGEABLE),
|
||||
ENDER_CRYSTAL(200, ENTITY),
|
||||
SPLASH_POTION(-1, ENTITY),
|
||||
LINGERING_POTION(-1, SPLASH_POTION),
|
||||
AREA_EFFECT_CLOUD(-1, ENTITY),
|
||||
EGG(-1, ENTITY),
|
||||
FISHING_HOOK(-1, ENTITY),
|
||||
LIGHTNING(-1, ENTITY),
|
||||
WEATHER(-1, ENTITY),
|
||||
PLAYER(-1, ENTITY_HUMAN),
|
||||
COMPLEX_PART(-1, ENTITY);
|
||||
|
||||
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
EntityType(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
EntityType(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
static {
|
||||
for (EntityType type : EntityType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<EntityType> findById(int id) {
|
||||
if (id == -1) // Check if this is called
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
|
||||
BOAT(1, EntityType.BOAT),
|
||||
ITEM(2, EntityType.DROPPED_ITEM),
|
||||
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
|
||||
MINECART(10, EntityType.MINECART_RIDEABLE),
|
||||
TNT_PRIMED(50, EntityType.PRIMED_TNT),
|
||||
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
|
||||
TIPPED_ARROW(60, EntityType.TIPPED_ARROW),
|
||||
SNOWBALL(61, EntityType.SNOWBALL),
|
||||
EGG(62, EntityType.EGG),
|
||||
FIREBALL(63, EntityType.FIREBALL),
|
||||
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
|
||||
ENDER_PEARL(65, EntityType.ENDER_PEARL),
|
||||
WITHER_SKULL(66, EntityType.WITHER_SKULL),
|
||||
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
|
||||
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
|
||||
ITEM_FRAME(71, EntityType.ITEM_FRAME),
|
||||
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
|
||||
POTION(73, EntityType.SPLASH_POTION),
|
||||
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
|
||||
FIREWORK(76, EntityType.FIREWORK),
|
||||
LEASH(77, EntityType.LEASH_HITCH),
|
||||
ARMOR_STAND(78, EntityType.ARMOR_STAND),
|
||||
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
|
||||
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
|
||||
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
|
||||
|
||||
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType type;
|
||||
|
||||
static {
|
||||
for (ObjectType type : ObjectType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectType(int id, EntityType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static Optional<ObjectType> findById(int id) {
|
||||
if (id == -1)
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
|
||||
public static Optional<EntityType> getPCEntity(int id) {
|
||||
Optional<ObjectType> output = findById(id);
|
||||
|
||||
if (!output.isPresent())
|
||||
return Optional.empty();
|
||||
return Optional.of(output.get().type);
|
||||
}
|
||||
}
|
||||
}
|
||||
+272
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
// 1.11 Entity / Object ids TODO maybe in the future instead of copying it, some api.
|
||||
public class Entity1_11Types {
|
||||
|
||||
public static EntityType getTypeFromId(int typeID, boolean isObject) {
|
||||
Optional<EntityType> type;
|
||||
|
||||
if (isObject)
|
||||
type = ObjectType.getPCEntity(typeID);
|
||||
else
|
||||
type = EntityType.findById(typeID);
|
||||
|
||||
if (!type.isPresent()) {
|
||||
Via.getPlatform().getLogger().severe("Could not find 1.11 type id " + typeID + " isObject=" + isObject);
|
||||
return EntityType.ENTITY; // Fall back to the basic ENTITY
|
||||
}
|
||||
|
||||
return type.get();
|
||||
}
|
||||
|
||||
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
|
||||
ENTITY(-1),
|
||||
DROPPED_ITEM(1, ENTITY),
|
||||
EXPERIENCE_ORB(2, ENTITY),
|
||||
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
ARROW(10, ENTITY),
|
||||
SNOWBALL(11, ENTITY), // Actually EntityProjectile
|
||||
FIREBALL(12, ENTITY),
|
||||
SMALL_FIREBALL(13, ENTITY),
|
||||
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
|
||||
ENDER_SIGNAL(15, ENTITY),
|
||||
THROWN_EXP_BOTTLE(17, ENTITY),
|
||||
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
|
||||
WITHER_SKULL(19, ENTITY),
|
||||
PRIMED_TNT(20, ENTITY),
|
||||
FALLING_BLOCK(21, ENTITY),
|
||||
FIREWORK(22, ENTITY),
|
||||
SPECTRAL_ARROW(24, ARROW),
|
||||
SHULKER_BULLET(25, ENTITY),
|
||||
DRAGON_FIREBALL(26, FIREBALL),
|
||||
EVOCATION_FANGS(33, ENTITY),
|
||||
|
||||
|
||||
ENTITY_LIVING(-1, ENTITY),
|
||||
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
|
||||
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
|
||||
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
|
||||
ENTITY_HUMAN(-1, ENTITY_LIVING),
|
||||
|
||||
ARMOR_STAND(30, ENTITY_LIVING),
|
||||
EVOCATION_ILLAGER(34, ENTITY_INSENTIENT),
|
||||
VEX(35, ENTITY_INSENTIENT),
|
||||
VINDICATION_ILLAGER(36, ENTITY_INSENTIENT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
MINECART_COMMAND(40, MINECART_ABSTRACT),
|
||||
BOAT(41, ENTITY),
|
||||
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
|
||||
MINECART_CHEST(43, MINECART_ABSTRACT),
|
||||
MINECART_FURNACE(44, MINECART_ABSTRACT),
|
||||
MINECART_TNT(45, MINECART_ABSTRACT),
|
||||
MINECART_HOPPER(46, MINECART_ABSTRACT),
|
||||
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
|
||||
|
||||
CREEPER(50, ENTITY_INSENTIENT),
|
||||
|
||||
ABSTRACT_SKELETON(-1, ENTITY_INSENTIENT),
|
||||
SKELETON(51, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(5, ABSTRACT_SKELETON),
|
||||
STRAY(6, ABSTRACT_SKELETON),
|
||||
|
||||
SPIDER(52, ENTITY_INSENTIENT),
|
||||
GIANT(53, ENTITY_INSENTIENT),
|
||||
|
||||
ZOMBIE(54, ENTITY_INSENTIENT),
|
||||
HUSK(23, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(27, ZOMBIE),
|
||||
|
||||
SLIME(55, ENTITY_INSENTIENT),
|
||||
GHAST(56, ENTITY_INSENTIENT),
|
||||
PIG_ZOMBIE(57, ZOMBIE),
|
||||
ENDERMAN(58, ENTITY_INSENTIENT),
|
||||
CAVE_SPIDER(59, SPIDER),
|
||||
SILVERFISH(60, ENTITY_INSENTIENT),
|
||||
BLAZE(61, ENTITY_INSENTIENT),
|
||||
MAGMA_CUBE(62, SLIME),
|
||||
ENDER_DRAGON(63, ENTITY_INSENTIENT),
|
||||
WITHER(64, ENTITY_INSENTIENT),
|
||||
BAT(65, ENTITY_INSENTIENT),
|
||||
WITCH(66, ENTITY_INSENTIENT),
|
||||
ENDERMITE(67, ENTITY_INSENTIENT),
|
||||
|
||||
GUARDIAN(68, ENTITY_INSENTIENT),
|
||||
ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
|
||||
|
||||
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
|
||||
SHULKER(69, IRON_GOLEM),
|
||||
PIG(90, ENTITY_AGEABLE),
|
||||
SHEEP(91, ENTITY_AGEABLE),
|
||||
COW(92, ENTITY_AGEABLE),
|
||||
CHICKEN(93, ENTITY_AGEABLE),
|
||||
SQUID(94, ENTITY_INSENTIENT),
|
||||
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
|
||||
MUSHROOM_COW(96, COW),
|
||||
SNOWMAN(97, IRON_GOLEM),
|
||||
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_HORSE(-1, ENTITY_AGEABLE),
|
||||
HORSE(100, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(28, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(29, ABSTRACT_HORSE),
|
||||
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(31, CHESTED_HORSE),
|
||||
MULE(32, CHESTED_HORSE),
|
||||
LIAMA(103, CHESTED_HORSE),
|
||||
|
||||
|
||||
RABBIT(101, ENTITY_AGEABLE),
|
||||
POLAR_BEAR(102, ENTITY_AGEABLE),
|
||||
VILLAGER(120, ENTITY_AGEABLE),
|
||||
ENDER_CRYSTAL(200, ENTITY),
|
||||
SPLASH_POTION(-1, ENTITY),
|
||||
LINGERING_POTION(-1, SPLASH_POTION),
|
||||
AREA_EFFECT_CLOUD(-1, ENTITY),
|
||||
EGG(-1, ENTITY),
|
||||
FISHING_HOOK(-1, ENTITY),
|
||||
LIGHTNING(-1, ENTITY),
|
||||
WEATHER(-1, ENTITY),
|
||||
PLAYER(-1, ENTITY_HUMAN),
|
||||
COMPLEX_PART(-1, ENTITY),
|
||||
LIAMA_SPIT(-1, ENTITY);
|
||||
|
||||
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
EntityType(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
EntityType(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
for (EntityType type : EntityType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<EntityType> findById(int id) {
|
||||
if (id == -1) // Check if this is called
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
|
||||
BOAT(1, EntityType.BOAT),
|
||||
ITEM(2, EntityType.DROPPED_ITEM),
|
||||
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
|
||||
MINECART(10, EntityType.MINECART_RIDEABLE),
|
||||
TNT_PRIMED(50, EntityType.PRIMED_TNT),
|
||||
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
|
||||
TIPPED_ARROW(60, EntityType.ARROW),
|
||||
SNOWBALL(61, EntityType.SNOWBALL),
|
||||
EGG(62, EntityType.EGG),
|
||||
FIREBALL(63, EntityType.FIREBALL),
|
||||
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
|
||||
ENDER_PEARL(65, EntityType.ENDER_PEARL),
|
||||
WITHER_SKULL(66, EntityType.WITHER_SKULL),
|
||||
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
|
||||
LIAMA_SPIT(68, EntityType.LIAMA_SPIT),
|
||||
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
|
||||
ITEM_FRAME(71, EntityType.ITEM_FRAME),
|
||||
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
|
||||
POTION(73, EntityType.SPLASH_POTION),
|
||||
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
|
||||
FIREWORK(76, EntityType.FIREWORK),
|
||||
LEASH(77, EntityType.LEASH_HITCH),
|
||||
ARMOR_STAND(78, EntityType.ARMOR_STAND),
|
||||
EVOCATION_FANGS(79, EntityType.EVOCATION_FANGS),
|
||||
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
|
||||
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
|
||||
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
|
||||
|
||||
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType type;
|
||||
|
||||
static {
|
||||
for (ObjectType type : ObjectType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectType(int id, EntityType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static Optional<ObjectType> findById(int id) {
|
||||
if (id == -1)
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
|
||||
public static Optional<EntityType> getPCEntity(int id) {
|
||||
Optional<ObjectType> output = findById(id);
|
||||
|
||||
if (!output.isPresent())
|
||||
return Optional.empty();
|
||||
return Optional.of(output.get().type);
|
||||
}
|
||||
}
|
||||
}
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
// 1.12 Entity / Object taken from https://github.com/Matsv/ViaBackwards/blob/master/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java
|
||||
public class Entity1_12Types {
|
||||
|
||||
public static EntityType getTypeFromId(int typeID, boolean isObject) {
|
||||
Optional<EntityType> type;
|
||||
|
||||
if (isObject)
|
||||
type = ObjectType.getPCEntity(typeID);
|
||||
else
|
||||
type = EntityType.findById(typeID);
|
||||
|
||||
if (!type.isPresent()) {
|
||||
Via.getPlatform().getLogger().severe("Could not find 1.12 type id " + typeID + " isObject=" + isObject);
|
||||
return EntityType.ENTITY; // Fall back to the basic ENTITY
|
||||
}
|
||||
|
||||
return type.get();
|
||||
}
|
||||
|
||||
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
|
||||
ENTITY(-1),
|
||||
DROPPED_ITEM(1, ENTITY),
|
||||
EXPERIENCE_ORB(2, ENTITY),
|
||||
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
|
||||
ARROW(10, ENTITY),
|
||||
SNOWBALL(11, ENTITY), // Actually EntityProjectile
|
||||
FIREBALL(12, ENTITY),
|
||||
SMALL_FIREBALL(13, ENTITY),
|
||||
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
|
||||
ENDER_SIGNAL(15, ENTITY),
|
||||
THROWN_EXP_BOTTLE(17, ENTITY),
|
||||
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
|
||||
WITHER_SKULL(19, ENTITY),
|
||||
PRIMED_TNT(20, ENTITY),
|
||||
FALLING_BLOCK(21, ENTITY),
|
||||
FIREWORK(22, ENTITY),
|
||||
SPECTRAL_ARROW(24, ARROW),
|
||||
SHULKER_BULLET(25, ENTITY),
|
||||
DRAGON_FIREBALL(26, FIREBALL),
|
||||
EVOCATION_FANGS(33, ENTITY),
|
||||
|
||||
|
||||
ENTITY_LIVING(-1, ENTITY),
|
||||
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
|
||||
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
|
||||
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
|
||||
ENTITY_HUMAN(-1, ENTITY_LIVING),
|
||||
|
||||
ARMOR_STAND(30, ENTITY_LIVING),
|
||||
ENTITY_ILLAGER_ABSTRACT(-1, ENTITY_INSENTIENT),
|
||||
EVOCATION_ILLAGER(34, ENTITY_ILLAGER_ABSTRACT),
|
||||
VEX(35, ENTITY_INSENTIENT),
|
||||
VINDICATION_ILLAGER(36, ENTITY_ILLAGER_ABSTRACT),
|
||||
ILLUSION_ILLAGER(37, EVOCATION_ILLAGER),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
MINECART_COMMAND(40, MINECART_ABSTRACT),
|
||||
BOAT(41, ENTITY),
|
||||
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
|
||||
MINECART_CHEST(43, MINECART_ABSTRACT),
|
||||
MINECART_FURNACE(44, MINECART_ABSTRACT),
|
||||
MINECART_TNT(45, MINECART_ABSTRACT),
|
||||
MINECART_HOPPER(46, MINECART_ABSTRACT),
|
||||
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
|
||||
|
||||
CREEPER(50, ENTITY_INSENTIENT),
|
||||
|
||||
ABSTRACT_SKELETON(-1, ENTITY_INSENTIENT),
|
||||
SKELETON(51, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(5, ABSTRACT_SKELETON),
|
||||
STRAY(6, ABSTRACT_SKELETON),
|
||||
|
||||
SPIDER(52, ENTITY_INSENTIENT),
|
||||
GIANT(53, ENTITY_INSENTIENT),
|
||||
|
||||
ZOMBIE(54, ENTITY_INSENTIENT),
|
||||
HUSK(23, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(27, ZOMBIE),
|
||||
|
||||
SLIME(55, ENTITY_INSENTIENT),
|
||||
GHAST(56, ENTITY_INSENTIENT),
|
||||
PIG_ZOMBIE(57, ZOMBIE),
|
||||
ENDERMAN(58, ENTITY_INSENTIENT),
|
||||
CAVE_SPIDER(59, SPIDER),
|
||||
SILVERFISH(60, ENTITY_INSENTIENT),
|
||||
BLAZE(61, ENTITY_INSENTIENT),
|
||||
MAGMA_CUBE(62, SLIME),
|
||||
ENDER_DRAGON(63, ENTITY_INSENTIENT),
|
||||
WITHER(64, ENTITY_INSENTIENT),
|
||||
BAT(65, ENTITY_INSENTIENT),
|
||||
WITCH(66, ENTITY_INSENTIENT),
|
||||
ENDERMITE(67, ENTITY_INSENTIENT),
|
||||
|
||||
GUARDIAN(68, ENTITY_INSENTIENT),
|
||||
ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
|
||||
|
||||
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
|
||||
SHULKER(69, IRON_GOLEM),
|
||||
PIG(90, ENTITY_AGEABLE),
|
||||
SHEEP(91, ENTITY_AGEABLE),
|
||||
COW(92, ENTITY_AGEABLE),
|
||||
CHICKEN(93, ENTITY_AGEABLE),
|
||||
SQUID(94, ENTITY_INSENTIENT),
|
||||
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
|
||||
MUSHROOM_COW(96, COW),
|
||||
SNOWMAN(97, IRON_GOLEM),
|
||||
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
|
||||
PARROT(105, ENTITY_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_HORSE(-1, ENTITY_AGEABLE),
|
||||
HORSE(100, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(28, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(29, ABSTRACT_HORSE),
|
||||
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(31, CHESTED_HORSE),
|
||||
MULE(32, CHESTED_HORSE),
|
||||
LIAMA(103, CHESTED_HORSE),
|
||||
|
||||
|
||||
RABBIT(101, ENTITY_AGEABLE),
|
||||
POLAR_BEAR(102, ENTITY_AGEABLE),
|
||||
VILLAGER(120, ENTITY_AGEABLE),
|
||||
ENDER_CRYSTAL(200, ENTITY),
|
||||
SPLASH_POTION(-1, ENTITY),
|
||||
LINGERING_POTION(-1, SPLASH_POTION),
|
||||
AREA_EFFECT_CLOUD(-1, ENTITY),
|
||||
EGG(-1, ENTITY),
|
||||
FISHING_HOOK(-1, ENTITY),
|
||||
LIGHTNING(-1, ENTITY),
|
||||
WEATHER(-1, ENTITY),
|
||||
PLAYER(-1, ENTITY_HUMAN),
|
||||
COMPLEX_PART(-1, ENTITY),
|
||||
LIAMA_SPIT(-1, ENTITY);
|
||||
|
||||
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
EntityType(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
EntityType(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
for (EntityType type : EntityType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<EntityType> findById(int id) {
|
||||
if (id == -1) // Check if this is called
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
|
||||
BOAT(1, EntityType.BOAT),
|
||||
ITEM(2, EntityType.DROPPED_ITEM),
|
||||
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
|
||||
MINECART(10, EntityType.MINECART_RIDEABLE),
|
||||
TNT_PRIMED(50, EntityType.PRIMED_TNT),
|
||||
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
|
||||
TIPPED_ARROW(60, EntityType.ARROW),
|
||||
SNOWBALL(61, EntityType.SNOWBALL),
|
||||
EGG(62, EntityType.EGG),
|
||||
FIREBALL(63, EntityType.FIREBALL),
|
||||
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
|
||||
ENDER_PEARL(65, EntityType.ENDER_PEARL),
|
||||
WITHER_SKULL(66, EntityType.WITHER_SKULL),
|
||||
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
|
||||
LIAMA_SPIT(68, EntityType.LIAMA_SPIT),
|
||||
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
|
||||
ITEM_FRAME(71, EntityType.ITEM_FRAME),
|
||||
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
|
||||
POTION(73, EntityType.SPLASH_POTION),
|
||||
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
|
||||
FIREWORK(76, EntityType.FIREWORK),
|
||||
LEASH(77, EntityType.LEASH_HITCH),
|
||||
ARMOR_STAND(78, EntityType.ARMOR_STAND),
|
||||
EVOCATION_FANGS(79, EntityType.EVOCATION_FANGS),
|
||||
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
|
||||
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
|
||||
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
|
||||
|
||||
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType type;
|
||||
|
||||
static {
|
||||
for (ObjectType type : ObjectType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectType(int id, EntityType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static Optional<ObjectType> findById(int id) {
|
||||
if (id == -1)
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
|
||||
public static Optional<EntityType> getPCEntity(int id) {
|
||||
Optional<ObjectType> output = findById(id);
|
||||
|
||||
if (!output.isPresent())
|
||||
return Optional.empty();
|
||||
return Optional.of(output.get().type);
|
||||
}
|
||||
}
|
||||
}
|
||||
+332
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class Entity1_13Types {
|
||||
|
||||
public static EntityType getTypeFromId(int typeID, boolean isObject) {
|
||||
Optional<EntityType> type;
|
||||
|
||||
if (isObject)
|
||||
type = ObjectType.getPCEntity(typeID);
|
||||
else
|
||||
type = EntityType.findById(typeID);
|
||||
|
||||
if (!type.isPresent()) {
|
||||
Via.getPlatform().getLogger().severe("Could not find 1.13 type id " + typeID + " isObject=" + isObject);
|
||||
return EntityType.ENTITY; // Fall back to the basic ENTITY
|
||||
}
|
||||
|
||||
return type.get();
|
||||
}
|
||||
|
||||
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
|
||||
// Auto generated
|
||||
|
||||
ENTITY(-1), // abm
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY), // abk
|
||||
END_CRYSTAL(16, ENTITY), // aho
|
||||
EVOKER_FANGS(20, ENTITY), // ala
|
||||
EXPERIENCE_ORB(22, ENTITY), // abs
|
||||
EYE_OF_ENDER(23, ENTITY), // alb
|
||||
FALLING_BLOCK(24, ENTITY), // aix
|
||||
FIREWORK_ROCKET(25, ENTITY), // alc
|
||||
ITEM(32, ENTITY), // aiy
|
||||
LLAMA_SPIT(37, ENTITY), // ale
|
||||
TNT(55, ENTITY), // aiz
|
||||
SHULKER_BULLET(60, ENTITY), // alh
|
||||
FISHING_BOBBER(93, ENTITY), // ais
|
||||
|
||||
LIVINGENTITY(-1, ENTITY), // abv
|
||||
ARMOR_STAND(1, LIVINGENTITY), // ail
|
||||
PLAYER(92, LIVINGENTITY), // aks
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY), // abw
|
||||
ENDER_DRAGON(17, ABSTRACT_INSENTIENT), // ahp
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT), // acd
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE), // abj
|
||||
VILLAGER(79, ABSTRACT_AGEABLE), // akn
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE), // agd
|
||||
CHICKEN(7, ABSTRACT_ANIMAL), // age
|
||||
COW(9, ABSTRACT_ANIMAL), // agg
|
||||
MOOSHROOM(47, COW), // agi
|
||||
PIG(51, ABSTRACT_ANIMAL), // agl
|
||||
POLAR_BEAR(54, ABSTRACT_ANIMAL), // agm
|
||||
RABBIT(56, ABSTRACT_ANIMAL), // ago
|
||||
SHEEP(58, ABSTRACT_ANIMAL), // agq
|
||||
TURTLE(73, ABSTRACT_ANIMAL), // agv
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL), // acg
|
||||
OCELOT(48, ABSTRACT_TAMEABLE_ANIMAL), // agj
|
||||
WOLF(86, ABSTRACT_TAMEABLE_ANIMAL), // agy
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL), // agr
|
||||
PARROT(50, ABSTRACT_PARROT), // agk
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL), // aha
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE), // agz
|
||||
DONKEY(11, CHESTED_HORSE), // ahb
|
||||
MULE(46, CHESTED_HORSE), // ahf
|
||||
LLAMA(36, CHESTED_HORSE), // ahe
|
||||
HORSE(29, ABSTRACT_HORSE), // ahc
|
||||
SKELETON_HORSE(63, ABSTRACT_HORSE), // ahg
|
||||
ZOMBIE_HORSE(88, ABSTRACT_HORSE), // ahi
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE), // agc
|
||||
SNOW_GOLEM(66, ABSTRACT_GOLEM), // ags
|
||||
IRON_GOLEM(80, ABSTRACT_GOLEM), // agw
|
||||
SHULKER(59, ABSTRACT_GOLEM), // ajx
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE), // agb
|
||||
COD(8, ABSTRACT_FISHES), // agf
|
||||
PUFFERFISH(52, ABSTRACT_FISHES), // agn
|
||||
SALMON(57, ABSTRACT_FISHES), // agp
|
||||
TROPICAL_FISH(72, ABSTRACT_FISHES), // agu
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE), // ajs
|
||||
BLAZE(4, ABSTRACT_MONSTER), // ajd
|
||||
CREEPER(10, ABSTRACT_MONSTER), // ajf
|
||||
ENDERMITE(19, ABSTRACT_MONSTER), // ajj
|
||||
ENDERMAN(18, ABSTRACT_MONSTER), // aji
|
||||
GIANT(27, ABSTRACT_MONSTER), // ajn
|
||||
SILVERFISH(61, ABSTRACT_MONSTER), // ajy
|
||||
VEX(78, ABSTRACT_MONSTER), // ake
|
||||
WITCH(82, ABSTRACT_MONSTER), // akg
|
||||
WITHER(83, ABSTRACT_MONSTER), // aij
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER), // ajb
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE), // akb
|
||||
EVOKER(21, ABSTRACT_EVO_ILLU_ILLAGER), // ajl
|
||||
ILLUSIONER(31, ABSTRACT_EVO_ILLU_ILLAGER), // ajq
|
||||
VINDICATOR(81, ABSTRACT_ILLAGER_BASE), // akf
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER), // ajc
|
||||
SKELETON(62, ABSTRACT_SKELETON), // ajz
|
||||
STRAY(71, ABSTRACT_SKELETON), // akd
|
||||
WITHER_SKELETON(84, ABSTRACT_SKELETON), // akh
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(28, ABSTRACT_MONSTER), // ajo
|
||||
ELDER_GUARDIAN(15, GUARDIAN), // ajh
|
||||
|
||||
// Spiders
|
||||
SPIDER(69, ABSTRACT_MONSTER), // akc
|
||||
CAVE_SPIDER(6, SPIDER), // aje
|
||||
|
||||
// Zombies - META CHECKED
|
||||
ZOMBIE(87, ABSTRACT_MONSTER), // aki
|
||||
DROWNED(14, ZOMBIE), // ajg
|
||||
HUSK(30, ZOMBIE), // ajp
|
||||
ZOMBIE_PIGMAN(53, ZOMBIE), // aju
|
||||
ZOMBIE_VILLAGER(89, ZOMBIE), // akj
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT), // abt
|
||||
GHAST(26, ABSTRACT_FLYING), // ajm
|
||||
PHANTOM(90, ABSTRACT_FLYING), // ajt
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT), // afy
|
||||
BAT(3, ABSTRACT_AMBIENT), // afz
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT), // agx
|
||||
SQUID(70, ABSTRACT_WATERMOB), // agt
|
||||
DOLPHIN(12, ABSTRACT_WATERMOB),
|
||||
|
||||
// Slimes
|
||||
SLIME(64, ABSTRACT_INSENTIENT), // aka
|
||||
MAGMA_CUBE(38, SLIME), // ajr
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY), // aim
|
||||
LEASH_KNOT(35, ABSTRACT_HANGING), // aio
|
||||
ITEM_FRAME(33, ABSTRACT_HANGING), // ain
|
||||
PAINTING(49, ABSTRACT_HANGING), // aiq
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY), // aiu
|
||||
LIGHTNING_BOLT(91, ABSTRACT_LIGHTNING), // aiv
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY), // akw
|
||||
ARROW(2, ABSTRACT_ARROW), // aky
|
||||
SPECTRAL_ARROW(68, ABSTRACT_ARROW), // alk
|
||||
TRIDENT(94, ABSTRACT_ARROW), // alq
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY), // akx
|
||||
DRAGON_FIREBALL(13, ABSTRACT_FIREBALL), // akz
|
||||
FIREBALL(34, ABSTRACT_FIREBALL), // ald
|
||||
SMALL_FIREBALL(65, ABSTRACT_FIREBALL), // ali
|
||||
WITHER_SKULL(85, ABSTRACT_FIREBALL), // alr
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY), // all
|
||||
SNOWBALL(67, PROJECTILE_ABSTRACT), // alj
|
||||
ENDER_PEARL(75, PROJECTILE_ABSTRACT), // aln
|
||||
EGG(74, PROJECTILE_ABSTRACT), // alm
|
||||
POTION(77, PROJECTILE_ABSTRACT), // alp
|
||||
EXPERIENCE_BOTTLE(76, PROJECTILE_ABSTRACT), // alo
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY), // alt
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT), // alu
|
||||
CHEST_MINECART(40, CHESTED_MINECART_ABSTRACT), // alx
|
||||
HOPPER_MINECART(43, CHESTED_MINECART_ABSTRACT), // ama
|
||||
MINECART(39, MINECART_ABSTRACT), // alw
|
||||
FURNACE_MINECART(42, MINECART_ABSTRACT), // alz
|
||||
COMMAND_BLOCK_MINECART(41, MINECART_ABSTRACT), // aly
|
||||
TNT_MINECART(45, MINECART_ABSTRACT), // amc
|
||||
SPAWNER_MINECART(44, MINECART_ABSTRACT), // amb
|
||||
BOAT(5, ENTITY); // alv
|
||||
|
||||
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
EntityType(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
EntityType(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
for (EntityType type : EntityType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<EntityType> findById(int id) {
|
||||
if (id == -1) // Check if this is called
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
|
||||
BOAT(1, EntityType.BOAT),
|
||||
ITEM(2, EntityType.ITEM),
|
||||
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
|
||||
MINECART(10, EntityType.MINECART),
|
||||
TNT_PRIMED(50, EntityType.TNT),
|
||||
ENDER_CRYSTAL(51, EntityType.END_CRYSTAL),
|
||||
TIPPED_ARROW(60, EntityType.ARROW),
|
||||
SNOWBALL(61, EntityType.SNOWBALL),
|
||||
EGG(62, EntityType.EGG),
|
||||
FIREBALL(63, EntityType.FIREBALL),
|
||||
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
|
||||
ENDER_PEARL(65, EntityType.ENDER_PEARL),
|
||||
WITHER_SKULL(66, EntityType.WITHER_SKULL),
|
||||
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
|
||||
LLAMA_SPIT(68, EntityType.LLAMA_SPIT),
|
||||
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
|
||||
ITEM_FRAME(71, EntityType.ITEM_FRAME),
|
||||
EYE_OF_ENDER(72, EntityType.EYE_OF_ENDER),
|
||||
POTION(73, EntityType.POTION),
|
||||
EXPERIENCE_BOTTLE(75, EntityType.EXPERIENCE_BOTTLE),
|
||||
FIREWORK_ROCKET(76, EntityType.FIREWORK_ROCKET),
|
||||
LEASH(77, EntityType.LEASH_KNOT),
|
||||
ARMOR_STAND(78, EntityType.ARMOR_STAND),
|
||||
EVOKER_FANGS(79, EntityType.EVOKER_FANGS),
|
||||
FISHIHNG_HOOK(90, EntityType.FISHING_BOBBER),
|
||||
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
|
||||
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL),
|
||||
TRIDENT(94, EntityType.TRIDENT);
|
||||
|
||||
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
|
||||
|
||||
private final int id;
|
||||
private final EntityType type;
|
||||
|
||||
static {
|
||||
for (ObjectType type : ObjectType.values()) {
|
||||
TYPES.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectType(int id, EntityType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static Optional<ObjectType> findById(int id) {
|
||||
if (id == -1)
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(TYPES.get(id));
|
||||
}
|
||||
|
||||
public static Optional<EntityType> getPCEntity(int id) {
|
||||
Optional<ObjectType> output = findById(id);
|
||||
if (!output.isPresent())
|
||||
return Optional.empty();
|
||||
return Optional.of(output.get().type);
|
||||
}
|
||||
|
||||
public static Optional<ObjectType> fromEntityType(EntityType type) {
|
||||
for (ObjectType ent : ObjectType.values())
|
||||
if (ent.type == type)
|
||||
return Optional.of(ent);
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
|
||||
public enum Entity1_14Types implements EntityType {
|
||||
|
||||
ENTITY(-1),
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY),
|
||||
END_CRYSTAL(17, ENTITY),
|
||||
EVOKER_FANGS(21, ENTITY),
|
||||
EXPERIENCE_ORB(23, ENTITY),
|
||||
EYE_OF_ENDER(24, ENTITY),
|
||||
FALLING_BLOCK(25, ENTITY),
|
||||
FIREWORK_ROCKET(26, ENTITY),
|
||||
ITEM(34, ENTITY),
|
||||
LLAMA_SPIT(39, ENTITY),
|
||||
TNT(58, ENTITY),
|
||||
SHULKER_BULLET(63, ENTITY),
|
||||
FISHING_BOBBER(101, ENTITY),
|
||||
|
||||
LIVINGENTITY(-1, ENTITY),
|
||||
ARMOR_STAND(1, LIVINGENTITY),
|
||||
PLAYER(100, LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
|
||||
ENDER_DRAGON(18, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
|
||||
VILLAGER(84, ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(88, ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
|
||||
DOLPHIN(13, ABSTRACT_INSENTIENT),
|
||||
CHICKEN(8, ABSTRACT_ANIMAL),
|
||||
COW(10, ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(49, COW),
|
||||
PANDA(52, ABSTRACT_INSENTIENT),
|
||||
PIG(54, ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(57, ABSTRACT_ANIMAL),
|
||||
RABBIT(59, ABSTRACT_ANIMAL),
|
||||
SHEEP(61, ABSTRACT_ANIMAL),
|
||||
TURTLE(77, ABSTRACT_ANIMAL),
|
||||
FOX(27, ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
|
||||
CAT(6, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(50, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(93, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
PARROT(53, ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(12, CHESTED_HORSE),
|
||||
MULE(48, CHESTED_HORSE),
|
||||
LLAMA(38, CHESTED_HORSE),
|
||||
TRADER_LLAMA(75, CHESTED_HORSE),
|
||||
HORSE(31, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(66, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(95, ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
|
||||
SNOW_GOLEM(69, ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(85, ABSTRACT_GOLEM),
|
||||
SHULKER(62, ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
|
||||
COD(9, ABSTRACT_FISHES),
|
||||
PUFFERFISH(55, ABSTRACT_FISHES),
|
||||
SALMON(60, ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(76, ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
|
||||
BLAZE(4, ABSTRACT_MONSTER),
|
||||
CREEPER(11, ABSTRACT_MONSTER),
|
||||
ENDERMITE(20, ABSTRACT_MONSTER),
|
||||
ENDERMAN(19, ABSTRACT_MONSTER),
|
||||
GIANT(29, ABSTRACT_MONSTER),
|
||||
SILVERFISH(64, ABSTRACT_MONSTER),
|
||||
VEX(83, ABSTRACT_MONSTER),
|
||||
WITCH(89, ABSTRACT_MONSTER),
|
||||
WITHER(90, ABSTRACT_MONSTER),
|
||||
RAVAGER(98, ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
|
||||
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(33, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(86, ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(87, ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
|
||||
SKELETON(65, ABSTRACT_SKELETON),
|
||||
STRAY(74, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(91, ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(30, ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(16, GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(72, ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(7, SPIDER),
|
||||
|
||||
// Zombies - META CHECKED
|
||||
ZOMBIE(94, ABSTRACT_MONSTER),
|
||||
DROWNED(15, ZOMBIE),
|
||||
HUSK(32, ZOMBIE),
|
||||
ZOMBIE_PIGMAN(56, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(96, ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
|
||||
GHAST(28, ABSTRACT_FLYING),
|
||||
PHANTOM(97, ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
|
||||
BAT(3, ABSTRACT_AMBIENT),
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
|
||||
SQUID(73, ABSTRACT_WATERMOB),
|
||||
|
||||
// Slimes
|
||||
SLIME(67, ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(40, SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY),
|
||||
LEASH_KNOT(37, ABSTRACT_HANGING),
|
||||
ITEM_FRAME(35, ABSTRACT_HANGING),
|
||||
PAINTING(51, ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY),
|
||||
LIGHTNING_BOLT(99, ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY),
|
||||
ARROW(2, ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(71, ABSTRACT_ARROW),
|
||||
TRIDENT(82, ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY),
|
||||
DRAGON_FIREBALL(14, ABSTRACT_FIREBALL),
|
||||
FIREBALL(36, ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(68, ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(92, ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY),
|
||||
SNOWBALL(70, PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(79, PROJECTILE_ABSTRACT),
|
||||
EGG(78, PROJECTILE_ABSTRACT),
|
||||
POTION(81, PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(80, PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
|
||||
CHEST_MINECART(42, CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(45, CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(41, MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(44, MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(43, MINECART_ABSTRACT),
|
||||
TNT_MINECART(47, MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(46, MINECART_ABSTRACT),
|
||||
BOAT(5, ENTITY);
|
||||
|
||||
private static final EntityType[] TYPES;
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
Entity1_14Types(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
Entity1_14Types(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
|
||||
public enum Entity1_15Types implements EntityType {
|
||||
|
||||
ENTITY(-1),
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY),
|
||||
END_CRYSTAL(18, ENTITY),
|
||||
EVOKER_FANGS(22, ENTITY),
|
||||
EXPERIENCE_ORB(24, ENTITY),
|
||||
EYE_OF_ENDER(25, ENTITY),
|
||||
FALLING_BLOCK(26, ENTITY),
|
||||
FIREWORK_ROCKET(27, ENTITY),
|
||||
ITEM(35, ENTITY),
|
||||
LLAMA_SPIT(40, ENTITY),
|
||||
TNT(59, ENTITY),
|
||||
SHULKER_BULLET(64, ENTITY),
|
||||
FISHING_BOBBER(102, ENTITY),
|
||||
|
||||
LIVINGENTITY(-1, ENTITY),
|
||||
ARMOR_STAND(1, LIVINGENTITY),
|
||||
PLAYER(101, LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
|
||||
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
|
||||
|
||||
BEE(4, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
|
||||
VILLAGER(85, ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(89, ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
|
||||
DOLPHIN(14, ABSTRACT_INSENTIENT),
|
||||
CHICKEN(9, ABSTRACT_ANIMAL),
|
||||
COW(11, ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(50, COW),
|
||||
PANDA(53, ABSTRACT_INSENTIENT),
|
||||
PIG(55, ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(58, ABSTRACT_ANIMAL),
|
||||
RABBIT(60, ABSTRACT_ANIMAL),
|
||||
SHEEP(62, ABSTRACT_ANIMAL),
|
||||
TURTLE(78, ABSTRACT_ANIMAL),
|
||||
FOX(28, ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
|
||||
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(51, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(94, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
PARROT(54, ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(13, CHESTED_HORSE),
|
||||
MULE(49, CHESTED_HORSE),
|
||||
LLAMA(39, CHESTED_HORSE),
|
||||
TRADER_LLAMA(76, CHESTED_HORSE),
|
||||
HORSE(32, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(67, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(96, ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
|
||||
SNOW_GOLEM(70, ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(86, ABSTRACT_GOLEM),
|
||||
SHULKER(63, ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
|
||||
COD(10, ABSTRACT_FISHES),
|
||||
PUFFERFISH(56, ABSTRACT_FISHES),
|
||||
SALMON(61, ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(77, ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
|
||||
BLAZE(5, ABSTRACT_MONSTER),
|
||||
CREEPER(12, ABSTRACT_MONSTER),
|
||||
ENDERMITE(21, ABSTRACT_MONSTER),
|
||||
ENDERMAN(20, ABSTRACT_MONSTER),
|
||||
GIANT(30, ABSTRACT_MONSTER),
|
||||
SILVERFISH(65, ABSTRACT_MONSTER),
|
||||
VEX(84, ABSTRACT_MONSTER),
|
||||
WITCH(90, ABSTRACT_MONSTER),
|
||||
WITHER(91, ABSTRACT_MONSTER),
|
||||
RAVAGER(99, ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
|
||||
EVOKER(23, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(34, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(87, ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(88, ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
|
||||
SKELETON(66, ABSTRACT_SKELETON),
|
||||
STRAY(75, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(92, ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(31, ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(17, GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(73, ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(8, SPIDER),
|
||||
|
||||
// Zombies
|
||||
ZOMBIE(95, ABSTRACT_MONSTER),
|
||||
DROWNED(16, ZOMBIE),
|
||||
HUSK(33, ZOMBIE),
|
||||
ZOMBIE_PIGMAN(57, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(97, ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
|
||||
GHAST(29, ABSTRACT_FLYING),
|
||||
PHANTOM(98, ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
|
||||
BAT(3, ABSTRACT_AMBIENT),
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
|
||||
SQUID(74, ABSTRACT_WATERMOB),
|
||||
|
||||
// Slimes
|
||||
SLIME(68, ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(41, SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY),
|
||||
LEASH_KNOT(38, ABSTRACT_HANGING),
|
||||
ITEM_FRAME(36, ABSTRACT_HANGING),
|
||||
PAINTING(52, ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY),
|
||||
LIGHTNING_BOLT(100, ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY),
|
||||
ARROW(2, ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(72, ABSTRACT_ARROW),
|
||||
TRIDENT(83, ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY),
|
||||
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
|
||||
FIREBALL(37, ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(69, ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(93, ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY),
|
||||
SNOWBALL(71, PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(80, PROJECTILE_ABSTRACT),
|
||||
EGG(79, PROJECTILE_ABSTRACT),
|
||||
POTION(82, PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(81, PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
|
||||
CHEST_MINECART(43, CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(46, CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(42, MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(45, MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(44, MINECART_ABSTRACT),
|
||||
TNT_MINECART(48, MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(47, MINECART_ABSTRACT),
|
||||
BOAT(6, ENTITY);
|
||||
|
||||
private static final EntityType[] TYPES;
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
Entity1_15Types(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
Entity1_15Types(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
|
||||
public enum Entity1_16Types implements EntityType {
|
||||
|
||||
ENTITY(-1),
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY),
|
||||
END_CRYSTAL(18, ENTITY),
|
||||
EVOKER_FANGS(23, ENTITY),
|
||||
EXPERIENCE_ORB(24, ENTITY),
|
||||
EYE_OF_ENDER(25, ENTITY),
|
||||
FALLING_BLOCK(26, ENTITY),
|
||||
FIREWORK_ROCKET(27, ENTITY),
|
||||
ITEM(37, ENTITY),
|
||||
LLAMA_SPIT(43, ENTITY),
|
||||
TNT(63, ENTITY),
|
||||
SHULKER_BULLET(70, ENTITY),
|
||||
FISHING_BOBBER(106, ENTITY),
|
||||
|
||||
LIVINGENTITY(-1, ENTITY),
|
||||
ARMOR_STAND(1, LIVINGENTITY),
|
||||
PLAYER(105, LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
|
||||
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
|
||||
|
||||
BEE(4, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
|
||||
VILLAGER(92, ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(94, ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
|
||||
DOLPHIN(13, ABSTRACT_INSENTIENT),
|
||||
CHICKEN(9, ABSTRACT_ANIMAL),
|
||||
COW(11, ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(53, COW),
|
||||
PANDA(56, ABSTRACT_INSENTIENT),
|
||||
PIG(59, ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(62, ABSTRACT_ANIMAL),
|
||||
RABBIT(65, ABSTRACT_ANIMAL),
|
||||
SHEEP(68, ABSTRACT_ANIMAL),
|
||||
TURTLE(90, ABSTRACT_ANIMAL),
|
||||
FOX(28, ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
|
||||
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(54, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(99, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
PARROT(57, ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(14, CHESTED_HORSE),
|
||||
MULE(52, CHESTED_HORSE),
|
||||
LLAMA(42, CHESTED_HORSE),
|
||||
TRADER_LLAMA(88, CHESTED_HORSE),
|
||||
HORSE(33, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(73, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(102, ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
|
||||
SNOW_GOLEM(76, ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(36, ABSTRACT_GOLEM),
|
||||
SHULKER(69, ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
|
||||
COD(10, ABSTRACT_FISHES),
|
||||
PUFFERFISH(64, ABSTRACT_FISHES),
|
||||
SALMON(67, ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(89, ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
|
||||
BLAZE(5, ABSTRACT_MONSTER),
|
||||
CREEPER(12, ABSTRACT_MONSTER),
|
||||
ENDERMITE(21, ABSTRACT_MONSTER),
|
||||
ENDERMAN(20, ABSTRACT_MONSTER),
|
||||
GIANT(30, ABSTRACT_MONSTER),
|
||||
SILVERFISH(71, ABSTRACT_MONSTER),
|
||||
VEX(91, ABSTRACT_MONSTER),
|
||||
WITCH(95, ABSTRACT_MONSTER),
|
||||
WITHER(96, ABSTRACT_MONSTER),
|
||||
RAVAGER(66, ABSTRACT_MONSTER),
|
||||
PIGLIN(60, ABSTRACT_MONSTER),
|
||||
|
||||
HOGLIN(32, ABSTRACT_ANIMAL),
|
||||
STRIDER(82, ABSTRACT_ANIMAL),
|
||||
ZOGLIN(100, ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
|
||||
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(35, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(93, ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(61, ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
|
||||
SKELETON(72, ABSTRACT_SKELETON),
|
||||
STRAY(81, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(97, ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(31, ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(17, GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(79, ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(8, SPIDER),
|
||||
|
||||
// Zombies
|
||||
ZOMBIE(101, ABSTRACT_MONSTER),
|
||||
DROWNED(16, ZOMBIE),
|
||||
HUSK(34, ZOMBIE),
|
||||
ZOMBIFIED_PIGLIN(104, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(103, ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
|
||||
GHAST(29, ABSTRACT_FLYING),
|
||||
PHANTOM(58, ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
|
||||
BAT(3, ABSTRACT_AMBIENT),
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
|
||||
SQUID(80, ABSTRACT_WATERMOB),
|
||||
|
||||
// Slimes
|
||||
SLIME(74, ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(44, SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY),
|
||||
LEASH_KNOT(40, ABSTRACT_HANGING),
|
||||
ITEM_FRAME(38, ABSTRACT_HANGING),
|
||||
PAINTING(55, ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY),
|
||||
LIGHTNING_BOLT(41, ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY),
|
||||
ARROW(2, ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(78, ABSTRACT_ARROW),
|
||||
TRIDENT(87, ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY),
|
||||
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
|
||||
FIREBALL(39, ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(75, ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(98, ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY),
|
||||
SNOWBALL(77, PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(84, PROJECTILE_ABSTRACT),
|
||||
EGG(83, PROJECTILE_ABSTRACT),
|
||||
POTION(86, PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(85, PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
|
||||
CHEST_MINECART(46, CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(49, CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(45, MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(48, MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(47, MINECART_ABSTRACT),
|
||||
TNT_MINECART(51, MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(50, MINECART_ABSTRACT),
|
||||
BOAT(6, ENTITY);
|
||||
|
||||
private static final EntityType[] TYPES;
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
Entity1_16Types(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
Entity1_16Types(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
|
||||
public enum Entity1_16_2Types implements EntityType {
|
||||
|
||||
ENTITY(-1),
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY),
|
||||
END_CRYSTAL(18, ENTITY),
|
||||
EVOKER_FANGS(23, ENTITY),
|
||||
EXPERIENCE_ORB(24, ENTITY),
|
||||
EYE_OF_ENDER(25, ENTITY),
|
||||
FALLING_BLOCK(26, ENTITY),
|
||||
FIREWORK_ROCKET(27, ENTITY),
|
||||
ITEM(37, ENTITY),
|
||||
LLAMA_SPIT(43, ENTITY),
|
||||
TNT(64, ENTITY),
|
||||
SHULKER_BULLET(71, ENTITY),
|
||||
FISHING_BOBBER(107, ENTITY),
|
||||
|
||||
LIVINGENTITY(-1, ENTITY),
|
||||
ARMOR_STAND(1, LIVINGENTITY),
|
||||
PLAYER(106, LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
|
||||
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
|
||||
|
||||
BEE(4, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
|
||||
VILLAGER(93, ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(95, ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
|
||||
DOLPHIN(13, ABSTRACT_INSENTIENT),
|
||||
CHICKEN(9, ABSTRACT_ANIMAL),
|
||||
COW(11, ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(53, COW),
|
||||
PANDA(56, ABSTRACT_INSENTIENT),
|
||||
PIG(59, ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(63, ABSTRACT_ANIMAL),
|
||||
RABBIT(66, ABSTRACT_ANIMAL),
|
||||
SHEEP(69, ABSTRACT_ANIMAL),
|
||||
TURTLE(91, ABSTRACT_ANIMAL),
|
||||
FOX(28, ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
|
||||
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(54, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(100, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
PARROT(57, ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(14, CHESTED_HORSE),
|
||||
MULE(52, CHESTED_HORSE),
|
||||
LLAMA(42, CHESTED_HORSE),
|
||||
TRADER_LLAMA(89, CHESTED_HORSE),
|
||||
HORSE(33, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(74, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(103, ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
|
||||
SNOW_GOLEM(77, ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(36, ABSTRACT_GOLEM),
|
||||
SHULKER(70, ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
|
||||
COD(10, ABSTRACT_FISHES),
|
||||
PUFFERFISH(65, ABSTRACT_FISHES),
|
||||
SALMON(68, ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(90, ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
|
||||
BLAZE(5, ABSTRACT_MONSTER),
|
||||
CREEPER(12, ABSTRACT_MONSTER),
|
||||
ENDERMITE(21, ABSTRACT_MONSTER),
|
||||
ENDERMAN(20, ABSTRACT_MONSTER),
|
||||
GIANT(30, ABSTRACT_MONSTER),
|
||||
SILVERFISH(72, ABSTRACT_MONSTER),
|
||||
VEX(92, ABSTRACT_MONSTER),
|
||||
WITCH(96, ABSTRACT_MONSTER),
|
||||
WITHER(97, ABSTRACT_MONSTER),
|
||||
RAVAGER(67, ABSTRACT_MONSTER),
|
||||
|
||||
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
|
||||
|
||||
PIGLIN(60, ABSTRACT_PIGLIN),
|
||||
PIGLIN_BRUTE(61, ABSTRACT_PIGLIN),
|
||||
|
||||
HOGLIN(32, ABSTRACT_ANIMAL),
|
||||
STRIDER(83, ABSTRACT_ANIMAL),
|
||||
ZOGLIN(101, ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
|
||||
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(35, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(94, ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(62, ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
|
||||
SKELETON(73, ABSTRACT_SKELETON),
|
||||
STRAY(82, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(98, ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(31, ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(17, GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(80, ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(8, SPIDER),
|
||||
|
||||
// Zombies
|
||||
ZOMBIE(102, ABSTRACT_MONSTER),
|
||||
DROWNED(16, ZOMBIE),
|
||||
HUSK(34, ZOMBIE),
|
||||
ZOMBIFIED_PIGLIN(105, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(104, ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
|
||||
GHAST(29, ABSTRACT_FLYING),
|
||||
PHANTOM(58, ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
|
||||
BAT(3, ABSTRACT_AMBIENT),
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
|
||||
SQUID(81, ABSTRACT_WATERMOB),
|
||||
|
||||
// Slimes
|
||||
SLIME(75, ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(44, SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY),
|
||||
LEASH_KNOT(40, ABSTRACT_HANGING),
|
||||
ITEM_FRAME(38, ABSTRACT_HANGING),
|
||||
PAINTING(55, ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY),
|
||||
LIGHTNING_BOLT(41, ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY),
|
||||
ARROW(2, ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(79, ABSTRACT_ARROW),
|
||||
TRIDENT(88, ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY),
|
||||
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
|
||||
FIREBALL(39, ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(76, ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(99, ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY),
|
||||
SNOWBALL(78, PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(85, PROJECTILE_ABSTRACT),
|
||||
EGG(84, PROJECTILE_ABSTRACT),
|
||||
POTION(87, PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(86, PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
|
||||
CHEST_MINECART(46, CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(49, CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(45, MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(48, MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(47, MINECART_ABSTRACT),
|
||||
TNT_MINECART(51, MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(50, MINECART_ABSTRACT),
|
||||
BOAT(6, ENTITY);
|
||||
|
||||
private static final EntityType[] TYPES;
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
Entity1_16_2Types(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
Entity1_16_2Types(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
|
||||
public enum Entity1_17Types implements EntityType {
|
||||
|
||||
ENTITY(-1),
|
||||
|
||||
AREA_EFFECT_CLOUD(0, ENTITY),
|
||||
END_CRYSTAL(19, ENTITY),
|
||||
EVOKER_FANGS(24, ENTITY),
|
||||
EXPERIENCE_ORB(25, ENTITY),
|
||||
EYE_OF_ENDER(26, ENTITY),
|
||||
FALLING_BLOCK(27, ENTITY),
|
||||
FIREWORK_ROCKET(28, ENTITY),
|
||||
ITEM(41, ENTITY),
|
||||
LLAMA_SPIT(47, ENTITY),
|
||||
TNT(69, ENTITY),
|
||||
SHULKER_BULLET(76, ENTITY),
|
||||
FISHING_BOBBER(112, ENTITY),
|
||||
|
||||
LIVINGENTITY(-1, ENTITY),
|
||||
ARMOR_STAND(1, LIVINGENTITY),
|
||||
MARKER(49, ENTITY),
|
||||
PLAYER(111, LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
|
||||
ENDER_DRAGON(20, ABSTRACT_INSENTIENT),
|
||||
|
||||
BEE(5, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
|
||||
VILLAGER(98, ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(100, ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
|
||||
AXOLOTL(3, ABSTRACT_ANIMAL),
|
||||
DOLPHIN(14, ABSTRACT_INSENTIENT),
|
||||
CHICKEN(10, ABSTRACT_ANIMAL),
|
||||
COW(12, ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(58, COW),
|
||||
PANDA(61, ABSTRACT_INSENTIENT),
|
||||
PIG(64, ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(68, ABSTRACT_ANIMAL),
|
||||
RABBIT(71, ABSTRACT_ANIMAL),
|
||||
SHEEP(74, ABSTRACT_ANIMAL),
|
||||
TURTLE(96, ABSTRACT_ANIMAL),
|
||||
FOX(29, ABSTRACT_ANIMAL),
|
||||
GOAT(34, ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
|
||||
CAT(8, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(59, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(105, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
|
||||
PARROT(62, ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
|
||||
CHESTED_HORSE(-1, ABSTRACT_HORSE),
|
||||
DONKEY(15, CHESTED_HORSE),
|
||||
MULE(57, CHESTED_HORSE),
|
||||
LLAMA(46, CHESTED_HORSE),
|
||||
TRADER_LLAMA(94, CHESTED_HORSE),
|
||||
HORSE(37, ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(79, ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(108, ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
|
||||
SNOW_GOLEM(82, ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(40, ABSTRACT_GOLEM),
|
||||
SHULKER(75, ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
|
||||
COD(11, ABSTRACT_FISHES),
|
||||
PUFFERFISH(70, ABSTRACT_FISHES),
|
||||
SALMON(73, ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(95, ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
|
||||
BLAZE(6, ABSTRACT_MONSTER),
|
||||
CREEPER(13, ABSTRACT_MONSTER),
|
||||
ENDERMITE(22, ABSTRACT_MONSTER),
|
||||
ENDERMAN(21, ABSTRACT_MONSTER),
|
||||
GIANT(31, ABSTRACT_MONSTER),
|
||||
SILVERFISH(77, ABSTRACT_MONSTER),
|
||||
VEX(97, ABSTRACT_MONSTER),
|
||||
WITCH(101, ABSTRACT_MONSTER),
|
||||
WITHER(102, ABSTRACT_MONSTER),
|
||||
RAVAGER(72, ABSTRACT_MONSTER),
|
||||
|
||||
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
|
||||
|
||||
PIGLIN(65, ABSTRACT_PIGLIN),
|
||||
PIGLIN_BRUTE(66, ABSTRACT_PIGLIN),
|
||||
|
||||
HOGLIN(36, ABSTRACT_ANIMAL),
|
||||
STRIDER(88, ABSTRACT_ANIMAL),
|
||||
ZOGLIN(106, ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
|
||||
EVOKER(23, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(39, ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(99, ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(67, ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
|
||||
SKELETON(78, ABSTRACT_SKELETON),
|
||||
STRAY(87, ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(103, ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(35, ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(18, GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(85, ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(9, SPIDER),
|
||||
|
||||
// Zombies
|
||||
ZOMBIE(107, ABSTRACT_MONSTER),
|
||||
DROWNED(17, ZOMBIE),
|
||||
HUSK(38, ZOMBIE),
|
||||
ZOMBIFIED_PIGLIN(110, ZOMBIE),
|
||||
ZOMBIE_VILLAGER(109, ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
|
||||
GHAST(30, ABSTRACT_FLYING),
|
||||
PHANTOM(63, ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
|
||||
BAT(4, ABSTRACT_AMBIENT),
|
||||
|
||||
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
|
||||
SQUID(86, ABSTRACT_WATERMOB),
|
||||
GLOW_SQUID(33, SQUID),
|
||||
|
||||
// Slimes
|
||||
SLIME(80, ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(48, SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(-1, ENTITY),
|
||||
LEASH_KNOT(44, ABSTRACT_HANGING),
|
||||
ITEM_FRAME(42, ABSTRACT_HANGING),
|
||||
GLOW_ITEM_FRAME(32, ITEM_FRAME),
|
||||
PAINTING(60, ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(-1, ENTITY),
|
||||
LIGHTNING_BOLT(45, ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(-1, ENTITY),
|
||||
ARROW(2, ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(84, ABSTRACT_ARROW),
|
||||
TRIDENT(93, ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(-1, ENTITY),
|
||||
DRAGON_FIREBALL(16, ABSTRACT_FIREBALL),
|
||||
FIREBALL(43, ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(81, ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(104, ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(-1, ENTITY),
|
||||
SNOWBALL(83, PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(90, PROJECTILE_ABSTRACT),
|
||||
EGG(89, PROJECTILE_ABSTRACT),
|
||||
POTION(92, PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(91, PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(-1, ENTITY),
|
||||
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
|
||||
CHEST_MINECART(51, CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(54, CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(50, MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(53, MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(52, MINECART_ABSTRACT),
|
||||
TNT_MINECART(56, MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(55, MINECART_ABSTRACT),
|
||||
BOAT(7, ENTITY);
|
||||
|
||||
private static final EntityType[] TYPES;
|
||||
|
||||
private final int id;
|
||||
private final EntityType parent;
|
||||
|
||||
Entity1_17Types(int id) {
|
||||
this.id = id;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
Entity1_17Types(int id, EntityType parent) {
|
||||
this.id = id;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface EntityType {
|
||||
|
||||
/**
|
||||
* Returns the entity id.
|
||||
*
|
||||
* @return entity id
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Returns the parent entity type if present.
|
||||
*
|
||||
* @return parent entity type if present
|
||||
*/
|
||||
@Nullable EntityType getParent();
|
||||
|
||||
/**
|
||||
* Returns the entity type name, not necessarily matching the Vanilla type name.
|
||||
*
|
||||
* @return entity type name
|
||||
*/
|
||||
String name();
|
||||
|
||||
default boolean is(EntityType... types) {
|
||||
for (EntityType type : types) {
|
||||
if (this == type) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean is(EntityType type) {
|
||||
return this == type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the current type is equal to the given type, or has it as a parent type.
|
||||
*
|
||||
* @param type entity type to check against
|
||||
* @return true if the current type is equal to the given type, or has it as a parent type
|
||||
*/
|
||||
default boolean isOrHasParent(EntityType type) {
|
||||
EntityType parent = this;
|
||||
|
||||
do {
|
||||
if (parent == type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
parent = parent.getParent();
|
||||
} while (parent != null);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.entities;
|
||||
|
||||
/**
|
||||
* Represents a legacy object entity type.
|
||||
*/
|
||||
public interface ObjectType {
|
||||
|
||||
int getId();
|
||||
|
||||
EntityType getType();
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.item;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class DataItem implements Item {
|
||||
@SerializedName(value = "identifier", alternate = "id")
|
||||
private int identifier;
|
||||
private byte amount;
|
||||
private short data;
|
||||
private CompoundTag tag;
|
||||
|
||||
public DataItem() {
|
||||
}
|
||||
|
||||
public DataItem(int identifier, byte amount, short data, @Nullable CompoundTag tag) {
|
||||
this.identifier = identifier;
|
||||
this.amount = amount;
|
||||
this.data = data;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public DataItem(Item toCopy) {
|
||||
this(toCopy.identifier(), (byte) toCopy.amount(), toCopy.data(), toCopy.tag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int identifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifier(int identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAmount(int amount) {
|
||||
if (amount > Byte.MAX_VALUE || amount < Byte.MIN_VALUE) {
|
||||
throw new IllegalArgumentException("Invalid item amount: " + amount);
|
||||
}
|
||||
this.amount = (byte) amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short data() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(short data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable CompoundTag tag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTag(@Nullable CompoundTag tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
DataItem item = (DataItem) o;
|
||||
if (identifier != item.identifier) return false;
|
||||
if (amount != item.amount) return false;
|
||||
if (data != item.data) return false;
|
||||
return Objects.equals(tag, item.tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = identifier;
|
||||
result = 31 * result + (int) amount;
|
||||
result = 31 * result + (int) data;
|
||||
result = 31 * result + (tag != null ? tag.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Item{" +
|
||||
"identifier=" + identifier +
|
||||
", amount=" + amount +
|
||||
", data=" + data +
|
||||
", tag=" + tag +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.item;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface Item {
|
||||
|
||||
/**
|
||||
* Returns the item identifier.
|
||||
*
|
||||
* @return item identifier
|
||||
*/
|
||||
int identifier();
|
||||
|
||||
/**
|
||||
* Sets the item identifier.
|
||||
*
|
||||
* @param identifier item identifier
|
||||
*/
|
||||
void setIdentifier(int identifier);
|
||||
|
||||
/**
|
||||
* Returns the item amount.
|
||||
*
|
||||
* @return item amount
|
||||
*/
|
||||
int amount();
|
||||
|
||||
/**
|
||||
* Returns the item amount.
|
||||
*
|
||||
* @param amount item amount
|
||||
*/
|
||||
void setAmount(int amount);
|
||||
|
||||
/**
|
||||
* Returns the item data. Always 0 for 1.13+ items.
|
||||
*
|
||||
* @return item data
|
||||
*/
|
||||
default short data() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item data used in versions before 1.13.
|
||||
*
|
||||
* @param data item data
|
||||
* @throws UnsupportedOperationException if the item implementation does not store data
|
||||
*/
|
||||
default void setData(short data) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the item compound tag if present.
|
||||
*
|
||||
* @return item tag
|
||||
*/
|
||||
@Nullable CompoundTag tag();
|
||||
|
||||
/**
|
||||
* Sets the item compound tag.
|
||||
*
|
||||
* @param tag item tag
|
||||
*/
|
||||
void setTag(@Nullable CompoundTag tag);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata;
|
||||
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public interface MetaType {
|
||||
|
||||
/**
|
||||
* Get the write/read type
|
||||
*
|
||||
* @return Type instance
|
||||
*/
|
||||
Type type();
|
||||
|
||||
/**
|
||||
* Get type id from the specific MetaDataType
|
||||
*
|
||||
* @return Type id as an integer
|
||||
*/
|
||||
int typeId();
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class Metadata {
|
||||
private int id;
|
||||
private MetaType metaType;
|
||||
private Object value;
|
||||
|
||||
/**
|
||||
* Creates a new metadata instance.
|
||||
*
|
||||
* @param id metadata index
|
||||
* @param metaType metadata type
|
||||
* @param value value if present
|
||||
* @throws IllegalArgumentException if the value and metaType are incompatible
|
||||
*/
|
||||
public Metadata(int id, MetaType metaType, @Nullable Object value) {
|
||||
this.id = id;
|
||||
this.metaType = metaType;
|
||||
this.value = checkValue(metaType, value);
|
||||
}
|
||||
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public MetaType metaType() {
|
||||
return metaType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the metadata type if compatible with the current value.
|
||||
*
|
||||
* @param metaType metadata type
|
||||
* @throws IllegalArgumentException if the metadata type and current value are incompatible
|
||||
* @see #setTypeAndValue(MetaType, Object)
|
||||
*/
|
||||
public void setMetaType(MetaType metaType) {
|
||||
checkValue(metaType, this.value);
|
||||
this.metaType = metaType;
|
||||
}
|
||||
|
||||
public @Nullable <T> T value() {
|
||||
return (T) value;
|
||||
}
|
||||
|
||||
public @Nullable Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the metadata value if compatible with the current meta type.
|
||||
*
|
||||
* @param value value
|
||||
* @throws IllegalArgumentException if the value and current metaType are incompatible
|
||||
* @see #setTypeAndValue(MetaType, Object)
|
||||
*/
|
||||
public void setValue(@Nullable Object value) {
|
||||
this.value = checkValue(this.metaType, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets metadata type and value.
|
||||
*
|
||||
* @param metaType metadata type
|
||||
* @param value value
|
||||
* @throws IllegalArgumentException if the value and metaType are incompatible
|
||||
*/
|
||||
public void setTypeAndValue(MetaType metaType, @Nullable Object value) {
|
||||
this.value = checkValue(metaType, value);
|
||||
this.metaType = metaType;
|
||||
}
|
||||
|
||||
private Object checkValue(MetaType metaType, @Nullable Object value) {
|
||||
Preconditions.checkNotNull(metaType);
|
||||
if (value != null && !metaType.type().getOutputClass().isAssignableFrom(value.getClass())) {
|
||||
throw new IllegalArgumentException("Metadata value and metaType are incompatible. Type=" + metaType
|
||||
+ ", value=" + (value != null ? value + " (" + value.getClass().getSimpleName() + ")" : "null"));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setMetaTypeUnsafe(MetaType type) {
|
||||
this.metaType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Metadata metadata = (Metadata) o;
|
||||
if (id != metadata.id) return false;
|
||||
if (metaType != metaType) return false;
|
||||
return Objects.equals(value, metadata.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = id;
|
||||
result = 31 * result + metaType.hashCode();
|
||||
result = 31 * result + (value != null ? value.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Metadata{" +
|
||||
"id=" + id +
|
||||
", metaType=" + metaType +
|
||||
", value=" + value +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public enum MetaType1_12 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
VarInt(1, Type.VAR_INT),
|
||||
Float(2, Type.FLOAT),
|
||||
String(3, Type.STRING),
|
||||
Chat(4, Type.COMPONENT),
|
||||
Slot(5, Type.ITEM),
|
||||
Boolean(6, Type.BOOLEAN),
|
||||
Vector3F(7, Type.ROTATION),
|
||||
Position(8, Type.POSITION),
|
||||
OptPosition(9, Type.OPTIONAL_POSITION),
|
||||
Direction(10, Type.VAR_INT),
|
||||
OptUUID(11, Type.OPTIONAL_UUID),
|
||||
BlockID(12, Type.VAR_INT),
|
||||
NBTTag(13, Type.NBT);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_12(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_12 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_13;
|
||||
|
||||
public enum MetaType1_13 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
VarInt(1, Type.VAR_INT),
|
||||
Float(2, Type.FLOAT),
|
||||
String(3, Type.STRING),
|
||||
Chat(4, Type.COMPONENT),
|
||||
OptChat(5, Type.OPTIONAL_COMPONENT),
|
||||
Slot(6, Type.FLAT_ITEM),
|
||||
Boolean(7, Type.BOOLEAN),
|
||||
Vector3F(8, Type.ROTATION),
|
||||
Position(9, Type.POSITION),
|
||||
OptPosition(10, Type.OPTIONAL_POSITION),
|
||||
Direction(11, Type.VAR_INT),
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Types1_13.PARTICLE);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_13(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_13 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_13_2;
|
||||
|
||||
public enum MetaType1_13_2 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
VarInt(1, Type.VAR_INT),
|
||||
Float(2, Type.FLOAT),
|
||||
String(3, Type.STRING),
|
||||
Chat(4, Type.COMPONENT),
|
||||
OptChat(5, Type.OPTIONAL_COMPONENT),
|
||||
Slot(6, Type.FLAT_VAR_INT_ITEM),
|
||||
Boolean(7, Type.BOOLEAN),
|
||||
Vector3F(8, Type.ROTATION),
|
||||
Position(9, Type.POSITION),
|
||||
OptPosition(10, Type.OPTIONAL_POSITION),
|
||||
Direction(11, Type.VAR_INT),
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Types1_13_2.PARTICLE);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_13_2(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_13_2 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_14;
|
||||
|
||||
public enum MetaType1_14 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
VarInt(1, Type.VAR_INT),
|
||||
Float(2, Type.FLOAT),
|
||||
String(3, Type.STRING),
|
||||
Chat(4, Type.COMPONENT),
|
||||
OptChat(5, Type.OPTIONAL_COMPONENT),
|
||||
Slot(6, Type.FLAT_VAR_INT_ITEM),
|
||||
Boolean(7, Type.BOOLEAN),
|
||||
Vector3F(8, Type.ROTATION),
|
||||
Position(9, Type.POSITION1_14),
|
||||
OptPosition(10, Type.OPTIONAL_POSITION_1_14),
|
||||
Direction(11, Type.VAR_INT),
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Types1_14.PARTICLE),
|
||||
VillagerData(16, Type.VILLAGER_DATA),
|
||||
OptVarInt(17, Type.OPTIONAL_VAR_INT),
|
||||
Pose(18, Type.VAR_INT);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_14(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_14 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_17;
|
||||
|
||||
public enum MetaType1_17 implements MetaType {
|
||||
BYTE(0, Type.BYTE),
|
||||
VAR_INT(1, Type.VAR_INT),
|
||||
FLOAT(2, Type.FLOAT),
|
||||
STRING(3, Type.STRING),
|
||||
COMPONENT(4, Type.COMPONENT),
|
||||
OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT),
|
||||
ITEM(6, Type.FLAT_VAR_INT_ITEM),
|
||||
BOOLEAN(7, Type.BOOLEAN),
|
||||
ROTATION(8, Type.ROTATION),
|
||||
POSITION(9, Type.POSITION1_14),
|
||||
OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14),
|
||||
DIRECTION(11, Type.VAR_INT),
|
||||
OPT_UUID(12, Type.OPTIONAL_UUID),
|
||||
BLOCK_STATE(13, Type.VAR_INT),
|
||||
NBT(14, Type.NBT),
|
||||
PARTICLE(15, Types1_17.PARTICLE),
|
||||
VILLAGER_DATA(16, Type.VILLAGER_DATA),
|
||||
OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT),
|
||||
POSE(18, Type.VAR_INT);
|
||||
|
||||
private static final MetaType1_17[] VALUES = values();
|
||||
private final int typeId;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_17(int typeId, Type type) {
|
||||
this.typeId = typeId;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_17 byId(int id) {
|
||||
return VALUES[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public enum MetaType1_8 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
Short(1, Type.SHORT),
|
||||
Int(2, Type.INT),
|
||||
Float(3, Type.FLOAT),
|
||||
String(4, Type.STRING),
|
||||
Slot(5, Type.ITEM),
|
||||
Position(6, Type.VECTOR),
|
||||
Rotation(7, Type.ROTATION),
|
||||
@Deprecated
|
||||
NonExistent(-1, Type.NOTHING);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_8(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_8 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.minecraft.metadata.types;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public enum MetaType1_9 implements MetaType {
|
||||
Byte(0, Type.BYTE),
|
||||
VarInt(1, Type.VAR_INT),
|
||||
Float(2, Type.FLOAT),
|
||||
String(3, Type.STRING),
|
||||
Chat(4, Type.COMPONENT),
|
||||
Slot(5, Type.ITEM),
|
||||
Boolean(6, Type.BOOLEAN),
|
||||
Vector3F(7, Type.ROTATION),
|
||||
Position(8, Type.POSITION),
|
||||
OptPosition(9, Type.OPTIONAL_POSITION),
|
||||
Direction(10, Type.VAR_INT),
|
||||
OptUUID(11, Type.OPTIONAL_UUID),
|
||||
BlockID(12, Type.VAR_INT);
|
||||
|
||||
private final int typeID;
|
||||
private final Type type;
|
||||
|
||||
MetaType1_9(int typeID, Type type) {
|
||||
this.typeID = typeID;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static MetaType1_9 byId(int id) {
|
||||
return values()[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type type() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutput;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
* See https://github.com/KyoriPowered/adventure.
|
||||
*/
|
||||
public final class BinaryTagIO {
|
||||
private BinaryTagIO() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from {@code path}.
|
||||
*
|
||||
* @param path the path
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readPath(final @NonNull Path path) throws IOException {
|
||||
return readInputStream(Files.newInputStream(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from an input stream.
|
||||
*
|
||||
* @param input the input stream
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readInputStream(final @NonNull InputStream input) throws IOException {
|
||||
try (final DataInputStream dis = new DataInputStream(input)) {
|
||||
return readDataInput(dis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from {@code path} using GZIP decompression.
|
||||
*
|
||||
* @param path the path
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readCompressedPath(final @NonNull Path path) throws IOException {
|
||||
return readCompressedInputStream(Files.newInputStream(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from an input stream using GZIP decompression.
|
||||
*
|
||||
* @param input the input stream
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readCompressedInputStream(final @NonNull InputStream input) throws IOException {
|
||||
try (final DataInputStream dis = new DataInputStream(new BufferedInputStream(new GZIPInputStream(input)))) {
|
||||
return readDataInput(dis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from {@code input}.
|
||||
*
|
||||
* @param input the input
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readDataInput(final @NonNull DataInput input) throws IOException {
|
||||
byte type = input.readByte();
|
||||
if (type != CompoundTag.ID) {
|
||||
throw new IOException(String.format("Expected root tag to be a CompoundTag, was %s", type));
|
||||
}
|
||||
input.skipBytes(input.readUnsignedShort()); // read empty name
|
||||
|
||||
final CompoundTag compoundTag = new CompoundTag();
|
||||
compoundTag.read(input);
|
||||
return compoundTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to {@code path}.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @param path the path
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static void writePath(final @NonNull CompoundTag tag, final @NonNull Path path) throws IOException {
|
||||
writeOutputStream(tag, Files.newOutputStream(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to an output stream.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @param output the output stream
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static void writeOutputStream(final @NonNull CompoundTag tag, final @NonNull OutputStream output) throws IOException {
|
||||
try (final DataOutputStream dos = new DataOutputStream(output)) {
|
||||
writeDataOutput(tag, dos);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to {@code path} using GZIP compression.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @param path the path
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static void writeCompressedPath(final @NonNull CompoundTag tag, final @NonNull Path path) throws IOException {
|
||||
writeCompressedOutputStream(tag, Files.newOutputStream(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to an output stream using GZIP compression.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @param output the output stream
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static void writeCompressedOutputStream(final @NonNull CompoundTag tag, final @NonNull OutputStream output) throws IOException {
|
||||
try (final DataOutputStream dos = new DataOutputStream(new GZIPOutputStream(output))) {
|
||||
writeDataOutput(tag, dos);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to {@code output}.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @param output the output
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static void writeDataOutput(final @NonNull CompoundTag tag, final @NonNull DataOutput output) throws IOException {
|
||||
output.writeByte(CompoundTag.ID);
|
||||
output.writeUTF(""); // write empty name
|
||||
tag.write(output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a compound tag from a {@link String}.
|
||||
*
|
||||
* @param input the string
|
||||
* @return the compound tag
|
||||
* @throws IOException if an exception was encountered while reading a compound tag
|
||||
*/
|
||||
public static @NonNull CompoundTag readString(final @NonNull String input) throws IOException {
|
||||
try {
|
||||
final CharBuffer buffer = new CharBuffer(input);
|
||||
final TagStringReader parser = new TagStringReader(buffer);
|
||||
final CompoundTag tag = parser.compound();
|
||||
if (buffer.skipWhitespace().hasMore()) {
|
||||
throw new IOException("Document had trailing content after first CompoundTag");
|
||||
}
|
||||
return tag;
|
||||
} catch (final StringTagParseException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a compound tag to a {@link String}.
|
||||
*
|
||||
* @param tag the compound tag
|
||||
* @return the string
|
||||
* @throws IOException if an exception was encountered while writing the compound tag
|
||||
*/
|
||||
public static @NonNull String writeString(final @NonNull CompoundTag tag) throws IOException {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
try (final TagStringWriter emit = new TagStringWriter(sb)) {
|
||||
emit.writeTag(tag);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
/* package */ final class CharBuffer {
|
||||
private final CharSequence sequence;
|
||||
private int index;
|
||||
|
||||
CharBuffer(final CharSequence sequence) {
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the character at the current position
|
||||
*
|
||||
* @return The current character
|
||||
*/
|
||||
public char peek() {
|
||||
return this.sequence.charAt(this.index);
|
||||
}
|
||||
|
||||
public char peek(final int offset) {
|
||||
return this.sequence.charAt(this.index + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current character and advance
|
||||
*
|
||||
* @return current character
|
||||
*/
|
||||
public char take() {
|
||||
return this.sequence.charAt(this.index++);
|
||||
}
|
||||
|
||||
public boolean advance() {
|
||||
this.index++;
|
||||
return this.hasMore();
|
||||
}
|
||||
|
||||
public boolean hasMore() {
|
||||
return this.index < this.sequence.length();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for the provided token, and advance the reader index past the {@code until} character.
|
||||
*
|
||||
* @param until Case-insensitive token
|
||||
* @return the string starting at the current position (inclusive) and going until the location of {@code until}, exclusive
|
||||
*/
|
||||
public CharSequence takeUntil(char until) throws StringTagParseException {
|
||||
until = Character.toLowerCase(until);
|
||||
int endIdx = -1;
|
||||
for (int idx = this.index; idx < this.sequence.length(); ++idx) {
|
||||
if (this.sequence.charAt(idx) == Tokens.ESCAPE_MARKER) {
|
||||
idx++;
|
||||
} else if (Character.toLowerCase(this.sequence.charAt(idx)) == until) {
|
||||
endIdx = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (endIdx == -1) {
|
||||
throw this.makeError("No occurrence of " + until + " was found");
|
||||
}
|
||||
|
||||
final CharSequence result = this.sequence.subSequence(this.index, endIdx);
|
||||
this.index = endIdx + 1;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the next non-whitespace character is the provided parameter.
|
||||
*
|
||||
* <p>If the assertion is successful, the token will be consumed.</p>
|
||||
*
|
||||
* @param expectedChar expected character
|
||||
* @return this
|
||||
* @throws StringTagParseException if EOF or non-matching value is found
|
||||
*/
|
||||
public CharBuffer expect(final char expectedChar) throws StringTagParseException {
|
||||
this.skipWhitespace();
|
||||
if (!this.hasMore()) {
|
||||
throw this.makeError("Expected character '" + expectedChar + "' but got EOF");
|
||||
}
|
||||
if (this.peek() != expectedChar) {
|
||||
throw this.makeError("Expected character '" + expectedChar + "' but got '" + this.peek() + "'");
|
||||
}
|
||||
this.take();
|
||||
return this;
|
||||
}
|
||||
|
||||
public CharBuffer skipWhitespace() {
|
||||
while (this.hasMore() && Character.isWhitespace(this.peek())) this.advance();
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringTagParseException makeError(final String message) {
|
||||
return new StringTagParseException(message, this.sequence, this.index);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* An exception thrown when parsing a string tag
|
||||
*/
|
||||
/* package */ class StringTagParseException extends IOException {
|
||||
private static final long serialVersionUID = -3001637554903912905L;
|
||||
private final CharSequence buffer;
|
||||
private final int position;
|
||||
|
||||
public StringTagParseException(final String message, final CharSequence buffer, final int position) {
|
||||
super(message);
|
||||
this.buffer = buffer;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
// TODO: Provide more specific position information
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return super.getMessage() + "(at position " + this.position + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.ByteArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ByteTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.DoubleTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.FloatTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.IntArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.IntTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ListTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.LongArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.LongTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.NumberTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ShortTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.StringTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.Tag;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* See https://github.com/KyoriPowered/adventure.
|
||||
*/
|
||||
/* package */ final class TagStringReader {
|
||||
private final CharBuffer buffer;
|
||||
|
||||
public TagStringReader(final CharBuffer buffer) {
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
||||
public CompoundTag compound() throws StringTagParseException {
|
||||
this.buffer.expect(Tokens.COMPOUND_BEGIN);
|
||||
final CompoundTag compoundTag = new CompoundTag();
|
||||
if (this.buffer.peek() == Tokens.COMPOUND_END) {
|
||||
this.buffer.take();
|
||||
return compoundTag;
|
||||
}
|
||||
|
||||
while (this.buffer.hasMore()) {
|
||||
final String key = this.key();
|
||||
final Tag tag = this.tag();
|
||||
compoundTag.put(key, tag);
|
||||
if (this.separatorOrCompleteWith(Tokens.COMPOUND_END)) {
|
||||
return compoundTag;
|
||||
}
|
||||
}
|
||||
throw this.buffer.makeError("Unterminated compound tag!");
|
||||
}
|
||||
|
||||
public ListTag list() throws StringTagParseException {
|
||||
final ListTag listTag = new ListTag();
|
||||
this.buffer.expect(Tokens.ARRAY_BEGIN);
|
||||
final boolean prefixedIndex = this.buffer.peek() == '0' && this.buffer.peek(1) == ':';
|
||||
while (this.buffer.hasMore()) {
|
||||
if (this.buffer.peek() == Tokens.ARRAY_END) {
|
||||
this.buffer.advance();
|
||||
return listTag;
|
||||
}
|
||||
|
||||
if (prefixedIndex) {
|
||||
this.buffer.takeUntil(':');
|
||||
}
|
||||
|
||||
final Tag next = this.tag();
|
||||
// TODO: validate type
|
||||
listTag.add(next);
|
||||
if (this.separatorOrCompleteWith(Tokens.ARRAY_END)) {
|
||||
return listTag;
|
||||
}
|
||||
}
|
||||
throw this.buffer.makeError("Reached end of file without end of list tag!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to a list tag in syntax, but returning a single array tag rather than a list of tags.
|
||||
*
|
||||
* @return array-typed tag
|
||||
*/
|
||||
public Tag array(final char elementType) throws StringTagParseException {
|
||||
this.buffer.expect(Tokens.ARRAY_BEGIN)
|
||||
.expect(elementType)
|
||||
.expect(Tokens.ARRAY_SIGNATURE_SEPARATOR);
|
||||
|
||||
if (elementType == Tokens.TYPE_BYTE) {
|
||||
return new ByteArrayTag(this.byteArray());
|
||||
} else if (elementType == Tokens.TYPE_INT) {
|
||||
return new IntArrayTag(this.intArray());
|
||||
} else if (elementType == Tokens.TYPE_LONG) {
|
||||
return new LongArrayTag(this.longArray());
|
||||
} else {
|
||||
throw this.buffer.makeError("Type " + elementType + " is not a valid element type in an array!");
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] byteArray() throws StringTagParseException {
|
||||
final List<Byte> bytes = new ArrayList<>();
|
||||
while (this.buffer.hasMore()) {
|
||||
final CharSequence value = this.buffer.skipWhitespace().takeUntil(Tokens.TYPE_BYTE);
|
||||
try {
|
||||
bytes.add(Byte.valueOf(value.toString()));
|
||||
} catch (final NumberFormatException ex) {
|
||||
throw this.buffer.makeError("All elements of a byte array must be bytes!");
|
||||
}
|
||||
|
||||
if (this.separatorOrCompleteWith(Tokens.ARRAY_END)) {
|
||||
final byte[] result = new byte[bytes.size()];
|
||||
for (int i = 0; i < bytes.size(); ++i) { // todo yikes, let's do less boxing
|
||||
result[i] = bytes.get(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
throw this.buffer.makeError("Reached end of document without array close");
|
||||
}
|
||||
|
||||
private int[] intArray() throws StringTagParseException {
|
||||
final IntStream.Builder builder = IntStream.builder();
|
||||
while (this.buffer.hasMore()) {
|
||||
final Tag value = this.tag();
|
||||
if (!(value instanceof IntTag)) {
|
||||
throw this.buffer.makeError("All elements of an int array must be ints!");
|
||||
}
|
||||
builder.add(((NumberTag) value).asInt());
|
||||
if (this.separatorOrCompleteWith(Tokens.ARRAY_END)) {
|
||||
return builder.build().toArray();
|
||||
}
|
||||
}
|
||||
throw this.buffer.makeError("Reached end of document without array close");
|
||||
}
|
||||
|
||||
private long[] longArray() throws StringTagParseException {
|
||||
final List<Long> longs = new ArrayList<>();
|
||||
while (this.buffer.hasMore()) {
|
||||
final CharSequence value = this.buffer.skipWhitespace().takeUntil(Tokens.TYPE_LONG);
|
||||
try {
|
||||
longs.add(Long.valueOf(value.toString()));
|
||||
} catch (final NumberFormatException ex) {
|
||||
throw this.buffer.makeError("All elements of a long array must be longs!");
|
||||
}
|
||||
|
||||
if (this.separatorOrCompleteWith(Tokens.ARRAY_END)) {
|
||||
final long[] result = new long[longs.size()];
|
||||
for (int i = 0; i < longs.size(); ++i) { // todo yikes
|
||||
result[i] = longs.get(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
throw this.buffer.makeError("Reached end of document without array close");
|
||||
}
|
||||
|
||||
public String key() throws StringTagParseException {
|
||||
this.buffer.skipWhitespace();
|
||||
final char starChar = this.buffer.peek();
|
||||
try {
|
||||
if (starChar == Tokens.SINGLE_QUOTE || starChar == Tokens.DOUBLE_QUOTE) {
|
||||
return unescape(this.buffer.takeUntil(this.buffer.take()).toString());
|
||||
}
|
||||
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
while (this.buffer.peek() != ':') { // DO NOT CHECK FOR CHARACTER VALIDITY; LEGACY NBT ALLOWS ANY CHARACTER, EVEN WHEN UNQUOTED
|
||||
builder.append(this.buffer.take());
|
||||
}
|
||||
return builder.toString();
|
||||
} finally {
|
||||
this.buffer.expect(Tokens.COMPOUND_KEY_TERMINATOR);
|
||||
}
|
||||
}
|
||||
|
||||
public Tag tag() throws StringTagParseException {
|
||||
final char startToken = this.buffer.skipWhitespace().peek();
|
||||
switch (startToken) {
|
||||
case Tokens.COMPOUND_BEGIN:
|
||||
return this.compound();
|
||||
case Tokens.ARRAY_BEGIN:
|
||||
if (this.buffer.peek(2) == ';') { // we know we're an array tag
|
||||
return this.array(this.buffer.peek(1));
|
||||
} else {
|
||||
return this.list();
|
||||
}
|
||||
case Tokens.SINGLE_QUOTE:
|
||||
case Tokens.DOUBLE_QUOTE:
|
||||
// definitely a string tag
|
||||
this.buffer.advance();
|
||||
return new StringTag(unescape(this.buffer.takeUntil(startToken).toString()));
|
||||
default: // scalar
|
||||
return this.scalar();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A tag that is definitely some sort of scalar
|
||||
*
|
||||
* <p>Does not detect quoted strings, so </p>
|
||||
*
|
||||
* @return a parsed tag
|
||||
*/
|
||||
private Tag scalar() {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
boolean possiblyNumeric = true;
|
||||
while (this.buffer.hasMore()) {
|
||||
final char current = this.buffer.peek();
|
||||
if (possiblyNumeric && !Tokens.numeric(current)) {
|
||||
if (builder.length() != 0) {
|
||||
Tag result = null;
|
||||
try {
|
||||
switch (Character.toUpperCase(current)) { // try to read and return as a number
|
||||
// case Tokens.TYPE_INTEGER: // handled below, ints are ~special~
|
||||
case Tokens.TYPE_BYTE:
|
||||
result = new ByteTag(Byte.parseByte(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_SHORT:
|
||||
result = new ShortTag(Short.parseShort(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_LONG:
|
||||
result = new LongTag(Long.parseLong(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_FLOAT:
|
||||
result = new FloatTag(Float.parseFloat(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_DOUBLE:
|
||||
result = new DoubleTag(Double.parseDouble(builder.toString()));
|
||||
break;
|
||||
}
|
||||
} catch (final NumberFormatException ex) {
|
||||
possiblyNumeric = false; // fallback to treating as a String
|
||||
}
|
||||
if (result != null) {
|
||||
this.buffer.take();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (current == '\\') { // escape -- we are significantly more lenient than original format at the moment
|
||||
this.buffer.advance();
|
||||
builder.append(this.buffer.take());
|
||||
} else if (Tokens.id(current)) {
|
||||
builder.append(this.buffer.take());
|
||||
} else { // end of value
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if we run out of content without an explicit value separator, then we're either an integer or string tag -- all others have a character at the end
|
||||
final String built = builder.toString();
|
||||
if (possiblyNumeric) {
|
||||
try {
|
||||
return new IntTag(Integer.parseInt(built));
|
||||
} catch (final NumberFormatException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
return new StringTag(built);
|
||||
|
||||
}
|
||||
|
||||
private boolean separatorOrCompleteWith(final char endCharacter) throws StringTagParseException {
|
||||
if (this.buffer.skipWhitespace().peek() == endCharacter) {
|
||||
this.buffer.take();
|
||||
return true;
|
||||
}
|
||||
this.buffer.expect(Tokens.VALUE_SEPARATOR);
|
||||
if (this.buffer.skipWhitespace().peek() == endCharacter) {
|
||||
this.buffer.take();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove simple escape sequences from a string
|
||||
*
|
||||
* @param withEscapes input string with escapes
|
||||
* @return string with escapes processed
|
||||
*/
|
||||
private static String unescape(final String withEscapes) {
|
||||
int escapeIdx = withEscapes.indexOf(Tokens.ESCAPE_MARKER);
|
||||
if (escapeIdx == -1) { // nothing to unescape
|
||||
return withEscapes;
|
||||
}
|
||||
int lastEscape = 0;
|
||||
final StringBuilder output = new StringBuilder(withEscapes.length());
|
||||
do {
|
||||
output.append(withEscapes, lastEscape, escapeIdx);
|
||||
lastEscape = escapeIdx + 1;
|
||||
} while ((escapeIdx = withEscapes.indexOf(Tokens.ESCAPE_MARKER, lastEscape + 1)) != -1); // add one extra character to make sure we don't include escaped backslashes
|
||||
output.append(withEscapes.substring(lastEscape));
|
||||
return output.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.ByteArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ByteTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.DoubleTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.FloatTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.IntArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.IntTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ListTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.LongArrayTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.LongTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.ShortTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.StringTag;
|
||||
import com.github.steveice10.opennbt.tag.builtin.Tag;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* See https://github.com/KyoriPowered/adventure.
|
||||
*/
|
||||
/* package */ final class TagStringWriter implements AutoCloseable {
|
||||
private final Appendable out;
|
||||
private final String indent = " "; // TODO: pretty-printing
|
||||
private int level;
|
||||
/**
|
||||
* Whether a {@link Tokens#VALUE_SEPARATOR} needs to be printed before the beginning of the next object.
|
||||
*/
|
||||
private boolean needsSeparator;
|
||||
|
||||
public TagStringWriter(final Appendable out) {
|
||||
this.out = out;
|
||||
}
|
||||
|
||||
// NBT-specific
|
||||
|
||||
public TagStringWriter writeTag(final Tag tag) throws IOException {
|
||||
if (tag instanceof CompoundTag) {
|
||||
return this.writeCompound((CompoundTag) tag);
|
||||
} else if (tag instanceof ListTag) {
|
||||
return this.writeList((ListTag) tag);
|
||||
} else if (tag instanceof ByteArrayTag) {
|
||||
return this.writeByteArray((ByteArrayTag) tag);
|
||||
} else if (tag instanceof IntArrayTag) {
|
||||
return this.writeIntArray((IntArrayTag) tag);
|
||||
} else if (tag instanceof LongArrayTag) {
|
||||
return this.writeLongArray((LongArrayTag) tag);
|
||||
} else if (tag instanceof StringTag) {
|
||||
return this.value(((StringTag) tag).getValue(), Tokens.EOF);
|
||||
} else if (tag instanceof ByteTag) {
|
||||
return this.value(Byte.toString(((ByteTag) tag).asByte()), Tokens.TYPE_BYTE);
|
||||
} else if (tag instanceof ShortTag) {
|
||||
return this.value(Short.toString(((ShortTag) tag).asShort()), Tokens.TYPE_SHORT);
|
||||
} else if (tag instanceof IntTag) {
|
||||
return this.value(Integer.toString(((IntTag) tag).asInt()), Tokens.TYPE_INT);
|
||||
} else if (tag instanceof LongTag) {
|
||||
return this.value(Long.toString(((LongTag) tag).asLong()), Tokens.TYPE_LONG);
|
||||
} else if (tag instanceof FloatTag) {
|
||||
return this.value(Float.toString(((FloatTag) tag).asFloat()), Tokens.TYPE_FLOAT);
|
||||
} else if (tag instanceof DoubleTag) {
|
||||
return this.value(Double.toString(((DoubleTag) tag).asDouble()), Tokens.TYPE_DOUBLE);
|
||||
} else {
|
||||
throw new IOException("Unknown tag type: " + tag.getClass().getSimpleName());
|
||||
// unknown!
|
||||
}
|
||||
}
|
||||
|
||||
private TagStringWriter writeCompound(final CompoundTag tag) throws IOException {
|
||||
this.beginCompound();
|
||||
for (Map.Entry<String, Tag> entry : tag.entrySet()) {
|
||||
this.key(entry.getKey());
|
||||
this.writeTag(entry.getValue());
|
||||
}
|
||||
this.endCompound();
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter writeList(final ListTag tag) throws IOException {
|
||||
this.beginList();
|
||||
for (final Tag el : tag) {
|
||||
this.printAndResetSeparator();
|
||||
this.writeTag(el);
|
||||
}
|
||||
this.endList();
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter writeByteArray(final ByteArrayTag tag) throws IOException {
|
||||
this.beginArray(Tokens.TYPE_BYTE);
|
||||
|
||||
final byte[] value = tag.getValue();
|
||||
for (int i = 0, length = value.length; i < length; i++) {
|
||||
this.printAndResetSeparator();
|
||||
this.value(Byte.toString(value[i]), Tokens.TYPE_BYTE);
|
||||
}
|
||||
this.endArray();
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter writeIntArray(final IntArrayTag tag) throws IOException {
|
||||
this.beginArray(Tokens.TYPE_INT);
|
||||
|
||||
final int[] value = tag.getValue();
|
||||
for (int i = 0, length = value.length; i < length; i++) {
|
||||
this.printAndResetSeparator();
|
||||
this.value(Integer.toString(value[i]), Tokens.TYPE_INT);
|
||||
}
|
||||
this.endArray();
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter writeLongArray(final LongArrayTag tag) throws IOException {
|
||||
this.beginArray(Tokens.TYPE_LONG);
|
||||
|
||||
final long[] value = tag.getValue();
|
||||
for (int i = 0, length = value.length; i < length; i++) {
|
||||
this.printAndResetSeparator();
|
||||
this.value(Long.toString(value[i]), Tokens.TYPE_LONG);
|
||||
}
|
||||
this.endArray();
|
||||
return this;
|
||||
}
|
||||
|
||||
// Value types
|
||||
|
||||
public TagStringWriter beginCompound() throws IOException {
|
||||
this.printAndResetSeparator();
|
||||
this.level++;
|
||||
this.out.append(Tokens.COMPOUND_BEGIN);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagStringWriter endCompound() throws IOException {
|
||||
this.out.append(Tokens.COMPOUND_END);
|
||||
this.level--;
|
||||
this.needsSeparator = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagStringWriter key(final String key) throws IOException {
|
||||
this.printAndResetSeparator();
|
||||
this.writeMaybeQuoted(key, false);
|
||||
this.out.append(Tokens.COMPOUND_KEY_TERMINATOR); // TODO: spacing/pretty-printing
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagStringWriter value(final String value, final char valueType) throws IOException {
|
||||
if (valueType == Tokens.EOF) { // string doesn't have its type
|
||||
this.writeMaybeQuoted(value, true);
|
||||
} else {
|
||||
this.out.append(value);
|
||||
if (valueType != Tokens.TYPE_INT) {
|
||||
this.out.append(valueType);
|
||||
}
|
||||
}
|
||||
this.needsSeparator = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagStringWriter beginList() throws IOException {
|
||||
this.printAndResetSeparator();
|
||||
this.level++;
|
||||
this.out.append(Tokens.ARRAY_BEGIN);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagStringWriter endList() throws IOException {
|
||||
this.out.append(Tokens.ARRAY_END);
|
||||
this.level--;
|
||||
this.needsSeparator = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter beginArray(final char type) throws IOException {
|
||||
this.beginList()
|
||||
.out.append(type)
|
||||
.append(Tokens.ARRAY_SIGNATURE_SEPARATOR);
|
||||
return this;
|
||||
}
|
||||
|
||||
private TagStringWriter endArray() throws IOException {
|
||||
return this.endList();
|
||||
}
|
||||
|
||||
private void writeMaybeQuoted(final String content, boolean requireQuotes) throws IOException {
|
||||
if (!requireQuotes) {
|
||||
for (int i = 0; i < content.length(); ++i) {
|
||||
if (!Tokens.id(content.charAt(i))) {
|
||||
requireQuotes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requireQuotes) { // TODO: single quotes
|
||||
this.out.append(Tokens.DOUBLE_QUOTE);
|
||||
this.out.append(escape(content, Tokens.DOUBLE_QUOTE));
|
||||
this.out.append(Tokens.DOUBLE_QUOTE);
|
||||
} else {
|
||||
this.out.append(content);
|
||||
}
|
||||
}
|
||||
|
||||
private static String escape(final String content, final char quoteChar) {
|
||||
final StringBuilder output = new StringBuilder(content.length());
|
||||
for (int i = 0; i < content.length(); ++i) {
|
||||
final char c = content.charAt(i);
|
||||
if (c == quoteChar || c == '\\') {
|
||||
output.append(Tokens.ESCAPE_MARKER);
|
||||
}
|
||||
output.append(c);
|
||||
}
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
private void printAndResetSeparator() throws IOException {
|
||||
if (this.needsSeparator) {
|
||||
this.out.append(Tokens.VALUE_SEPARATOR);
|
||||
this.needsSeparator = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (this.level != 0) {
|
||||
throw new IllegalStateException("Document finished with unbalanced start and end objects");
|
||||
}
|
||||
if (this.out instanceof Writer) {
|
||||
((Writer) this.out).flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is part of adventure, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2017-2020 KyoriPowered
|
||||
*
|
||||
* 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 com.viaversion.viaversion.api.minecraft.nbt;
|
||||
|
||||
/**
|
||||
* See https://github.com/KyoriPowered/adventure.
|
||||
*/
|
||||
/* package */ final class Tokens {
|
||||
// Compounds
|
||||
static final char COMPOUND_BEGIN = '{';
|
||||
static final char COMPOUND_END = '}';
|
||||
static final char COMPOUND_KEY_TERMINATOR = ':';
|
||||
|
||||
// Arrays
|
||||
static final char ARRAY_BEGIN = '[';
|
||||
static final char ARRAY_END = ']';
|
||||
static final char ARRAY_SIGNATURE_SEPARATOR = ';';
|
||||
|
||||
static final char VALUE_SEPARATOR = ',';
|
||||
|
||||
static final char SINGLE_QUOTE = '\'';
|
||||
static final char DOUBLE_QUOTE = '"';
|
||||
static final char ESCAPE_MARKER = '\\';
|
||||
|
||||
static final char TYPE_BYTE = 'B';
|
||||
static final char TYPE_SHORT = 'S';
|
||||
static final char TYPE_INT = 'I'; // array only
|
||||
static final char TYPE_LONG = 'L';
|
||||
static final char TYPE_FLOAT = 'F';
|
||||
static final char TYPE_DOUBLE = 'D';
|
||||
|
||||
static final char EOF = '\0';
|
||||
|
||||
private Tokens() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if a character is a valid component in an identifier
|
||||
*
|
||||
* <p>An identifier character must match the expression {@code [a-zA-Z0-9_+.-]}</p>
|
||||
*
|
||||
* @param c the character
|
||||
* @return identifier
|
||||
*/
|
||||
static boolean id(final char c) {
|
||||
return (c >= 'a' && c <= 'z')
|
||||
|| (c >= 'A' && c <= 'Z')
|
||||
|| (c >= '0' && c <= '9')
|
||||
|| c == '-' || c == '_'
|
||||
|| c == '.' || c == '+';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether a character could be at some position in a number.
|
||||
* <p>
|
||||
* A string passing this check does not necessarily mean it is syntactically valid
|
||||
*
|
||||
* @param c character to check
|
||||
* @return if possibly part of a number
|
||||
*/
|
||||
static boolean numeric(final char c) {
|
||||
return (c >= '0' && c <= '9') // digit
|
||||
|| c == '+' || c == '-' // positive or negative
|
||||
|| c == 'e' || c == 'E' // exponent
|
||||
|| c == '.'; // decimal
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* @param <T> task type
|
||||
*/
|
||||
public interface PlatformTask<T> {
|
||||
|
||||
/**
|
||||
* Returns the actual object represented by this task/task id.
|
||||
* Null if task cannot be instantly tracked.
|
||||
*
|
||||
* @return platform based object, or null if not tracked/cancellable
|
||||
*/
|
||||
@Nullable T getObject();
|
||||
|
||||
/**
|
||||
* Cancels the task.
|
||||
*
|
||||
* @throws IllegalArgumentException if the task is not cancellable
|
||||
*/
|
||||
void cancel();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform;
|
||||
|
||||
public interface UnsupportedSoftware {
|
||||
|
||||
/**
|
||||
* Returns the software name.
|
||||
*
|
||||
* @return software name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the reason for being unsupported by Via.
|
||||
*
|
||||
* @return reason for being unsupported
|
||||
*/
|
||||
String getReason();
|
||||
|
||||
/**
|
||||
* Returns whether the unsupported software is present.
|
||||
*
|
||||
* @return true if the unsupported software is found
|
||||
*/
|
||||
boolean findMatch();
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import it.unimi.dsi.fastutil.ints.IntSortedSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSortedSets;
|
||||
|
||||
public interface ViaInjector {
|
||||
|
||||
/**
|
||||
* Inject into the current Platform
|
||||
*
|
||||
* @throws Exception If there is an error with injecting
|
||||
*/
|
||||
void inject() throws Exception;
|
||||
|
||||
/**
|
||||
* Uninject into the current Platform
|
||||
*
|
||||
* @throws Exception If there is an error with uninjecting
|
||||
*/
|
||||
void uninject() throws Exception;
|
||||
|
||||
/**
|
||||
* Returns true if the protocol version cannot be used in the early init.
|
||||
* Namely, this returns true for forks of Vanilla without extra API to get the protocol version.
|
||||
*
|
||||
* @return true if the protocol version cannot be used in the early init
|
||||
*/
|
||||
default boolean lateProtocolVersionSetting() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the server protocol version.
|
||||
* For proxies, this returns the lowest supported protocol version.
|
||||
*
|
||||
* @return server protocol version
|
||||
* @throws Exception if there is an error with getting this info, eg. not binded
|
||||
* @see ViaPlatform#isProxy()
|
||||
*/
|
||||
int getServerProtocolVersion() throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the supported server protocol versions.
|
||||
*
|
||||
* @return server protocol versions
|
||||
* @throws Exception if there is an error with getting this info, eg. not binded
|
||||
* @see ViaPlatform#isProxy()
|
||||
*/
|
||||
default IntSortedSet getServerProtocolVersions() throws Exception {
|
||||
return IntSortedSets.singleton(getServerProtocolVersion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the encoder for then netty pipeline for this platform.
|
||||
*
|
||||
* @return The name
|
||||
*/
|
||||
String getEncoderName();
|
||||
|
||||
/**
|
||||
* Get the name of the decoder for then netty pipeline for this platform.
|
||||
*
|
||||
* @return The name
|
||||
*/
|
||||
String getDecoderName();
|
||||
|
||||
/**
|
||||
* Get any relevant data for debugging injection issues.
|
||||
*
|
||||
* @return JSONObject containing the data
|
||||
*/
|
||||
JsonObject getDump();
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.viaversion.viaversion.api.ViaAPI;
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
|
||||
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* ViaPlatform represents a platform ViaVersion runs on
|
||||
*
|
||||
* @param <T> - The player type for the platform, used for API related methods
|
||||
*/
|
||||
public interface ViaPlatform<T> {
|
||||
|
||||
/**
|
||||
* Get the logger for this platform
|
||||
*
|
||||
* @return Java Logger (may be a wrapper)
|
||||
*/
|
||||
Logger getLogger();
|
||||
|
||||
/**
|
||||
* Get the platform name
|
||||
*
|
||||
* @return Platform Name (simply its name)
|
||||
*/
|
||||
String getPlatformName();
|
||||
|
||||
/**
|
||||
* Get the platform version
|
||||
*
|
||||
* @return Platform version
|
||||
*/
|
||||
String getPlatformVersion();
|
||||
|
||||
/**
|
||||
* Returns true if the server Via is running on is a proxy server.
|
||||
*
|
||||
* @return true if the platform is a proxy
|
||||
*/
|
||||
default boolean isProxy() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plugin version
|
||||
*
|
||||
* @return Plugin version as a semver string
|
||||
*/
|
||||
String getPluginVersion();
|
||||
|
||||
/**
|
||||
* Run a task Async
|
||||
*
|
||||
* @param runnable The task to run
|
||||
* @return The Task ID
|
||||
*/
|
||||
PlatformTask runAsync(Runnable runnable);
|
||||
|
||||
/**
|
||||
* Run a task Sync
|
||||
*
|
||||
* @param runnable The task to run
|
||||
* @return The Task ID
|
||||
*/
|
||||
PlatformTask runSync(Runnable runnable);
|
||||
|
||||
/**
|
||||
* Run a task Sync after a interval
|
||||
* This must be only used after plugin enable.
|
||||
*
|
||||
* @param runnable The task to run
|
||||
* @param ticks The interval to run it after
|
||||
* @return The Task ID
|
||||
*/
|
||||
PlatformTask runSync(Runnable runnable, long ticks);
|
||||
|
||||
/**
|
||||
* Run a task at a repeating interval.
|
||||
* Initial interval is the same as repeat.
|
||||
*
|
||||
* @param runnable The task to run
|
||||
* @param ticks The interval to run it at
|
||||
* @return The Task ID
|
||||
*/
|
||||
PlatformTask runRepeatingSync(Runnable runnable, long ticks);
|
||||
|
||||
/**
|
||||
* Get the online players
|
||||
*
|
||||
* @return Array of ViaCommandSender
|
||||
*/
|
||||
ViaCommandSender[] getOnlinePlayers();
|
||||
|
||||
/**
|
||||
* Send a message to a player
|
||||
*
|
||||
* @param uuid The player's UUID
|
||||
* @param message The message to send
|
||||
*/
|
||||
void sendMessage(UUID uuid, String message);
|
||||
|
||||
/**
|
||||
* Kick a player for a reason
|
||||
*
|
||||
* @param uuid The player's UUID
|
||||
* @param message The message to kick them with
|
||||
* @return True if it was successful
|
||||
*/
|
||||
boolean kickPlayer(UUID uuid, String message);
|
||||
|
||||
/**
|
||||
* Disconnects an UserConnection for a reason
|
||||
*
|
||||
* @param connection The UserConnection
|
||||
* @param message The message to kick them with
|
||||
* @return True if it was successful
|
||||
*/
|
||||
default boolean disconnect(UserConnection connection, String message) {
|
||||
if (connection.isClientSide()) return false;
|
||||
UUID uuid = connection.getProtocolInfo().getUuid();
|
||||
if (uuid == null) return false;
|
||||
return kickPlayer(uuid, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the plugin is enabled.
|
||||
*
|
||||
* @return True if it is enabled
|
||||
*/
|
||||
boolean isPluginEnabled();
|
||||
|
||||
/**
|
||||
* Get the API for this platform
|
||||
*
|
||||
* @return The API for the platform
|
||||
*/
|
||||
ViaAPI<T> getApi();
|
||||
|
||||
/**
|
||||
* Get the config API for this platform
|
||||
*
|
||||
* @return The config API
|
||||
*/
|
||||
ViaVersionConfig getConf();
|
||||
|
||||
/**
|
||||
* Get the backend configuration provider for this platform.
|
||||
* (On some platforms this returns the same as getConf())
|
||||
*
|
||||
* @return The configuration provider
|
||||
*/
|
||||
ConfigurationProvider getConfigurationProvider();
|
||||
|
||||
/**
|
||||
* Get ViaVersions's data folder.
|
||||
*
|
||||
* @return data folder
|
||||
*/
|
||||
File getDataFolder();
|
||||
|
||||
/**
|
||||
* Called when a reload happens
|
||||
*/
|
||||
void onReload();
|
||||
|
||||
/**
|
||||
* Get the JSON data required for /viaversion dump
|
||||
*
|
||||
* @return The json data
|
||||
*/
|
||||
JsonObject getDump();
|
||||
|
||||
/**
|
||||
* Get if older clients are allowed to be used using ViaVersion.
|
||||
* (Only 1.9 on 1.9.2 server is supported by ViaVersion alone)
|
||||
*
|
||||
* @return True if allowed
|
||||
*/
|
||||
boolean isOldClientsAllowed();
|
||||
|
||||
/**
|
||||
* Returns an immutable collection of classes to be checked as unsupported software with their software name.
|
||||
* If any of the classes exist at runtime, a warning about their potential instability will be given to the console.
|
||||
*
|
||||
* @return immutable collection of unsupported software to be checked
|
||||
*/
|
||||
default Collection<UnsupportedSoftware> getUnsupportedSoftwareClasses() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform;
|
||||
|
||||
public interface ViaPlatformLoader {
|
||||
|
||||
/**
|
||||
* Initialise the loading for a platform, eg. registering listeners / providers / events etc.
|
||||
*/
|
||||
void load();
|
||||
|
||||
void unload();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform.providers;
|
||||
|
||||
public interface Provider {
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.platform.providers;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ViaProviders {
|
||||
private final Map<Class<? extends Provider>, Provider> providers = new HashMap<>();
|
||||
private final List<Class<? extends Provider>> lonelyProviders = new ArrayList<>();
|
||||
|
||||
public void require(Class<? extends Provider> provider) {
|
||||
lonelyProviders.add(provider);
|
||||
}
|
||||
|
||||
public <T extends Provider> void register(Class<T> provider, T value) {
|
||||
providers.put(provider, value);
|
||||
}
|
||||
|
||||
public <T extends Provider> void use(Class<T> provider, T value) {
|
||||
lonelyProviders.remove(provider);
|
||||
providers.put(provider, value);
|
||||
}
|
||||
|
||||
public @Nullable <T extends Provider> T get(Class<T> provider) {
|
||||
Provider rawProvider = providers.get(provider);
|
||||
if (rawProvider != null) {
|
||||
return (T) rawProvider;
|
||||
} else {
|
||||
if (lonelyProviders.contains(provider)) {
|
||||
throw new IllegalStateException("There was no provider for " + provider + ", one is required!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2021 ViaVersion and 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 com.viaversion.viaversion.api.protocol;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
|
||||
import com.viaversion.viaversion.api.protocol.packet.Direction;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketType;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||
import com.viaversion.viaversion.exception.CancelException;
|
||||
import com.viaversion.viaversion.exception.InformativeException;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 extends ClientboundPacketType, S1 extends ServerboundPacketType, S2 extends ServerboundPacketType>
|
||||
implements Protocol<C1, C2, S1, S2> {
|
||||
private final Map<Packet, ProtocolPacket> serverbound = new HashMap<>();
|
||||
private final Map<Packet, ProtocolPacket> clientbound = new HashMap<>();
|
||||
private final Map<Class<?>, Object> storedObjects = new HashMap<>(); // currently only used for MetadataRewriters
|
||||
protected final Class<C1> oldClientboundPacketEnum;
|
||||
protected final Class<C2> newClientboundPacketEnum;
|
||||
protected final Class<S1> oldServerboundPacketEnum;
|
||||
protected final Class<S2> newServerboundPacketEnum;
|
||||
private boolean initialized;
|
||||
|
||||
protected AbstractProtocol() {
|
||||
this(null, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a protocol with automated id mapping if the respective enums are not null.
|
||||
*/
|
||||
protected AbstractProtocol(@Nullable Class<C1> oldClientboundPacketEnum, @Nullable Class<C2> clientboundPacketEnum,
|
||||
@Nullable Class<S1> oldServerboundPacketEnum, @Nullable Class<S2> serverboundPacketEnum) {
|
||||
this.oldClientboundPacketEnum = oldClientboundPacketEnum;
|
||||
this.newClientboundPacketEnum = clientboundPacketEnum;
|
||||
this.oldServerboundPacketEnum = oldServerboundPacketEnum;
|
||||
this.newServerboundPacketEnum = serverboundPacketEnum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void initialize() {
|
||||
Preconditions.checkArgument(!initialized);
|
||||
initialized = true;
|
||||
|
||||
registerPackets();
|
||||
|
||||
// Register the rest of the ids with no handlers if necessary
|
||||
if (oldClientboundPacketEnum != null && newClientboundPacketEnum != null
|
||||
&& oldClientboundPacketEnum != newClientboundPacketEnum) {
|
||||
registerClientboundChannelIdChanges();
|
||||
}
|
||||
if (oldServerboundPacketEnum != null && newServerboundPacketEnum != null
|
||||
&& oldServerboundPacketEnum != newServerboundPacketEnum) {
|
||||
registerServerboundChannelIdChanges();
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerClientboundChannelIdChanges() {
|
||||
ClientboundPacketType[] newConstants = newClientboundPacketEnum.getEnumConstants();
|
||||
Map<String, ClientboundPacketType> newClientboundPackets = new HashMap<>(newConstants.length);
|
||||
for (ClientboundPacketType newConstant : newConstants) {
|
||||
newClientboundPackets.put(newConstant.getName(), newConstant);
|
||||
}
|
||||
|
||||
for (ClientboundPacketType packet : oldClientboundPacketEnum.getEnumConstants()) {
|
||||
ClientboundPacketType mappedPacket = newClientboundPackets.get(packet.getName());
|
||||
int oldId = packet.getId();
|
||||
if (mappedPacket == null) {
|
||||
// Packet doesn't exist on new client
|
||||
Preconditions.checkArgument(hasRegisteredClientbound(State.PLAY, oldId),
|
||||
"Packet " + packet + " in " + getClass().getSimpleName() + " has no mapping - it needs to be manually cancelled or remapped!");
|
||||
continue;
|
||||
}
|
||||
|
||||
int newId = mappedPacket.getId();
|
||||
if (!hasRegisteredClientbound(State.PLAY, oldId)) {
|
||||
registerClientbound(State.PLAY, oldId, newId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerServerboundChannelIdChanges() {
|
||||
ServerboundPacketType[] oldConstants = oldServerboundPacketEnum.getEnumConstants();
|
||||
Map<String, ServerboundPacketType> oldServerboundConstants = new HashMap<>(oldConstants.length);
|
||||
for (ServerboundPacketType oldConstant : oldConstants) {
|
||||
oldServerboundConstants.put(oldConstant.getName(), oldConstant);
|
||||
}
|
||||
|
||||
for (ServerboundPacketType packet : newServerboundPacketEnum.getEnumConstants()) {
|
||||
ServerboundPacketType mappedPacket = oldServerboundConstants.get(packet.getName());
|
||||
int newId = packet.getId();
|
||||
if (mappedPacket == null) {
|
||||
// Packet doesn't exist on old server
|
||||
Preconditions.checkArgument(hasRegisteredServerbound(State.PLAY, newId),
|
||||
"Packet " + packet + " in " + getClass().getSimpleName() + " has no mapping - it needs to be manually cancelled or remapped!");
|
||||
continue;
|
||||
}
|
||||
|
||||
int oldId = mappedPacket.getId();
|
||||
if (!hasRegisteredServerbound(State.PLAY, newId)) {
|
||||
registerServerbound(State.PLAY, oldId, newId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the packets for this protocol. To be overriden.
|
||||
*/
|
||||
protected void registerPackets() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void loadMappingData() {
|
||||
getMappingData().load();
|
||||
onMappingDataLoaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after {@link #loadMappingData()} is called; load extra mapping data for the protocol.
|
||||
* <p>
|
||||
* To be overridden if needed.
|
||||
*/
|
||||
protected void onMappingDataLoaded() {
|
||||
}
|
||||
|
||||
protected void addEntityTracker(UserConnection connection, EntityTracker tracker) {
|
||||
connection.addEntityTracker(this.getClass(), tracker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerServerbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) {
|
||||
ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper);
|
||||
Packet packet = new Packet(state, newPacketID);
|
||||
if (!override && serverbound.containsKey(packet)) {
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, packet + " already registered!" +
|
||||
" If this override is intentional, set override to true. Stacktrace: ", new Exception());
|
||||
}
|
||||
serverbound.put(packet, protocolPacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelServerbound(State state, int oldPacketID, int newPacketID) {
|
||||
registerServerbound(state, oldPacketID, newPacketID, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(PacketWrapper::cancel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelClientbound(State state, int oldPacketID, int newPacketID) {
|
||||
registerClientbound(state, oldPacketID, newPacketID, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(PacketWrapper::cancel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerClientbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) {
|
||||
ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper);
|
||||
Packet packet = new Packet(state, oldPacketID);
|
||||
if (!override && clientbound.containsKey(packet)) {
|
||||
Via.getPlatform().getLogger().log(Level.WARNING, packet + " already registered!" +
|
||||
" If override is intentional, set override to true. Stacktrace: ", new Exception());
|
||||
}
|
||||
clientbound.put(packet, protocolPacket);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerClientbound(C1 packetType, @Nullable PacketRemapper packetRemapper) {
|
||||
checkPacketType(packetType, packetType.getClass() == oldClientboundPacketEnum);
|
||||
|
||||
ClientboundPacketType mappedPacket = oldClientboundPacketEnum == newClientboundPacketEnum ? packetType
|
||||
: Arrays.stream(newClientboundPacketEnum.getEnumConstants()).filter(en -> en.getName().equals(packetType.getName())).findAny().orElse(null);
|
||||
Preconditions.checkNotNull(mappedPacket, "Packet type " + packetType + " in " + packetType.getClass().getSimpleName() + " could not be automatically mapped!");
|
||||
|
||||
int oldId = packetType.getId();
|
||||
int newId = mappedPacket.getId();
|
||||
registerClientbound(State.PLAY, oldId, newId, packetRemapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerClientbound(C1 packetType, @Nullable C2 mappedPacketType, @Nullable PacketRemapper packetRemapper) {
|
||||
checkPacketType(packetType, packetType.getClass() == oldClientboundPacketEnum);
|
||||
checkPacketType(mappedPacketType, mappedPacketType == null || mappedPacketType.getClass() == newClientboundPacketEnum);
|
||||
|
||||
registerClientbound(State.PLAY, packetType.getId(), mappedPacketType != null ? mappedPacketType.getId() : -1, packetRemapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelClientbound(C1 packetType) {
|
||||
cancelClientbound(State.PLAY, packetType.getId(), packetType.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerServerbound(S2 packetType, @Nullable PacketRemapper packetRemapper) {
|
||||
checkPacketType(packetType, packetType.getClass() == newServerboundPacketEnum);
|
||||
|
||||
ServerboundPacketType mappedPacket = oldServerboundPacketEnum == newServerboundPacketEnum ? packetType
|
||||
: Arrays.stream(oldServerboundPacketEnum.getEnumConstants()).filter(en -> en.getName().equals(packetType.getName())).findAny().orElse(null);
|
||||
Preconditions.checkNotNull(mappedPacket, "Packet type " + packetType + " in " + packetType.getClass().getSimpleName() + " could not be automatically mapped!");
|
||||
|
||||
int oldId = mappedPacket.getId();
|
||||
int newId = packetType.getId();
|
||||
registerServerbound(State.PLAY, oldId, newId, packetRemapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerServerbound(S2 packetType, @Nullable S1 mappedPacketType, @Nullable PacketRemapper packetRemapper) {
|
||||
checkPacketType(packetType, packetType.getClass() == newServerboundPacketEnum);
|
||||
checkPacketType(mappedPacketType, mappedPacketType == null || mappedPacketType.getClass() == oldServerboundPacketEnum);
|
||||
|
||||
registerServerbound(State.PLAY, mappedPacketType != null ? mappedPacketType.getId() : -1, packetType.getId(), packetRemapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelServerbound(S2 packetType) {
|
||||
Preconditions.checkArgument(packetType.getClass() == newServerboundPacketEnum);
|
||||
cancelServerbound(State.PLAY, -1, packetType.getId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasRegisteredClientbound(State state, int oldPacketID) {
|
||||
Packet packet = new Packet(state, oldPacketID);
|
||||
return clientbound.containsKey(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRegisteredServerbound(State state, int newPacketId) {
|
||||
Packet packet = new Packet(state, newPacketId);
|
||||
return serverbound.containsKey(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transform(Direction direction, State state, PacketWrapper packetWrapper) throws Exception {
|
||||
Packet statePacket = new Packet(state, packetWrapper.getId());
|
||||
Map<Packet, ProtocolPacket> packetMap = (direction == Direction.CLIENTBOUND ? clientbound : serverbound);
|
||||
ProtocolPacket protocolPacket = packetMap.get(statePacket);
|
||||
if (protocolPacket == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Write packet id
|
||||
int oldId = packetWrapper.getId();
|
||||
int newId = direction == Direction.CLIENTBOUND ? protocolPacket.getNewID() : protocolPacket.getOldID();
|
||||
packetWrapper.setId(newId);
|
||||
|
||||
PacketRemapper remapper = protocolPacket.getRemapper();
|
||||
if (remapper != null) {
|
||||
try {
|
||||
remapper.remap(packetWrapper);
|
||||
} catch (InformativeException e) { // Catch InformativeExceptions, pass through CancelExceptions
|
||||
throwRemapError(direction, state, oldId, newId, e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (packetWrapper.isCancelled()) {
|
||||
throw CancelException.generate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void throwRemapError(Direction direction, State state, int oldId, int newId, InformativeException e) throws InformativeException {
|
||||
// Don't print errors during handshake
|
||||
if (state == State.HANDSHAKE) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
Class<? extends PacketType> packetTypeClass = state == State.PLAY ? (direction == Direction.CLIENTBOUND ? oldClientboundPacketEnum : newServerboundPacketEnum) : null;
|
||||
if (packetTypeClass != null) {
|
||||
PacketType[] enumConstants = packetTypeClass.getEnumConstants();
|
||||
PacketType packetType = oldId < enumConstants.length && oldId >= 0 ? enumConstants[oldId] : null;
|
||||
Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName() + " IN REMAP OF " + packetType + " (" + toNiceHex(oldId) + ")");
|
||||
} else {
|
||||
Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName()
|
||||
+ " IN REMAP OF " + toNiceHex(oldId) + "->" + toNiceHex(newId));
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
private String toNiceHex(int id) {
|
||||
String hex = Integer.toHexString(id).toUpperCase();
|
||||
return (hex.length() == 1 ? "0x0" : "0x") + hex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param packetType packet type
|
||||
* @param isValid expression to check the packet's validity
|
||||
* @throws IllegalArgumentException if the given expression is not met
|
||||
*/
|
||||
private void checkPacketType(PacketType packetType, boolean isValid) {
|
||||
if (!isValid) {
|
||||
throw new IllegalArgumentException("Packet type " + packetType + " in " + packetType.getClass().getSimpleName() + " is taken from the wrong enum");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable <T> T get(Class<T> objectClass) {
|
||||
return (T) storedObjects.get(objectClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(Object object) {
|
||||
storedObjects.put(object.getClass(), object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMappingDataToLoad() {
|
||||
return getMappingData() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Protocol:" + getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public static final class Packet {
|
||||
private final State state;
|
||||
private final int packetId;
|
||||
|
||||
public Packet(State state, int packetId) {
|
||||
this.state = state;
|
||||
this.packetId = packetId;
|
||||
}
|
||||
|
||||
public State getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public int getPacketId() {
|
||||
return packetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Packet{" + "state=" + state + ", packetId=" + packetId + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Packet that = (Packet) o;
|
||||
return packetId == that.packetId && state == that.state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = state != null ? state.hashCode() : 0;
|
||||
result = 31 * result + packetId;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ProtocolPacket {
|
||||
private final State state;
|
||||
private final int oldID;
|
||||
private final int newID;
|
||||
private final PacketRemapper remapper;
|
||||
|
||||
public ProtocolPacket(State state, int oldID, int newID, @Nullable PacketRemapper remapper) {
|
||||
this.state = state;
|
||||
this.oldID = oldID;
|
||||
this.newID = newID;
|
||||
this.remapper = remapper;
|
||||
}
|
||||
|
||||
public State getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public int getOldID() {
|
||||
return oldID;
|
||||
}
|
||||
|
||||
public int getNewID() {
|
||||
return newID;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PacketRemapper getRemapper() {
|
||||
return remapper;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 690 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user