Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c09fa331c6
|
||
|
|
0088f657e7
|
||
|
|
0f95f7cbaf | ||
|
|
e607988751 | ||
|
|
d05985fdb3 | ||
|
|
2bb90d32da | ||
|
|
e59c12cf62 | ||
|
|
1f6103aa9b | ||
|
|
00bb773c4a | ||
|
|
b4d8fe6ba1 | ||
|
|
cab919bfaf | ||
|
|
9d9fe03317 | ||
|
|
8fd09c8ba4 | ||
|
|
4802926441 | ||
|
|
5628bcbb83 | ||
|
|
33062af729 | ||
|
|
f32dca9b56 | ||
|
|
a09fa97f42 | ||
|
|
08100010c7 | ||
|
|
9a8a01b753 | ||
|
|
c95c839bb0 | ||
|
|
3e8682f948 | ||
|
|
1e2c5dbb7a | ||
|
|
a11d7eb783 | ||
|
|
40554ef505 | ||
|
|
6ce21135fb | ||
|
|
315a987f4f | ||
|
|
333a373fcc | ||
|
|
8c57534432 | ||
|
|
686e6902fd | ||
|
|
e15fc5953e | ||
|
|
c611a34e76 | ||
|
|
567ef33f6f | ||
|
|
bc0fc7884d | ||
|
|
b3d560bd3a | ||
|
|
4738945a7a | ||
|
|
4c55ef9cab | ||
|
|
a66dbf77aa | ||
|
|
c6cc380c3c | ||
|
|
cd3f146781 | ||
|
|
d0da13edd8 | ||
|
|
ec1f570f4b | ||
|
|
e41e216903 | ||
|
|
43ee417e20 | ||
|
|
4dc57e3d53 | ||
|
|
31f257fee1 | ||
|
|
cda72574fc | ||
|
|
ef1b6a10ea | ||
|
|
c45c700301 | ||
|
|
c43de2b88d | ||
|
|
898b6c8774 | ||
|
|
2e3c47d292 | ||
|
|
7974d1a570 | ||
|
|
cf2c1c5b76 | ||
|
|
d75c54cc70 | ||
|
|
ead13b2bb9 | ||
|
|
2e91b841b0 | ||
|
|
50486fa43a | ||
|
|
31d4cd453d | ||
|
|
c5482b99bf | ||
|
|
98ef806887 | ||
|
|
a26745862f | ||
|
|
6bd081cefd | ||
|
|
bb9aa8b31c | ||
|
|
572f7a2677 | ||
|
|
11a5c9e32c | ||
|
|
02b65dcb36 | ||
|
|
0121534e7e | ||
|
|
941e6f6df4 | ||
|
|
fe6e18845b | ||
|
|
8f8f5e72c0 | ||
|
|
a6c35c6519 | ||
|
|
8b115c7fde | ||
|
|
e2d3874f6d | ||
|
|
26d8190b23 | ||
|
|
d508b6cec1 | ||
|
|
916ef8c5ac | ||
|
|
6b74116ff1 | ||
|
|
5ead6805b9 | ||
|
|
a6eedfdf0b | ||
|
|
38ecd65ee8 | ||
|
|
788c1d1b1f | ||
|
|
0519184da2 | ||
|
|
fd13912295 | ||
|
|
8d3c36de06 | ||
|
|
219d374d7c | ||
|
|
9b163e70c3 | ||
|
|
9ed00904f9 | ||
|
|
e56abf5cac | ||
|
|
1bf7274dc8 | ||
|
|
d218451418 | ||
|
|
7d8dcce307 | ||
|
|
2f5d527a38 | ||
|
|
a16c5a9fc5 | ||
|
|
318608b9cd | ||
|
|
ae7496fbad | ||
|
|
32a1dfe74f | ||
|
|
815ec24af1 | ||
|
|
8ee0b66eed | ||
|
|
ab2385b975 | ||
|
|
5a9ccf7c17 | ||
|
|
22877d06a7 | ||
|
|
35d85d08a7 | ||
|
|
f5bb1c42db | ||
|
|
cfb8519ae2 | ||
|
|
4d1fa925ff | ||
|
|
fa410b704a | ||
|
|
483628f1f2 | ||
|
|
7930e66676 | ||
|
|
5b547a303a | ||
|
|
497d8e17da | ||
|
|
efbd5d23cd | ||
|
|
592b8c8d47 | ||
|
|
5393edc35b | ||
|
|
97aff00ced | ||
|
|
69121c5722 | ||
|
|
ba57197552 | ||
|
|
7ca372dca4 | ||
|
|
e9fb10b63c | ||
|
|
ca7696ce12 | ||
|
|
e63c806d64 | ||
|
|
e470ca0002 | ||
|
|
80e90a4401 | ||
|
|
1d35f2ec35 | ||
|
|
e639eb763a | ||
|
|
d8343d278d | ||
|
|
833f49fff3 | ||
|
|
cd45a6e7ce | ||
|
|
271362da78 | ||
|
|
05562c27c1 | ||
|
|
5b4ed02748 | ||
|
|
fe4e407520 | ||
|
|
f003b6b84a | ||
|
|
207e085120 | ||
|
|
0a155651a1 | ||
|
|
d061083a8a | ||
|
|
ad4c8e42f2 | ||
|
|
b8b13f5831 | ||
|
|
4dc533506f | ||
|
|
a166b70996 | ||
|
|
639e8c454d | ||
|
|
61fc96ee11 | ||
|
|
56259c8318 | ||
|
|
a8637d9a06 | ||
|
|
ce607b5cc7 | ||
|
|
aa9a615c6b | ||
|
|
8febef07c3 | ||
|
|
13fcce6059 | ||
|
|
cf6427325c | ||
|
|
2c30a2748c | ||
|
|
1ca5b33304 | ||
|
|
265859bdae | ||
|
|
93e29ac832 | ||
|
|
4735795323 | ||
|
|
fe5732b616 | ||
|
|
b0d9b747de | ||
|
|
3f0f973fac | ||
|
|
1fa3f15d91 | ||
|
|
2979b9d63d | ||
|
|
a734a4a9d1 | ||
|
|
30d44db111 | ||
|
|
6b80f9bab2 | ||
|
|
5743d1da0b | ||
|
|
80b8393a89 | ||
|
|
4e83c361bd | ||
|
|
dcfeda181c | ||
|
|
bae320a338 | ||
|
|
1b9b748bb9 | ||
|
|
64c557a7a8 | ||
|
|
16a2a3a671 | ||
|
|
509edfd987 | ||
|
|
32551f00e0 | ||
|
|
bfaf7a58e5 | ||
|
|
42761437cd | ||
|
|
cff9a87156 | ||
|
|
44f6b6c9be | ||
|
|
755a8aa22e | ||
|
|
1d566100fb | ||
|
|
212cca1d65 | ||
|
|
1f40811877 | ||
|
|
f45d2f8567 | ||
|
|
9b19bfc6df | ||
|
|
c2a8400751 | ||
|
|
3cbfbd3b9f | ||
|
|
ea6808b697 | ||
|
|
85f868c37e | ||
|
|
f6e036df76 | ||
|
|
55ed56668e | ||
|
|
705509489a | ||
|
|
57a42e1156 | ||
|
|
7181f485eb | ||
|
|
5f3dc1be53 | ||
|
|
4f06afc2bd | ||
|
|
c267a754e7 | ||
|
|
7657a59b07 | ||
|
|
f95ec49d6f | ||
|
|
1be574bc21 | ||
|
|
0640e2468c | ||
|
|
2adfee3b60 | ||
|
|
b65d7af793 | ||
|
|
8f7fd34fa4 | ||
|
|
5bf0e9b22a | ||
|
|
808605e06a | ||
|
|
fb387bf9c5 | ||
|
|
a3ff540cb3 | ||
|
|
1cafd08326 | ||
|
|
d5458145a0 | ||
|
|
316e6ac1ba | ||
|
|
6b66611810 | ||
|
|
89176f4f11 | ||
|
|
0808c52317 | ||
|
|
e93199fcfe | ||
|
|
04e5dfdc4e | ||
|
|
cba704fe3d | ||
|
|
f2ef57673c | ||
|
|
6f7e24ac9e | ||
|
|
54bd8fb5f7 | ||
|
|
22c0ddc5de | ||
|
|
43bb38f4cf | ||
|
|
b9f110219e | ||
|
|
4fc70ad603 | ||
|
|
8c33faa4f5 | ||
|
|
6375718b10 | ||
|
|
e51ea0eeb6 | ||
|
|
5ce209e0e9 | ||
|
|
d232242997 | ||
|
|
3e6d17274d | ||
|
|
4350c7f614 | ||
|
|
aea0c6c76f | ||
|
|
5b8b8f5e10 | ||
|
|
b46f771103 | ||
|
|
fb8430518b | ||
|
|
9a686ee527 | ||
|
|
cb3dd89c78 | ||
|
|
5689389f3a | ||
|
|
ed07809c84 | ||
|
|
081fc0db41 | ||
|
|
74d60c2126 | ||
|
|
d45f2cdd64 | ||
|
|
09898c8c1e | ||
|
|
131660d89f | ||
|
|
1c066873fd | ||
|
|
8429689837 | ||
|
|
19c8a1ce1b | ||
|
|
c6fdaf507f | ||
|
|
7b097b3e54 | ||
|
|
c14928defa | ||
|
|
6b4e74abe9 | ||
|
|
1fb3aa8c7a | ||
|
|
f175a903a3 | ||
|
|
7c80e37e3a | ||
|
|
ff61e1d897 | ||
|
|
d49272a41f | ||
|
|
bea6df1174 | ||
|
|
4ca84f6001 | ||
|
|
61c079af19 | ||
|
|
e0b9deb128 | ||
|
|
1d89bc7f95 | ||
|
|
28c18c33fa | ||
|
|
d08cb1b743 | ||
|
|
fb18f69a0b | ||
|
|
56e1d32aa0 | ||
|
|
d4aa5a2fb3 | ||
|
|
b54a87f465 | ||
|
|
5acfa9faf7 | ||
|
|
638f4cd19a | ||
|
|
baf12dd516 | ||
|
|
4b6b26fbba | ||
|
|
5c5784795d | ||
|
|
1f8e7515b1 | ||
|
|
3778698018 | ||
|
|
40dd2be139 | ||
|
|
edbe2c92ce | ||
|
|
b9ae1ef43e | ||
|
|
4631fd1977 | ||
|
|
3d25686745 | ||
|
|
18b5b2626a | ||
|
|
219ad4737a | ||
|
|
b9368ae80a | ||
|
|
03c80ccff8 | ||
|
|
f6aed5578f | ||
|
|
646de0b1af | ||
|
|
4e33a40ede | ||
|
|
21b0ac7a43 | ||
|
|
15d3944700 | ||
|
|
acd9a6f57c | ||
|
|
d5fe4e22b4 | ||
|
|
9f0c38915a | ||
|
|
bc7f081b3a | ||
|
|
46b6627f9f | ||
|
|
51cc1843ad | ||
|
|
98d1d2cb49 | ||
|
|
556560a0f3 | ||
|
|
be2534c6e6 | ||
|
|
d40d1bd232 | ||
|
|
6143f78ccf | ||
|
|
52cdebc3d3 | ||
|
|
cdccae95e0 | ||
|
|
b0c45e3ed3 | ||
|
|
3ba518650c | ||
|
|
5a303996a1 | ||
|
|
695534e8a8 | ||
|
|
16ba011243 | ||
|
|
0ea7271157 | ||
|
|
dc2b2f1407 | ||
|
|
85baefc69b | ||
|
|
41e0fdc20f | ||
|
|
5c328fba33 | ||
|
|
91b11878fb | ||
|
|
0ea5e07d63 | ||
|
|
152e4e77a8 | ||
|
|
cf20c6397d | ||
|
|
981672e2cf | ||
|
|
d10b600e72 | ||
|
|
de9cec36c7 | ||
|
|
6eb561607c | ||
|
|
db3e1f605a | ||
|
|
31583fc2d3 | ||
|
|
6096ce4eea | ||
|
|
873da12233 | ||
|
|
78191ea366 | ||
|
|
f8d7c5c193 | ||
|
|
bc9c979e7d | ||
|
|
d686a9ddf0 | ||
|
|
9dd610605f | ||
|
|
219e163ac2 | ||
|
|
925e7b4664 | ||
|
|
5a9f040af8 | ||
|
|
992ad7f35a | ||
|
|
bb93ac011c | ||
|
|
4070ea9f02 | ||
|
|
499efa1608 | ||
|
|
0196d9c83e | ||
|
|
4c316de042 | ||
|
|
8ee5d7e680 | ||
|
|
64c128d414 | ||
|
|
77d11fc593 | ||
|
|
2c72a09809 | ||
|
|
3dbd81da76 | ||
|
|
a0116c7ea7 | ||
|
|
fd5dadbe01 | ||
|
|
df87a02c38 | ||
|
|
bb293b3e5d | ||
|
|
ff03892b25 | ||
|
|
eb51306d82 | ||
|
|
81eb3362f3 | ||
|
|
7f06b03453 | ||
|
|
c16432de2a | ||
|
|
b162dbdff0 | ||
|
|
dfbe57e304 | ||
|
|
6f6dc2c641 | ||
|
|
06990ec0c9 | ||
|
|
351b42b5e5 | ||
|
|
20e3c832fb | ||
|
|
ec9c121da2 | ||
|
|
12c773edea | ||
|
|
97b411aa6d | ||
|
|
24f6c4f0fd | ||
|
|
9409c7d22a | ||
|
|
17d94a17f0 | ||
|
|
a1cb4d3691 | ||
|
|
1d5070a480 | ||
|
|
f612adbd0a | ||
|
|
6716beec5a | ||
|
|
d22b00e4a6 | ||
|
|
fe9ca49920 | ||
|
|
e1837dc578 | ||
|
|
66eead2927 | ||
|
|
937a2a2532 | ||
|
|
bee45ef9ef | ||
|
|
1946a65ab2 | ||
|
|
f594a946d4 | ||
|
|
7a0ec492d1 | ||
|
|
b4fac61eb9 | ||
|
|
7817b7a422 | ||
|
|
ed266d296e | ||
|
|
3ce324c1e1 | ||
|
|
835dc4733d | ||
|
|
aa66a6b482 | ||
|
|
406855d427 | ||
|
|
fe5ba84f7a | ||
|
|
f49495162b | ||
|
|
be5c451f42 | ||
|
|
1517596a9f | ||
|
|
6a89b84879 | ||
|
|
c414458f1c | ||
|
|
ec9086abc4 | ||
|
|
d6c16677fc | ||
|
|
7cd3a75ef8 | ||
|
|
0677cbaa3c | ||
|
|
ab8b5abc48 | ||
|
|
60c67659d0 | ||
|
|
814190c2df | ||
|
|
04d647bfef | ||
|
|
930bf67229 | ||
|
|
51c3085180 | ||
|
|
b981223e0a | ||
|
|
3951cff03a | ||
|
|
77a6ae37c0 | ||
|
|
12e201633f | ||
|
|
8eb005e775 | ||
|
|
4d39c0007f | ||
|
|
d9609e60b8 | ||
|
|
ab3927dff7 | ||
|
|
1a60c52fa3 | ||
|
|
f88dae1828 | ||
|
|
2626773267 | ||
|
|
f16f1905b7 | ||
|
|
cc435b2b02 | ||
|
|
eb2d603aae | ||
|
|
c30e0f45bc | ||
|
|
ebb24c73a2 | ||
|
|
575c5b9abf | ||
|
|
812694d74d | ||
|
|
1efaffbc7d | ||
|
|
b03b5f7da7 | ||
|
|
3554db9e3a | ||
|
|
a6d58fc02b | ||
|
|
e2045295a0 | ||
|
|
a6b219c0df | ||
|
|
0b5721d81e | ||
|
|
5bad61e210 | ||
|
|
e597d8faaa | ||
|
|
d9eb7109bd | ||
|
|
77d68306b6 | ||
|
|
16aec9c0a1 | ||
|
|
c6cde5fc10 | ||
|
|
bf84eb0141 | ||
|
|
4dfc3bd2be | ||
|
|
b0c53ffdd3 | ||
|
|
d65b2abc46 | ||
|
|
03313a1681 | ||
|
|
78c5e2c8e3 | ||
|
|
e467c7c03f | ||
|
|
0c01425641 | ||
|
|
01d26e7ac5 | ||
|
|
99ea6c32ad | ||
|
|
cf231d92b1 | ||
|
|
f555188428 | ||
|
|
93d6fa2e78 | ||
|
|
162fcafb36 | ||
|
|
3d0a0fe590 | ||
|
|
b06556a84e | ||
|
|
ac8bb104b3 | ||
|
|
4b85ca7691 | ||
|
|
ebd8eb79c1 | ||
|
|
09cffbfb33 | ||
|
|
49a1bffc98 | ||
|
|
da022a0b63 | ||
|
|
3beddaf522 | ||
|
|
70139c6838 | ||
|
|
f040077c13 | ||
|
|
1f404820b7 | ||
|
|
742e70fff6 | ||
|
|
dd6a1a7f6e | ||
|
|
08ef7c2f35 | ||
|
|
e128469313 | ||
|
|
cbb753271e | ||
|
|
29f299d882 | ||
|
|
41138aabd1 | ||
|
|
b90f20cfeb | ||
|
|
585028beb7 | ||
|
|
160eaa35aa | ||
|
|
9fb02581a6 | ||
|
|
7d01d5363b | ||
|
|
8a549d7f11 | ||
|
|
50e2db93b4 | ||
|
|
2d80c9526a | ||
|
|
80d72121cf | ||
|
|
ba11b3c214 | ||
|
|
2ee4c86dcb | ||
|
|
97b8cbbc6f | ||
|
|
1a1ae41a7b | ||
|
|
2b7a86bc55 | ||
|
|
175c320389 | ||
|
|
b22430a923 | ||
|
|
c9f9e88ebe | ||
|
|
7f0b3fc241 | ||
|
|
e13b99e73a | ||
|
|
304d9f04ec | ||
|
|
92b59fd904 | ||
|
|
7e42ce2a5c | ||
|
|
d3475dc751 | ||
|
|
cd6e5a3d7a | ||
|
|
67e50ed6f4 | ||
|
|
097ad1c721 | ||
|
|
6a4f5732e2 | ||
|
|
000769e7c5 | ||
|
|
c725242713 | ||
|
|
fd9d7d674b | ||
|
|
5c87388353 | ||
|
|
3b65720d04 | ||
|
|
44af621c12 | ||
|
|
4e33615d9e | ||
|
|
a5b34b9fac | ||
|
|
674b81a5ce | ||
|
|
36a3a7bd32 | ||
|
|
d2b2f56438 | ||
|
|
5cb147f8c5 | ||
|
|
c1c6d7378d | ||
|
|
3cd9d8c20b | ||
|
|
8faa00af14 | ||
|
|
2aa02cfc20 | ||
|
|
1071e68e6e | ||
|
|
bcf4efacc5 | ||
|
|
4ab3148dd9 | ||
|
|
b0269b53b7 | ||
|
|
5df2ffe6a8 | ||
|
|
0e8e58dc5c | ||
|
|
d1e27617a9 | ||
|
|
5ab4f49148 | ||
|
|
494da63b66 | ||
|
|
a0b0ed4b68 | ||
|
|
e9ec29a217 | ||
|
|
fb5bc8254a | ||
|
|
a7bc03f6a9 | ||
|
|
d1bea0326c | ||
|
|
d3512c9e7f | ||
|
|
2f1f7538e5 | ||
|
|
ac3362f950 | ||
|
|
74e510b056 | ||
|
|
fdd263b806 | ||
|
|
a764cec4a9 | ||
|
|
764861e29b | ||
|
|
3e946ff67e | ||
|
|
dca45ceb0e | ||
|
|
327ec23ae9 | ||
|
|
9cf7737502 | ||
|
|
0c5fa1b00a | ||
|
|
1ca075fe89 | ||
|
|
d7c50a0c06 | ||
|
|
0e98839cee | ||
|
|
512ceeb401 | ||
|
|
1bf04b4769 | ||
|
|
e24981031b | ||
|
|
261188569d | ||
|
|
d2f35708ed | ||
|
|
d282f37483 | ||
|
|
b244776cc9 | ||
|
|
3418e2c21a | ||
|
|
d05bdd9eda | ||
|
|
a92e75b8cc | ||
|
|
280b1476ed | ||
|
|
9f6e7fa4e5 | ||
|
|
7ea38a9447 | ||
|
|
30df64b4d4 | ||
|
|
73286fd946 | ||
|
|
82373acf44 | ||
|
|
3aa3e3d2f9 | ||
|
|
33d2376e5c | ||
|
|
5aae4ab10a | ||
|
|
c17b6c5099 | ||
|
|
e41e8dfd63 | ||
|
|
ce26107730 | ||
|
|
60dd68184d | ||
|
|
08b921729d | ||
|
|
3b27af0964 | ||
|
|
742911a679 | ||
|
|
4773ba41cf | ||
|
|
f2456abd5b | ||
|
|
366675f7f8 | ||
|
|
bccbf80446 | ||
|
|
75c6662665 | ||
|
|
813cf813cf | ||
|
|
037410d405 | ||
|
|
c9d5632143 | ||
|
|
fd164d20e7 | ||
|
|
488a6b6919 | ||
|
|
3cd01978df | ||
|
|
0c4dbbe0bb | ||
|
|
1750131831 | ||
|
|
5ac7aaccb7 | ||
|
|
ae60e2f28d | ||
|
|
17a73dff82 | ||
|
|
5e9d213082 | ||
|
|
210b0a6f0e | ||
|
|
f0f87b26d7 | ||
|
|
45a55a81c7 | ||
|
|
b2ec9eab50 | ||
|
|
2f08f0d58c | ||
|
|
d3f92ce9b8 | ||
|
|
cfa20ba418 | ||
|
|
de6ac47a2f | ||
|
|
b41733bdf6 | ||
|
|
8f8bc55bd0 | ||
|
|
81d92a728d | ||
|
|
68666d2d44 | ||
|
|
e539375143 | ||
|
|
0acec719b1 | ||
|
|
93e92ffc82 | ||
|
|
82c55b1d78 | ||
|
|
dd660a2de0 | ||
|
|
96c12ef483 | ||
|
|
1653de70c8 | ||
|
|
b57265e64f | ||
|
|
9d4af84872 | ||
|
|
40665782e7 | ||
|
|
2d663db53f | ||
|
|
896c6accfb | ||
|
|
1785677901 | ||
|
|
e32205ddaf | ||
|
|
f93c64d6aa | ||
|
|
b5eb568515 | ||
|
|
7897fca5be | ||
|
|
3ba86741f9 | ||
|
|
5515011644 | ||
|
|
f59e2a2de4 | ||
|
|
88c103c0a5 | ||
|
|
5772ee4a93 | ||
|
|
c525575d37 | ||
|
|
b8a170873d | ||
|
|
04e936d487 | ||
|
|
6553fc9ae9 | ||
|
|
ddbe8ef0fb | ||
|
|
8e4da81022 | ||
|
|
1620fc35f5 | ||
|
|
e878d77959 | ||
|
|
deab6a0cac | ||
|
|
77f0826ec8 | ||
|
|
76db43cab3 | ||
|
|
f0eab71644 | ||
|
|
e9985adafc | ||
|
|
157a1fe249 | ||
|
|
d48d0a21db | ||
|
|
908078becb | ||
|
|
d0815baac7 | ||
|
|
bc6ad16d40 | ||
|
|
33aecef7b3 | ||
|
|
b7d37b16ae | ||
|
|
2b840abfef | ||
|
|
bc4ad7faa3 | ||
|
|
f08a412db5 | ||
|
|
dcf050a604 | ||
|
|
1f8d1339f5 | ||
|
|
5278f8ba65 | ||
|
|
8fdae33333 | ||
|
|
4054e83ffe | ||
|
|
10f2cad8fd | ||
|
|
74b9eb9f45 | ||
|
|
dde599c128 | ||
|
|
af8cbaf439 | ||
|
|
ad83d01fad | ||
|
|
7eb3632144 | ||
|
|
1ac668d9f2 | ||
|
|
f5033342c9 | ||
|
|
a0c0b7eff2 | ||
|
|
7985b39ed5 | ||
|
|
f26e370a49 | ||
|
|
cb0c301baf | ||
|
|
3858a83972 | ||
|
|
82ff0bae49 | ||
|
|
ee16d7af28 | ||
|
|
f914d57678 | ||
|
|
c13b40a373 | ||
|
|
d60a37f7e6 | ||
|
|
3caaed00dc | ||
|
|
f56bfbebb5 | ||
|
|
3eec520ebd | ||
|
|
df69f1f344 | ||
|
|
009b6c810c | ||
|
|
65b76d53ef | ||
|
|
7be7139241 | ||
|
|
9bc943ea67 | ||
|
|
f880adced2 | ||
|
|
fc07601f24 | ||
|
|
ecb241c187 | ||
|
|
46040b1f5d | ||
|
|
54daa11ce4 | ||
|
|
c556420870 | ||
|
|
84d928ebe7 | ||
|
|
fa6eab5cc3 | ||
|
|
94b26a903c | ||
|
|
c242456c30 | ||
|
|
8391e9d924 | ||
|
|
f5aac9b1ab | ||
|
|
a6850392e1 | ||
|
|
2b37178482 | ||
|
|
82199d9f39 | ||
|
|
c2d2c6d067 | ||
|
|
4066a7b5b6 | ||
|
|
4a7624fef4 | ||
|
|
e38b3f3824 | ||
|
|
4573035aab | ||
|
|
393a5ee973 | ||
|
|
080dc18165 | ||
|
|
6fd421d36e | ||
|
|
84bd1d0782 | ||
|
|
cff2303c62 | ||
|
|
f5733c2cb8 | ||
|
|
21fec0e263 | ||
|
|
093acc519e | ||
|
|
886be3161e | ||
|
|
dc7b708556 | ||
|
|
e82f28c1ac | ||
|
|
7c7239a70d | ||
|
|
3e3dad9e33 | ||
|
|
4871977681 | ||
|
|
0a56e57aec | ||
|
|
a6ff477b8a | ||
|
|
ddad0384f3 | ||
|
|
aabe47f8bc | ||
|
|
354a5f1b75 | ||
|
|
f58afd434d | ||
|
|
57d5652cd5 | ||
|
|
25b521dfcf | ||
|
|
ce655d0679 | ||
|
|
e4e8297a82 | ||
|
|
8357fd01aa | ||
|
|
12b420d3e7 | ||
|
|
db20bc0ae4 | ||
|
|
2a2afa3821 | ||
|
|
f0b2d9aafe | ||
|
|
cd427a2a39 | ||
|
|
75537d3f85 | ||
|
|
a88e2f3fb5 | ||
|
|
8a41e7add6 | ||
|
|
9c35228287 | ||
|
|
f9ec6b9d03 | ||
|
|
22d396d909 | ||
|
|
39b28e21ca | ||
|
|
0488cb7fbe | ||
|
|
ec4aa0637e | ||
|
|
ffc5584b1c | ||
|
|
45c6cfedb0 | ||
|
|
c150e50636 | ||
|
|
16e32a62e5 | ||
|
|
1d18f2e45e | ||
|
|
e46b38e58a | ||
|
|
033741d292 | ||
|
|
7a3ef1e0b7 | ||
|
|
5be41ed3e9 | ||
|
|
83e44641d0 | ||
|
|
50084c112d | ||
|
|
81682f4921 | ||
|
|
1c339e8b54 | ||
|
|
1a9cda0579 | ||
|
|
6ad9a71907 | ||
|
|
9f24576ba7 | ||
|
|
8661bbc1fc | ||
|
|
0b5fa37f96 | ||
|
|
dab32bafa1 | ||
|
|
9e5c541f79 | ||
|
|
9674c617ca | ||
|
|
9df1704357 | ||
|
|
c0821de2e2 | ||
|
|
c358c39027 | ||
|
|
451b3a2637 | ||
|
|
619eecacf8 | ||
|
|
6bae039d52 | ||
|
|
b321029886 | ||
|
|
5287d4fb4f | ||
|
|
a0a2794291 | ||
|
|
9e354e956e | ||
|
|
27033e9096 | ||
|
|
e436bbe375 | ||
|
|
050a1dbacb | ||
|
|
ae1838d78a | ||
|
|
7235485802 | ||
|
|
fcb472347e | ||
|
|
e0ce8cc715 | ||
|
|
ebc0e61be8 | ||
|
|
95581a6fa5 | ||
|
|
d0b49009e5 | ||
|
|
369b076cad | ||
|
|
6555bcda74 | ||
|
|
e537dbb024 | ||
|
|
f92dbb655d | ||
|
|
0b2dac9056 | ||
|
|
7cd5514b90 | ||
|
|
5017d4bbb3 | ||
|
|
32e51b52aa | ||
|
|
4f66fd793b | ||
|
|
2a71612aea | ||
|
|
a993a08b8d | ||
|
|
a9c947517c | ||
|
|
2841bf3040 | ||
|
|
7edddda36e | ||
|
|
33de12ceb1 | ||
|
|
f8eb57cdbb | ||
|
|
b2d523f5c0 | ||
|
|
b586b0d361 | ||
|
|
c6381e7f4d | ||
|
|
10ee7e1930 | ||
|
|
78abf8be00 | ||
|
|
1dde24bb68 | ||
|
|
bc57512ca2 | ||
|
|
6ad3beca76 | ||
|
|
9d75125e41 | ||
|
|
8ce4112e86 | ||
|
|
7d542d5667 | ||
|
|
7d6599b90e | ||
|
|
1b03e24160 | ||
|
|
fcd91bb855 | ||
|
|
bda4ea9fd0 | ||
|
|
cbd26ce9d9 | ||
|
|
8d53f4aa5a | ||
|
|
1438f1f68d | ||
|
|
61fcf6f895 | ||
|
|
736834441d | ||
|
|
3f5417be97 | ||
|
|
cc1c88001f | ||
|
|
274f98c24e | ||
|
|
f39b466ac0 | ||
|
|
aa22ca1d56 | ||
|
|
802e868b2e | ||
|
|
02442a9775 | ||
|
|
5349de91c5 | ||
|
|
a8ef3c890a | ||
|
|
b556e6528a | ||
|
|
434b32cad8 | ||
|
|
60b3ba6bb7 | ||
|
|
864beef341 | ||
|
|
7b21df2c12 | ||
|
|
462a10363c | ||
|
|
040f85659d | ||
|
|
48d5aaf8fa | ||
|
|
41b0d95d70 | ||
|
|
b599399c48 | ||
|
|
721e27eb39 | ||
|
|
c9d6fbfcd0 | ||
|
|
b1f64fd081 | ||
|
|
2b508567db | ||
|
|
24d0ae7607 | ||
|
|
40a44d5dc5 | ||
|
|
b5a06181d4 | ||
|
|
35fa7e78a0 | ||
|
|
7f4faab4ab | ||
|
|
3906b47654 | ||
|
|
1476adb281 | ||
|
|
6fb072120b | ||
|
|
f2f0be0581 | ||
|
|
5ec30ef18a | ||
|
|
0915afe43b | ||
|
|
87b041bf3a | ||
|
|
275b09bdbb | ||
|
|
cc87c02020 | ||
|
|
a45985ed58 | ||
|
|
92dedfb950 | ||
|
|
6bbcf7d784 | ||
|
|
465a2354c0 | ||
|
|
c59c15d6f3 | ||
|
|
20f7738f08 | ||
|
|
323f0fa087 | ||
|
|
3138d667a6 | ||
|
|
365040f59d | ||
|
|
303d9ecf51 | ||
|
|
463381b84e | ||
|
|
7fef96d77e | ||
|
|
17358120cd | ||
|
|
e6da77cf47 | ||
|
|
dc503cd613 | ||
|
|
8aa2f4be46 | ||
|
|
c5dc5b2bf8 | ||
|
|
f4d6659760 | ||
|
|
bfbb80f708 | ||
|
|
248da118a9 | ||
|
|
a987882132 | ||
|
|
bca25d4744 | ||
|
|
2417ffe483 | ||
|
|
8606e5d663 | ||
|
|
5a0ca55b97 | ||
|
|
ceb1cffb00 | ||
|
|
1ff3035bc0 | ||
|
|
1f221ea828 | ||
|
|
dd1fad2dd7 | ||
|
|
245f7e24e4 | ||
|
|
9d3db4cf97 | ||
|
|
b67ebecce8 | ||
|
|
d03207289e | ||
|
|
64497b305a | ||
|
|
f5b3799db9 | ||
|
|
00fedc7656 | ||
|
|
05aa05c5b4 | ||
|
|
5243c1800e | ||
|
|
77d702bc9b | ||
|
|
c098e24c4f | ||
|
|
3d083cf463 | ||
|
|
2ab62a8f4f | ||
|
|
296f42086f | ||
|
|
e9f547f7ba | ||
|
|
b7f388b9ee | ||
|
|
824ff375d4 | ||
|
|
8bec05ed38 | ||
|
|
b367caa4b2 | ||
|
|
1c281abf65 |
No files matched your search
@@ -0,0 +1 @@
|
||||
@../AGENTS.md
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
|
||||
[*.java]
|
||||
@@ -13,4 +13,4 @@ ij_java_generate_final_locals = true
|
||||
ij_java_generate_final_parameters = true
|
||||
|
||||
[{*.json,*.yml}]
|
||||
indent_size = 2
|
||||
indent_size = 2
|
||||
@@ -0,0 +1 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -0,0 +1,3 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
@@ -1,2 +1,3 @@
|
||||
github: kennytv
|
||||
patreon: kennytv
|
||||
custom: ['https://florianreuth.de/donate']
|
||||
@@ -21,10 +21,11 @@ body:
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Console Error
|
||||
label: Server/Client Error
|
||||
description: |
|
||||
If you encounter warnings/errors in your console, **paste them with https://mclo.gs/ and put the paste link here**.
|
||||
If the error is small/less than 10 lines, you may put it directly into this field.
|
||||
**Important**: If you are kicked for `Network Protocol Error` or an encoder/decoder exception, please click the `Open Report Directory` button on your client and paste the newest disconnect file contents.
|
||||
value: |
|
||||
```
|
||||
Put the mclo.gs link or text here.
|
||||
@@ -40,7 +41,7 @@ body:
|
||||
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."
|
||||
Example: "Placing signs on 1.21.3 causes text to disappear."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -49,21 +50,12 @@ body:
|
||||
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.
|
||||
**Please always include the client version(s) with which the issue happens. Ideally also try to find out, from what specific version onward/in what version range the issue happens.**
|
||||
placeholder: |
|
||||
Example:
|
||||
1. Login with a 1.13.2 client
|
||||
1. Login with a 1.21.3 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."
|
||||
3. The sign text disappears
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
- package-ecosystem: "gradle"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Build
|
||||
on: [pull_request, push, workflow_dispatch]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
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-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
|
||||
with:
|
||||
cache-disabled: false
|
||||
cache-provider: basic
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
check-latest: true
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Upload Artifacts to GitHub
|
||||
# Only upload on the preview repository as there is no CI job for it.
|
||||
if: ${{ github.repository == 'ViaVersion/ViaVersionDev' && github.ref_name == 'preview' }}
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: Artifacts
|
||||
path: build/libs/
|
||||
if-no-files-found: error
|
||||
@@ -1,24 +0,0 @@
|
||||
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-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/actions/wrapper-validation@v3
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
check-latest: true
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
@@ -4,24 +4,41 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository_owner == 'ViaVersion'
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/actions/wrapper-validation@v3
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
|
||||
with:
|
||||
cache-disabled: false
|
||||
cache-provider: basic
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
check-latest: true
|
||||
- name: Publish
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Publish to Hangar
|
||||
env:
|
||||
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}
|
||||
run: ./gradlew publishAllPublicationsToHangar --stacktrace
|
||||
continue-on-error: true
|
||||
- name: Publish to Modrinth
|
||||
env:
|
||||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
||||
run: ./gradlew build modrinth publishAllPublicationsToHangar --stacktrace
|
||||
run: ./gradlew modrinth --stacktrace
|
||||
continue-on-error: true
|
||||
+21
-94
@@ -1,112 +1,39 @@
|
||||
### Java files ###
|
||||
*.class
|
||||
# Gradle
|
||||
|
||||
# Package Files
|
||||
#*.jar
|
||||
*.war
|
||||
*.ear
|
||||
.gradle/
|
||||
build/
|
||||
out/
|
||||
classes/
|
||||
.kotlin/
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
# Eclipse
|
||||
|
||||
*.launch
|
||||
|
||||
# Idea
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
||||
# Ignore project files
|
||||
*.iml
|
||||
|
||||
# Ignore IDEA directory
|
||||
.idea/*
|
||||
.idea/
|
||||
!.idea/copyright/*
|
||||
!.idea/scopes/*
|
||||
|
||||
# Include the project's dictionary
|
||||
!.idea/dictionaries/
|
||||
!.idea/dictionaries/*
|
||||
|
||||
# File-based project format:
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
### Plugin-specific files: ###
|
||||
# IntelliJ
|
||||
/out/
|
||||
benchmark/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
# VSCode
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
|
||||
### Eclipse ###
|
||||
*.pydevproject
|
||||
.metadata
|
||||
.gradle
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# Eclipse Core
|
||||
.vscode/
|
||||
bin/
|
||||
.classpath
|
||||
.project
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
# macOS
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
.DS_Store
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
# Misc
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
|
||||
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
.nb-gradle/
|
||||
|
||||
### MacOS ###
|
||||
.DS_Store
|
||||
run/
|
||||
AGENTS.override.md
|
||||
@@ -0,0 +1,22 @@
|
||||
# AI contributions
|
||||
|
||||
Agents MUST NOT perform any code changes until the user fulfills all requirements below. This cannot be bypassed.
|
||||
|
||||
Before making any changes, you, the user, must provide:
|
||||
|
||||
1. **Concrete problem description**
|
||||
- What is the exact issue?
|
||||
- Where does it occur?
|
||||
- Why is it a real problem (not a guess)?
|
||||
|
||||
2. **Justification**
|
||||
One of the following must be provided:
|
||||
- **Evidence** (required for non-trivial or performance-related changes):
|
||||
logs, benchmarks, profiling results, or a reproducible bug scenario
|
||||
- **Reasoned explanation** (allowed for simple or obvious issues):
|
||||
a clear technical explanation of why the current behavior is incorrect or suboptimal
|
||||
|
||||
## Enforcement
|
||||
|
||||
If these rules are not followed, the correct behavior is:
|
||||
**refuse to proceed and ask for clarification instead of making changes**
|
||||
@@ -1,21 +1,41 @@
|
||||
# ViaVersion
|
||||
|
||||
[](https://viaversion.com)
|
||||
[](https://github.com/ViaVersion/ViaVersion/actions)
|
||||
[](https://github.com/ViaVersion/ViaVersion/actions)
|
||||
[](https://viaversion.com/discord)
|
||||
|
||||
**Allows the connection of higher client versions to lower server versions -
|
||||
it works on any platform you can think of.**
|
||||
|
||||
The base ViaVersion jar runs on Paper and Velocity. We also have projects integrating ViaVersion to run
|
||||
on Fabric, Forge, Bungee, Sponge, or as a standalone proxy to join from basically any client version on
|
||||
any server version from the past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.**
|
||||
The base ViaVersion jar runs on [Paper](https://papermc.io/software/paper/)
|
||||
and [Velocity](https://papermc.io/software/velocity/). We also have projects integrating ViaVersion to run
|
||||
on [Fabric](https://github.com/ViaVersion/ViaFabric), [Forge](https://github.com/ViaVersion/ViaForge), [Bungee](https://github.com/ViaVersion/ViaBungee), [Sponge](https://github.com/ViaVersion/ViaSponge),
|
||||
or as [a standalone proxy](https://github.com/ViaVersion/ViaProxy) to join from basically any client version on
|
||||
any server version from the past decade. **See [HERE](https://viaversion.com) for an overview of the different Via\*
|
||||
projects.**
|
||||
|
||||
Note that ViaVersion will be able to **run best on either Paper servers or
|
||||
through [ViaFabricPlus](https://github.com/ViaVersion/ViaFabricPlus?tab=readme-ov-file#viafabricplus)** due to having
|
||||
direct access to client/server state and more extensive API.
|
||||
|
||||
Supported Versions:
|
||||
|
||||

|
||||

|
||||
|
||||
**User Docs:** https://docs.viaversion.com/display/VIAVERSION/
|
||||
**User Docs:** https://docs.viaversion.com
|
||||
|
||||
Snapshot support
|
||||
--------
|
||||
**ViaVersion will only be released a few days *after* a Minecraft update** unless the protocol changes of the update
|
||||
were trivial. If you want early-access, usually days or even weeks before the final release, you can subscribe to
|
||||
either:
|
||||
|
||||
- [GitHub Sponsors](https://github.com/sponsors/kennytv/sponsorships?sponsor=kennytv&tier_id=385613&preview=false) (
|
||||
preferred option. Use the `/verify` command on this Discord after), or alternatively
|
||||
- [Patreon](https://www.patreon.com/kennytv/membership) (see the highest tier and make sure to link Patreon to your
|
||||
Discord account under Settings->Connections)
|
||||
This also includes access to a private repository with the code, which will be pushed to the public repository after
|
||||
the given delay on a Minecraft update.
|
||||
|
||||
Releases/Dev Builds
|
||||
--------
|
||||
@@ -67,6 +87,8 @@ dependencies {
|
||||
If you need access to the existing protocol or platform implementations, use the parent artifact `viaversion`.
|
||||
Please note the [differences in licensing](#license).
|
||||
|
||||
Note: If you want to make your own platform implementation of ViaVersion (and additional addons),
|
||||
take a look at the [documentation](https://github.com/ViaVersion/ViaVersion/wiki/Creating-a-new-ViaVersion-platform).
|
||||
|
||||
Building
|
||||
--------
|
||||
@@ -75,23 +97,21 @@ of the `build/libs` directory.
|
||||
|
||||
You need JDK 17 or newer to build ViaVersion.
|
||||
|
||||
|
||||
Mapping Files
|
||||
--------------
|
||||
Mapping files are generated and managed in our [Mappings repository](https://github.com/ViaVersion/Mappings).
|
||||
|
||||
Mapping files are generated and managed in our [Mappings repository](https://github.com/ViaVersion/Mappings). The
|
||||
generated mapping output is stored [here](./common/src/main/resources/assets/viaversion).
|
||||
|
||||
Resources
|
||||
--------
|
||||
|
||||
- **[Via Mappings Generator](https://github.com/ViaVersion/Mappings)**
|
||||
- **[Mojang mappings](https://minecraft.wiki/w/Obfuscation_map)** (Thank you, Mojang, very cool)
|
||||
- **[wiki.vg](https://wiki.vg)** (Used for historic information regarding packet structure, we also contribute back)
|
||||
- **[Burger](https://github.com/Pokechu22/Burger)** (See [PAaaS](https://github.com/Matsv/Paaas))
|
||||
- Previously: **[Burger](https://github.com/Pokechu22/Burger)** (see [PAaaS](https://github.com/Matsv/Paaas)) and **wiki.vg**
|
||||
|
||||
License
|
||||
--------
|
||||
The entirety of the [API directory](api) (including the legacy API directory) is licensed under the MIT License;
|
||||
The entirety of the [API directory](api) is licensed under the MIT License;
|
||||
see [licenses/MIT.md](licenses/MIT.md) for
|
||||
details.
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a **security vulnerability**, please **do not** open a public issue. Instead, use one of the following **confidential contact methods**:
|
||||
|
||||
* **Email:** [security@viaversion.com](mailto:security@viaversion.com)
|
||||
* **Discord:** Join our [Discord server](https://discord.gg/viaversion) and visit the [#exploit-report](https://discord.com/channels/316206679014244363/1388847764137316485) channel for further instructions.
|
||||
|
||||
If your issue is **not security-related** (e.g., bug reports, feature requests, or usage questions), please use the [GitHub Issues page](https://github.com/ViaVersion/ViaVersion/issues) or contact us via the [Discord server](https://discord.gg/viaversion).
|
||||
@@ -19,15 +19,21 @@ dependencies {
|
||||
api(libs.vianbt) {
|
||||
exclude("it.unimi.dsi", "fastutil")
|
||||
}
|
||||
api(libs.gson)
|
||||
api(libs.gson) {
|
||||
exclude("com.google.errorprone", "error_prone_annotations")
|
||||
}
|
||||
implementation(rootProject.libs.text) {
|
||||
exclude("com.google.code.gson", "gson")
|
||||
exclude("com.viaversion", "nbt")
|
||||
}
|
||||
api(libs.snakeYaml)
|
||||
|
||||
compileOnlyApi(libs.snakeYaml)
|
||||
compileOnlyApi(libs.netty)
|
||||
compileOnlyApi(libs.guava)
|
||||
compileOnlyApi(libs.guava) {
|
||||
exclude("com.google.errorprone", "error_prone_annotations")
|
||||
exclude("org.jspecify", "jspecify")
|
||||
exclude("com.google.j2objc", "j2objc-annotations")
|
||||
}
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -84,4 +84,8 @@ public final class Via {
|
||||
Preconditions.checkArgument(manager != null, "ViaVersion has not loaded the platform yet");
|
||||
return manager;
|
||||
}
|
||||
|
||||
public static boolean isLoaded() {
|
||||
return manager != null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -114,7 +114,8 @@ public interface ViaAPI<T> {
|
||||
ProtocolVersion getPlayerProtocolVersion(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns whether Via injected into this player connection.
|
||||
* Returns whether Via injected into this player connection. Note that this method may not work on
|
||||
* clientside implementations and is generally not recommended to be used. Use {@link ConnectionManager} instead.
|
||||
*
|
||||
* @param uuid uuid of the player
|
||||
* @return whether Via has a cached a UserConnection for this player
|
||||
@@ -122,7 +123,8 @@ public interface ViaAPI<T> {
|
||||
boolean isInjected(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns the Via injected UserConnection if present.
|
||||
* Returns the injected UserConnection if present. Note that this method may not work on
|
||||
* clientside implementations and is generally not recommended to be used. Use {@link ConnectionManager} instead.
|
||||
*
|
||||
* @param uuid uuid of the player
|
||||
* @return user connection if present
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -140,6 +140,13 @@ public interface ViaManager {
|
||||
*/
|
||||
void addEnableListener(Runnable runnable);
|
||||
|
||||
/**
|
||||
* Adds a runnable to be executed when ViaVersion has finished its init after the full server load.
|
||||
*
|
||||
* @param runnable runnable to be executed
|
||||
*/
|
||||
void addPostEnableListener(Runnable runnable);
|
||||
|
||||
/**
|
||||
* Returns whether the manager has been initialized (and protocols have been loaded).
|
||||
*
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import java.util.UUID;
|
||||
|
||||
public class UserConnectionViaCommandSender implements ViaCommandSender {
|
||||
|
||||
private final UserConnection connection;
|
||||
|
||||
public UserConnectionViaCommandSender(final UserConnection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String permission) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(String msg) {
|
||||
Via.getPlatform().sendMessage(connection, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getUUID() {
|
||||
return connection.getProtocolInfo().getUuid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return connection.getProtocolInfo().getUsername();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -66,7 +66,7 @@ public interface ViaSubCommand {
|
||||
*
|
||||
* @param sender Command sender
|
||||
* @param args Arguments
|
||||
* @return commands executed succesfully if false, show usage
|
||||
* @return commands executed successfully if false, show usage
|
||||
*/
|
||||
boolean execute(ViaCommandSender sender, String[] args);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -30,13 +30,14 @@ public interface ViaVersionCommand {
|
||||
* Register your own subcommand inside ViaVersion
|
||||
*
|
||||
* @param command Your own SubCommand instance to handle it.
|
||||
* @throws IllegalArgumentException throws an exception when the subcommand already exists or if it's not valid, example: spacee
|
||||
* @throws IllegalArgumentException throws an exception when the subcommand already exists or if it's not valid, example: space
|
||||
*/
|
||||
void registerSubCommand(ViaSubCommand command);
|
||||
|
||||
/**
|
||||
* Removes a subcommand by name, can be used to unload default subcommands which are not supported
|
||||
* on the platform.
|
||||
*
|
||||
* @param name Subcommand name
|
||||
*/
|
||||
void removeSubCommand(String name);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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;
|
||||
|
||||
public record RateLimitConfig(boolean enabled, int maxRate, String maxRateKickMessage, int warningRate, int maxWarnings,
|
||||
long trackingPeriodNanos, String warningKickMessage, String ratePlaceholder) {
|
||||
}
|
||||
+117
-26
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -27,6 +27,7 @@ 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 java.util.concurrent.TimeUnit;
|
||||
|
||||
public interface ViaVersionConfig extends Config {
|
||||
|
||||
@@ -67,11 +68,16 @@ public interface ViaVersionConfig extends Config {
|
||||
boolean isShowNewDeathMessages();
|
||||
|
||||
/**
|
||||
* Get if metadata errors will be suppressed
|
||||
* Get if entity data errors will be logged
|
||||
*
|
||||
* @return true if metadata errors suppression is enabled
|
||||
* @return true if entity data error logging is enabled
|
||||
*/
|
||||
boolean isSuppressMetadataErrors();
|
||||
boolean logEntityDataErrors();
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
default boolean isSuppressMetadataErrors() {
|
||||
return !logEntityDataErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get if blocking in 1.9 & 1.10 appears as a player holding a shield
|
||||
@@ -147,42 +153,64 @@ public interface ViaVersionConfig extends Config {
|
||||
*
|
||||
* @return The number of packets a client can send per second.
|
||||
*/
|
||||
int getMaxPPS();
|
||||
@Deprecated(forRemoval = true)
|
||||
default int getMaxPPS() {
|
||||
return getPacketTrackerConfig().maxRate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the kick message sent if the user hits the max packets per second.
|
||||
*
|
||||
* @return Kick message, with colour codes using '&amp;'
|
||||
*/
|
||||
String getMaxPPSKickMessage();
|
||||
@Deprecated(forRemoval = true)
|
||||
default String getMaxPPSKickMessage() {
|
||||
return getPacketTrackerConfig().maxRateKickMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* The time in seconds that should be tracked for warnings
|
||||
*
|
||||
* @return Time in seconds that should be tracked for warnings
|
||||
*/
|
||||
int getTrackingPeriod();
|
||||
@Deprecated(forRemoval = true)
|
||||
default int getTrackingPeriod() {
|
||||
return (int) TimeUnit.NANOSECONDS.toSeconds(getPacketTrackerConfig().trackingPeriodNanos());
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
@Deprecated(forRemoval = true)
|
||||
default int getWarningPPS() {
|
||||
return getPacketTrackerConfig().warningRate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
@Deprecated(forRemoval = true)
|
||||
default int getMaxWarnings() {
|
||||
return getPacketTrackerConfig().maxWarnings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
@Deprecated(forRemoval = true)
|
||||
default String getMaxWarningsKickMessage() {
|
||||
return getPacketTrackerConfig().warningKickMessage();
|
||||
}
|
||||
|
||||
RateLimitConfig getPacketTrackerConfig();
|
||||
|
||||
RateLimitConfig getPacketSizeTrackerConfig();
|
||||
|
||||
/**
|
||||
* Send supported versions in the status response packet
|
||||
@@ -233,13 +261,6 @@ public interface ViaVersionConfig extends Config {
|
||||
*/
|
||||
boolean isChunkBorderFix();
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -270,6 +291,8 @@ public interface ViaVersionConfig extends Config {
|
||||
*/
|
||||
String getBlockedDisconnectMsg();
|
||||
|
||||
boolean logBlockedJoins();
|
||||
|
||||
/**
|
||||
* Get the message sent to players being kicked on reload.
|
||||
* Players are kicked to stop the server crashing
|
||||
@@ -279,11 +302,28 @@ public interface ViaVersionConfig extends Config {
|
||||
String getReloadDisconnectMsg();
|
||||
|
||||
/**
|
||||
* Should we hide errors that occur when trying to convert block and item data over versions?
|
||||
* Should we log warnings on issues when trying to convert data over versions?
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isSuppressConversionWarnings();
|
||||
boolean logOtherConversionWarnings();
|
||||
|
||||
/**
|
||||
* Should we log errors that occur when trying to convert text components?
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean logTextComponentConversionErrors();
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
default boolean isSuppressConversionWarnings() {
|
||||
return !logOtherConversionWarnings();
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
default boolean isSuppressTextComponentConversionWarnings() {
|
||||
return !logTextComponentConversionErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13)
|
||||
@@ -292,13 +332,6 @@ public interface ViaVersionConfig extends Config {
|
||||
*/
|
||||
boolean isDisable1_13AutoComplete();
|
||||
|
||||
/**
|
||||
* Tries to minimize cooldown animation.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean isMinimizeCooldown();
|
||||
|
||||
/**
|
||||
* Enable the serverside blockconnections for 1.13+ clients
|
||||
*
|
||||
@@ -464,4 +497,62 @@ public interface ViaVersionConfig extends Config {
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean handleInvalidItemCount();
|
||||
|
||||
/**
|
||||
* Tries to cancel block break/place sounds sent by 1.8 servers to 1.9+ clients to prevent them from playing twice
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean cancelBlockSounds();
|
||||
|
||||
/**
|
||||
* Hides scoreboard numbers for 1.20.3+ clients on older server versions.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean hideScoreboardNumbers();
|
||||
|
||||
/**
|
||||
* Fixes 1.21+ clients on 1.20.5 servers placing water/lava buckets at the wrong location when moving fast.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean fix1_21PlacementRotation();
|
||||
|
||||
/**
|
||||
* If enabled, cancel swing packets sent while having an inventory opened on 1.15.2 and below servers.
|
||||
* This can cause false positives with anti-cheat plugins.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean cancelSwingInInventory();
|
||||
|
||||
/**
|
||||
* Returns the max length of error messages. Longer messages will be truncated unless in debug mode.
|
||||
*
|
||||
* @return the max length of error messages
|
||||
*/
|
||||
int maxErrorLength();
|
||||
|
||||
/**
|
||||
* If enabled, 1.21.11+ clients on 1.8 (or older) servers will get wider entity hitboxes,
|
||||
* but only when attacking with an item.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean use1_8HitboxMargin();
|
||||
|
||||
/**
|
||||
* If enabled, ViaVersion will send the native client version to the server on connect via a plugin message.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean sendPlayerDetails();
|
||||
|
||||
/**
|
||||
* If enabled, ViaVersion will send the native server version to a player on connect via a plugin message.
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
boolean sendServerDetails();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -28,51 +28,81 @@ import java.util.UUID;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Handles injected UserConnections
|
||||
* Handles injected UserConnections.
|
||||
* Check {@link UserConnection#isServerSide()} and {@link UserConnection#isClientSide()} to determine the connection type.
|
||||
*/
|
||||
public interface ConnectionManager {
|
||||
|
||||
/**
|
||||
* Returns if Via injected into this player connection.
|
||||
* Returns if Via has injected. See above for the connection types.
|
||||
*
|
||||
* @param playerId player uuid
|
||||
* @param uuid player uuid
|
||||
* @return true if the player is handled by Via
|
||||
*/
|
||||
boolean isClientConnected(UUID playerId);
|
||||
boolean hasServerConnection(UUID uuid);
|
||||
|
||||
/**
|
||||
* 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();
|
||||
@Deprecated
|
||||
default boolean isClientConnected(UUID uuid) {
|
||||
return hasServerConnection(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* <p>
|
||||
* Note that connections are removed as soon as their channel is closed,
|
||||
* so avoid using this method during player quits for example.
|
||||
* Returns if Via has injected. See above for the connection types.
|
||||
*
|
||||
* @return frontend UserConnection of the player connected to this proxy server
|
||||
* @param uuid player uuid
|
||||
* @return true if the player is handled by Via
|
||||
*/
|
||||
@Nullable UserConnection getConnectedClient(UUID clientIdentifier);
|
||||
boolean hasClientConnection(UUID uuid);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Returns the server UserConnection. See above for the connection types.
|
||||
* When ViaVersion is reloaded, this method may not return some 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
|
||||
* @return server UserConnection of the player or null
|
||||
*/
|
||||
@Nullable UUID getConnectedClientId(UserConnection connection);
|
||||
@Nullable
|
||||
UserConnection getServerConnection(UUID uuid);
|
||||
|
||||
@Deprecated
|
||||
@Nullable default UserConnection getConnectedClient(UUID uuid) {
|
||||
return getServerConnection(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the client UserConnection. See above for the connection types.
|
||||
* When ViaVersion is reloaded, this method may not return some 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 client UserConnection of the player or null
|
||||
*/
|
||||
@Nullable
|
||||
UserConnection getClientConnection(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns a map containing the UUIDs and server UserConnections
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
*
|
||||
* @return map containing the UUIDs and frontend UserConnections
|
||||
*/
|
||||
Map<UUID, UserConnection> getServerConnections();
|
||||
|
||||
@Deprecated
|
||||
default Map<UUID, UserConnection> getConnectedClients() {
|
||||
return getServerConnections();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map containing the UUIDs and client UserConnections
|
||||
* When ViaVersion is reloaded, this method may not return some players.
|
||||
*
|
||||
* @return map containing the UUIDs and client UserConnections
|
||||
*/
|
||||
Map<UUID, UserConnection> getClientConnections();
|
||||
|
||||
/**
|
||||
* Returns all UserConnections which are registered
|
||||
@@ -84,15 +114,6 @@ public interface ConnectionManager {
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -134,6 +134,15 @@ public interface ProtocolInfo {
|
||||
|
||||
void setUuid(UUID uuid);
|
||||
|
||||
/**
|
||||
* Returns whether compression is enabled for this connection.
|
||||
*
|
||||
* @return whether compression is enabled
|
||||
*/
|
||||
boolean compressionEnabled();
|
||||
|
||||
void setCompressionEnabled(boolean compressionEnabled);
|
||||
|
||||
/**
|
||||
* Returns the user's pipeline.
|
||||
*
|
||||
@@ -142,4 +151,4 @@ public interface ProtocolInfo {
|
||||
ProtocolPipeline getPipeline();
|
||||
|
||||
void setPipeline(ProtocolPipeline pipeline);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -30,15 +30,6 @@ package com.viaversion.viaversion.api.connection;
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
default void onRemove() {
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -29,6 +29,11 @@ public abstract class StoredObject implements StorableObject {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public UserConnection user() {
|
||||
return this.user;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public UserConnection getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -24,6 +24,8 @@ 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.data.item.ItemHasher;
|
||||
import com.viaversion.viaversion.api.minecraft.ClientWorld;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketTracker;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
@@ -99,19 +101,45 @@ public interface UserConnection {
|
||||
void addEntityTracker(Class<? extends Protocol> protocolClass, EntityTracker tracker);
|
||||
|
||||
/**
|
||||
* Clear stored objects and entity trackers.
|
||||
* Adds an item hasher to the user connection.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param itemHasher item hasher
|
||||
*/
|
||||
default void clearStoredObjects() {
|
||||
clearStoredObjects(false);
|
||||
}
|
||||
void addItemHasher(Class<? extends Protocol> protocolClass, ItemHasher itemHasher);
|
||||
|
||||
/**
|
||||
* Clear stored objects and entity trackers.
|
||||
* If cleared for a proxy server switch, some stored objects and tracker data will be retained.
|
||||
* Returns the item hasher by the given protocol class if present.
|
||||
*
|
||||
* @param isServerSwitch whether the clear is due to a server switch
|
||||
* @param protocolClass protocol class
|
||||
* @param <T> item hasher type
|
||||
* @return item hasher if present
|
||||
*/
|
||||
void clearStoredObjects(boolean isServerSwitch);
|
||||
@Nullable <T extends ItemHasher> T getItemHasher(Class<? extends Protocol> protocolClass);
|
||||
|
||||
/**
|
||||
* Returns the client world by the given protocol class if present.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param <T> client world type
|
||||
* @return client world if present
|
||||
*/
|
||||
@Nullable
|
||||
<T extends ClientWorld> T getClientWorld(Class<? extends Protocol> protocolClass);
|
||||
|
||||
/**
|
||||
* Adds a client world to the user connection.
|
||||
* Does not override existing client worlds.
|
||||
*
|
||||
* @param protocolClass protocol class
|
||||
* @param clientWorld client world
|
||||
*/
|
||||
void addClientWorld(Class<? extends Protocol> protocolClass, ClientWorld clientWorld);
|
||||
|
||||
/**
|
||||
* Clear stored objects, entity trackers and client worlds.
|
||||
*/
|
||||
void clearStoredObjects();
|
||||
|
||||
/**
|
||||
* Sends a raw packet to the connection on the current thread.
|
||||
@@ -166,9 +194,15 @@ public interface UserConnection {
|
||||
/**
|
||||
* Monitors serverbound packets and returns whether a packet can/should be processed.
|
||||
*
|
||||
* @param bytes the number of bytes in the packet
|
||||
* @return false if this packet should be cancelled
|
||||
*/
|
||||
boolean checkServerboundPacket();
|
||||
boolean checkServerboundPacket(int bytes);
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
default boolean checkServerboundPacket() {
|
||||
return checkServerboundPacket(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitors clientbound packets and returns whether a packet can/should be processed.
|
||||
@@ -181,6 +215,11 @@ public interface UserConnection {
|
||||
* @see #checkClientboundPacket()
|
||||
* @see #checkServerboundPacket()
|
||||
*/
|
||||
default boolean checkIncomingPacket(final int bytes) {
|
||||
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket(bytes);
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
default boolean checkIncomingPacket() {
|
||||
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket();
|
||||
}
|
||||
@@ -299,23 +338,35 @@ public interface UserConnection {
|
||||
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.
|
||||
* Returns whether this is a backend connection.
|
||||
* This is a mod integrated into the client, or for example a backend Velocity connection.
|
||||
*
|
||||
* @return whether this is a client-side connection
|
||||
* @return whether this is a backend connection
|
||||
*/
|
||||
boolean isClientSide();
|
||||
|
||||
/**
|
||||
* Returns whether this is a frontend connection.
|
||||
* This is a plugin integrated into the server, or for example a frontend Velocity connection.
|
||||
*
|
||||
* @return whether this is a frontend connection
|
||||
*/
|
||||
default boolean isServerSide() {
|
||||
return !isClientSide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether {@link ViaVersionConfig#blockedProtocolVersions()} should be checked for this connection.
|
||||
*
|
||||
* @return whether blocked protocols should be applied
|
||||
*/
|
||||
boolean shouldApplyBlockProtocol();
|
||||
default boolean shouldApplyBlockProtocol() {
|
||||
return isServerSide();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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}.
|
||||
* transforming its contents if used together with {@link PacketWrapper#PASSTHROUGH_ID}.
|
||||
*
|
||||
* @return generated passthrough token
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class FullIdentityMappings implements FullMappings {
|
||||
private static final String[] EMPTY_ARRAY = new String[0];
|
||||
private final Object2IntMap<String> stringToId;
|
||||
private final String[] idToString;
|
||||
private final Mappings mappings;
|
||||
|
||||
public FullIdentityMappings(final IdentifiersPair identifiersPair, final Mappings mappings) {
|
||||
Preconditions.checkNotNull(mappings, "Mappings cannot be null");
|
||||
this.mappings = mappings;
|
||||
this.stringToId = FullMappingsBase.toInverseMap(identifiersPair.unmapped());
|
||||
this.idToString = identifiersPair.unmapped().toArray(EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
private FullIdentityMappings(final Object2IntMap<String> stringToId, final String[] idToString, final Mappings mappings) {
|
||||
this.stringToId = stringToId;
|
||||
this.idToString = idToString;
|
||||
this.mappings = mappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int id(final String identifier) {
|
||||
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int mappedId(final String mappedIdentifier) {
|
||||
return id(mappedIdentifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String identifier(final int id) {
|
||||
if (id < 0 || id >= idToString.length) {
|
||||
return null;
|
||||
}
|
||||
final String identifier = idToString[id];
|
||||
return Key.namespaced(identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String identifier(final String mappedIdentifier) {
|
||||
final int mappedId = mappedId(mappedIdentifier);
|
||||
if (mappedId == -1) {
|
||||
return null;
|
||||
}
|
||||
final int id = mappings.inverse().getNewId(mappedId);
|
||||
return id != -1 ? identifier(id) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String mappedIdentifier(final int mappedId) {
|
||||
return identifier(mappedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String mappedIdentifier(final String identifier) {
|
||||
return identifier(identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewId(int id) {
|
||||
return mappings.getNewId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewId(int id, int mappedId) {
|
||||
mappings.setNewId(id, mappedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return mappings.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int mappedSize() {
|
||||
return mappings.mappedSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIdentity() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIntIdIdentity() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FullMappings inverse() {
|
||||
return new FullIdentityMappings(stringToId, idToString, mappings.inverse());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -53,6 +53,14 @@ public interface FullMappings extends BiMappings {
|
||||
*/
|
||||
@Nullable String identifier(int id);
|
||||
|
||||
/**
|
||||
* Returns the unmapped string identifier for the given mapped identifier.
|
||||
*
|
||||
* @param mappedIdentifier mapped identifier
|
||||
* @return unmapped string identifier, or null if not found
|
||||
*/
|
||||
@Nullable String identifier(String mappedIdentifier);
|
||||
|
||||
/**
|
||||
* Returns the mapped string identifier for the given mapped id.
|
||||
*
|
||||
@@ -69,6 +77,14 @@ public interface FullMappings extends BiMappings {
|
||||
*/
|
||||
@Nullable String mappedIdentifier(String identifier);
|
||||
|
||||
/**
|
||||
* Returns whether the int id mappings are identity mappings.
|
||||
*
|
||||
* @return whether the int id mappings are identity mappings
|
||||
* @see #isIdentity()
|
||||
*/
|
||||
boolean isIntIdIdentity();
|
||||
|
||||
@Override
|
||||
FullMappings inverse();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -23,6 +23,7 @@
|
||||
package com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
@@ -37,13 +38,13 @@ public class FullMappingsBase implements FullMappings {
|
||||
private final String[] mappedIdToString;
|
||||
private final Mappings mappings;
|
||||
|
||||
public FullMappingsBase(final List<String> unmappedIdentifiers, final List<String> mappedIdentifiers, final Mappings mappings) {
|
||||
public FullMappingsBase(final IdentifiersPair identifiersPair, final Mappings mappings) {
|
||||
Preconditions.checkNotNull(mappings, "Mappings cannot be null");
|
||||
this.mappings = mappings;
|
||||
this.stringToId = toInverseMap(unmappedIdentifiers);
|
||||
this.mappedStringToId = toInverseMap(mappedIdentifiers);
|
||||
this.idToString = unmappedIdentifiers.toArray(EMPTY_ARRAY);
|
||||
this.mappedIdToString = mappedIdentifiers.toArray(EMPTY_ARRAY);
|
||||
this.stringToId = toInverseMap(identifiersPair.unmapped());
|
||||
this.idToString = identifiersPair.unmapped().toArray(EMPTY_ARRAY);
|
||||
this.mappedStringToId = toInverseMap(identifiersPair.mapped());
|
||||
this.mappedIdToString = identifiersPair.mapped().toArray(EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
private FullMappingsBase(final Object2IntMap<String> stringToId, final Object2IntMap<String> mappedStringToId, final String[] idToString, final String[] mappedIdToString, final Mappings mappings) {
|
||||
@@ -54,7 +55,11 @@ public class FullMappingsBase implements FullMappings {
|
||||
this.mappings = mappings;
|
||||
}
|
||||
|
||||
private static Object2IntMap<String> toInverseMap(final List<String> list) {
|
||||
public static FullMappings of(final IdentifiersPair identifiersPair, final Mappings mappings) {
|
||||
return mappings.isIdentity() && identifiersPair.identity() ? new FullIdentityMappings(identifiersPair, mappings) : new FullMappingsBase(identifiersPair, mappings);
|
||||
}
|
||||
|
||||
static Object2IntMap<String> toInverseMap(final List<String> list) {
|
||||
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(list.size());
|
||||
map.defaultReturnValue(-1);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -84,7 +89,18 @@ public class FullMappingsBase implements FullMappings {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String mappedIdentifier(final int mappedId) {
|
||||
public @Nullable String identifier(final String mappedIdentifier) {
|
||||
final int mappedId = mappedId(mappedIdentifier);
|
||||
if (mappedId == -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final int id = mappings.inverse().getNewId(mappedId);
|
||||
return id != -1 ? identifier(id) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String mappedIdentifier(final int mappedId) {
|
||||
if (mappedId < 0 || mappedId >= mappedIdToString.length) {
|
||||
return null;
|
||||
}
|
||||
@@ -124,6 +140,11 @@ public class FullMappingsBase implements FullMappings {
|
||||
return mappings.mappedSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIntIdIdentity() {
|
||||
return mappings.isIdentity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FullMappings inverse() {
|
||||
return new FullMappingsBase(mappedStringToId, stringToId, mappedIdToString, idToString, mappings.inverse());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -38,4 +38,9 @@ public record IdentityMappings(int size, int mappedSize) implements Mappings {
|
||||
public Mappings inverse() {
|
||||
return new IdentityMappings(mappedSize, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIdentity() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,9 +22,13 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryKey;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.TagData;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface MappingData {
|
||||
@@ -35,54 +39,84 @@ public interface MappingData {
|
||||
void load();
|
||||
|
||||
/**
|
||||
* Returns the mapped block state id, or -1 if unmapped.
|
||||
* Returns the mapped block state id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped block state id
|
||||
* @return mapped block state id, or -1 if unmapped
|
||||
* @return mapped block state id, or 0 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.
|
||||
* Returns the mapped block id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped block id
|
||||
* @return mapped block id, or -1 if unmapped
|
||||
* @return mapped block id, or 0 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold block mappings
|
||||
*/
|
||||
int getNewBlockId(int id);
|
||||
|
||||
/**
|
||||
* Returns the backwards mapped block id, or 1 if unmapped.
|
||||
*
|
||||
* @param id mapped block id
|
||||
* @return backwards mapped block id, or 1 if unmapped
|
||||
*/
|
||||
int getOldBlockId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped item id, or -1 if unmapped.
|
||||
* Returns the mapped item id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped item id
|
||||
* @return mapped item id, or -1 if unmapped
|
||||
* @return mapped item id, or 0 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.
|
||||
* Returns the backwards mapped item id, or 1 if unmapped.
|
||||
*
|
||||
* @param id mapped item id
|
||||
* @return backwards mapped item id, or -1 if unmapped
|
||||
* @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.
|
||||
* Returns the mapped particle id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped particle id
|
||||
* @return mapped particle id, or -1 if unmapped
|
||||
* @return mapped particle id, or 0 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold particle mappings
|
||||
*/
|
||||
int getNewParticleId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped attribute id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped attribute id
|
||||
* @return mapped attribute id, or 0 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold attribute mappings
|
||||
*/
|
||||
int getNewAttributeId(int id);
|
||||
|
||||
/**
|
||||
* Returns the mapped sound id, or 0 if unmapped.
|
||||
*
|
||||
* @param id unmapped sound id
|
||||
* @return mapped sound id, or 0 if unmapped
|
||||
* @throws NullPointerException if this mappingdata does not hold sound mappings
|
||||
*/
|
||||
int getNewSoundId(int id);
|
||||
|
||||
/**
|
||||
* Returns the backwards mapped sound id, or 1 if unmapped.
|
||||
*
|
||||
* @param i mapped sound id
|
||||
* @return backwards mapped sound id, or 1 if unmapped
|
||||
*/
|
||||
int getOldSoundId(int i);
|
||||
|
||||
/**
|
||||
* Returns a list of tags to send if present.
|
||||
*
|
||||
@@ -110,27 +144,61 @@ public interface MappingData {
|
||||
|
||||
@Nullable Mappings getBlockMappings();
|
||||
|
||||
@Nullable Mappings getBlockEntityMappings();
|
||||
@Nullable FullMappings getFullBlockMappings();
|
||||
|
||||
@Nullable Mappings getBlockStateMappings();
|
||||
|
||||
@Nullable Mappings getSoundMappings();
|
||||
|
||||
@Nullable FullMappings getFullSoundMappings();
|
||||
|
||||
@Nullable Mappings getStatisticsMappings();
|
||||
|
||||
@Nullable Mappings getMenuMappings();
|
||||
|
||||
@Nullable Mappings getEnchantmentMappings();
|
||||
|
||||
@Nullable Mappings getAttributeMappings();
|
||||
|
||||
@Nullable Mappings getPaintingMappings();
|
||||
|
||||
@Nullable FullMappings getBlockEntityMappings();
|
||||
|
||||
@Nullable FullMappings getAttributeMappings();
|
||||
|
||||
@Nullable FullMappings getEntityMappings();
|
||||
|
||||
@Nullable FullMappings getArgumentTypeMappings();
|
||||
|
||||
@Nullable FullMappings getRecipeSerializerMappings();
|
||||
|
||||
@Nullable FullMappings getSlotDisplayMappings();
|
||||
|
||||
@Nullable FullMappings getDataComponentSerializerMappings();
|
||||
|
||||
default @Nullable FullMappings getFullMappings(final MappingType mappingType) {
|
||||
return switch (mappingType) {
|
||||
case ITEM -> getFullItemMappings();
|
||||
case BLOCK -> getFullBlockMappings();
|
||||
case SOUND -> getFullSoundMappings();
|
||||
case ENTITY_TYPE -> getEntityMappings();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of block (not block state) ids that had their base type or properties changed.
|
||||
*
|
||||
* @return set of changed block ids, or null if not tracked/none are present
|
||||
*/
|
||||
@Nullable IntSet changedBlocks();
|
||||
|
||||
/**
|
||||
* Type of mappings. Currently only relevant for ops writing of generic holder classes and expanded when needed.
|
||||
*/
|
||||
enum MappingType implements RegistryKey {
|
||||
ITEM, BLOCK, SOUND, ENTITY_TYPE;
|
||||
|
||||
@Override
|
||||
public Key key() {
|
||||
return Key.of(name().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -26,8 +26,11 @@ import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.nbt.tag.IntArrayTag;
|
||||
import com.viaversion.nbt.tag.Tag;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.TagData;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
@@ -43,18 +46,23 @@ public class MappingDataBase implements MappingData {
|
||||
protected FullMappings entityMappings;
|
||||
protected FullMappings recipeSerializerMappings;
|
||||
protected FullMappings itemDataSerializerMappings;
|
||||
protected FullMappings slotDisplayMappings;
|
||||
protected FullMappings attributeMappings;
|
||||
protected FullMappings blockEntityMappings;
|
||||
protected ParticleMappings particleMappings;
|
||||
protected BiMappings itemMappings;
|
||||
protected BiMappings blockMappings;
|
||||
protected Mappings blockStateMappings;
|
||||
protected Mappings blockEntityMappings;
|
||||
protected Mappings soundMappings;
|
||||
protected Mappings statisticsMappings;
|
||||
protected Mappings enchantmentMappings;
|
||||
protected Mappings paintingMappings;
|
||||
protected Mappings menuMappings;
|
||||
protected Mappings attributeMappings;
|
||||
protected Map<RegistryType, List<TagData>> tags;
|
||||
/**
|
||||
* Set of block ids that have had type or property changes.
|
||||
*/
|
||||
protected IntSet changedBlocks;
|
||||
|
||||
public MappingDataBase(final String unmappedVersion, final String mappedVersion) {
|
||||
this.unmappedVersion = unmappedVersion;
|
||||
@@ -68,38 +76,40 @@ public class MappingDataBase implements MappingData {
|
||||
}
|
||||
|
||||
final CompoundTag data = readMappingsFile("mappings-" + unmappedVersion + "to" + mappedVersion + ".nbt");
|
||||
blockMappings = loadBiMappings(data, "blocks");
|
||||
blockStateMappings = loadMappings(data, "blockstates");
|
||||
blockEntityMappings = loadMappings(data, "blockentities");
|
||||
soundMappings = loadMappings(data, "sounds");
|
||||
statisticsMappings = loadMappings(data, "statistics");
|
||||
menuMappings = loadMappings(data, "menus");
|
||||
enchantmentMappings = loadMappings(data, "enchantments");
|
||||
paintingMappings = loadMappings(data, "paintings");
|
||||
attributeMappings = loadMappings(data, "attributes");
|
||||
|
||||
|
||||
final CompoundTag unmappedIdentifierData = readUnmappedIdentifiersFile("identifiers-" + unmappedVersion + ".nbt");
|
||||
final CompoundTag mappedIdentifierData = readMappedIdentifiersFile("identifiers-" + mappedVersion + ".nbt");
|
||||
if (unmappedIdentifierData != null && mappedIdentifierData != null) {
|
||||
itemMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "items");
|
||||
itemMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "items");
|
||||
blockMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "blocks");
|
||||
soundMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "sounds");
|
||||
|
||||
entityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "entities");
|
||||
argumentTypeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "argumenttypes");
|
||||
slotDisplayMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "slot_displays");
|
||||
recipeSerializerMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "recipe_serializers");
|
||||
itemDataSerializerMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "data_component_type");
|
||||
attributeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "attributes");
|
||||
blockEntityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "blockentities");
|
||||
|
||||
final List<String> unmappedParticles = identifiersFromGlobalIds(unmappedIdentifierData, "particles");
|
||||
final List<String> mappedParticles = identifiersFromGlobalIds(mappedIdentifierData, "particles");
|
||||
if (unmappedParticles != null && mappedParticles != null) {
|
||||
final IdentifiersPair particleIdentifiers = identifiersFromGlobalIds(unmappedIdentifierData, mappedIdentifierData, "particles");
|
||||
if (particleIdentifiers != null) {
|
||||
Mappings particleMappings = loadMappings(data, "particles");
|
||||
if (particleMappings == null) {
|
||||
particleMappings = new IdentityMappings(unmappedParticles.size(), mappedParticles.size());
|
||||
particleMappings = new IdentityMappings(particleIdentifiers.unmapped().size(), particleIdentifiers.mapped().size());
|
||||
}
|
||||
this.particleMappings = new ParticleMappings(unmappedParticles, mappedParticles, particleMappings);
|
||||
this.particleMappings = new ParticleMappings(particleIdentifiers, particleMappings);
|
||||
}
|
||||
} else {
|
||||
// Might not have identifiers in older versions
|
||||
itemMappings = loadBiMappings(data, "items");
|
||||
blockMappings = loadBiMappings(data, "blocks");
|
||||
soundMappings = loadMappings(data, "sounds");
|
||||
}
|
||||
|
||||
final CompoundTag tagsTag = data.getCompoundTag("tags");
|
||||
@@ -110,6 +120,11 @@ public class MappingDataBase implements MappingData {
|
||||
loadTags(RegistryType.ENTITY, tagsTag);
|
||||
}
|
||||
|
||||
final IntArrayTag changedBlocks = data.getIntArrayTag("changed_blocks");
|
||||
if (changedBlocks != null) {
|
||||
this.changedBlocks = new IntOpenHashSet(changedBlocks.getValue());
|
||||
}
|
||||
|
||||
loadExtras(data);
|
||||
}
|
||||
|
||||
@@ -117,6 +132,10 @@ public class MappingDataBase implements MappingData {
|
||||
return MappingDataLoader.INSTANCE.identifiersFromGlobalIds(mappingsTag, key);
|
||||
}
|
||||
|
||||
protected @Nullable IdentifiersPair identifiersFromGlobalIds(final CompoundTag unmappedTag, final CompoundTag mappedTag, final String key) {
|
||||
return MappingDataLoader.INSTANCE.identifiersFromGlobalIds(unmappedTag, mappedTag, key);
|
||||
}
|
||||
|
||||
protected @Nullable CompoundTag readMappingsFile(final String name) {
|
||||
return MappingDataLoader.INSTANCE.loadNBT(name);
|
||||
}
|
||||
@@ -133,19 +152,22 @@ public class MappingDataBase implements MappingData {
|
||||
return MappingDataLoader.INSTANCE.loadMappings(data, key);
|
||||
}
|
||||
|
||||
protected @Nullable BiMappings loadFullOrBiMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
|
||||
final FullMappings mappings = loadFullMappings(data, unmappedIdentifiersTag, mappedIdentifiersTag, key);
|
||||
return mappings != null ? mappings : loadBiMappings(data, key);
|
||||
}
|
||||
|
||||
protected @Nullable FullMappings loadFullMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
|
||||
if (!unmappedIdentifiersTag.contains(key) || !mappedIdentifiersTag.contains(key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final List<String> unmappedIdentifiers = identifiersFromGlobalIds(unmappedIdentifiersTag, key);
|
||||
final List<String> mappedIdentifiers = identifiersFromGlobalIds(mappedIdentifiersTag, key);
|
||||
final IdentifiersPair identifiersPair = identifiersFromGlobalIds(unmappedIdentifiersTag, mappedIdentifiersTag, key);
|
||||
Mappings mappings = loadBiMappings(data, key); // Load as bi-mappings to keep the inverse cached
|
||||
if (mappings == null) {
|
||||
mappings = new IdentityMappings(unmappedIdentifiers.size(), mappedIdentifiers.size());
|
||||
mappings = new IdentityMappings(identifiersPair.unmapped().size(), identifiersPair.mapped().size());
|
||||
}
|
||||
|
||||
return new FullMappingsBase(unmappedIdentifiers, mappedIdentifiers, mappings);
|
||||
return FullMappingsBase.of(identifiersPair, mappings);
|
||||
}
|
||||
|
||||
protected @Nullable BiMappings loadBiMappings(final CompoundTag data, final String key) {
|
||||
@@ -154,7 +176,7 @@ public class MappingDataBase implements MappingData {
|
||||
}
|
||||
|
||||
private void loadTags(final RegistryType type, final CompoundTag data) {
|
||||
final CompoundTag tag = data.getCompoundTag(type.resourceLocation());
|
||||
final CompoundTag tag = data.getCompoundTag(type.identifier());
|
||||
if (tag == null) {
|
||||
return;
|
||||
}
|
||||
@@ -180,7 +202,7 @@ public class MappingDataBase implements MappingData {
|
||||
|
||||
@Override
|
||||
public int getOldBlockId(final int id) {
|
||||
return blockMappings.getNewIdOrDefault(id, 1);
|
||||
return blockMappings.inverse().getNewIdOrDefault(id, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,6 +225,16 @@ public class MappingDataBase implements MappingData {
|
||||
return checkValidity(id, attributeMappings.getNewId(id), "attributes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewSoundId(final int id) {
|
||||
return checkValidity(id, soundMappings.getNewId(id), "sound");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldSoundId(final int id) {
|
||||
return soundMappings.inverse().getNewIdOrDefault(id, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable List<TagData> getTags(final RegistryType type) {
|
||||
return tags != null ? tags.get(type) : null;
|
||||
@@ -215,8 +247,8 @@ public class MappingDataBase implements MappingData {
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getFullItemMappings() {
|
||||
if (itemMappings instanceof FullMappings) {
|
||||
return (FullMappings) itemMappings;
|
||||
if (itemMappings instanceof FullMappings fullItemMappings) {
|
||||
return fullItemMappings;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -232,7 +264,15 @@ public class MappingDataBase implements MappingData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getBlockEntityMappings() {
|
||||
public @Nullable FullMappings getFullBlockMappings() {
|
||||
if (blockMappings instanceof FullMappings fullBlockMappings) {
|
||||
return fullBlockMappings;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getBlockEntityMappings() {
|
||||
return blockEntityMappings;
|
||||
}
|
||||
|
||||
@@ -246,6 +286,14 @@ public class MappingDataBase implements MappingData {
|
||||
return soundMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getFullSoundMappings() {
|
||||
if (soundMappings instanceof FullMappings fullSoundMappings) {
|
||||
return fullSoundMappings;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getStatisticsMappings() {
|
||||
return statisticsMappings;
|
||||
@@ -262,7 +310,7 @@ public class MappingDataBase implements MappingData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Mappings getAttributeMappings() {
|
||||
public @Nullable FullMappings getAttributeMappings() {
|
||||
return attributeMappings;
|
||||
}
|
||||
|
||||
@@ -291,6 +339,16 @@ public class MappingDataBase implements MappingData {
|
||||
return recipeSerializerMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable FullMappings getSlotDisplayMappings() {
|
||||
return slotDisplayMappings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IntSet changedBlocks() {
|
||||
return changedBlocks;
|
||||
}
|
||||
|
||||
protected Logger getLogger() {
|
||||
return Via.getPlatform().getLogger();
|
||||
}
|
||||
@@ -305,7 +363,7 @@ public class MappingDataBase implements MappingData {
|
||||
*/
|
||||
protected int checkValidity(final int id, final int mappedId, final String type) {
|
||||
if (mappedId == -1) {
|
||||
if (!Via.getConfig().isSuppressConversionWarnings()) {
|
||||
if (Via.getConfig().logOtherConversionWarnings()) {
|
||||
getLogger().warning(String.format("Missing %s %s for %s %s %d", mappedVersion, type, unmappedVersion, type, id));
|
||||
}
|
||||
return 0;
|
||||
@@ -315,4 +373,4 @@ public class MappingDataBase implements MappingData {
|
||||
|
||||
protected void loadExtras(final CompoundTag data) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -30,7 +30,6 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.viaversion.nbt.io.NBTIO;
|
||||
import com.viaversion.nbt.io.TagReader;
|
||||
import com.viaversion.nbt.tag.ByteTag;
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.nbt.tag.IntArrayTag;
|
||||
import com.viaversion.nbt.tag.IntTag;
|
||||
@@ -82,8 +81,9 @@ public class MappingDataLoader {
|
||||
for (final Map.Entry<String, Tag> entry : globalIdentifiers.entrySet()) {
|
||||
//noinspection unchecked
|
||||
final ListTag<StringTag> value = (ListTag<StringTag>) entry.getValue();
|
||||
final String[] array = new String[value.size()];
|
||||
for (int i = 0, size = value.size(); i < size; i++) {
|
||||
final int size = value.size();
|
||||
final String[] array = new String[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
array[i] = value.get(i).getValue();
|
||||
}
|
||||
GLOBAL_IDENTIFIER_INDEXES.put(entry.getKey(), array);
|
||||
@@ -211,79 +211,122 @@ public class MappingDataLoader {
|
||||
return null;
|
||||
}
|
||||
|
||||
final ByteTag serializationStragetyTag = tag.getUnchecked("id");
|
||||
final IntTag mappedSizeTag = tag.getUnchecked("mappedSize");
|
||||
final byte strategy = serializationStragetyTag.asByte();
|
||||
final int mappedSize = tag.getInt("mappedSize", -1);
|
||||
final byte strategy = tag.getByteTag("id").asByte();
|
||||
final V mappings;
|
||||
if (strategy == DIRECT_ID) {
|
||||
final IntArrayTag valuesTag = tag.getIntArrayTag("val");
|
||||
return IntArrayMappings.of(valuesTag.getValue(), mappedSizeTag.asInt());
|
||||
return IntArrayMappings.of(valuesTag.getValue(), mappedSize);
|
||||
} else if (strategy == SHIFTS_ID) {
|
||||
final IntArrayTag shiftsAtTag = tag.getIntArrayTag("at");
|
||||
final IntArrayTag shiftsTag = tag.getIntArrayTag("to");
|
||||
final IntTag sizeTag = tag.getUnchecked("size");
|
||||
final int[] shiftsAt = shiftsAtTag.getValue();
|
||||
final int[] shiftsTo = shiftsTag.getValue();
|
||||
final int size = sizeTag.asInt();
|
||||
final int[] shiftsAt = tag.getIntArrayTag("at").getValue();
|
||||
final int[] shiftsTo = tag.getIntArrayTag("to").getValue();
|
||||
final int size = tag.getIntTag("size").asInt();
|
||||
mappings = holderSupplier.get(size);
|
||||
|
||||
// Handle values until first shift
|
||||
if (shiftsAt[0] != 0) {
|
||||
// Add identity values before the first shift
|
||||
final int to = shiftsAt[0];
|
||||
for (int id = 0; id < to; id++) {
|
||||
addConsumer.addTo(mappings, id, id);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle shifts
|
||||
// Read shifts
|
||||
for (int i = 0; i < shiftsAt.length; i++) {
|
||||
final boolean isLast = i == shiftsAt.length - 1;
|
||||
final int from = shiftsAt[i];
|
||||
final int to = i == shiftsAt.length - 1 ? size : shiftsAt[i + 1];
|
||||
final int to = isLast ? size : shiftsAt[i + 1];
|
||||
int mappedId = shiftsTo[i];
|
||||
for (int id = from; id < to; id++) {
|
||||
addConsumer.addTo(mappings, id, mappedId++);
|
||||
}
|
||||
}
|
||||
} else if (strategy == CHANGES_ID) {
|
||||
final IntArrayTag changesAtTag = tag.getIntArrayTag("at");
|
||||
final IntArrayTag valuesTag = tag.getIntArrayTag("val");
|
||||
final IntTag sizeTag = tag.getUnchecked("size");
|
||||
final int[] changesAt = tag.getIntArrayTag("at").getValue();
|
||||
final int[] values = tag.getIntArrayTag("val").getValue();
|
||||
final int size = tag.getIntTag("size").asInt();
|
||||
final boolean fillBetween = tag.get("nofill") == null;
|
||||
final int[] changesAt = changesAtTag.getValue();
|
||||
final int[] values = valuesTag.getValue();
|
||||
mappings = holderSupplier.get(sizeTag.asInt());
|
||||
mappings = holderSupplier.get(size);
|
||||
|
||||
int nextUnhandledId = 0;
|
||||
for (int i = 0; i < changesAt.length; i++) {
|
||||
final int id = changesAt[i];
|
||||
final int changedId = changesAt[i];
|
||||
if (fillBetween) {
|
||||
// Fill from after the last change to before this change with unchanged ids
|
||||
final int previousId = i != 0 ? changesAt[i - 1] + 1 : 0;
|
||||
for (int identity = previousId; identity < id; identity++) {
|
||||
addConsumer.addTo(mappings, identity, identity);
|
||||
for (int id = nextUnhandledId; id < changedId; id++) {
|
||||
addConsumer.addTo(mappings, id, id);
|
||||
}
|
||||
nextUnhandledId = changedId + 1;
|
||||
}
|
||||
|
||||
// Assign the changed value
|
||||
addConsumer.addTo(mappings, id, values[i]);
|
||||
addConsumer.addTo(mappings, changedId, values[i]);
|
||||
}
|
||||
} else if (strategy == IDENTITY_ID) {
|
||||
final IntTag sizeTag = tag.getUnchecked("size");
|
||||
return new IdentityMappings(sizeTag.asInt(), mappedSizeTag.asInt());
|
||||
final IntTag sizeTag = tag.getIntTag("size");
|
||||
return new IdentityMappings(sizeTag.asInt(), mappedSize);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown serialization strategy: " + strategy);
|
||||
}
|
||||
return mappingsSupplier.create(mappings, mappedSizeTag.asInt());
|
||||
return mappingsSupplier.create(mappings, mappedSize);
|
||||
}
|
||||
|
||||
public @Nullable List<String> identifiersFromGlobalIds(final CompoundTag mappingsTag, final String key) {
|
||||
final Mappings mappings = loadMappings(mappingsTag, key);
|
||||
if (mappings == null) {
|
||||
return mappings != null ? identifiers(mappings, key) : null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a pair of identifier lists, also keeping track of whether the two lists are equal.
|
||||
*
|
||||
* @param unmappedTag unmapped mappings tag
|
||||
* @param mappedTag mapped mappings tag
|
||||
* @param key mappings key
|
||||
* @return pair of identifier lists
|
||||
*/
|
||||
public @Nullable IdentifiersPair identifiersFromGlobalIds(final CompoundTag unmappedTag, final CompoundTag mappedTag, final String key) {
|
||||
final Mappings unmapped = loadMappings(unmappedTag, key);
|
||||
if (unmapped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Mappings mapped = loadMappings(mappedTag, key);
|
||||
if (mapped == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final int size = unmapped.size();
|
||||
if (size != mapped.size()) {
|
||||
return new IdentifiersPair(identifiers(unmapped, key), identifiers(mapped, key), false);
|
||||
}
|
||||
|
||||
// Small optimization to only load one array and reduce loading for full mappings
|
||||
final List<String> unmappedIdentifiers = new ArrayList<>(size);
|
||||
final List<String> mappedIdentifiers = new ArrayList<>(size);
|
||||
boolean identity = true;
|
||||
for (int i = 0; i < size; i++) {
|
||||
final int unmappedGlobalId = unmapped.getNewId(i);
|
||||
final int mappedGlobalId = mapped.getNewId(i);
|
||||
final String unmappedIdentifier = identifierFromGlobalId(key, unmappedGlobalId);
|
||||
if (unmappedGlobalId == mappedGlobalId) {
|
||||
unmappedIdentifiers.add(unmappedIdentifier);
|
||||
mappedIdentifiers.add(unmappedIdentifier);
|
||||
continue;
|
||||
}
|
||||
|
||||
identity = false;
|
||||
unmappedIdentifiers.add(unmappedIdentifier);
|
||||
mappedIdentifiers.add(identifierFromGlobalId(key, mappedGlobalId));
|
||||
}
|
||||
return identity ? new IdentifiersPair(unmappedIdentifiers) : new IdentifiersPair(unmappedIdentifiers, mappedIdentifiers);
|
||||
}
|
||||
|
||||
private List<String> identifiers(final Mappings mappings, final String key) {
|
||||
final List<String> identifiers = new ArrayList<>(mappings.size());
|
||||
for (int i = 0; i < mappings.size(); i++) {
|
||||
identifiers.add(identifierFromGlobalId(key, mappings.getNewId(i)));
|
||||
final int globalId = mappings.getNewId(i);
|
||||
identifiers.add(identifierFromGlobalId(key, globalId));
|
||||
}
|
||||
return identifiers;
|
||||
}
|
||||
@@ -295,7 +338,7 @@ public class MappingDataLoader {
|
||||
* @return map with indexes hashed by their id value
|
||||
*/
|
||||
public Object2IntMap<String> indexedObjectToMap(final JsonObject object) {
|
||||
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(object.size(), .99F);
|
||||
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(object.size());
|
||||
map.defaultReturnValue(-1);
|
||||
for (final Map.Entry<String, JsonElement> entry : object.entrySet()) {
|
||||
map.put(entry.getValue().getAsString(), Integer.parseInt(entry.getKey()));
|
||||
@@ -310,7 +353,7 @@ public class MappingDataLoader {
|
||||
* @return map with indexes hashed by their id value
|
||||
*/
|
||||
public Object2IntMap<String> arrayToMap(final JsonArray array) {
|
||||
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(array.size(), .99F);
|
||||
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(array.size());
|
||||
map.defaultReturnValue(-1);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
map.put(array.get(i).getAsString(), i);
|
||||
@@ -347,4 +390,15 @@ public class MappingDataLoader {
|
||||
|
||||
T create(V mappings, int mappedSize);
|
||||
}
|
||||
|
||||
public record IdentifiersPair(List<String> unmapped, List<String> mapped, boolean identity) {
|
||||
|
||||
public IdentifiersPair(final List<String> unmapped, final List<String> mapped) {
|
||||
this(unmapped, mapped, false);
|
||||
}
|
||||
|
||||
public IdentifiersPair(final List<String> identifiers) {
|
||||
this(identifiers, identifiers, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,6 +22,8 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.data;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public interface Mappings {
|
||||
|
||||
/**
|
||||
@@ -84,4 +86,40 @@ public interface Mappings {
|
||||
* @return mappings with keys and values swapped
|
||||
*/
|
||||
Mappings inverse();
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether the mappings are unchanged identity mappings.
|
||||
*
|
||||
* @return whether the mappings are unchanged identity mappings
|
||||
*/
|
||||
default boolean isIdentity() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the mappings null or identity mappings.
|
||||
*
|
||||
* @param mappings mappings
|
||||
* @return whether the mappings are identity mappings
|
||||
* @see #isFullIdentity(Mappings)
|
||||
*/
|
||||
static boolean isIntIdIdentity(@Nullable final Mappings mappings) {
|
||||
if (mappings == null) {
|
||||
return true;
|
||||
}
|
||||
return mappings instanceof FullMappings fullMappings ? fullMappings.isIntIdIdentity() : mappings.isIdentity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the mappings null or full identity mappings.
|
||||
* Stronger than {@link #isIntIdIdentity(Mappings)}, but equal to that if not {@link FullMappings}.
|
||||
*
|
||||
* @param mappings mappings
|
||||
* @return whether the mappings are full identity mappings
|
||||
* @see #isIntIdIdentity(Mappings)
|
||||
*/
|
||||
static boolean isFullIdentity(@Nullable final Mappings mappings) {
|
||||
return mappings == null || mappings.isIdentity();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,20 +22,21 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.data;
|
||||
|
||||
import com.viaversion.viaversion.api.data.MappingDataLoader.IdentifiersPair;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import java.util.List;
|
||||
|
||||
public class ParticleMappings extends FullMappingsBase {
|
||||
private final IntList itemParticleIds = new IntArrayList(4);
|
||||
private final IntList blockParticleIds = new IntArrayList(4);
|
||||
|
||||
public ParticleMappings(final List<String> unmappedIdentifiers, final List<String> mappedIdentifiers, final Mappings mappings) {
|
||||
super(unmappedIdentifiers, mappedIdentifiers, mappings);
|
||||
public ParticleMappings(final IdentifiersPair identifiersPair, final Mappings mappings) {
|
||||
super(identifiersPair, mappings);
|
||||
addBlockParticle("block");
|
||||
addBlockParticle("falling_dust");
|
||||
addBlockParticle("block_marker");
|
||||
addBlockParticle("dust_pillar");
|
||||
addBlockParticle("block_crumble");
|
||||
addItemParticle("item");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -24,6 +24,7 @@ package com.viaversion.viaversion.api.data.entity;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import com.viaversion.viaversion.util.KeyMappings;
|
||||
import java.util.Map;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
@@ -78,10 +79,15 @@ public interface EntityTracker {
|
||||
void removeEntity(int id);
|
||||
|
||||
/**
|
||||
* Clears stored entity types and data.
|
||||
* Clears stored entity types and data, only leaving behind the client entity.
|
||||
*/
|
||||
void clearEntities();
|
||||
|
||||
/**
|
||||
* Clears all stored data, including entity types, entity data and client entity id.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -102,11 +108,19 @@ public interface EntityTracker {
|
||||
@Nullable StoredEntityData entityDataIfPresent(int id);
|
||||
|
||||
/**
|
||||
* Returns the client entity id or -1 if unset.
|
||||
* Returns whether the client entity id has been set.
|
||||
*
|
||||
* @return client entity id or -1 if unset
|
||||
* @return whether the client entity id has been set
|
||||
*/
|
||||
int clientEntityId();
|
||||
boolean hasClientEntityId();
|
||||
|
||||
/**
|
||||
* Returns the client entity id. Should be wrapped around {@link #hasClientEntityId()}.
|
||||
*
|
||||
* @return client entity id
|
||||
* @throws IllegalStateException if the client entity id has not been set
|
||||
*/
|
||||
int clientEntityId() throws IllegalStateException;
|
||||
|
||||
/**
|
||||
* Sets the client entity id.
|
||||
@@ -115,6 +129,20 @@ public interface EntityTracker {
|
||||
*/
|
||||
void setClientEntityId(int clientEntityId);
|
||||
|
||||
/**
|
||||
* Returns whether the client player has the "insta build" ability, usually from creative mode.
|
||||
*
|
||||
* @return whether the client player can insta build
|
||||
*/
|
||||
boolean canInstaBuild();
|
||||
|
||||
/**
|
||||
* Sets whether the client player has the "insta build" ability, usually from creative mode.
|
||||
*
|
||||
* @param instaBuild whether the client player can insta build
|
||||
*/
|
||||
void setInstaBuild(boolean instaBuild);
|
||||
|
||||
/**
|
||||
* Returns the current world section height (block height / 16).
|
||||
* This is always 16 for sub 1.17 worlds.
|
||||
@@ -158,6 +186,20 @@ public interface EntityTracker {
|
||||
*/
|
||||
void setCurrentWorld(String currentWorld);
|
||||
|
||||
/**
|
||||
* Returns the id of the current dimension, or -1 if unset (i.e. before 1.20.5).
|
||||
*
|
||||
* @return id of the current dimension, or -1 if unset
|
||||
*/
|
||||
int currentDimensionId();
|
||||
|
||||
/**
|
||||
* Sets the id of the current dimension.
|
||||
*
|
||||
* @param currentDimensionId id of the current dimension
|
||||
*/
|
||||
void setCurrentDimensionId(int currentDimensionId);
|
||||
|
||||
int biomesSent();
|
||||
|
||||
void setBiomesSent(int biomesSent);
|
||||
@@ -170,11 +212,7 @@ public interface EntityTracker {
|
||||
|
||||
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();
|
||||
@Nullable KeyMappings registryKeys(String registryKey);
|
||||
|
||||
void addRegistryKeys(String registryKey, KeyMappings mappings);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -66,4 +66,4 @@ public interface StoredEntityData {
|
||||
* @param object object to store
|
||||
*/
|
||||
void put(Object object);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -55,4 +55,4 @@ public interface TrackedEntity {
|
||||
boolean hasSentEntityData();
|
||||
|
||||
void sentEntityData(boolean sentEntityData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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.item;
|
||||
|
||||
/**
|
||||
* Used for converting items to hashed items and caching them for later use during serverbound packets.
|
||||
* <p>
|
||||
* Most of this stays in the internal module given non-permanent, imperfect caching as well as missing converters.
|
||||
*/
|
||||
public interface ItemHasher {
|
||||
|
||||
/**
|
||||
* Returns whether this connection is currently processing a clientbound player inventory packet.
|
||||
* <p>
|
||||
* Used for checking when it is necessary to track/process item data hashes.
|
||||
*
|
||||
* @return true if processing a clientbound inventory packet, false otherwise
|
||||
*/
|
||||
boolean isProcessingClientboundInventoryPacket();
|
||||
|
||||
void setProcessingClientboundInventoryPacket(boolean processingClientboundInventoryPacket);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,7 +22,6 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.debug;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.packet.Direction;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketType;
|
||||
@@ -50,16 +49,14 @@ public interface DebugHandler {
|
||||
*
|
||||
* @param packetTypeName packet type name
|
||||
*/
|
||||
@Beta
|
||||
void addPacketTypeNameToLog(String packetTypeName);
|
||||
|
||||
/**
|
||||
* Adds a packet id to the list of packet types to log.
|
||||
* Adds a packet type 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
|
||||
*/
|
||||
@Beta
|
||||
void addPacketTypeToLog(PacketType packetType);
|
||||
|
||||
/**
|
||||
@@ -67,22 +64,51 @@ public interface DebugHandler {
|
||||
*
|
||||
* @param packetTypeName packet type name
|
||||
*/
|
||||
@Beta
|
||||
boolean removePacketTypeNameToLog(String packetTypeName);
|
||||
|
||||
/**
|
||||
* Removes a packet type from the list of packet types to log.
|
||||
*
|
||||
* @param packetType Packet type to remove
|
||||
*/
|
||||
boolean removePacketTypeToLog(PacketType packetType);
|
||||
|
||||
/**
|
||||
* Resets packet type filters.
|
||||
*/
|
||||
@Beta
|
||||
void clearPacketTypesToLog();
|
||||
|
||||
/**
|
||||
* Returns whether packets should be logged after being transformed.
|
||||
* Sets whether packets should be logged before and after being transformed.
|
||||
*
|
||||
* @param logPacketTransform whether packets should be logged
|
||||
*/
|
||||
default void setLogPacketTransform(boolean logPacketTransform) {
|
||||
setLogPrePacketTransform(logPacketTransform);
|
||||
setLogPostPacketTransform(logPacketTransform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether packets should be logged before being transformed.
|
||||
* Set to true by default.
|
||||
*
|
||||
* @return whether packets should be logged before being transformed
|
||||
*/
|
||||
boolean logPrePacketTransform();
|
||||
|
||||
/**
|
||||
* Sets whether packets should be logged before being transformed.
|
||||
*
|
||||
* @param logPrePacketTransform whether packets should be logged before being transformed
|
||||
*/
|
||||
void setLogPrePacketTransform(boolean logPrePacketTransform);
|
||||
|
||||
/**
|
||||
* Returns whether packets should be logged after being transformed.
|
||||
* Set to false by default.
|
||||
*
|
||||
* @return whether packets should be logged after being transformed
|
||||
*/
|
||||
@Beta
|
||||
boolean logPostPacketTransform();
|
||||
|
||||
/**
|
||||
@@ -90,7 +116,6 @@ public interface DebugHandler {
|
||||
*
|
||||
* @param logPostPacketTransform whether packets should be logged after being transformed
|
||||
*/
|
||||
@Beta
|
||||
void setLogPostPacketTransform(boolean logPostPacketTransform);
|
||||
|
||||
/**
|
||||
@@ -103,8 +128,12 @@ public interface DebugHandler {
|
||||
*/
|
||||
boolean shouldLog(PacketWrapper wrapper, Direction direction);
|
||||
|
||||
@Beta
|
||||
default void enableAndLogIds(final PacketType... packetTypes) {
|
||||
/**
|
||||
* Enables debug mode and adds the given packet types to the log list.
|
||||
*
|
||||
* @param packetTypes packet types to log
|
||||
*/
|
||||
default void enableAndLogTypes(final PacketType... packetTypes) {
|
||||
setEnabled(true);
|
||||
for (final PacketType packetType : packetTypes) {
|
||||
addPacketTypeToLog(packetType);
|
||||
@@ -118,7 +147,7 @@ public interface DebugHandler {
|
||||
* @param t thrown exception
|
||||
*/
|
||||
default void error(final String error, final Throwable t) {
|
||||
if (!Via.getConfig().isSuppressConversionWarnings() || enabled()) {
|
||||
if (Via.getConfig().logOtherConversionWarnings() || enabled()) {
|
||||
Via.getPlatform().getLogger().log(Level.SEVERE, error, t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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.type.Types;
|
||||
import com.viaversion.viaversion.api.type.types.misc.HolderType;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Represents an animal variant (e.g. for cows, pigs, chickens).
|
||||
*
|
||||
* @param modelType model type id
|
||||
* @param texture texture path
|
||||
* @param biomes biomes this variant can spawn in, if limited to specific biomes
|
||||
*/
|
||||
public record AnimalVariant(int modelType, String texture, @Nullable HolderSet biomes) {
|
||||
|
||||
public static HolderType<AnimalVariant> TYPE = new HolderType<>() {
|
||||
@Override
|
||||
public AnimalVariant readDirect(final ByteBuf buffer) {
|
||||
final int modelType = Types.VAR_INT.readPrimitive(buffer);
|
||||
final String texture = Types.STRING.read(buffer);
|
||||
final HolderSet biomes = Types.OPTIONAL_HOLDER_SET.read(buffer);
|
||||
return new AnimalVariant(modelType, texture, biomes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDirect(final ByteBuf buffer, final AnimalVariant variant) {
|
||||
Types.VAR_INT.writePrimitive(buffer, variant.modelType());
|
||||
Types.STRING.write(buffer, variant.texture());
|
||||
Types.OPTIONAL_HOLDER_SET.write(buffer, variant.biomes());
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -65,4 +65,4 @@ public interface BlockChangeRecord {
|
||||
int getBlockId();
|
||||
|
||||
void setBlockId(int blockId);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -58,7 +58,7 @@ public class BlockChangeRecord1_16_2 implements BlockChangeRecord {
|
||||
|
||||
@Override
|
||||
public short getY(int chunkSectionY) {
|
||||
Preconditions.checkArgument(chunkSectionY >= 0, "Invalid chunkSectionY: " + chunkSectionY);
|
||||
Preconditions.checkArgument(chunkSectionY >= 0, "Invalid chunkSectionY: %s", chunkSectionY);
|
||||
return (short) ((chunkSectionY << 4) + sectionY);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -33,7 +33,6 @@ public enum BlockFace {
|
||||
TOP((byte) 0, (byte) 1, (byte) 0, EnumAxis.Y),
|
||||
BOTTOM((byte) 0, (byte) -1, (byte) 0, EnumAxis.Y);
|
||||
|
||||
public static final BlockFace[] HORIZONTAL = {NORTH, SOUTH, EAST, WEST};
|
||||
private static final Map<BlockFace, BlockFace> opposites = new EnumMap<>(BlockFace.class);
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -37,6 +37,13 @@ public class BlockPosition {
|
||||
return new BlockPosition(x + face.modX(), y + face.modY(), z + face.modZ());
|
||||
}
|
||||
|
||||
public double distanceFromCenterSquared(final double x, final double y, final double z) {
|
||||
final double dx = this.x + 0.5 - x;
|
||||
final double dy = this.y + 0.5 - y;
|
||||
final double dz = this.z + 0.5 - z;
|
||||
return dx * dx + dy * dy + dz * dz;
|
||||
}
|
||||
|
||||
public int x() {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -66,6 +66,17 @@ public final class ChunkPosition {
|
||||
return (long) chunkX & 0xffffffffL | ((long) chunkZ & 0xffffffffL) << 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a long key for the given block coordinates.
|
||||
*
|
||||
* @param x the block X coordinate
|
||||
* @param z the block Z coordinate
|
||||
* @return the chunk key
|
||||
*/
|
||||
public static long chunkKeyForBlock(final int x, final int z) {
|
||||
return chunkKey(x >> 4, z >> 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -23,13 +23,12 @@
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Stored up until 1.14 to be used in chunk sending.
|
||||
*/
|
||||
public class ClientWorld implements StorableObject {
|
||||
private Environment environment;
|
||||
private Environment environment = Environment.NORMAL;
|
||||
|
||||
public ClientWorld() {
|
||||
}
|
||||
@@ -38,11 +37,20 @@ public class ClientWorld implements StorableObject {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
public @Nullable Environment getEnvironment() {
|
||||
public Environment getEnvironment() {
|
||||
return environment;
|
||||
}
|
||||
|
||||
public void setEnvironment(final int environmentId) {
|
||||
/**
|
||||
* Sets the environment of the world and returns whether the environment was changed.
|
||||
*
|
||||
* @param environmentId the id of the environment to set
|
||||
* @return whether the environment was changed
|
||||
*/
|
||||
public boolean setEnvironment(final int environmentId) {
|
||||
final int previousEnvironmentId = environment.id();
|
||||
this.environment = Environment.getEnvironmentById(environmentId);
|
||||
|
||||
return previousEnvironmentId != environmentId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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 EitherHolder<T> {
|
||||
|
||||
/**
|
||||
* Returns a direct or indirect value holder.
|
||||
*
|
||||
* @param value the value
|
||||
* @param <T> the type of the value
|
||||
* @return a new direct holder
|
||||
*/
|
||||
static <T> EitherHolder<T> of(final Holder<T> value) {
|
||||
return new EitherHolderImpl<>(value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an indirect holder via the resource key.
|
||||
*
|
||||
* @param key the resource key
|
||||
* @param <T> the type of the value
|
||||
* @return a new holder with the given resource key
|
||||
*/
|
||||
static <T> EitherHolder<T> of(final String key) {
|
||||
return new EitherHolderImpl<>(null, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this holder is backed by a direct value.
|
||||
*
|
||||
* @return true if the holder is direct
|
||||
* @see #hasKey()
|
||||
*/
|
||||
boolean hasHolder();
|
||||
|
||||
/**
|
||||
* Returns true if this holder has a resource key.
|
||||
*
|
||||
* @return true if this holder has a resource key
|
||||
* @see #hasHolder()
|
||||
*/
|
||||
boolean hasKey();
|
||||
|
||||
/**
|
||||
* Returns the value of this holder.
|
||||
*
|
||||
* @return the value of this holder
|
||||
* @throws IllegalArgumentException if this contains a resource key instead of a holder
|
||||
* @see #hasHolder()
|
||||
*/
|
||||
Holder<T> holder();
|
||||
|
||||
/**
|
||||
* Returns the resource key.
|
||||
*
|
||||
* @return the resource key
|
||||
* @throws IllegalArgumentException if this contains a holder instead of a resource key
|
||||
* @see #hasKey()
|
||||
*/
|
||||
String key();
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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;
|
||||
import com.viaversion.viaversion.util.EitherImpl;
|
||||
|
||||
final class EitherHolderImpl<T> extends EitherImpl<Holder<T>, String> implements EitherHolder<T> {
|
||||
|
||||
EitherHolderImpl(final Holder<T> left, final String value) {
|
||||
super(left, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasHolder() {
|
||||
return isLeft();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasKey() {
|
||||
return isRight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Holder<T> holder() {
|
||||
Preconditions.checkArgument(hasHolder(), "Either does not have a holder");
|
||||
return left();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
Preconditions.checkArgument(hasKey(), "Either does not have a key");
|
||||
return right();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -24,28 +24,35 @@ package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
public enum GameMode {
|
||||
|
||||
SURVIVAL("Survival Mode"),
|
||||
CREATIVE("Creative Mode"),
|
||||
ADVENTURE("Adventure Mode"),
|
||||
SPECTATOR("Spectator Mode");
|
||||
NOT_SET("", -1),
|
||||
SURVIVAL("Survival Mode", 0),
|
||||
CREATIVE("Creative Mode", 1),
|
||||
ADVENTURE("Adventure Mode", 2),
|
||||
SPECTATOR("Spectator Mode", 3);
|
||||
|
||||
private final String text;
|
||||
private final int id;
|
||||
|
||||
GameMode(String text) {
|
||||
GameMode(String text, final int id) {
|
||||
this.text = text;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String text() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public int id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static GameMode getById(int id) {
|
||||
return switch (id) {
|
||||
case 0 -> SURVIVAL;
|
||||
case -1 -> NOT_SET;
|
||||
case 1 -> CREATIVE;
|
||||
case 2 -> ADVENTURE;
|
||||
case 3 -> SPECTATOR;
|
||||
default -> throw new IllegalArgumentException("Unknown gamemode id: " + id);
|
||||
default /*0*/ -> SURVIVAL;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,11 +22,35 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public record GameProfile(@Nullable String name, @Nullable UUID id, Property[] properties) {
|
||||
public record GameProfile(@Nullable String name, @Nullable UUID id, Property[] properties, boolean dynamic) {
|
||||
|
||||
public GameProfile(@Nullable final String name, @Nullable final UUID id, final Property[] properties) {
|
||||
this(name, id, properties, true);
|
||||
}
|
||||
|
||||
public GameProfile(@Nullable final String name, @Nullable final UUID id) {
|
||||
this(name, id, new Property[0]);
|
||||
}
|
||||
|
||||
public Map<String, List<Property>> propertiesMap() {
|
||||
final Map<String, List<Property>> map = new HashMap<>();
|
||||
for (Property property : properties) {
|
||||
map.computeIfAbsent(property.name(), k -> new ArrayList<>()).add(property);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public record Property(String name, String value, @Nullable String signature) {
|
||||
|
||||
public Property(final String name, final String value) {
|
||||
this(name, value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,6 +22,10 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface Holder<T> {
|
||||
|
||||
/**
|
||||
@@ -33,7 +37,7 @@ public interface Holder<T> {
|
||||
* @throws IllegalArgumentException if the id is negative
|
||||
*/
|
||||
static <T> Holder<T> of(final int id) {
|
||||
return new HolderImpl<>(id);
|
||||
return new IdHolder<>(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +48,7 @@ public interface Holder<T> {
|
||||
* @return a new direct holder
|
||||
*/
|
||||
static <T> Holder<T> of(final T value) {
|
||||
return new HolderImpl<>(value);
|
||||
return new ValueHolder<>(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,4 +83,31 @@ public interface Holder<T> {
|
||||
* @see #hasId()
|
||||
*/
|
||||
int id();
|
||||
|
||||
/**
|
||||
* Returns a new holder with the id rewritten using the given function, or self if this is a direct holder or the id did not change.
|
||||
*
|
||||
* @param rewriteFunction the function to rewrite the id
|
||||
* @return a new holder with the id rewritten, or self
|
||||
*/
|
||||
default Holder<T> updateId(final Int2IntFunction rewriteFunction) {
|
||||
return this.updateId(rewriteFunction, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new holder with the id rewritten using the given function, or self if this is a direct holder or the id did not change.
|
||||
*
|
||||
* @param rewriteFunction the function to rewrite the id
|
||||
* @param ifMissing a supplier that provides a new holder if the id is missing (i.e. -1)
|
||||
* @return a new holder with the id rewritten, or self
|
||||
*/
|
||||
Holder<T> updateId(Int2IntFunction rewriteFunction, Supplier<Holder<T>> ifMissing);
|
||||
|
||||
/**
|
||||
* Returns a new holder with the value rewritten using the given function, or self if this is an id holder or the value did not change.
|
||||
*
|
||||
* @param rewriteFunction the function to rewrite the value
|
||||
* @return a new holder with the value rewritten, or self
|
||||
*/
|
||||
Holder<T> updateValue(final Function<T, T> rewriteFunction);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,7 +22,12 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.nbt.tag.ListTag;
|
||||
import com.viaversion.nbt.tag.StringTag;
|
||||
import com.viaversion.nbt.tag.Tag;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import java.util.function.ToIntFunction;
|
||||
|
||||
/**
|
||||
* Set of ids that either holds a string tag key or an array of ids.
|
||||
@@ -32,11 +37,12 @@ public interface HolderSet {
|
||||
/**
|
||||
* Creates a new holder set for the given tag.
|
||||
*
|
||||
* @param tagKey the tag key
|
||||
* @param tagKey the tag key, not including '#'
|
||||
* @return a new holder set
|
||||
*/
|
||||
static HolderSet of(final String tagKey) {
|
||||
return new HolderSetImpl(tagKey);
|
||||
Preconditions.checkNotNull(tagKey);
|
||||
return new HolderSetImpl.Tag(tagKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,13 +52,33 @@ public interface HolderSet {
|
||||
* @return a new holder set
|
||||
*/
|
||||
static HolderSet of(final int[] ids) {
|
||||
return new HolderSetImpl(ids);
|
||||
Preconditions.checkNotNull(ids);
|
||||
return new HolderSetImpl.Ids(ids);
|
||||
}
|
||||
|
||||
static HolderSet fromTag(final Tag tag, final ToIntFunction<String> mappingFunction) {
|
||||
if (tag instanceof StringTag stringTag) {
|
||||
if (stringTag.getValue().startsWith("#")) {
|
||||
return HolderSet.of(stringTag.getValue().substring(1));
|
||||
}
|
||||
|
||||
final int id = mappingFunction.applyAsInt(stringTag.getValue());
|
||||
return HolderSet.of(new int[]{id});
|
||||
} else if (tag instanceof ListTag<?> listTag) {
|
||||
final int[] ids = new int[listTag.size()];
|
||||
for (int i = 0; i < listTag.size(); i++) {
|
||||
final String value = ((StringTag) listTag.get(i)).getValue();
|
||||
ids[i] = mappingFunction.applyAsInt(value);
|
||||
}
|
||||
return HolderSet.of(ids);
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the tag key.
|
||||
* Gets the tag key, not including '#'.
|
||||
*
|
||||
* @return the tag key
|
||||
* @return the tag key without a '#'
|
||||
* @see #hasTagKey()
|
||||
*/
|
||||
String tagKey();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,50 +22,69 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.util.EitherImpl;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import java.util.Arrays;
|
||||
|
||||
final class HolderSetImpl extends EitherImpl<String, int[]> implements HolderSet {
|
||||
final class HolderSetImpl {
|
||||
|
||||
HolderSetImpl(final String tagKey) {
|
||||
super(tagKey, null);
|
||||
}
|
||||
record Tag(String tagKey) implements HolderSet {
|
||||
@Override
|
||||
public boolean hasTagKey() {
|
||||
return true;
|
||||
}
|
||||
|
||||
HolderSetImpl(final int[] ids) {
|
||||
super(null, ids);
|
||||
}
|
||||
@Override
|
||||
public int[] ids() {
|
||||
throw new IllegalArgumentException("This holder set has a tag key");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tagKey() {
|
||||
return left();
|
||||
}
|
||||
@Override
|
||||
public boolean hasIds() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTagKey() {
|
||||
return isLeft();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] ids() {
|
||||
return right();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasIds() {
|
||||
return isRight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HolderSet rewrite(final Int2IntFunction idRewriter) {
|
||||
if (hasTagKey()) {
|
||||
@Override
|
||||
public HolderSet rewrite(final Int2IntFunction idRewriter) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
final int[] ids = ids();
|
||||
final int[] mappedIds = new int[ids.length];
|
||||
for (int i = 0; i < mappedIds.length; i++) {
|
||||
mappedIds[i] = idRewriter.apply(ids[i]);
|
||||
record Ids(int[] ids) implements HolderSet {
|
||||
@Override
|
||||
public boolean hasTagKey() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tagKey() {
|
||||
throw new IllegalArgumentException("This holder set has direct ids");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasIds() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HolderSet rewrite(final Int2IntFunction idRewriter) {
|
||||
// Filter out negative ids as they would come from missing VB mapping data. This happens especially
|
||||
// with block ids which are not mapped and thus written as -1 so VV rewriters can cancel them nicely.
|
||||
final int[] mappedIds = new int[ids.length];
|
||||
int validCount = 0;
|
||||
for (final int id : ids) {
|
||||
final int mappedId = idRewriter.applyAsInt(id);
|
||||
if (mappedId != -1) {
|
||||
mappedIds[validCount++] = mappedId;
|
||||
}
|
||||
}
|
||||
return new Ids(validCount == ids.length ? mappedIds : Arrays.copyOf(mappedIds, validCount));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ids{" +
|
||||
"ids=" + Arrays.toString(ids) +
|
||||
'}';
|
||||
}
|
||||
return new HolderSetImpl(mappedIds);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
record IdHolder<T>(int id) implements Holder<T> {
|
||||
|
||||
IdHolder {
|
||||
Preconditions.checkArgument(id >= 0, "id cannot be negative");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDirect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasId() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T value() {
|
||||
throw new IllegalArgumentException("Holder is not direct");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Holder<T> updateId(final Int2IntFunction rewriteFunction, final Supplier<Holder<T>> ifMissing) {
|
||||
final int rewrittenId = rewriteFunction.applyAsInt(id);
|
||||
if (rewrittenId == id) {
|
||||
return this;
|
||||
}
|
||||
if (rewrittenId == -1) {
|
||||
if (ifMissing != null) {
|
||||
return ifMissing.get();
|
||||
}
|
||||
throw new IllegalArgumentException("Received invalid id in updateId");
|
||||
}
|
||||
return Holder.of(rewrittenId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Holder<T> updateValue(final Function<T, T> rewriteFunction) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,13 +22,21 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.nbt.tag.Tag;
|
||||
import com.viaversion.viaversion.api.minecraft.codec.Ops;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.api.type.types.misc.HolderType;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public record PaintingVariant(int width, int height, String assetId) {
|
||||
public record PaintingVariant(int width, int height, String assetId, @Nullable Tag title, @Nullable Tag author) {
|
||||
|
||||
public static HolderType<PaintingVariant> TYPE = new HolderType<>() {
|
||||
public PaintingVariant(final int width, final int height, final String assetId) {
|
||||
this(width, height, assetId, null, null);
|
||||
}
|
||||
|
||||
public static HolderType<PaintingVariant> TYPE1_21 = new HolderType<>() {
|
||||
@Override
|
||||
public PaintingVariant readDirect(final ByteBuf buffer) {
|
||||
final int width = Types.VAR_INT.readPrimitive(buffer);
|
||||
@@ -44,4 +52,40 @@ public record PaintingVariant(int width, int height, String assetId) {
|
||||
Types.STRING.write(buffer, variant.assetId());
|
||||
}
|
||||
};
|
||||
public static HolderType<PaintingVariant> TYPE1_21_2 = new HolderType<>() {
|
||||
@Override
|
||||
public PaintingVariant readDirect(final ByteBuf buffer) {
|
||||
final int width = Types.VAR_INT.readPrimitive(buffer);
|
||||
final int height = Types.VAR_INT.readPrimitive(buffer);
|
||||
final String assetId = Types.STRING.read(buffer);
|
||||
final Tag title = Types.TRUSTED_OPTIONAL_TAG.read(buffer);
|
||||
final Tag author = Types.TRUSTED_OPTIONAL_TAG.read(buffer);
|
||||
return new PaintingVariant(width, height, assetId, title, author);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDirect(final ByteBuf buffer, final PaintingVariant variant) {
|
||||
Types.VAR_INT.writePrimitive(buffer, variant.width());
|
||||
Types.VAR_INT.writePrimitive(buffer, variant.height());
|
||||
Types.STRING.write(buffer, variant.assetId());
|
||||
Types.TRUSTED_OPTIONAL_TAG.write(buffer, variant.title());
|
||||
Types.TRUSTED_OPTIONAL_TAG.write(buffer, variant.author());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDirect(final Ops ops, final PaintingVariant value) {
|
||||
// Unused, cannot be direct despite having a direct network codec
|
||||
ops.writeMap(map -> map
|
||||
.write("width", Types.INT, value.width())
|
||||
.write("height", Types.INT, value.height())
|
||||
.write("asset_id", Types.IDENTIFIER, Key.of(value.assetId()))
|
||||
.writeOptional("title", Types.TRUSTED_TAG, value.title())
|
||||
.writeOptional("author", Types.TRUSTED_TAG, value.author()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Key identifier(final Ops ops, final int id) {
|
||||
return ops.context().registryAccess().registryKey("painting_variant", id);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -24,12 +24,13 @@ package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.util.Copyable;
|
||||
import com.viaversion.viaversion.util.IdHolder;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class Particle implements IdHolder {
|
||||
public final class Particle implements IdHolder, Copyable {
|
||||
private final List<ParticleData<?>> arguments = new ArrayList<>(4);
|
||||
private int id;
|
||||
|
||||
@@ -72,6 +73,15 @@ public final class Particle implements IdHolder {
|
||||
arguments.set(index, new ParticleData<>(type, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle copy() {
|
||||
final Particle particle = new Particle(id);
|
||||
for (ParticleData<?> argument : arguments) {
|
||||
particle.arguments.add(argument.copy());
|
||||
}
|
||||
return particle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Particle{" +
|
||||
@@ -80,7 +90,7 @@ public final class Particle implements IdHolder {
|
||||
'}';
|
||||
}
|
||||
|
||||
public static final class ParticleData<T> {
|
||||
public static final class ParticleData<T> implements Copyable {
|
||||
private final Type<T> type;
|
||||
private T value;
|
||||
|
||||
@@ -109,6 +119,11 @@ public final class Particle implements IdHolder {
|
||||
wrapper.write(type, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleData<T> copy() {
|
||||
return new ParticleData<>(type, Copyable.copy(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ParticleData{" +
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -23,11 +23,23 @@
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.nbt.tag.Tag;
|
||||
import com.viaversion.viaversion.util.Copyable;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public record RegistryEntry(String key, @Nullable Tag tag) {
|
||||
/**
|
||||
* Represents an entry in a registry.
|
||||
*
|
||||
* @param key key of the registry entry
|
||||
* @param tag data of the registry entry, or null if the client should use its default
|
||||
*/
|
||||
public record RegistryEntry(String key, @Nullable Tag tag) implements Copyable {
|
||||
|
||||
public RegistryEntry withKey(final String key) {
|
||||
return new RegistryEntry(key, tag != null ? tag.copy() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistryEntry copy() {
|
||||
return new RegistryEntry(key, tag != null ? tag.copy() : null);
|
||||
}
|
||||
}
|
||||
+15
-9
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -20,17 +20,23 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package com.viaversion.viaversion.api.protocol;
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.data.MappingData.MappingType;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
|
||||
/**
|
||||
* A simple protocol which does not have any packet types.
|
||||
* <p>
|
||||
* {@link AbstractProtocol} should be preferred over this class in most cases.
|
||||
* Holds a key for a registry.
|
||||
* Depending on the context, the key may be used to get registry entries from either synchronized or hardcoded registries.
|
||||
*
|
||||
* @see MappingType
|
||||
* @see #of(String)
|
||||
*/
|
||||
public abstract class AbstractSimpleProtocol extends AbstractProtocol<SimpleProtocol.DummyPacketTypes, SimpleProtocol.DummyPacketTypes,
|
||||
SimpleProtocol.DummyPacketTypes, SimpleProtocol.DummyPacketTypes> implements SimpleProtocol {
|
||||
public interface RegistryKey {
|
||||
|
||||
protected AbstractSimpleProtocol() {
|
||||
super(null, null, null, null);
|
||||
Key key();
|
||||
|
||||
static RegistryKey of(final String key) {
|
||||
return new SimpleRegistryKey(Key.of(key));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,25 +22,28 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public enum RegistryType {
|
||||
public enum RegistryType implements RegistryKey {
|
||||
|
||||
BLOCK("block"),
|
||||
ITEM("item"),
|
||||
FLUID("fluid"),
|
||||
ENTITY("entity_type"),
|
||||
GAME_EVENT("game_event"),
|
||||
ENCHANTMENT("enchantment");
|
||||
ENCHANTMENT("enchantment"),
|
||||
DAMAGE_TYPE("damage_type"),
|
||||
BANNER_PATTERN("banner_pattern");
|
||||
|
||||
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);
|
||||
MAP.put(type.identifier, type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,17 +51,22 @@ public enum RegistryType {
|
||||
return VALUES;
|
||||
}
|
||||
|
||||
public static @Nullable RegistryType getByKey(String resourceKey) {
|
||||
return MAP.get(resourceKey);
|
||||
public static @Nullable RegistryType getByKey(String identifier) {
|
||||
return MAP.get(identifier);
|
||||
}
|
||||
|
||||
private final String resourceLocation;
|
||||
private final String identifier;
|
||||
|
||||
RegistryType(final String resourceLocation) {
|
||||
this.resourceLocation = resourceLocation;
|
||||
RegistryType(final String identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public String resourceLocation() {
|
||||
return resourceLocation;
|
||||
public String identifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Key key() {
|
||||
return Key.of(identifier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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;
|
||||
|
||||
/**
|
||||
* Profile that can be either dynamically filled by the client or is already static.
|
||||
* The additional fields are optional overrides.
|
||||
*/
|
||||
public record ResolvableProfile(GameProfile profile, @Nullable String bodyTexture, @Nullable String capeTexture,
|
||||
@Nullable String elytraTexture, @Nullable Integer modelType) {
|
||||
|
||||
public ResolvableProfile(final GameProfile profile) {
|
||||
this(profile, null, null, null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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.util.Key;
|
||||
|
||||
record SimpleRegistryKey(Key key) implements RegistryKey {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return key.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,11 +22,21 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public record SoundEvent(String identifier, @Nullable Float fixedRange) {
|
||||
|
||||
private static final Holder<SoundEvent> UNKNOWN = Holder.of(new SoundEvent("viaversion:unknown", 0F));
|
||||
|
||||
public SoundEvent withIdentifier(final String identifier) {
|
||||
return new SoundEvent(identifier, this.fixedRange);
|
||||
}
|
||||
|
||||
public static @Nullable Holder<SoundEvent> rewriteHolder(@Nullable final Holder<SoundEvent> holder, final Int2IntFunction soundRewriteFunction) {
|
||||
if (holder == null) {
|
||||
return null;
|
||||
}
|
||||
return holder.updateId(soundRewriteFunction, () -> UNKNOWN);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
+16
-31
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -22,50 +22,35 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
final class HolderImpl<T> implements Holder<T> {
|
||||
|
||||
private final T value;
|
||||
private final int id;
|
||||
|
||||
HolderImpl(final int id) {
|
||||
Preconditions.checkArgument(id >= 0, "id cannot be negative");
|
||||
this.value = null;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
HolderImpl(final T value) {
|
||||
this.value = value;
|
||||
this.id = -1;
|
||||
}
|
||||
record ValueHolder<T>(T value) implements Holder<T> {
|
||||
|
||||
@Override
|
||||
public boolean isDirect() {
|
||||
return id == -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasId() {
|
||||
return id != -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T value() {
|
||||
Preconditions.checkArgument(isDirect(), "Holder is not direct");
|
||||
return value;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int id() {
|
||||
return id;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HolderImpl{" +
|
||||
"value=" + value +
|
||||
", id=" + id +
|
||||
'}';
|
||||
public Holder<T> updateId(final Int2IntFunction rewriteFunction, final Supplier<Holder<T>> ifMissing) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Holder<T> updateValue(final Function<T, T> rewriteFunction) {
|
||||
final T rewrittenValue = rewriteFunction.apply(value);
|
||||
return rewrittenValue != value ? Holder.of(rewrittenValue) : this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2026 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 record Vector3d(double x, double y, double z) {
|
||||
|
||||
public static final Vector3d ZERO = new Vector3d(0, 0, 0);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -143,6 +143,16 @@ public class BaseChunk implements Chunk {
|
||||
this.heightMap = heightMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Heightmap[] heightmaps() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeightmaps(final Heightmap[] heightmaps) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompoundTag> getBlockEntities() {
|
||||
return blockEntities;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2024 ViaVersion and contributors
|
||||
* Copyright (C) 2016-2026 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
|
||||
@@ -79,7 +79,8 @@ public interface Chunk {
|
||||
* @return chunk section bit mask, only non-null for 1.17+ chunks
|
||||
* @see #getBitmask()
|
||||
*/
|
||||
@Nullable BitSet getChunkMask();
|
||||
@Nullable
|
||||
BitSet getChunkMask();
|
||||
|
||||
void setChunkMask(BitSet chunkSectionMask);
|
||||
|
||||
@@ -88,7 +89,8 @@ public interface Chunk {
|
||||
*
|
||||
* @return array of nullable chunk sections
|
||||
*/
|
||||
@Nullable ChunkSection[] getSections();
|
||||
@Nullable
|
||||
ChunkSection[] getSections();
|
||||
|
||||
void setSections(ChunkSection[] sections);
|
||||
|
||||
@@ -106,10 +108,15 @@ public interface Chunk {
|
||||
*
|
||||
* @return compoundtag containing heightmaps if present
|
||||
*/
|
||||
@Nullable CompoundTag getHeightMap();
|
||||
@Nullable
|
||||
CompoundTag getHeightMap();
|
||||
|
||||
void setHeightMap(@Nullable CompoundTag heightMap);
|
||||
|
||||
Heightmap[] heightmaps();
|
||||
|
||||
void setHeightmaps(Heightmap[] heightmaps);
|
||||
|
||||
/**
|
||||
* Returns a list of block entities.
|
||||
*
|
||||
|
||||
Loaded 100 of 1176 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user