Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adb10f5fe7 | ||
|
|
a268d3d298 | ||
|
|
b60771e96e | ||
|
|
435a986068 | ||
|
|
6c58f0980c | ||
|
|
e3dde71821 | ||
|
|
47b15e5fef | ||
|
|
ed196bdf99 | ||
|
|
9247e87bbf | ||
|
|
08727f959f | ||
|
|
78342da180 | ||
|
|
2b735172bd | ||
|
|
b032a868bb | ||
|
|
c4fa3b0ff8 | ||
|
|
0c3a1803e1 | ||
|
|
04f9971dee | ||
|
|
9c3395b76b | ||
|
|
f9bbb5b1a3 | ||
|
|
087bbdce1f | ||
|
|
494bf62535 | ||
|
|
4f2a5bb7e2 | ||
|
|
1c511a82b2 | ||
|
|
0c39723d1a | ||
|
|
322af00e80 | ||
|
|
a88747d904 | ||
|
|
e194d27bea | ||
|
|
22daa60eb6 | ||
|
|
6eca07966c | ||
|
|
56cc711c01 | ||
|
|
c2ee558235 | ||
|
|
c8a010c390 | ||
|
|
53c54485eb | ||
|
|
f42a308f2c | ||
|
|
44250cbb99 | ||
|
|
55ffe72198 | ||
|
|
a47dd2ecdb | ||
|
|
8a5233b6a1 | ||
|
|
c8a1279e75 | ||
|
|
57ef90e851 | ||
|
|
2262681351 | ||
|
|
56e1d0a69d | ||
|
|
63ffb51df5 | ||
|
|
b33bd2ac2b | ||
|
|
1afff77a0f | ||
|
|
26af09f2a4 | ||
|
|
a8e475dbf0 | ||
|
|
6388021c6d | ||
|
|
f4aa96a5f8 | ||
|
|
6baae5e4f7 | ||
|
|
189b244a3a | ||
|
|
12d538fe0d | ||
|
|
34f0dbf642 | ||
|
|
548f80bb7c | ||
|
|
9113a77331 | ||
|
|
e3e85db02a | ||
|
|
c4d9209c81 | ||
|
|
24d887a53d | ||
|
|
702ced200e | ||
|
|
40f5cb6e71 | ||
|
|
7ab0c41be6 | ||
|
|
66b21431f2 | ||
|
|
c6cd655f7e | ||
|
|
e9bccda259 | ||
|
|
9a34ff2a51 | ||
|
|
f01d9408de | ||
|
|
15ff7b4c9d | ||
|
|
d47765ce45 | ||
|
|
b82b067745 | ||
|
|
b7005f2400 | ||
|
|
312fe3a851 | ||
|
|
69d50fa992 | ||
|
|
1308dcb8dd | ||
|
|
b4ecba8382 | ||
|
|
3529d6a229 | ||
|
|
4213c4cce5 | ||
|
|
3d3e09977c | ||
|
|
90feac8c83 | ||
|
|
80a807e366 | ||
|
|
3eba8ba922 | ||
|
|
71a68bf36e | ||
|
|
e67501cde3 | ||
|
|
9aa7f5e879 | ||
|
|
854ecf0b47 | ||
|
|
f538f25d63 | ||
|
|
48a7fdc1d1 | ||
|
|
1d5ae0e3e0 | ||
|
|
f0462085d3 | ||
|
|
7dc7b62cc9 | ||
|
|
b9f80754e0 | ||
|
|
5b9f775743 | ||
|
|
0e66228a96 | ||
|
|
8df48bc378 | ||
|
|
d36d5d6def | ||
|
|
8b51430555 | ||
|
|
f71288e299 | ||
|
|
c0fc8195ce | ||
|
|
dd189411e6 | ||
|
|
4693b95bea | ||
|
|
596a42e312 | ||
|
|
71944be482 | ||
|
|
d1699fbb8d | ||
|
|
bd880b608f | ||
|
|
3386431749 | ||
|
|
c3fc8b5f18 | ||
|
|
ec740476da | ||
|
|
a536ad1d10 | ||
|
|
a1ae7818a2 | ||
|
|
365b3a8a38 | ||
|
|
823eb1f392 | ||
|
|
a12dfa405f | ||
|
|
9798ec296a | ||
|
|
c1b993c01b | ||
|
|
f55696a605 | ||
|
|
f361bd66ea | ||
|
|
3dfb96dec9 | ||
|
|
82ada0bcd8 | ||
|
|
28bd50a105 | ||
|
|
46bd5814e3 | ||
|
|
4e9cddac8f | ||
|
|
a85c5578c1 | ||
|
|
130ab70550 | ||
|
|
ee27cbdd22 | ||
|
|
bd0d238f23 | ||
|
|
3a5ac6f037 | ||
|
|
8db0f3ac6e | ||
|
|
60eda447b4 | ||
|
|
d5f2388723 | ||
|
|
d5a568b3fc | ||
|
|
2704d70c1f | ||
|
|
2a1e82ac6d | ||
|
|
755a69e912 | ||
|
|
101a4f63de | ||
|
|
84bdaa79e2 | ||
|
|
c3b6f5ce64 | ||
|
|
06a7260173 | ||
|
|
54236f718f | ||
|
|
2143e38d27 | ||
|
|
7d7651bc39 | ||
|
|
64c11b1f8f | ||
|
|
a1a0926c4b | ||
|
|
aade94a48f | ||
|
|
edebe64cf8 | ||
|
|
ae4f837091 | ||
|
|
5e6d87c8fd | ||
|
|
20e9723d21 | ||
|
|
54724ac540 | ||
|
|
a9c848e32e | ||
|
|
02f9e87233 | ||
|
|
22d546edc0 | ||
|
|
f464e8e287 | ||
|
|
bd5217acb4 | ||
|
|
e0cf62825b | ||
|
|
9ce356aff4 | ||
|
|
60fa54dddc | ||
|
|
99b457965b | ||
|
|
1d1a330ef1 | ||
|
|
4e9910c20e | ||
|
|
82f2958ac6 | ||
|
|
1afa441571 | ||
|
|
d159047dc0 | ||
|
|
3a529d00ce | ||
|
|
b14b2b86e8 | ||
|
|
9ab4319771 | ||
|
|
8de7a4c828 | ||
|
|
782d7a2172 | ||
|
|
2e5f3e4d66 | ||
|
|
6a00bf099e | ||
|
|
bc11bd4caf | ||
|
|
c133552d04 | ||
|
|
2065a83fa1 | ||
|
|
30ce0eaa45 | ||
|
|
8be1fc9340 | ||
|
|
6a8aa497b0 | ||
|
|
390155e03b | ||
|
|
3051ddb6c0 | ||
|
|
25d74632c2 | ||
|
|
2b77427d0b | ||
|
|
dfc77b6f84 | ||
|
|
6bc7f911c3 | ||
|
|
718614f81f | ||
|
|
8e1f3bb086 | ||
|
|
3a87eb463a | ||
|
|
a49c395486 | ||
|
|
ad7f782a1a | ||
|
|
3aa84b5a5a | ||
|
|
52457ea749 | ||
|
|
8104b96b8c | ||
|
|
a7835650bf | ||
|
|
d326dadb5d | ||
|
|
d9307dad0c | ||
|
|
752735159c | ||
|
|
7cc6eb2b66 | ||
|
|
0a19057606 | ||
|
|
a49d73c4c6 | ||
|
|
82ded0299c | ||
|
|
ab7cd4955b | ||
|
|
95493f3bbe | ||
|
|
a8c6f6b783 | ||
|
|
516f746061 | ||
|
|
d8d65ea989 | ||
|
|
d80735e248 | ||
|
|
ff5ad2385c | ||
|
|
2f28b25af3 | ||
|
|
02bf9501a9 | ||
|
|
a6292988d5 | ||
|
|
431f773b77 | ||
|
|
bd2bd1cf32 | ||
|
|
f5d92bf74f | ||
|
|
dbe8b6551a | ||
|
|
027e132749 | ||
|
|
7e3a157fcf | ||
|
|
9cd1ebf576 | ||
|
|
03f929163c | ||
|
|
e7e1ee7a2b | ||
|
|
3f229c4cb9 | ||
|
|
b2e0fdeaf8 | ||
|
|
0b541befbc | ||
|
|
fd9346d4da | ||
|
|
e744214ad6 | ||
|
|
3feff8e751 | ||
|
|
a2acd261d8 | ||
|
|
36b8884d92 | ||
|
|
c15d7b8882 | ||
|
|
9f33a09e87 | ||
|
|
cc78180a6c | ||
|
|
e5338688bb | ||
|
|
b19ec959b3 | ||
|
|
8b4a57985b | ||
|
|
7fb4e4a095 | ||
|
|
1bc4fc211d | ||
|
|
0a4d08886d | ||
|
|
0f5fa620d1 | ||
|
|
a0f26f1ca3 | ||
|
|
e64a0fb62e | ||
|
|
69409d71d1 | ||
|
|
68c63d20ed | ||
|
|
2afa3fd9de | ||
|
|
0bcaf3e422 | ||
|
|
6e5992c168 | ||
|
|
02122f8ce6 | ||
|
|
39f7f70a32 | ||
|
|
427b0a68d0 | ||
|
|
50f3a05fa5 | ||
|
|
a306c222d4 | ||
|
|
5bfee3339a | ||
|
|
2b9df69627 | ||
|
|
4f1e92f309 | ||
|
|
88165088a9 | ||
|
|
e38f76b8bc | ||
|
|
1f63fc7de1 | ||
|
|
763a88fe97 | ||
|
|
12e2be40e8 | ||
|
|
22379eda6f | ||
|
|
4485af577d | ||
|
|
0fcfd78b62 | ||
|
|
4940ed66c1 | ||
|
|
73093c0ff2 | ||
|
|
c5e27b89af | ||
|
|
111cd2fd46 | ||
|
|
5a90c8374c | ||
|
|
9ffa737a4d | ||
|
|
c565f2c9c7 | ||
|
|
eaa18f569a | ||
|
|
bfe6389377 | ||
|
|
f72412484a | ||
|
|
b4301adb3b | ||
|
|
d67269c9fe | ||
|
|
c264e639d6 | ||
|
|
32a84f24ef | ||
|
|
68e4146f3b | ||
|
|
f4f7215a6a | ||
|
|
a0b19872f8 | ||
|
|
f2147179c2 | ||
|
|
e7a0b4cf04 | ||
|
|
533572e8cd | ||
|
|
257eea5b04 | ||
|
|
47af0d634f | ||
|
|
5e11d9d51f | ||
|
|
7ffcff7a7b | ||
|
|
9ee548b967 | ||
|
|
c9142223fd | ||
|
|
2094397bca | ||
|
|
b81109f512 | ||
|
|
874dbafe26 | ||
|
|
46ca469a4a | ||
|
|
8fb51bf3b7 | ||
|
|
9874a9053a | ||
|
|
db87774426 | ||
|
|
d14db9396b | ||
|
|
d7966567e7 | ||
|
|
b4f8024eef | ||
|
|
e70f230f39 | ||
|
|
b28f743306 | ||
|
|
9f97a09942 | ||
|
|
4f7e655613 | ||
|
|
a7d94c2f8f | ||
|
|
c2172821fd | ||
|
|
24393d4ef4 | ||
|
|
622ea91648 | ||
|
|
aed1a63a77 | ||
|
|
14cd568e46 | ||
|
|
44d836e2e7 | ||
|
|
f9af6947f7 | ||
|
|
8e1da82793 | ||
|
|
860aca974b | ||
|
|
6a66d7653f | ||
|
|
d32a4541a9 | ||
|
|
26719169ee | ||
|
|
eae145543e | ||
|
|
48f1300908 | ||
|
|
5cdaabeaec | ||
|
|
40f87e9472 | ||
|
|
7f385d4762 | ||
|
|
389c5adaa3 | ||
|
|
7a82ded94b | ||
|
|
86278e837a | ||
|
|
34a0499152 | ||
|
|
68ccc6634d | ||
|
|
317af7ebc5 | ||
|
|
206368b777 | ||
|
|
204a81b0ea | ||
|
|
b940ecab9c | ||
|
|
15cbc96697 | ||
|
|
b5e5b46f77 | ||
|
|
42b6a1378c | ||
|
|
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 |
No files matched your search
@@ -0,0 +1,92 @@
|
||||
name: Bug Report
|
||||
description: Report a bug or console error
|
||||
labels: [Unconfirmed]
|
||||
|
||||
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 the latest build(s) 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,38 @@
|
||||
name: Feature Request
|
||||
description: Suggest a feature to be added
|
||||
labels: [Feature Request]
|
||||
|
||||
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 to 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: 'temurin'
|
||||
java-version: 11
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifact
|
||||
path: build/libs
|
||||
+4
-8
@@ -18,9 +18,8 @@ hs_err_pid*
|
||||
|
||||
# Ignore IDEA directory
|
||||
.idea/*
|
||||
|
||||
# Include the project's code style settings file
|
||||
!.idea/codeStyleSettings.xml
|
||||
!.idea/copyright/*
|
||||
!.idea/scopes/*
|
||||
|
||||
# Include the project's dictionary
|
||||
!.idea/dictionaries/
|
||||
@@ -109,8 +108,5 @@ nbactions.xml
|
||||
nb-configuration.xml
|
||||
.nb-gradle/
|
||||
|
||||
|
||||
|
||||
### Git ###
|
||||
# Don't exclude the .gitignore itself
|
||||
!.gitignore
|
||||
### MacOS ###
|
||||
.DS_Store
|
||||
Generated
+11
@@ -0,0 +1,11 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings>
|
||||
<module2copyright>
|
||||
<element module="ViaVersion-API" copyright="viaversion-mit" />
|
||||
<element module="ViaVersion" copyright="viaversion-gpl" />
|
||||
</module2copyright>
|
||||
<LanguageOptions name="__TEMPLATE__">
|
||||
<option name="addBlankAfter" value="false" />
|
||||
</LanguageOptions>
|
||||
</settings>
|
||||
</component>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion Copyright (C) 2016-2022 ViaVersion and contributors 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 <http://www.gnu.org/licenses/>." />
|
||||
<option name="myName" value="viaversion-gpl" />
|
||||
</copyright>
|
||||
</component>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion Copyright (C) 2016-2022 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." />
|
||||
<option name="myName" value="viaversion-mit" />
|
||||
</copyright>
|
||||
</component>
|
||||
Generated
+3
@@ -0,0 +1,3 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="ViaVersion" pattern="com.viaversion.viaversion..*&&!src[viaversion-parent.viaversion-api*]:*..*" />
|
||||
</component>
|
||||
Generated
+3
@@ -0,0 +1,3 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="ViaVersion-API" pattern="src[viaversion-parent.viaversion-api*]:*..*&&!src[viaversion-parent.viaversion-api.main]:com.viaversion.viaversion.api.minecraft.nbt.*" />
|
||||
</component>
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
sudo: false
|
||||
|
||||
language: java
|
||||
jdk: oraclejdk7
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- '$HOME/.m2/repository'
|
||||
|
||||
script:
|
||||
- mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
|
||||
- mvn clean install -B -U
|
||||
@@ -1,12 +0,0 @@
|
||||
### What version of ViaVersion are you using? Type /ver viaversion
|
||||
|
||||
### What version of Spigot are you using? Type /ver
|
||||
|
||||
### What plugins are you using? Type /plugins
|
||||
|
||||
### Are you using any additional software like BungeeCord? If so, what software and version? (Please list your plugins as well)
|
||||
|
||||
### How does this error happen? login? Using an item?
|
||||
|
||||
### Is there an error in the console? Use pastebin.com. Is there a kick message?
|
||||
|
||||
@@ -1,3 +1,674 @@
|
||||
License:
|
||||
--------
|
||||
You may modify this work, all rights are still owned by myself excluding any files in the spacebase package as they belong to the respected contributors. Please credit the original author (myself) when forking etc. (or if it helped you understand the new protocol or netty!)
|
||||
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>.
|
||||
@@ -1,48 +1,27 @@
|
||||
# ViaVersion 0.8.0
|
||||
[](https://travis-ci.org/MylesIsCool/ViaVersion)
|
||||
[](https://gitter.im/MylesIsCool/ViaVersion)
|
||||
# ViaVersion - Spigot, Sponge, BungeeCord, Velocity
|
||||
|
||||
**Allows the connection of 1.9 clients to 1.8**
|
||||
[](https://viaversion.com)
|
||||
[](https://github.com/ViaVersion/ViaVersion/actions)
|
||||
[](https://viaversion.com/discord)
|
||||
|
||||
This plugin modifies netty to allow connection of 1.9 clients to 1.8,
|
||||
**Allows the connection of higher client versions to lower server versions**
|
||||
|
||||
###*Don't use late bind*
|
||||
Supported Versions:
|
||||
|
||||
This uses our new API, we currently don't have javadocs yet but look at one of our protocols on how to get started then use ProtocolRegistry.registerProtocol()
|
||||

|
||||
|
||||
This took 100s hours of work, so if you enjoy this consider looking into contacting me and supporting my projects.
|
||||
On Paper you may also use ProtocolSupport, but ensure you have the right build for your server version.
|
||||
|
||||
**Contributor Chat:** https://gitter.im/MylesIsCool/ViaVersion
|
||||
**User Docs:** https://docs.viaversion.com/display/VIAVERSION/
|
||||
|
||||
|
||||
Sources:
|
||||
--------
|
||||
**[wiki.vg](https://wiki.vg)** (Used for information regarding packet structure, we also contribute back)
|
||||
|
||||
**wiki.vg** (Protocol info, though I did have to find a lot myself)
|
||||
|
||||
**OpenNBT** (used for slot rewriting)
|
||||
|
||||
|
||||
|
||||
Contributors:
|
||||
--------
|
||||
|
||||
**Myself** (harhar)
|
||||
|
||||
**Matsv/StamBoom**
|
||||
|
||||
**HugoDaBosss**
|
||||
|
||||
**SanderGielisse**
|
||||
|
||||
**Paulomart**
|
||||
|
||||
**gigosaurus**
|
||||
|
||||
**fillefilip8**
|
||||
|
||||
**lenis0012**
|
||||
**[Burger](https://github.com/Pokechu22/Burger)** (See [PAaaS](https://github.com/Matsv/Paaas))
|
||||
|
||||
**[OpenNBT](https://github.com/ViaVersion/OpenNBT)**
|
||||
|
||||
|
||||
Releases / Dev Builds:
|
||||
@@ -51,23 +30,50 @@ You can find official releases here:
|
||||
|
||||
https://www.spigotmc.org/resources/viaversion.19254/history
|
||||
|
||||
|
||||
----------
|
||||
|
||||
You can find unofficial dev builds here:
|
||||
You can find official dev builds here:
|
||||
|
||||
**Terrobility's Build Server:** https://ci.terrocidepvp.net/job/ViaVersion/
|
||||
**Jenkins:** https://ci.viaversion.com
|
||||
|
||||
**sgdc3's Build Server:** http://ci.xephi.fr/job/ViaVersion/
|
||||
**sgdc3's Maven:** http://ci.xephi.fr/plugin/repository/everything/
|
||||
**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.
|
||||
|
||||
**JavaDocs:** https://jd.matsv.nl/
|
||||
|
||||
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.
|
||||
|
||||
You may modify this work, all rights are still owned by myself excluding any files in the spacebase package as they belong to the respected contributors. Please credit the original author (myself) when forking etc. (or if it helped you understand the new protocol or netty!)
|
||||
|
||||
|
||||
Thanks!
|
||||
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-2022 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-2022 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-2022 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-2022 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-2022 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-2022 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-2022 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,250 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 v1_17 = register(755, "1.17");
|
||||
public static final ProtocolVersion v1_17_1 = register(756, "1.17.1");
|
||||
public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1));
|
||||
public static final ProtocolVersion v1_18_2 = register(758, "1.18.2");
|
||||
public static final ProtocolVersion v1_19 = register(759, "1.19");
|
||||
public static final ProtocolVersion v1_19_1 = register(760, "1.19.1");
|
||||
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.rangeFrom(); i <= versionRange.rangeTo(); i++) {
|
||||
if (i == 0) {
|
||||
includedVersions.add(versionRange.baseVersion()); // Keep both the base version and with ".0" appended
|
||||
}
|
||||
|
||||
includedVersions.add(versionRange.baseVersion() + "." + 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,29 @@
|
||||
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.flare)
|
||||
api(libs.flareFastutil)
|
||||
api(libs.openNBT)
|
||||
api(libs.gson)
|
||||
|
||||
compileOnlyApi(libs.snakeYaml)
|
||||
compileOnlyApi(libs.netty)
|
||||
compileOnlyApi(libs.guava)
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
}
|
||||
|
||||
java {
|
||||
withJavadocJar()
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
import com.viaversion.viaversion.api.platform.ViaServerProxyPlatform;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public static ViaServerProxyPlatform<?> proxyPlatform() {
|
||||
Preconditions.checkArgument(manager().getPlatform() instanceof ViaServerProxyPlatform, "Platform is not proxying Minecraft servers!");
|
||||
return (ViaServerProxyPlatform<?>) 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,160 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 <b>major version</b> matching {@link #getVersion()}.
|
||||
* It is highly advised to check against the major version and to disable/not initiate
|
||||
* any hooks into ViaVersion if given and expected versions do not match.
|
||||
*
|
||||
* @return major plugin version
|
||||
* @since 4.0.2
|
||||
*/
|
||||
default int majorVersion() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an <b>internally based API version</b> 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 15;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,128 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.debug.DebugHandler;
|
||||
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
|
||||
*/
|
||||
@Deprecated
|
||||
default boolean isDebug() {
|
||||
return debugHandler().enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the debug mode. If enabled, packets and other otherwise suppressed warnings will be logged.
|
||||
*
|
||||
* @param debug whether debug should be enabled
|
||||
*/
|
||||
@Deprecated
|
||||
default void setDebug(boolean debug) {
|
||||
debugHandler().setEnabled(debug);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the debug handler.
|
||||
*
|
||||
* @return debug handler
|
||||
*/
|
||||
DebugHandler debugHandler();
|
||||
|
||||
/**
|
||||
* 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-2022 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-2022 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-2022 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-2022 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,461 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 com.google.gson.JsonElement;
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.WorldIdentifiers;
|
||||
import com.viaversion.viaversion.api.protocol.version.BlockedProtocolVersions;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
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();
|
||||
|
||||
/**
|
||||
* Fix 1.9+ clients not rendering the far away chunks
|
||||
*
|
||||
* @return true to fix chunk borders
|
||||
*/
|
||||
boolean isChunkBorderFix();
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* API to check for blocked protocol versions.
|
||||
*
|
||||
* @return blocked protocol versions
|
||||
*/
|
||||
BlockedProtocolVersions blockedProtocolVersions();
|
||||
|
||||
/**
|
||||
* Get the blocked protocols
|
||||
*
|
||||
* @return An Integer list
|
||||
* @deprecated use {@link #blockedProtocolVersions()}
|
||||
*/
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default IntSet getBlockedProtocols() {
|
||||
return blockedProtocolVersions().singleBlockedVersions();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Get the message that is sent when a user displays a resource pack prompt.
|
||||
*
|
||||
* @return cached serialized component
|
||||
*/
|
||||
JsonElement get1_17ResourcePackPrompt();
|
||||
|
||||
/***
|
||||
* Get the world names that should be returned for each Vanilla dimension.
|
||||
* Note that this can be overriden per-user by using {@link UserConnection#put(StorableObject)} with
|
||||
* a custom instance of {@link WorldIdentifiers} for the user's {@link UserConnection}.
|
||||
*
|
||||
* @return the global map from vanilla dimensions to world name
|
||||
*/
|
||||
WorldIdentifiers get1_16WorldNamesMap();
|
||||
|
||||
boolean cache1_17Light();
|
||||
|
||||
@Nullable String chatTypeFormat(String translationKey);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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-2022 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,41 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 {
|
||||
|
||||
/**
|
||||
* Returns whether the object should be uncached on a server switch.
|
||||
*
|
||||
* @return whether the object should be uncached on a server switch
|
||||
*/
|
||||
default boolean clearOnServerSwitch() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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,340 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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);
|
||||
|
||||
/**
|
||||
* Removes and returns an object from the storage.
|
||||
*
|
||||
* @param objectClass class of the object to get
|
||||
* @param <T> type of the class you want to get
|
||||
* @return removed storable object if present
|
||||
*/
|
||||
@Nullable <T extends StorableObject> T remove(Class<T> 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.
|
||||
* Does not override existing entity trackers.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param tracker entity tracker
|
||||
*/
|
||||
void addEntityTracker(Class<? extends Protocol> protocolClass, EntityTracker tracker);
|
||||
|
||||
/**
|
||||
* Clear stored objects and entity trackers.
|
||||
*/
|
||||
default void clearStoredObjects() {
|
||||
clearStoredObjects(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear stored objects and entity trackers.
|
||||
* If cleared for a proxy server switch, some stored objects and tracker data will be retained.
|
||||
*
|
||||
* @param isServerSwitch whether the clear is due to a server switch
|
||||
*/
|
||||
void clearStoredObjects(boolean isServerSwitch);
|
||||
|
||||
/**
|
||||
* 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#blockedProtocolVersions()} should be checked for this connection.
|
||||
*
|
||||
* @return whether blocked protocols should be applied
|
||||
*/
|
||||
boolean shouldApplyBlockProtocol();
|
||||
|
||||
/**
|
||||
* Returns whether the packet limiter applies to this user.
|
||||
*
|
||||
* @return whether the packet limiter applies to this user
|
||||
*/
|
||||
boolean isPacketLimiterEnabled();
|
||||
|
||||
/**
|
||||
* Sets the status of the packet limiter.
|
||||
*
|
||||
* @param packetLimiterEnabled whether the packet limiter should be enabled
|
||||
*/
|
||||
void setPacketLimiterEnabled(boolean packetLimiterEnabled);
|
||||
|
||||
/**
|
||||
* 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,73 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Mappings containing the full string identifier mappings.
|
||||
*/
|
||||
public interface FullMappings {
|
||||
|
||||
Mappings mappings();
|
||||
|
||||
/**
|
||||
* Returns the unmapped integer id for the given identifier, or -1 if not found.
|
||||
*
|
||||
* @param identifier unmapped string identifier
|
||||
* @return unmapped int id, or -1 if not found
|
||||
*/
|
||||
int id(String identifier);
|
||||
|
||||
/**
|
||||
* Returns the mapped integer id for the given mapped identifier, or -1 if not found.
|
||||
*
|
||||
* @param mappedIdentifier mapped string identifier
|
||||
* @return mapped int id, or -1 if not found
|
||||
*/
|
||||
int mappedId(String mappedIdentifier);
|
||||
|
||||
/**
|
||||
* Returns the unmapped string identifier for the given mapped id.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @return unmapped string identifier
|
||||
*/
|
||||
String identifier(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped string identifier for the given mapped id.
|
||||
*
|
||||
* @param mappedId mapped id
|
||||
* @return mapped string identifier
|
||||
*/
|
||||
String mappedIdentifier(int mappedId);
|
||||
|
||||
/**
|
||||
* Returns the mapped string identifier for the given unmapped identifier.
|
||||
*
|
||||
* @param identifier unmapped identifier
|
||||
* @return mapped string identifier, or null if not found
|
||||
*/
|
||||
@Nullable String mappedIdentifier(String identifier);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class FullMappingsBase implements FullMappings {
|
||||
private final Object2IntMap<String> stringToId;
|
||||
private final Object2IntMap<String> mappedStringToId;
|
||||
private final String[] idToString;
|
||||
private final String[] mappedIdToString;
|
||||
private final Mappings mappings;
|
||||
|
||||
public FullMappingsBase(final JsonArray oldMappings, final JsonArray newMappings, final Mappings mappings) {
|
||||
this.mappings = mappings;
|
||||
stringToId = MappingDataLoader.arrayToMap(oldMappings);
|
||||
mappedStringToId = MappingDataLoader.arrayToMap(newMappings);
|
||||
stringToId.defaultReturnValue(-1);
|
||||
mappedStringToId.defaultReturnValue(-1);
|
||||
|
||||
idToString = new String[oldMappings.size()];
|
||||
for (int i = 0; i < oldMappings.size(); i++) {
|
||||
idToString[i] = oldMappings.get(i).getAsString();
|
||||
}
|
||||
|
||||
mappedIdToString = new String[newMappings.size()];
|
||||
for (int i = 0; i < newMappings.size(); i++) {
|
||||
mappedIdToString[i] = newMappings.get(i).getAsString();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mappings mappings() {
|
||||
return mappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int id(final String identifier) {
|
||||
return stringToId.getInt(identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int mappedId(final String mappedIdentifier) {
|
||||
return mappedStringToId.getInt(mappedIdentifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier(final int id) {
|
||||
return idToString[id];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String mappedIdentifier(final int mappedId) {
|
||||
return mappedIdToString[mappedId];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String mappedIdentifier(final String identifier) {
|
||||
final int id = id(identifier);
|
||||
if (id == -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final int mappedId = mappings.getNewId(id);
|
||||
return mappedId != -1 ? mappedIdentifier(mappedId) : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
|
||||
public class Int2IntMapMappings implements Mappings {
|
||||
private final Int2IntMap mappings;
|
||||
private final int mappedIds;
|
||||
|
||||
protected Int2IntMapMappings(final Int2IntMap mappings, final int mappedIds) {
|
||||
this.mappings = mappings;
|
||||
this.mappedIds = mappedIds;
|
||||
mappings.defaultReturnValue(-1);
|
||||
}
|
||||
|
||||
public static Int2IntMapMappings of(final Int2IntMap mappings, final int mappedIds) {
|
||||
return new Int2IntMapMappings(mappings, mappedIds);
|
||||
}
|
||||
|
||||
public static Int2IntMapMappings of() {
|
||||
|
||||
return new Int2IntMapMappings(new Int2IntOpenHashMap(), -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewId(final int id) {
|
||||
return mappings.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewId(final int id, final int newId) {
|
||||
mappings.put(id, newId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return mappings.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int mappedSize() {
|
||||
return mappedIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 {
|
||||
private final int[] oldToNew;
|
||||
private final int mappedIds;
|
||||
|
||||
protected IntArrayMappings(final int[] oldToNew, final int mappedIds) {
|
||||
this.oldToNew = oldToNew;
|
||||
this.mappedIds = mappedIds;
|
||||
}
|
||||
|
||||
public static IntArrayMappings of(final int[] oldToNew, final int mappedIds) {
|
||||
return new IntArrayMappings(oldToNew, mappedIds);
|
||||
}
|
||||
|
||||
public static Builder<IntArrayMappings> builder() {
|
||||
return Mappings.builder(IntArrayMappings::new);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int[] oldToNew) {
|
||||
this(oldToNew, -1);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
this.mappedIds = newMapping.size();
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
|
||||
this(oldMapping.entrySet().size(), oldMapping, newMapping, diffMapping);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
mappedIds = -1;
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping) {
|
||||
this(oldMapping.entrySet().size(), oldMapping, newMapping);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping, boolean warnOnMissing) {
|
||||
oldToNew = new int[size];
|
||||
Arrays.fill(oldToNew, -1);
|
||||
mappedIds = -1;
|
||||
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping, warnOnMissing);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
|
||||
this(size, oldMapping, newMapping, null, warnOnMissing);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
|
||||
this(oldMapping.size(), oldMapping, newMapping, warnOnMissing);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping) {
|
||||
this(size, oldMapping, newMapping, true);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping) {
|
||||
this(oldMapping.size(), oldMapping, newMapping, diffMapping, true);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return oldToNew.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int mappedSize() {
|
||||
return mappedIds;
|
||||
}
|
||||
|
||||
public int[] getOldToNew() {
|
||||
return oldToNew;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 getBlockEntityMappings();
|
||||
|
||||
@Nullable Mappings getBlockStateMappings();
|
||||
|
||||
@Nullable Mappings getSoundMappings();
|
||||
|
||||
@Nullable Mappings getStatisticsMappings();
|
||||
|
||||
@Nullable Mappings getEnchantmentMappings();
|
||||
|
||||
@Nullable FullMappings getEntityMappings();
|
||||
|
||||
@Nullable FullMappings getArgumentTypeMappings();
|
||||
|
||||
@Nullable Mappings getPaintingMappings();
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 FullMappings argumentTypeMappings;
|
||||
protected FullMappings entityMappings;
|
||||
protected ParticleMappings particleMappings;
|
||||
protected Mappings blockMappings;
|
||||
protected Mappings blockStateMappings;
|
||||
protected Mappings blockEntityMappings;
|
||||
protected Mappings soundMappings;
|
||||
protected Mappings statisticsMappings;
|
||||
protected Mappings enchantmentMappings;
|
||||
protected Mappings paintingMappings;
|
||||
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");
|
||||
blockEntityMappings = loadFromArray(oldMappings, newMappings, diffmapping, "blockentities");
|
||||
soundMappings = loadFromArray(oldMappings, newMappings, diffmapping, "sounds");
|
||||
statisticsMappings = loadFromArray(oldMappings, newMappings, diffmapping, "statistics");
|
||||
enchantmentMappings = loadFromArray(oldMappings, newMappings, diffmapping, "enchantments");
|
||||
paintingMappings = loadFromArray(oldMappings, newMappings, diffmapping, "paintings");
|
||||
|
||||
entityMappings = loadFullMappings(oldMappings, newMappings, diffmapping, "entities");
|
||||
argumentTypeMappings = loadFullMappings(oldMappings, newMappings, diffmapping, "argumenttypes");
|
||||
|
||||
Mappings particles = loadFromArray(oldMappings, newMappings, diffmapping, "particles");
|
||||
if (particles != null) {
|
||||
particleMappings = new ParticleMappings(oldMappings.getAsJsonArray("particles"), newMappings.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, true);
|
||||
}
|
||||
|
||||
if (diffmapping != null && diffmapping.has("tags")) {
|
||||
this.tags = new EnumMap<>(RegistryType.class);
|
||||
JsonObject tags = diffmapping.getAsJsonObject("tags");
|
||||
if (tags.has(RegistryType.ITEM.resourceLocation())) {
|
||||
loadTags(RegistryType.ITEM, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("items")));
|
||||
}
|
||||
if (tags.has(RegistryType.BLOCK.resourceLocation())) {
|
||||
loadTags(RegistryType.BLOCK, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("blocks")));
|
||||
}
|
||||
}
|
||||
|
||||
loadExtras(oldMappings, newMappings, diffmapping);
|
||||
}
|
||||
|
||||
protected FullMappings loadFullMappings(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||
Mappings mappings = loadFromArray(oldMappings, newMappings, diffMappings, key);
|
||||
return mappings != null ? new FullMappingsBase(oldMappings.getAsJsonArray(key), newMappings.getAsJsonArray(key), mappings) : null;
|
||||
}
|
||||
|
||||
private void loadTags(RegistryType type, JsonObject object, Object2IntMap<String> typeMapping) {
|
||||
JsonObject tags = object.getAsJsonObject(type.resourceLocation());
|
||||
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.mappings().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 getBlockEntityMappings() {
|
||||
return blockEntityMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getBlockStateMappings() {
|
||||
return blockStateMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getSoundMappings() {
|
||||
return soundMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getStatisticsMappings() {
|
||||
return statisticsMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getEnchantmentMappings() {
|
||||
return enchantmentMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getEntityMappings() {
|
||||
return entityMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getArgumentTypeMappings() {
|
||||
return argumentTypeMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getPaintingMappings() {
|
||||
return paintingMappings;
|
||||
}
|
||||
|
||||
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 IntArrayMappings.builder().unmapped(oldMappings.getAsJsonArray(key))
|
||||
.mapped(newMappings.getAsJsonArray(key)).diffMappings(diff).build();
|
||||
}
|
||||
|
||||
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 IntArrayMappings.builder().unmapped(oldMappings.getAsJsonObject(key))
|
||||
.mapped(newMappings.getAsJsonObject(key)).diffMappings(diff).build();
|
||||
}
|
||||
|
||||
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,252 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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, boolean warnOnMissing) {
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
|
||||
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
|
||||
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers, warnOnMissing);
|
||||
if (value != -1) {
|
||||
output.put(Integer.parseInt(entry.getKey()), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers) {
|
||||
mapIdentifiers(output, oldIdentifiers, newIdentifiers, null);
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
|
||||
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
|
||||
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
|
||||
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers, warnOnMissing);
|
||||
if (value != -1) {
|
||||
output[Integer.parseInt(entry.getKey())] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers) {
|
||||
mapIdentifiers(output, oldIdentifiers, newIdentifiers, diffIdentifiers, true);
|
||||
}
|
||||
|
||||
private static int mapIdentifierEntry(Map.Entry<String, JsonElement> entry, Object2IntMap<String> newIdentifierMap, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
|
||||
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 (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
Via.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( ");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
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(), .99F);
|
||||
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(), .99F);
|
||||
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,204 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 java.util.Arrays;
|
||||
|
||||
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);
|
||||
|
||||
/**
|
||||
* Returns the mapped id from the given id, or the given default if unmapped/invalid.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @param def fallback return value
|
||||
* @return mapped id, or -1 if invalid/out of bounds
|
||||
*/
|
||||
default int getNewIdOrDefault(int id, int def) {
|
||||
final int mappedId = getNewId(id);
|
||||
return mappedId != -1 ? mappedId : def;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the id has a mapping.
|
||||
*
|
||||
* @param id unmapped id
|
||||
* @return whether the id has a mapped id
|
||||
*/
|
||||
default boolean contains(int id) {
|
||||
return getNewId(id) != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Returns amount of unmapped entries, being the size of the mapping.
|
||||
*
|
||||
* @return amount of unmapped entries
|
||||
*/
|
||||
int size();
|
||||
|
||||
/**
|
||||
* Returns the amount of new ids total, even if it does not have a direct mapping.
|
||||
* Returns -1 if unknown.
|
||||
*
|
||||
* @return amount of new ids, or -1 if unknown
|
||||
*/
|
||||
int mappedSize();
|
||||
|
||||
static <T extends Mappings> Builder<T> builder(final MappingsSupplier<T> supplier) {
|
||||
return new Builder(supplier);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface MappingsSupplier<T extends Mappings> {
|
||||
|
||||
T supply(int[] mappings, int mappedIds);
|
||||
}
|
||||
|
||||
class Builder<T extends Mappings> {
|
||||
|
||||
protected final MappingsSupplier<T> supplier;
|
||||
protected JsonElement unmapped;
|
||||
protected JsonElement mapped;
|
||||
protected JsonObject diffMappings;
|
||||
protected int mappedSize = -1;
|
||||
protected int size = -1;
|
||||
protected boolean warnOnMissing = true;
|
||||
|
||||
protected Builder(final MappingsSupplier<T> supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom entry size different to the size of the unmapped collection.
|
||||
*
|
||||
* @param size custom entry size
|
||||
* @return self
|
||||
*/
|
||||
public Builder<T> customEntrySize(final int size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a custom entry mapped ids count different to the size of the mapped collection.
|
||||
*
|
||||
* @param size custom mapped id count
|
||||
* @return self
|
||||
*/
|
||||
public Builder<T> customMappedSize(final int size) {
|
||||
this.mappedSize = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether warnings should be logged for missing mapped ids.
|
||||
*
|
||||
* @param warnOnMissing whether warnings should be logged for missing mapped ids
|
||||
* @return self
|
||||
*/
|
||||
public Builder<T> warnOnMissing(final boolean warnOnMissing) {
|
||||
this.warnOnMissing = warnOnMissing;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> unmapped(final JsonArray unmappedArray) {
|
||||
this.unmapped = unmappedArray;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> unmapped(final JsonObject unmappedObject) {
|
||||
this.unmapped = unmappedObject;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> mapped(final JsonArray mappedArray) {
|
||||
this.mapped = mappedArray;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> mapped(final JsonObject mappedObject) {
|
||||
this.mapped = mappedObject;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> diffMappings(final JsonObject diffMappings) {
|
||||
this.diffMappings = diffMappings;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T build() {
|
||||
final int size = this.size != -1 ? this.size : size(unmapped);
|
||||
final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped);
|
||||
final int[] mappings = new int[size];
|
||||
Arrays.fill(mappings, -1);
|
||||
|
||||
// Do conversion if one is an array and the other an object, otherwise directly map
|
||||
if (unmapped.isJsonArray()) {
|
||||
if (mapped.isJsonObject()) {
|
||||
MappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
|
||||
} else {
|
||||
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
|
||||
}
|
||||
} else if (mapped.isJsonArray()) {
|
||||
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing);
|
||||
} else {
|
||||
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
|
||||
}
|
||||
|
||||
return supplier.supply(mappings, mappedSize);
|
||||
}
|
||||
|
||||
protected int size(final JsonElement element) {
|
||||
return element.isJsonObject() ? element.getAsJsonObject().size() : element.getAsJsonArray().size();
|
||||
}
|
||||
|
||||
protected JsonObject toJsonObject(final JsonArray array) {
|
||||
final JsonObject object = new JsonObject();
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
final JsonElement element = array.get(i);
|
||||
object.add(Integer.toString(i), element);
|
||||
}
|
||||
return object;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
|
||||
public class ParticleMappings extends FullMappingsBase {
|
||||
private final IntList itemParticleIds = new IntArrayList(2);
|
||||
private final IntList blockParticleIds = new IntArrayList(4);
|
||||
|
||||
public ParticleMappings(JsonArray oldMappings, JsonArray newMappings, Mappings mappings) {
|
||||
super(oldMappings, newMappings, mappings);
|
||||
addBlockParticle("block");
|
||||
addBlockParticle("falling_dust");
|
||||
addBlockParticle("block_marker");
|
||||
addItemParticle("item");
|
||||
}
|
||||
|
||||
public boolean addItemParticle(final String identifier) {
|
||||
final int id = id(identifier);
|
||||
return id != -1 && itemParticleIds.add(id);
|
||||
}
|
||||
|
||||
public boolean addBlockParticle(final String identifier) {
|
||||
final int id = id(identifier);
|
||||
return id != -1 && blockParticleIds.add(id);
|
||||
}
|
||||
|
||||
public boolean isBlockParticle(final int id) {
|
||||
return blockParticleIds.contains(id);
|
||||
}
|
||||
|
||||
public boolean isItemParticle(final int id) {
|
||||
return itemParticleIds.contains(id);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public int getBlockId() {
|
||||
return id("block");
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public int getFallingDustId() {
|
||||
return id("falling_dust");
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public int getItemId() {
|
||||
return id("item");
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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,30 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 DimensionData {
|
||||
|
||||
int minY();
|
||||
|
||||
int height();
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
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);
|
||||
|
||||
/**
|
||||
* Clears stored entity types and data.
|
||||
*/
|
||||
void clearEntities();
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
|
||||
*/
|
||||
@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)}
|
||||
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
|
||||
*/
|
||||
@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 (block height / 16).
|
||||
* This is 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);
|
||||
|
||||
/**
|
||||
* Returns the name of the world the player is currently in.
|
||||
*
|
||||
* @return world name of the current world
|
||||
*/
|
||||
@Nullable String currentWorld();
|
||||
|
||||
/**
|
||||
* Sets the name of the world the player is currently in.
|
||||
*
|
||||
* @param currentWorld name of the current world
|
||||
*/
|
||||
void setCurrentWorld(String currentWorld);
|
||||
|
||||
int biomesSent();
|
||||
|
||||
void setBiomesSent(int biomesSent);
|
||||
|
||||
EntityType playerType();
|
||||
|
||||
@Nullable DimensionData dimensionData(String dimension);
|
||||
|
||||
void setDimensions(Map<String, DimensionData> dimensions);
|
||||
|
||||
/**
|
||||
* Adds the client player entity to the tracker.
|
||||
* If the client entity has not been set yet, this will return false.
|
||||
*
|
||||
* @return whether the client has been tracked
|
||||
*/
|
||||
boolean trackClientEntity();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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);
|
||||
|
||||
/**
|
||||
* Removes and returns an object from the storage if present.
|
||||
*
|
||||
* @param objectClass class of the object to remove
|
||||
* @param <T> object type
|
||||
* @return removed object if present
|
||||
*/
|
||||
@Nullable <T> T remove(Class<T> objectClass);
|
||||
|
||||
/**
|
||||
* Stores an object based on its class.
|
||||
*
|
||||
* @param object object to store
|
||||
*/
|
||||
void put(Object object);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.debug;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
import com.viaversion.viaversion.api.protocol.packet.Direction;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketType;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
|
||||
@Beta
|
||||
public interface DebugHandler {
|
||||
|
||||
/**
|
||||
* Returns whether debug mode is enabled.
|
||||
*
|
||||
* @return whether debug mode is enabled
|
||||
*/
|
||||
boolean enabled();
|
||||
|
||||
/**
|
||||
* Sets debug mode.
|
||||
*
|
||||
* @param enabled whether debug should be enabled
|
||||
*/
|
||||
void setEnabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Adds a packet type name to the list of packet types to log.
|
||||
*
|
||||
* @param packetTypeName packet type name
|
||||
*/
|
||||
void addPacketTypeNameToLog(String packetTypeName);
|
||||
|
||||
/**
|
||||
* Adds a packet id to the list of packet types to log.
|
||||
* Packets will be checked on each protocol transformer, so this is best used on single protocol pipes.
|
||||
*
|
||||
* @param packetType packet type
|
||||
*/
|
||||
void addPacketTypeToLog(PacketType packetType);
|
||||
|
||||
/**
|
||||
* Removes a packet type name from the list of packet types to log.
|
||||
*
|
||||
* @param packetTypeName packet type name
|
||||
*/
|
||||
boolean removePacketTypeNameToLog(String packetTypeName);
|
||||
|
||||
/**
|
||||
* Resets packet type filters.
|
||||
*/
|
||||
void clearPacketTypesToLog();
|
||||
|
||||
/**
|
||||
* Returns whether packets should be logged after being transformed.
|
||||
* Set to true by default.
|
||||
*
|
||||
* @return whether packets should be logged after being transformed
|
||||
*/
|
||||
boolean logPostPacketTransform();
|
||||
|
||||
/**
|
||||
* Sets whether packets should be logged after being transformed.
|
||||
*
|
||||
* @param logPostPacketTransform whether packets should be logged after being transformed
|
||||
*/
|
||||
void setLogPostPacketTransform(boolean logPostPacketTransform);
|
||||
|
||||
/**
|
||||
* Returns whether the given packet should be logged.
|
||||
* If no specific packet type has been added, all packet types will be logged.
|
||||
*
|
||||
* @param wrapper packet wrapper
|
||||
* @param direction packet direction
|
||||
* @return whether the packet should be logged
|
||||
*/
|
||||
boolean shouldLog(PacketWrapper wrapper, Direction direction);
|
||||
|
||||
default void enableAndLogIds(final PacketType... packetTypes) {
|
||||
setEnabled(true);
|
||||
for (final PacketType packetType : packetTypes) {
|
||||
addPacketTypeToLog(packetType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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-2022 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-2022 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,40 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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),
|
||||
CREATE_FOG(4);
|
||||
|
||||
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-2022 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-2022 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-2022 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, "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-2022 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,104 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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);
|
||||
|
||||
public static final BlockFace[] HORIZONTAL = new BlockFace[]{NORTH, SOUTH, EAST, WEST};
|
||||
|
||||
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 modX() {
|
||||
return modX;
|
||||
}
|
||||
|
||||
public byte modY() {
|
||||
return modY;
|
||||
}
|
||||
|
||||
public byte modZ() {
|
||||
return modZ;
|
||||
}
|
||||
|
||||
public EnumAxis axis() {
|
||||
return axis;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public byte getModX() {
|
||||
return modX;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public byte getModY() {
|
||||
return modY;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public byte getModZ() {
|
||||
return modZ;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public EnumAxis getAxis() {
|
||||
return axis;
|
||||
}
|
||||
|
||||
public enum EnumAxis {
|
||||
X, Y, Z
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
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,62 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 x() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public float y() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public float z() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public float getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public float getZ() {
|
||||
return z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 GlobalPosition extends Position {
|
||||
private final String dimension;
|
||||
|
||||
public GlobalPosition(final String dimension, final int x, final int y, final int z) {
|
||||
super(x, y, z);
|
||||
this.dimension = dimension;
|
||||
}
|
||||
|
||||
public String dimension() {
|
||||
return dimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
final GlobalPosition position = (GlobalPosition) o;
|
||||
if (x != position.x) return false;
|
||||
if (y != position.y) return false;
|
||||
if (z != position.z) return false;
|
||||
return dimension.equals(position.dimension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = dimension.hashCode();
|
||||
result = 31 * result + x;
|
||||
result = 31 * result + y;
|
||||
result = 31 * result + z;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GlobalPosition{" +
|
||||
"dimension='" + dimension + '\'' +
|
||||
", x=" + x +
|
||||
", y=" + y +
|
||||
", z=" + z +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.UUID;
|
||||
|
||||
public final class PlayerMessageSignature {
|
||||
private final UUID uuid;
|
||||
private final byte[] signatureBytes;
|
||||
|
||||
public PlayerMessageSignature(final UUID uuid, final byte[] signatureBytes) {
|
||||
this.uuid = uuid;
|
||||
this.signatureBytes = signatureBytes;
|
||||
}
|
||||
|
||||
public UUID uuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public byte[] signatureBytes() {
|
||||
return signatureBytes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 {
|
||||
protected final int x;
|
||||
protected final int y;
|
||||
protected final int z;
|
||||
|
||||
public Position(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public Position(int x, short y, int z) {
|
||||
this(x, (int) y, z);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public Position(Position toCopy) {
|
||||
this(toCopy.x(), toCopy.y(), toCopy.z());
|
||||
}
|
||||
|
||||
public Position getRelative(BlockFace face) {
|
||||
return new Position(x + face.modX(), (short) (y + face.modY()), z + face.modZ());
|
||||
}
|
||||
|
||||
public int x() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int y() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int z() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public GlobalPosition withDimension(String dimension) {
|
||||
return new GlobalPosition(dimension, x, y, z);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
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,47 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 Position3d {
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
|
||||
public Position3d(final double x, final double y, final double z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double x() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public double y() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public double z() {
|
||||
return z;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 ProfileKey {
|
||||
private final long expiresAt;
|
||||
private final byte[] publicKey;
|
||||
private final byte[] keySignature;
|
||||
|
||||
public ProfileKey(final long expiresAt, final byte[] publicKey, final byte[] keySignature) {
|
||||
this.expiresAt = expiresAt;
|
||||
this.publicKey = publicKey;
|
||||
this.keySignature = keySignature;
|
||||
}
|
||||
|
||||
public long expiresAt() {
|
||||
return expiresAt;
|
||||
}
|
||||
|
||||
public byte[] publicKey() {
|
||||
return publicKey;
|
||||
}
|
||||
|
||||
public byte[] keySignature() {
|
||||
return keySignature;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public String getResourceLocation() {
|
||||
return resourceLocation;
|
||||
}
|
||||
|
||||
public String resourceLocation() {
|
||||
return resourceLocation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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,77 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 blockX() {
|
||||
return blockX;
|
||||
}
|
||||
|
||||
public int blockY() {
|
||||
return blockY;
|
||||
}
|
||||
|
||||
public int blockZ() {
|
||||
return blockZ;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getBlockX() {
|
||||
return blockX;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getBlockY() {
|
||||
return blockY;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getBlockZ() {
|
||||
return blockZ;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public void setBlockX(int blockX) {
|
||||
this.blockX = blockX;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public void setBlockY(int blockY) {
|
||||
this.blockY = blockY;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public void setBlockZ(int blockZ) {
|
||||
this.blockZ = blockZ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int profession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
public int level() {
|
||||
return level;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval=true)*/
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.viaversion.viaversion.api.connection.StorableObject;
|
||||
|
||||
public class WorldIdentifiers implements StorableObject {
|
||||
public static final String OVERWORLD_DEFAULT = "minecraft:overworld";
|
||||
public static final String NETHER_DEFAULT = "minecraft:the_nether";
|
||||
public static final String END_DEFAULT = "minecraft:the_end";
|
||||
|
||||
private final String overworld;
|
||||
private final String nether;
|
||||
private final String end;
|
||||
|
||||
public WorldIdentifiers(String overworld) {
|
||||
this(overworld, NETHER_DEFAULT, END_DEFAULT);
|
||||
}
|
||||
|
||||
public WorldIdentifiers(String overworld, String nether, String end) {
|
||||
this.overworld = overworld;
|
||||
this.nether = nether;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
public String overworld() {
|
||||
return this.overworld;
|
||||
}
|
||||
|
||||
public String nether() {
|
||||
return this.nether;
|
||||
}
|
||||
|
||||
public String end() {
|
||||
return this.end;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.blockentity;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface BlockEntity {
|
||||
|
||||
default byte sectionX() {
|
||||
return (byte) ((packedXZ() >> 4) & 15);
|
||||
}
|
||||
|
||||
default byte sectionZ() {
|
||||
return (byte) (packedXZ() & 15);
|
||||
}
|
||||
|
||||
byte packedXZ();
|
||||
|
||||
short y();
|
||||
|
||||
int typeId();
|
||||
|
||||
@Nullable CompoundTag tag();
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.blockentity;
|
||||
|
||||
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||
|
||||
public final class BlockEntityImpl implements BlockEntity {
|
||||
private final byte packedXZ;
|
||||
private final short y;
|
||||
private final int typeId;
|
||||
private final CompoundTag tag;
|
||||
|
||||
public BlockEntityImpl(final byte packedXZ, final short y, final int typeId, final CompoundTag tag) {
|
||||
this.packedXZ = packedXZ;
|
||||
this.y = y;
|
||||
this.typeId = typeId;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte packedXZ() {
|
||||
return packedXZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short y() {
|
||||
return y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int typeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag tag() {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockEntity> blockEntities() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
// TODO specialized sub interfaces
|
||||
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();
|
||||
|
||||
/**
|
||||
* Returns a list of block entities.
|
||||
*
|
||||
* @return list of block entities
|
||||
*/
|
||||
List<BlockEntity> blockEntities();
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
public class Chunk1_18 implements Chunk {
|
||||
protected final int x;
|
||||
protected final int z;
|
||||
protected ChunkSection[] sections;
|
||||
protected CompoundTag heightMap;
|
||||
protected final List<BlockEntity> blockEntities;
|
||||
|
||||
public Chunk1_18(int x, int z, ChunkSection[] sections, CompoundTag heightMap, List<BlockEntity> blockEntities) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
this.sections = sections;
|
||||
this.heightMap = heightMap;
|
||||
this.blockEntities = blockEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBiomeData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullChunk() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreOldLightData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIgnoreOldLightData(boolean ignoreOldLightData) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBitmask() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBitmask(int bitmask) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable BitSet getChunkMask() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChunkMask(BitSet chunkSectionMask) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkSection[] getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSections(ChunkSection[] sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int @Nullable [] getBiomeData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBiomeData(int @Nullable [] biomeData) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable CompoundTag getHeightMap() {
|
||||
return heightMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeightMap(final CompoundTag heightMap) {
|
||||
this.heightMap = heightMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompoundTag> getBlockEntities() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BlockEntity> blockEntities() {
|
||||
return blockEntities;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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
|
||||
|
||||
/**
|
||||
* Size (dimensions) of biomes in a chunks section.
|
||||
*/
|
||||
int BIOME_SIZE = 4 * 4 * 4;
|
||||
|
||||
static int index(int x, int y, int z) {
|
||||
return y << 8 | z << 4 | x;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getFlatBlock(int idx) {
|
||||
return palette(PaletteType.BLOCKS).idAt(idx);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getFlatBlock(int x, int y, int z) {
|
||||
return getFlatBlock(index(x, y, z));
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setFlatBlock(int idx, int id) {
|
||||
palette(PaletteType.BLOCKS).setIdAt(idx, id);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setFlatBlock(int x, int y, int z, int id) {
|
||||
setFlatBlock(index(x, y, z), id);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getBlockWithoutData(int x, int y, int z) {
|
||||
return getFlatBlock(x, y, z) >> 4;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getBlockData(int x, int y, int z) {
|
||||
return getFlatBlock(x, y, z) & 0xF;
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setBlockWithData(int x, int y, int z, int type, int data) {
|
||||
setFlatBlock(index(x, y, z), type << 4 | (data & 0xF));
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setBlockWithData(int idx, int type, int data) {
|
||||
setFlatBlock(idx, type << 4 | (data & 0xF));
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setPaletteIndex(int idx, int index) {
|
||||
palette(PaletteType.BLOCKS).setPaletteIndexAt(idx, index);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getPaletteIndex(int idx) {
|
||||
return palette(PaletteType.BLOCKS).paletteIndexAt(idx);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getPaletteSize() {
|
||||
return palette(PaletteType.BLOCKS).size();
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default int getPaletteEntry(int index) {
|
||||
return palette(PaletteType.BLOCKS).idByIndex(index);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void setPaletteEntry(int index, int id) {
|
||||
palette(PaletteType.BLOCKS).setIdByIndex(index, id);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void replacePaletteEntry(int oldId, int newId) {
|
||||
palette(PaletteType.BLOCKS).replaceId(oldId, newId);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void addPaletteEntry(int id) {
|
||||
palette(PaletteType.BLOCKS).addId(id);
|
||||
}
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
default void clearPalette() {
|
||||
palette(PaletteType.BLOCKS).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Returns the palette of the given type if present.
|
||||
*
|
||||
* @param type type of the palette
|
||||
* @return palette
|
||||
*/
|
||||
@Nullable DataPalette palette(PaletteType type);
|
||||
|
||||
void addPalette(PaletteType type, DataPalette blockPalette);
|
||||
|
||||
void removePalette(PaletteType type);
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
public class ChunkSectionImpl implements ChunkSection {
|
||||
|
||||
private final EnumMap<PaletteType, DataPalette> palettes = new EnumMap<>(PaletteType.class);
|
||||
private ChunkSectionLight light;
|
||||
private int nonAirBlocksCount;
|
||||
|
||||
public ChunkSectionImpl() {
|
||||
}
|
||||
|
||||
public ChunkSectionImpl(final boolean holdsLight) {
|
||||
addPalette(PaletteType.BLOCKS, new DataPaletteImpl(ChunkSection.SIZE));
|
||||
if (holdsLight) {
|
||||
this.light = new ChunkSectionLightImpl();
|
||||
}
|
||||
}
|
||||
|
||||
public ChunkSectionImpl(final boolean holdsLight, final int expectedPaletteLength) {
|
||||
addPalette(PaletteType.BLOCKS, new DataPaletteImpl(ChunkSection.SIZE, expectedPaletteLength));
|
||||
if (holdsLight) {
|
||||
this.light = new ChunkSectionLightImpl();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNonAirBlocksCount() {
|
||||
return nonAirBlocksCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNonAirBlocksCount(final int nonAirBlocksCount) {
|
||||
this.nonAirBlocksCount = nonAirBlocksCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ChunkSectionLight getLight() {
|
||||
return light;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLight(@Nullable final ChunkSectionLight light) {
|
||||
this.light = light;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataPalette palette(final PaletteType type) {
|
||||
return palettes.get(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPalette(final PaletteType type, final DataPalette palette) {
|
||||
palettes.put(type, palette);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePalette(final PaletteType type) {
|
||||
palettes.remove(type);
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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-2022 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,137 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
public interface DataPalette {
|
||||
|
||||
/**
|
||||
* Returns the packet section index of the given coordinates.
|
||||
*
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
* @return packed section index of the given coordinates
|
||||
*/
|
||||
int index(final int x, final int y, final int z);
|
||||
|
||||
/**
|
||||
* Returns the value of the given chunk coordinate.
|
||||
*
|
||||
* @param sectionCoordinate section index within the section
|
||||
* @return section state of the given index
|
||||
*/
|
||||
int idAt(int sectionCoordinate);
|
||||
|
||||
/**
|
||||
* Returns the value of the section coordinate.
|
||||
*
|
||||
* @param sectionX section x
|
||||
* @param sectionY section y
|
||||
* @param sectionZ section z
|
||||
* @return id of the given section coordinate
|
||||
*/
|
||||
default int idAt(final int sectionX, final int sectionY, final int sectionZ) {
|
||||
return idAt(index(sectionX, sectionY, sectionZ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a value in the chunk section.
|
||||
* This method does not update non-air blocks count.
|
||||
*
|
||||
* @param sectionCoordinate section index within the section
|
||||
* @param id id value
|
||||
*/
|
||||
void setIdAt(int sectionCoordinate, int id);
|
||||
|
||||
/**
|
||||
* Set a value in the chunk section.
|
||||
* This method does not update non-air blocks count.
|
||||
*
|
||||
* @param sectionX section x
|
||||
* @param sectionY section y
|
||||
* @param sectionZ section z
|
||||
* @param id id value
|
||||
*/
|
||||
default void setIdAt(final int sectionX, final int sectionY, final int sectionZ, final int id) {
|
||||
setIdAt(index(sectionX, sectionY, sectionZ), id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id assigned to the given palette index.
|
||||
*
|
||||
* @param index palette index
|
||||
* @return id assigned to the given palette index
|
||||
*/
|
||||
int idByIndex(int index);
|
||||
|
||||
/**
|
||||
* Assigns an id assigned to the given palette index.
|
||||
*
|
||||
* @param index palette index
|
||||
* @param id id value
|
||||
*/
|
||||
void setIdByIndex(int index, int id);
|
||||
|
||||
/**
|
||||
* Returns the palette index of the given section index.
|
||||
*
|
||||
* @param packedCoordinate section index
|
||||
* @return palette index of the given section index
|
||||
*/
|
||||
int paletteIndexAt(int packedCoordinate);
|
||||
|
||||
/**
|
||||
* Sets the index of the given section coordinate.
|
||||
*
|
||||
* @param sectionCoordinate section index
|
||||
* @param index palette index
|
||||
*/
|
||||
void setPaletteIndexAt(int sectionCoordinate, int index);
|
||||
|
||||
/**
|
||||
* Adds a new id to the palette.
|
||||
*
|
||||
* @param id id value
|
||||
*/
|
||||
void addId(int id);
|
||||
|
||||
/**
|
||||
* Replaces an id in the palette.
|
||||
*
|
||||
* @param oldId old id
|
||||
* @param newId new id
|
||||
*/
|
||||
void replaceId(int oldId, int newId);
|
||||
|
||||
/**
|
||||
* Returns the size of the palette.
|
||||
*
|
||||
* @return palette size
|
||||
*/
|
||||
int size();
|
||||
|
||||
/**
|
||||
* Clears the palette.
|
||||
*/
|
||||
void clear();
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
public final class DataPaletteImpl implements DataPalette {
|
||||
|
||||
private final IntList palette;
|
||||
private final Int2IntMap inversePalette;
|
||||
private final int[] values;
|
||||
private final int sizeBits;
|
||||
|
||||
public DataPaletteImpl(final int valuesLength) {
|
||||
this(valuesLength, 8);
|
||||
}
|
||||
|
||||
public DataPaletteImpl(final int valuesLength, final int expectedPaletteLength) {
|
||||
this.values = new int[valuesLength];
|
||||
sizeBits = Integer.numberOfTrailingZeros(valuesLength) / 3;
|
||||
// Pre-size the palette array/map
|
||||
palette = new IntArrayList(expectedPaletteLength);
|
||||
inversePalette = new Int2IntOpenHashMap(expectedPaletteLength);
|
||||
inversePalette.defaultReturnValue(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int index(final int x, final int y, final int z) {
|
||||
return (y << this.sizeBits | z) << this.sizeBits | x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idAt(final int sectionCoordinate) {
|
||||
final int index = values[sectionCoordinate];
|
||||
return palette.getInt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdAt(final int sectionCoordinate, final int id) {
|
||||
int index = inversePalette.get(id);
|
||||
if (index == -1) {
|
||||
index = palette.size();
|
||||
palette.add(id);
|
||||
inversePalette.put(id, index);
|
||||
}
|
||||
|
||||
values[sectionCoordinate] = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int paletteIndexAt(final int packedCoordinate) {
|
||||
return values[packedCoordinate];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPaletteIndexAt(final int sectionCoordinate, final int index) {
|
||||
values[sectionCoordinate] = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return palette.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idByIndex(final int index) {
|
||||
return palette.getInt(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdByIndex(final int index, final int id) {
|
||||
final 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 replaceId(final int oldId, final int newId) {
|
||||
final 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 addId(final int id) {
|
||||
inversePalette.put(id, palette.size());
|
||||
palette.add(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
palette.clear();
|
||||
inversePalette.clear();
|
||||
}
|
||||
}
|
||||
+29
-6
@@ -1,4 +1,26 @@
|
||||
package us.myles.ViaVersion.api.minecraft.chunks;
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
@@ -30,7 +52,7 @@ public class NibbleArray {
|
||||
* @return The value at the given XYZ
|
||||
*/
|
||||
public byte get(int x, int y, int z) {
|
||||
return get(y << 8 | z << 4 | x);
|
||||
return get(ChunkSection.index(x, y, z));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +79,7 @@ public class NibbleArray {
|
||||
* @param value Desired Value
|
||||
*/
|
||||
public void set(int x, int y, int z, int value) {
|
||||
set(y << 8 | z << 4 | x, value);
|
||||
set(ChunkSection.index(x, y, z), value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,11 +89,12 @@ public class NibbleArray {
|
||||
* @param value The desired value
|
||||
*/
|
||||
public void set(int index, int value) {
|
||||
index /= 2;
|
||||
if (index % 2 == 0) {
|
||||
handle[index] = (byte) (handle[index] & 0xF0 | value & 0xF);
|
||||
index /= 2;
|
||||
handle[index] = (byte) ((handle[index] & 0xF0) | (value & 0xF));
|
||||
} else {
|
||||
handle[index] = (byte) (handle[index] & 0xF | (value & 0xF) << 4);
|
||||
index /= 2;
|
||||
handle[index] = (byte) ((handle[index] & 0xF) | ((value & 0xF) << 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
|
||||
public enum PaletteType {
|
||||
BLOCKS(ChunkSection.SIZE, 8),
|
||||
BIOMES(ChunkSection.BIOME_SIZE, 3);
|
||||
|
||||
private final int size;
|
||||
private final int highestBitsPerValue;
|
||||
|
||||
PaletteType(final int size, final int highestBitsPerValue) {
|
||||
this.size = size;
|
||||
this.highestBitsPerValue = highestBitsPerValue;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public int highestBitsPerValue() {
|
||||
return highestBitsPerValue;
|
||||
}
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+282
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+286
@@ -0,0 +1,286 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+342
@@ -0,0 +1,342 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+255
@@ -0,0 +1,255 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+260
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
static {
|
||||
TYPES = EntityTypeUtil.toOrderedArray(values());
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
}
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.util.EntityTypeUtil;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum Entity1_19Types implements EntityType {
|
||||
|
||||
ENTITY(null, null),
|
||||
|
||||
AREA_EFFECT_CLOUD(ENTITY),
|
||||
END_CRYSTAL(ENTITY),
|
||||
EVOKER_FANGS(ENTITY),
|
||||
EXPERIENCE_ORB(ENTITY),
|
||||
EYE_OF_ENDER(ENTITY),
|
||||
FALLING_BLOCK(ENTITY),
|
||||
FIREWORK_ROCKET(ENTITY),
|
||||
ITEM(ENTITY),
|
||||
LLAMA_SPIT(ENTITY),
|
||||
TNT(ENTITY),
|
||||
SHULKER_BULLET(ENTITY),
|
||||
FISHING_BOBBER(ENTITY),
|
||||
|
||||
LIVINGENTITY(ENTITY, null),
|
||||
ARMOR_STAND(LIVINGENTITY),
|
||||
MARKER(ENTITY),
|
||||
PLAYER(LIVINGENTITY),
|
||||
|
||||
ABSTRACT_INSENTIENT(LIVINGENTITY, null),
|
||||
ENDER_DRAGON(ABSTRACT_INSENTIENT),
|
||||
|
||||
BEE(ABSTRACT_INSENTIENT),
|
||||
|
||||
ABSTRACT_CREATURE(ABSTRACT_INSENTIENT, null),
|
||||
|
||||
ABSTRACT_AGEABLE(ABSTRACT_CREATURE, null),
|
||||
VILLAGER(ABSTRACT_AGEABLE),
|
||||
WANDERING_TRADER(ABSTRACT_AGEABLE),
|
||||
|
||||
// Animals
|
||||
ABSTRACT_ANIMAL(ABSTRACT_AGEABLE, null),
|
||||
AXOLOTL(ABSTRACT_ANIMAL),
|
||||
DOLPHIN(ABSTRACT_INSENTIENT),
|
||||
CHICKEN(ABSTRACT_ANIMAL),
|
||||
COW(ABSTRACT_ANIMAL),
|
||||
MOOSHROOM(COW),
|
||||
PANDA(ABSTRACT_INSENTIENT),
|
||||
PIG(ABSTRACT_ANIMAL),
|
||||
POLAR_BEAR(ABSTRACT_ANIMAL),
|
||||
RABBIT(ABSTRACT_ANIMAL),
|
||||
SHEEP(ABSTRACT_ANIMAL),
|
||||
TURTLE(ABSTRACT_ANIMAL),
|
||||
FOX(ABSTRACT_ANIMAL),
|
||||
FROG(ABSTRACT_ANIMAL),
|
||||
GOAT(ABSTRACT_ANIMAL),
|
||||
|
||||
ABSTRACT_TAMEABLE_ANIMAL(ABSTRACT_ANIMAL, null),
|
||||
CAT(ABSTRACT_TAMEABLE_ANIMAL),
|
||||
OCELOT(ABSTRACT_TAMEABLE_ANIMAL),
|
||||
WOLF(ABSTRACT_TAMEABLE_ANIMAL),
|
||||
|
||||
ABSTRACT_PARROT(ABSTRACT_TAMEABLE_ANIMAL, null),
|
||||
PARROT(ABSTRACT_PARROT),
|
||||
|
||||
// Horses
|
||||
ABSTRACT_HORSE(ABSTRACT_ANIMAL, null),
|
||||
CHESTED_HORSE(ABSTRACT_HORSE, null),
|
||||
DONKEY(CHESTED_HORSE),
|
||||
MULE(CHESTED_HORSE),
|
||||
LLAMA(CHESTED_HORSE),
|
||||
TRADER_LLAMA(CHESTED_HORSE),
|
||||
HORSE(ABSTRACT_HORSE),
|
||||
SKELETON_HORSE(ABSTRACT_HORSE),
|
||||
ZOMBIE_HORSE(ABSTRACT_HORSE),
|
||||
|
||||
// Golem
|
||||
ABSTRACT_GOLEM(ABSTRACT_CREATURE, null),
|
||||
SNOW_GOLEM(ABSTRACT_GOLEM),
|
||||
IRON_GOLEM(ABSTRACT_GOLEM),
|
||||
SHULKER(ABSTRACT_GOLEM),
|
||||
|
||||
// Fish
|
||||
ABSTRACT_FISHES(ABSTRACT_CREATURE, null),
|
||||
COD(ABSTRACT_FISHES),
|
||||
PUFFERFISH(ABSTRACT_FISHES),
|
||||
SALMON(ABSTRACT_FISHES),
|
||||
TROPICAL_FISH(ABSTRACT_FISHES),
|
||||
|
||||
// Monsters
|
||||
ABSTRACT_MONSTER(ABSTRACT_CREATURE, null),
|
||||
BLAZE(ABSTRACT_MONSTER),
|
||||
CREEPER(ABSTRACT_MONSTER),
|
||||
ENDERMITE(ABSTRACT_MONSTER),
|
||||
ENDERMAN(ABSTRACT_MONSTER),
|
||||
GIANT(ABSTRACT_MONSTER),
|
||||
SILVERFISH(ABSTRACT_MONSTER),
|
||||
VEX(ABSTRACT_MONSTER),
|
||||
WITCH(ABSTRACT_MONSTER),
|
||||
WITHER(ABSTRACT_MONSTER),
|
||||
RAVAGER(ABSTRACT_MONSTER),
|
||||
|
||||
ABSTRACT_PIGLIN(ABSTRACT_MONSTER, null),
|
||||
|
||||
PIGLIN(ABSTRACT_PIGLIN),
|
||||
PIGLIN_BRUTE(ABSTRACT_PIGLIN),
|
||||
|
||||
HOGLIN(ABSTRACT_ANIMAL),
|
||||
STRIDER(ABSTRACT_ANIMAL),
|
||||
TADPOLE(ABSTRACT_FISHES),
|
||||
ZOGLIN(ABSTRACT_MONSTER),
|
||||
WARDEN(ABSTRACT_MONSTER),
|
||||
|
||||
// Illagers
|
||||
ABSTRACT_ILLAGER_BASE(ABSTRACT_MONSTER, null),
|
||||
ABSTRACT_EVO_ILLU_ILLAGER(ABSTRACT_ILLAGER_BASE, null),
|
||||
EVOKER(ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
ILLUSIONER(ABSTRACT_EVO_ILLU_ILLAGER),
|
||||
VINDICATOR(ABSTRACT_ILLAGER_BASE),
|
||||
PILLAGER(ABSTRACT_ILLAGER_BASE),
|
||||
|
||||
// Skeletons
|
||||
ABSTRACT_SKELETON(ABSTRACT_MONSTER, null),
|
||||
SKELETON(ABSTRACT_SKELETON),
|
||||
STRAY(ABSTRACT_SKELETON),
|
||||
WITHER_SKELETON(ABSTRACT_SKELETON),
|
||||
|
||||
// Guardians
|
||||
GUARDIAN(ABSTRACT_MONSTER),
|
||||
ELDER_GUARDIAN(GUARDIAN),
|
||||
|
||||
// Spiders
|
||||
SPIDER(ABSTRACT_MONSTER),
|
||||
CAVE_SPIDER(SPIDER),
|
||||
|
||||
// Zombies
|
||||
ZOMBIE(ABSTRACT_MONSTER),
|
||||
DROWNED(ZOMBIE),
|
||||
HUSK(ZOMBIE),
|
||||
ZOMBIFIED_PIGLIN(ZOMBIE),
|
||||
ZOMBIE_VILLAGER(ZOMBIE),
|
||||
|
||||
// Flying entities
|
||||
ABSTRACT_FLYING(ABSTRACT_INSENTIENT, null),
|
||||
GHAST(ABSTRACT_FLYING),
|
||||
PHANTOM(ABSTRACT_FLYING),
|
||||
|
||||
ABSTRACT_AMBIENT(ABSTRACT_INSENTIENT, null),
|
||||
BAT(ABSTRACT_AMBIENT),
|
||||
ALLAY(ABSTRACT_CREATURE),
|
||||
|
||||
ABSTRACT_WATERMOB(ABSTRACT_INSENTIENT, null),
|
||||
SQUID(ABSTRACT_WATERMOB),
|
||||
GLOW_SQUID(SQUID),
|
||||
|
||||
// Slimes
|
||||
SLIME(ABSTRACT_INSENTIENT),
|
||||
MAGMA_CUBE(SLIME),
|
||||
|
||||
// Hangable objects
|
||||
ABSTRACT_HANGING(ENTITY, null),
|
||||
LEASH_KNOT(ABSTRACT_HANGING),
|
||||
ITEM_FRAME(ABSTRACT_HANGING),
|
||||
GLOW_ITEM_FRAME(ITEM_FRAME),
|
||||
PAINTING(ABSTRACT_HANGING),
|
||||
|
||||
ABSTRACT_LIGHTNING(ENTITY, null),
|
||||
LIGHTNING_BOLT(ABSTRACT_LIGHTNING),
|
||||
|
||||
// Arrows
|
||||
ABSTRACT_ARROW(ENTITY, null),
|
||||
ARROW(ABSTRACT_ARROW),
|
||||
SPECTRAL_ARROW(ABSTRACT_ARROW),
|
||||
TRIDENT(ABSTRACT_ARROW),
|
||||
|
||||
// Fireballs
|
||||
ABSTRACT_FIREBALL(ENTITY, null),
|
||||
DRAGON_FIREBALL(ABSTRACT_FIREBALL),
|
||||
FIREBALL(ABSTRACT_FIREBALL),
|
||||
SMALL_FIREBALL(ABSTRACT_FIREBALL),
|
||||
WITHER_SKULL(ABSTRACT_FIREBALL),
|
||||
|
||||
// Projectiles
|
||||
PROJECTILE_ABSTRACT(ENTITY, null),
|
||||
SNOWBALL(PROJECTILE_ABSTRACT),
|
||||
ENDER_PEARL(PROJECTILE_ABSTRACT),
|
||||
EGG(PROJECTILE_ABSTRACT),
|
||||
POTION(PROJECTILE_ABSTRACT),
|
||||
EXPERIENCE_BOTTLE(PROJECTILE_ABSTRACT),
|
||||
|
||||
// Vehicles
|
||||
MINECART_ABSTRACT(ENTITY, null),
|
||||
CHESTED_MINECART_ABSTRACT(MINECART_ABSTRACT, null),
|
||||
CHEST_MINECART(CHESTED_MINECART_ABSTRACT),
|
||||
HOPPER_MINECART(CHESTED_MINECART_ABSTRACT),
|
||||
MINECART(MINECART_ABSTRACT),
|
||||
FURNACE_MINECART(MINECART_ABSTRACT),
|
||||
COMMAND_BLOCK_MINECART(MINECART_ABSTRACT),
|
||||
TNT_MINECART(MINECART_ABSTRACT),
|
||||
SPAWNER_MINECART(MINECART_ABSTRACT),
|
||||
BOAT(ENTITY),
|
||||
CHEST_BOAT(BOAT);
|
||||
|
||||
private static final EntityType[] TYPES = EntityTypeUtil.createSizedArray(values());
|
||||
private final EntityType parent;
|
||||
private final String identifier;
|
||||
private int id = -1;
|
||||
|
||||
Entity1_19Types(final EntityType parent) {
|
||||
this.parent = parent;
|
||||
this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
Entity1_19Types(final EntityType parent, @Nullable final String identifier) {
|
||||
this.parent = parent;
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
if (id == -1) {
|
||||
throw new IllegalStateException("Ids have not been initialized yet (type " + name() + ")");
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier() {
|
||||
Preconditions.checkArgument(identifier != null, "Called identifier method on abstract type");
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable EntityType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbstractType() {
|
||||
return identifier == null;
|
||||
}
|
||||
|
||||
public static EntityType getTypeFromId(final int typeId) {
|
||||
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
|
||||
}
|
||||
|
||||
public static void initialize(final Protocol<?, ?, ?, ?> protocol) {
|
||||
EntityTypeUtil.initialize(values(), TYPES, protocol, (type, id) -> type.id = id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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
|
||||
* @throws IllegalStateException if ids have not been loaded yet
|
||||
*/
|
||||
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();
|
||||
|
||||
/**
|
||||
* Returns the entity's Vanilla identifier.
|
||||
*
|
||||
* @return entity identifier
|
||||
* @throws IllegalArgumentException if {@link #isAbstractType()} returns true
|
||||
*/
|
||||
String identifier();
|
||||
|
||||
/**
|
||||
* Returns whether the type does not represent an actual entity, e.g. animal or monster.
|
||||
*
|
||||
* @return whether the type does not represent an actual entity
|
||||
*/
|
||||
boolean isAbstractType();
|
||||
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
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-2022 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,129 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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 Item copy() {
|
||||
return new DataItem(identifier, amount, data, 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,97 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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);
|
||||
|
||||
/**
|
||||
* Returns a copy of the item.
|
||||
*
|
||||
* @return copy of the item
|
||||
*/
|
||||
Item copy();
|
||||
}
|
||||
Loaded 100 of 867 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user