mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-21 06:36:25 -04:00
Compare commits
760
Commits
form-registry
...
v1.3.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6c543e965 | ||
|
|
505eb06406 | ||
|
|
83963d038d | ||
|
|
cedcf1aacf | ||
|
|
5613726acd | ||
|
|
4be346d96d | ||
|
|
29e6861f88 | ||
|
|
6deb272ec3 | ||
|
|
18caae05ca | ||
|
|
1bb4692273 | ||
|
|
6a4bd4dfa6 | ||
|
|
28ff02cc3e | ||
|
|
b8378bf11c | ||
|
|
8d8cf6d071 | ||
|
|
6b2b9fb064 | ||
|
|
2c151ddcec | ||
|
|
1b4584557d | ||
|
|
6773084212 | ||
|
|
fead7cc367 | ||
|
|
622b06b68b | ||
|
|
af7645feb4 | ||
|
|
ccf7218cfc | ||
|
|
9b767f5170 | ||
|
|
fcb4861e94 | ||
|
|
aa8b0d3fbb | ||
|
|
d4fa5255ec | ||
|
|
4f3e874e70 | ||
|
|
6df0f17798 | ||
|
|
a9e3115b46 | ||
|
|
bef8e064f1 | ||
|
|
79873c44e7 | ||
|
|
d4abf9f2b5 | ||
|
|
fd8b6c50a5 | ||
|
|
2b872d85cf | ||
|
|
d98908b91d | ||
|
|
f592e6bc05 | ||
|
|
dad86f3692 | ||
|
|
817b55407c | ||
|
|
b2167a9902 | ||
|
|
d3f5ce42a8 | ||
|
|
0eababd67a | ||
|
|
103f65800f | ||
|
|
55925fc4a4 | ||
|
|
63d4176e86 | ||
|
|
4709d0f766 | ||
|
|
e1ef1d9bb0 | ||
|
|
5745b394b5 | ||
|
|
335f6f7104 | ||
|
|
2de001f61c | ||
|
|
9739ed917a | ||
|
|
e9e699c60b | ||
|
|
4dd78d5755 | ||
|
|
1e67385f15 | ||
|
|
f29a26869b | ||
|
|
aefdbfcce3 | ||
|
|
05bce3c058 | ||
|
|
8ba622a635 | ||
|
|
3b1e8f1624 | ||
|
|
eae49b0f7e | ||
|
|
9af141e9cd | ||
|
|
061a418c90 | ||
|
|
bb52d55c80 | ||
|
|
416affb1c3 | ||
|
|
7061d58333 | ||
|
|
b59aab557f | ||
|
|
1f98355bec | ||
|
|
ad6b63055c | ||
|
|
96611b04dc | ||
|
|
49d1015104 | ||
|
|
0eeb992724 | ||
|
|
9e9921098a | ||
|
|
0b23e68786 | ||
|
|
0ce309c37c | ||
|
|
75527fdf40 | ||
|
|
2389bdf25d | ||
|
|
24c9073c4c | ||
|
|
b33e2118b4 | ||
|
|
993ca68a5a | ||
|
|
f0d47055c4 | ||
|
|
bf331a7471 | ||
|
|
f74ba3dc77 | ||
|
|
063b627043 | ||
|
|
85335d14ed | ||
|
|
358b544583 | ||
|
|
ac945b4597 | ||
|
|
8733085232 | ||
|
|
cbc484a611 | ||
|
|
e5412a9c3b | ||
|
|
3ac325a22e | ||
|
|
6775e30f87 | ||
|
|
5d30990eb6 | ||
|
|
c8917ff02e | ||
|
|
de151442cd | ||
|
|
b09e553557 | ||
|
|
11e150e6aa | ||
|
|
85afe85150 | ||
|
|
4f73361565 | ||
|
|
34d2de0319 | ||
|
|
e8be1c9ccf | ||
|
|
9c36b9449c | ||
|
|
1a7695f844 | ||
|
|
134ebe1c2f | ||
|
|
923ef08db4 | ||
|
|
c962aceed2 | ||
|
|
ebeebeeee7 | ||
|
|
6d6867fb09 | ||
|
|
e98084343d | ||
|
|
19dad2daa7 | ||
|
|
f513475267 | ||
|
|
80fbf4a300 | ||
|
|
6904e302ff | ||
|
|
faf3858a5e | ||
|
|
501dd51e29 | ||
|
|
7b23ce055c | ||
|
|
ec8b9be4f6 | ||
|
|
e62e08aafb | ||
|
|
db6a60d3cb | ||
|
|
94ca3808ed | ||
|
|
9eec283036 | ||
|
|
3a0c801ffd | ||
|
|
ab795a4c6c | ||
|
|
0db41c1f9b | ||
|
|
2d315920f8 | ||
|
|
7449bc2377 | ||
|
|
15065e621f | ||
|
|
59fdd41c46 | ||
|
|
fa04e168ac | ||
|
|
94b28c025a | ||
|
|
6ed4938028 | ||
|
|
99d03b16b2 | ||
|
|
f70f7fe354 | ||
|
|
878c31fac7 | ||
|
|
9945143dd9 | ||
|
|
770d248b3a | ||
|
|
345dd60e11 | ||
|
|
7b48ddf418 | ||
|
|
e8ea697caa | ||
|
|
33021e2cb8 | ||
|
|
d577687a87 | ||
|
|
e603238339 | ||
|
|
a62f1fe560 | ||
|
|
96dd007db9 | ||
|
|
c339e36f9a | ||
|
|
2798487106 | ||
|
|
252139d07f | ||
|
|
e55c54fb24 | ||
|
|
74c4e2ae04 | ||
|
|
49671f7867 | ||
|
|
70b1431c44 | ||
|
|
90a0135f94 | ||
|
|
1a3790a071 | ||
|
|
f62a875c52 | ||
|
|
c11d8f7d84 | ||
|
|
f49c4c0b6c | ||
|
|
e633c5f1b0 | ||
|
|
30d2c4ddfc | ||
|
|
14e721c81f | ||
|
|
4675a47bc6 | ||
|
|
de55ec98a0 | ||
|
|
2e6d7509a6 | ||
|
|
e30ca8bc23 | ||
|
|
9b485ee8ad | ||
|
|
631d6ab776 | ||
|
|
ccacd18a23 | ||
|
|
bca0812d0c | ||
|
|
5518b5c66c | ||
|
|
fef2db118e | ||
|
|
cbcc9c65d9 | ||
|
|
3d3ce6fa0f | ||
|
|
b5d05c4c55 | ||
|
|
ec6dcdb21a | ||
|
|
b5f2e260ea | ||
|
|
60c0c97722 | ||
|
|
ddb78d1467 | ||
|
|
0878abc9f4 | ||
|
|
c466d5e0cb | ||
|
|
0778014d80 | ||
|
|
3f9cb4037a | ||
|
|
8794dcf0cd | ||
|
|
161d3acf0c | ||
|
|
f914d1e38e | ||
|
|
47282fcf82 | ||
|
|
54a719da91 | ||
|
|
890c6c94d9 | ||
|
|
d23363e427 | ||
|
|
f17fb5da25 | ||
|
|
8d091d905f | ||
|
|
6bc413f4d6 | ||
|
|
59768de4d6 | ||
|
|
b1b435c464 | ||
|
|
5fe7bb0097 | ||
|
|
2f1f33f802 | ||
|
|
51f6cf1ed3 | ||
|
|
e487dd2cde | ||
|
|
bfef29b11a | ||
|
|
e22bcd9fb3 | ||
|
|
167b70d237 | ||
|
|
e60fd588f8 | ||
|
|
90f446455f | ||
|
|
1368f1ed76 | ||
|
|
ef10c62114 | ||
|
|
fb01cd0302 | ||
|
|
2fae30206c | ||
|
|
ea3a1f16f3 | ||
|
|
20b6f44e63 | ||
|
|
d61656afe9 | ||
|
|
cc69f04afa | ||
|
|
397e9a2b5f | ||
|
|
dbd7714a26 | ||
|
|
33cfe3b981 | ||
|
|
391283a604 | ||
|
|
a56f313957 | ||
|
|
93261ada2b | ||
|
|
6f3797a8db | ||
|
|
73751c083d | ||
|
|
f9aa09c654 | ||
|
|
1e92ac4603 | ||
|
|
fb1c1170b3 | ||
|
|
5ec7c0f16e | ||
|
|
1e33b4fc1d | ||
|
|
9d4251ac98 | ||
|
|
07b182f044 | ||
|
|
1619cc117f | ||
|
|
574f0cfe1c | ||
|
|
d3e51c9211 | ||
|
|
6dbaba2895 | ||
|
|
036f1af99f | ||
|
|
c3592183fb | ||
|
|
bf322930e7 | ||
|
|
9a9885adef | ||
|
|
0e22e56ca8 | ||
|
|
0d9b639247 | ||
|
|
c59733b8ae | ||
|
|
c3f28b01f9 | ||
|
|
7707530b2f | ||
|
|
e7774a2737 | ||
|
|
fc3c01aac6 | ||
|
|
0b5fffae3d | ||
|
|
2f0f9e9f9a | ||
|
|
c3201effc7 | ||
|
|
c11074b828 | ||
|
|
cb62ebb524 | ||
|
|
1eda4884b3 | ||
|
|
52ead1d48a | ||
|
|
8eabd03a2b | ||
|
|
4ec1e27b09 | ||
|
|
5a6671e988 | ||
|
|
ae6def9d5f | ||
|
|
cadb313ff8 | ||
|
|
2826bea987 | ||
|
|
a698725324 | ||
|
|
e6b3b6fae1 | ||
|
|
06c5eae339 | ||
|
|
d70f0d2b8a | ||
|
|
b2e56130cf | ||
|
|
6ce1288506 | ||
|
|
b32a949c56 | ||
|
|
3f994e761a | ||
|
|
7891c3e9d8 | ||
|
|
e2d6933f8a | ||
|
|
d78fda0b9d | ||
|
|
64d910e10b | ||
|
|
f1e83aa039 | ||
|
|
f2fc1b234d | ||
|
|
9bc4648807 | ||
|
|
0a07058511 | ||
|
|
09cbe63a94 | ||
|
|
52c4f65927 | ||
|
|
f67a1e1784 | ||
|
|
55cddf8ded | ||
|
|
6879b7ce1a | ||
|
|
fb40bc0d3c | ||
|
|
a8429018ea | ||
|
|
c445b26639 | ||
|
|
715d7643b7 | ||
|
|
a937b842e9 | ||
|
|
0f978ade5a | ||
|
|
9bd5866ef7 | ||
|
|
1ec94b0ebe | ||
|
|
8974769f87 | ||
|
|
c20d147838 | ||
|
|
e28d590dc3 | ||
|
|
fe3dbdcdd8 | ||
|
|
77828008fa | ||
|
|
fd13d9400c | ||
|
|
9603713fcb | ||
|
|
cc6ba92d42 | ||
|
|
8316537e90 | ||
|
|
6b396c4fc8 | ||
|
|
e5fe46eb4d | ||
|
|
f2cbf78144 | ||
|
|
8aafbd54f5 | ||
|
|
169145656a | ||
|
|
97bb85e9f5 | ||
|
|
7f35f46705 | ||
|
|
2164a59a84 | ||
|
|
6a65035823 | ||
|
|
f0fb20f701 | ||
|
|
7ed179edd2 | ||
|
|
2d242af211 | ||
|
|
c1f5b6e2b9 | ||
|
|
f8521fe238 | ||
|
|
ca66e1e0a7 | ||
|
|
fc2a23ebf4 | ||
|
|
7df91c2608 | ||
|
|
5b67155112 | ||
|
|
a241ac5653 | ||
|
|
ac743f9f43 | ||
|
|
a703687bed | ||
|
|
16dd7d6fa2 | ||
|
|
d1da3aee57 | ||
|
|
e4818da893 | ||
|
|
85c3582d78 | ||
|
|
95b11cae28 | ||
|
|
809718a89b | ||
|
|
0dd87a8ac4 | ||
|
|
82a9ad7756 | ||
|
|
99e326a720 | ||
|
|
15d034bb60 | ||
|
|
100ba9cff3 | ||
|
|
f86d88a7b9 | ||
|
|
eac4afb1c4 | ||
|
|
c94e176b06 | ||
|
|
009a5c554b | ||
|
|
6829b65f5e | ||
|
|
1ea27c6c4c | ||
|
|
36e0fb8ca0 | ||
|
|
690615b39b | ||
|
|
b31352e229 | ||
|
|
c08e683e32 | ||
|
|
4a7ef9170d | ||
|
|
d0d5db4327 | ||
|
|
328c682b08 | ||
|
|
83024e9451 | ||
|
|
59339775ac | ||
|
|
c4b7fad8e8 | ||
|
|
f289c7945b | ||
|
|
d7b29c6938 | ||
|
|
08e94d23ea | ||
|
|
0f59920a3f | ||
|
|
2f58fc530f | ||
|
|
e64294a71a | ||
|
|
8512c13e6d | ||
|
|
4b4534aea1 | ||
|
|
63bd6d8d08 | ||
|
|
2ea661a6ea | ||
|
|
6d931c6a8a | ||
|
|
ad71a445ba | ||
|
|
a77d74c352 | ||
|
|
bda35d6bbd | ||
|
|
8852752c07 | ||
|
|
788009e14a | ||
|
|
296c618377 | ||
|
|
47fa5bda68 | ||
|
|
a0e18a6037 | ||
|
|
2522a87a22 | ||
|
|
99db2e8f24 | ||
|
|
6a53bb2ecb | ||
|
|
e40ff82366 | ||
|
|
bec0d11fcb | ||
|
|
0d9f49af52 | ||
|
|
b6c6cd855c | ||
|
|
f15d4ae709 | ||
|
|
76738cfd26 | ||
|
|
ef60725cfa | ||
|
|
639571f139 | ||
|
|
94b14c6c36 | ||
|
|
3fdd9fcb3c | ||
|
|
16bc02528e | ||
|
|
e742f8f4ab | ||
|
|
40dfe91f18 | ||
|
|
6a9632731c | ||
|
|
1a12cd7fb7 | ||
|
|
43d5be4825 | ||
|
|
2ffe69cae2 | ||
|
|
7b07ffdb7f | ||
|
|
30a658e54d | ||
|
|
aed8e08a0c | ||
|
|
c0302a69c1 | ||
|
|
b69a09c5ab | ||
|
|
1f84f38f6c | ||
|
|
a22f427988 | ||
|
|
17490019b1 | ||
|
|
510ddd5850 | ||
|
|
d061e3fa60 | ||
|
|
ed43a0a414 | ||
|
|
17c917b4eb | ||
|
|
bf48b04efe | ||
|
|
ea48eefc9f | ||
|
|
a91cabab11 | ||
|
|
e98dc35224 | ||
|
|
1e9e17d32c | ||
|
|
d4958c362f | ||
|
|
84a0a504f2 | ||
|
|
a16e5ea8b7 | ||
|
|
8f145b8565 | ||
|
|
8fce820e22 | ||
|
|
b82f9ec790 | ||
|
|
01b424994c | ||
|
|
a11ce41e11 | ||
|
|
36f8b695c1 | ||
|
|
c021b76700 | ||
|
|
8765a8a5e5 | ||
|
|
87fa04c6b3 | ||
|
|
d997e03829 | ||
|
|
4ef0b4ea85 | ||
|
|
bf2ecb3080 | ||
|
|
566dbb0e33 | ||
|
|
168e40034d | ||
|
|
554914fc30 | ||
|
|
cfd1e234dc | ||
|
|
374ab5f40c | ||
|
|
ebb92d4771 | ||
|
|
a179ca4091 | ||
|
|
1d01f3fffe | ||
|
|
7644b49a32 | ||
|
|
673cbffbbe | ||
|
|
71e1462897 | ||
|
|
e97f7cecd7 | ||
|
|
2ec4fd8aeb | ||
|
|
25ba62eb31 | ||
|
|
d5888935b3 | ||
|
|
553a633451 | ||
|
|
0b7719946e | ||
|
|
fa94d60505 | ||
|
|
dc4a9d9392 | ||
|
|
c1e51ffd72 | ||
|
|
711901cda2 | ||
|
|
c4137d179a | ||
|
|
1441d870b6 | ||
|
|
f962cde3a9 | ||
|
|
91fa0fb73e | ||
|
|
48b5999337 | ||
|
|
39e03173e0 | ||
|
|
febac0bec6 | ||
|
|
4fcc2c386e | ||
|
|
d5b71cd4ab | ||
|
|
dca38c3ad3 | ||
|
|
7c084aeca2 | ||
|
|
867cf0faab | ||
|
|
42ab6ce174 | ||
|
|
f924034fab | ||
|
|
9fcb767743 | ||
|
|
9a4beb597f | ||
|
|
8309c60154 | ||
|
|
01a82c5e74 | ||
|
|
ed55dd21af | ||
|
|
96be99880c | ||
|
|
9099781c86 | ||
|
|
9065420d61 | ||
|
|
9c4accaa55 | ||
|
|
596ddd0391 | ||
|
|
2de7076156 | ||
|
|
93895a5e1a | ||
|
|
09c38b71b5 | ||
|
|
3767d3f770 | ||
|
|
97e4fd55f5 | ||
|
|
0368c79a28 | ||
|
|
29f1319834 | ||
|
|
35ed67be98 | ||
|
|
3991a52f3e | ||
|
|
acd04e6451 | ||
|
|
f0afeb6647 | ||
|
|
d2a38ca33c | ||
|
|
150e132ad6 | ||
|
|
b81e262998 | ||
|
|
93a5c81aa0 | ||
|
|
9eec02cd23 | ||
|
|
e4e209437d | ||
|
|
f8bfb5ad4d | ||
|
|
eb91dc7eed | ||
|
|
76fad53bbf | ||
|
|
13e3ba28a0 | ||
|
|
ee01de09e7 | ||
|
|
851591de3f | ||
|
|
f5b10c8cb6 | ||
|
|
edba5a6633 | ||
|
|
98c4baad5e | ||
|
|
ca66fc3fc2 | ||
|
|
5efefe9ceb | ||
|
|
d2b9949b29 | ||
|
|
17c6608203 | ||
|
|
b8c287e48f | ||
|
|
c5c448a5ed | ||
|
|
1cd2254958 | ||
|
|
d0feab0830 | ||
|
|
922a1420e2 | ||
|
|
321ccacdb3 | ||
|
|
61a84eb039 | ||
|
|
224d2b38b7 | ||
|
|
059dc4ce95 | ||
|
|
d846ad6545 | ||
|
|
bb68cea310 | ||
|
|
3882b26d93 | ||
|
|
41906f6b1c | ||
|
|
1e862be75a | ||
|
|
117048ea37 | ||
|
|
30cf97e2fe | ||
|
|
a4e7b53d71 | ||
|
|
071b797e51 | ||
|
|
b15decd5c5 | ||
|
|
a584db1445 | ||
|
|
936c95e188 | ||
|
|
00ca1dcbab | ||
|
|
fe016f4ffa | ||
|
|
10ff034801 | ||
|
|
50eda62025 | ||
|
|
fab6aed2d5 | ||
|
|
41bb92d4d4 | ||
|
|
d00bdc3d21 | ||
|
|
d72801facc | ||
|
|
65dbb4baca | ||
|
|
5977827b06 | ||
|
|
466567eec1 | ||
|
|
363dcd31c5 | ||
|
|
3d3ffe3c10 | ||
|
|
85b17bb8ff | ||
|
|
ed14ddb4a3 | ||
|
|
17bd787d9f | ||
|
|
a19fb83337 | ||
|
|
34023187ef | ||
|
|
cb4e4ee071 | ||
|
|
859c041a6c | ||
|
|
e212c113c5 | ||
|
|
df9852fcc5 | ||
|
|
3d383151be | ||
|
|
8304009c47 | ||
|
|
44947814ba | ||
|
|
8747f46f5e | ||
|
|
370c08fa31 | ||
|
|
e3732ef15f | ||
|
|
0c651cc4f0 | ||
|
|
e08cfc493f | ||
|
|
21035fa445 | ||
|
|
2de7f98190 | ||
|
|
d497a72088 | ||
|
|
453e31931f | ||
|
|
46dc76e6a2 | ||
|
|
91923f3ba7 | ||
|
|
8907f0f091 | ||
|
|
e58b0e8347 | ||
|
|
689da5bd5c | ||
|
|
948ffbc404 | ||
|
|
196cae58dd | ||
|
|
a1bba3cb61 | ||
|
|
deb9088d94 | ||
|
|
0b7e671527 | ||
|
|
3349bc81be | ||
|
|
9b113a4a3e | ||
|
|
de81a0b165 | ||
|
|
35a1e57bd9 | ||
|
|
22d33a23a5 | ||
|
|
026af46945 | ||
|
|
741b4afe8a | ||
|
|
f006880586 | ||
|
|
dacb0c920a | ||
|
|
d5579fb75c | ||
|
|
161263846d | ||
|
|
b32f13cdbf | ||
|
|
fd200e2400 | ||
|
|
e0da4b8535 | ||
|
|
502fe10713 | ||
|
|
47730b9bb1 | ||
|
|
9bdc2c881b | ||
|
|
fc41f8ecc3 | ||
|
|
a9012d0205 | ||
|
|
7aa712b574 | ||
|
|
6f3b569b04 | ||
|
|
b08a60fc4f | ||
|
|
f8548c6f33 | ||
|
|
9e201122ea | ||
|
|
f0de0d1177 | ||
|
|
58b90c71be | ||
|
|
563842f392 | ||
|
|
f8cf70a42c | ||
|
|
1c3def7ae8 | ||
|
|
60b82b436d | ||
|
|
ae4cb1c771 | ||
|
|
0dbe65fcc1 | ||
|
|
d764f05dc7 | ||
|
|
e51b6e432b | ||
|
|
e46d54d5ae | ||
|
|
873307cc41 | ||
|
|
1a47712541 | ||
|
|
6ed9cd9111 | ||
|
|
647a9df2ef | ||
|
|
a7178ac0a0 | ||
|
|
21b84f487c | ||
|
|
85ea797064 | ||
|
|
b408b208ed | ||
|
|
2d4da2c44b | ||
|
|
06c212a313 | ||
|
|
5cd4fe72dd | ||
|
|
c188db7ac6 | ||
|
|
ef74e16949 | ||
|
|
dbe6363d96 | ||
|
|
ea6f46503c | ||
|
|
f9a6da8b0c | ||
|
|
f0fdb65557 | ||
|
|
d15816bbb5 | ||
|
|
76e0e02c02 | ||
|
|
2d6c40deea | ||
|
|
0ab9e52b3d | ||
|
|
498fc013dc | ||
|
|
9143a52da5 | ||
|
|
4b4623ac53 | ||
|
|
bac71d9267 | ||
|
|
0bf42d14cf | ||
|
|
0e955824d7 | ||
|
|
2b74b23bf1 | ||
|
|
8f2df565d2 | ||
|
|
334b03b6dd | ||
|
|
2620ad51ad | ||
|
|
6c5e7adb03 | ||
|
|
d28ba6d85e | ||
|
|
e273e4228e | ||
|
|
7ce03ad732 | ||
|
|
5f4748d82f | ||
|
|
fd209a3892 | ||
|
|
6cc03a5d0b | ||
|
|
01fcc9271c | ||
|
|
e81ab88909 | ||
|
|
00f2420e09 | ||
|
|
cd4e83da8c | ||
|
|
331371128a | ||
|
|
5716e609da | ||
|
|
f70322d479 | ||
|
|
d5771a5802 | ||
|
|
30137a9308 | ||
|
|
c853644c16 | ||
|
|
794d1b391d | ||
|
|
3ac2687f1e | ||
|
|
511fd00652 | ||
|
|
b36e93fa9b | ||
|
|
405d3fd774 | ||
|
|
e6d3bbac3a | ||
|
|
7a26d613fd | ||
|
|
0a02edf6f3 | ||
|
|
e8c7b31144 | ||
|
|
d6f6742658 | ||
|
|
c76dfe9e96 | ||
|
|
3ba88265eb | ||
|
|
dcc8975757 | ||
|
|
9d930b9ff1 | ||
|
|
e824234057 | ||
|
|
0cc8bd6e0f | ||
|
|
1e45ff34f0 | ||
|
|
bca83a8cdc | ||
|
|
bdb5afde9d | ||
|
|
7e8b448f48 | ||
|
|
697dee2f28 | ||
|
|
00e746adc7 | ||
|
|
2532511d53 | ||
|
|
14f7c5ecc3 | ||
|
|
3b62b7773b | ||
|
|
06d9d06bab | ||
|
|
1ec6af6d34 | ||
|
|
e472ee5fbd | ||
|
|
7fc651c947 | ||
|
|
7b4f43fd12 | ||
|
|
8a49b88c7a | ||
|
|
2138022f6d | ||
|
|
fd3bc667a9 | ||
|
|
4db5e54d88 | ||
|
|
62748437de | ||
|
|
163b2df7f6 | ||
|
|
386bad2c1c | ||
|
|
d304028389 | ||
|
|
964894f376 | ||
|
|
ec8dfd746d | ||
|
|
732547213a | ||
|
|
df888a7f36 | ||
|
|
bd01b9d682 | ||
|
|
ab390703da | ||
|
|
28cd8f0265 | ||
|
|
9fb91f8f6a | ||
|
|
ca47636ffe | ||
|
|
a852b8e535 | ||
|
|
fa6f52d305 | ||
|
|
3e8d8daa9b | ||
|
|
8196a686df | ||
|
|
da157a1b28 | ||
|
|
167191a135 | ||
|
|
e6f881df6e | ||
|
|
53f82b1971 | ||
|
|
9f775f2c92 | ||
|
|
07f89dc691 | ||
|
|
0c70a5cbac | ||
|
|
3ceda765c9 | ||
|
|
e3360e2d18 | ||
|
|
6fbd4c16e3 | ||
|
|
b4e2ecc8f1 | ||
|
|
bdd6ea48a0 | ||
|
|
64b624c1a7 | ||
|
|
ffd3afb8d9 | ||
|
|
84244c0376 | ||
|
|
6fec1417b1 | ||
|
|
142c47de1c | ||
|
|
e796883660 | ||
|
|
c6779385a7 | ||
|
|
1a0ea5db72 | ||
|
|
342a1ceb6d | ||
|
|
0e7d3438a5 | ||
|
|
cadcdab39b | ||
|
|
0bc7614809 | ||
|
|
ecbde40aa6 | ||
|
|
672ed74309 | ||
|
|
469e9e9065 | ||
|
|
2dba103c14 | ||
|
|
be7c0220d4 | ||
|
|
feaf87f615 | ||
|
|
14f9640556 | ||
|
|
3b2940ac59 | ||
|
|
036d9c5e6b | ||
|
|
76cdecbb94 | ||
|
|
1d6317b5d6 | ||
|
|
26f963f9b9 | ||
|
|
9ee90508ed | ||
|
|
9b6da631ee | ||
|
|
c26edc55f5 | ||
|
|
f1c306051c | ||
|
|
dacb16044d | ||
|
|
68478f84d8 | ||
|
|
6272bfe2d6 | ||
|
|
e561bfd148 | ||
|
|
2f9cc2b41c | ||
|
|
8d39e2536b | ||
|
|
17fa80e752 | ||
|
|
4d2641308a | ||
|
|
27e02963eb | ||
|
|
d71c03e48a | ||
|
|
43b69ba860 | ||
|
|
64bfb72c53 | ||
|
|
6810232183 | ||
|
|
6e25c2591e | ||
|
|
0be43ec28c | ||
|
|
78f0f572b2 | ||
|
|
6d99c7e643 | ||
|
|
c6f4fc8992 | ||
|
|
320c471b4e | ||
|
|
0ea8d8932e | ||
|
|
7325f4b6ac | ||
|
|
4fd035aa16 | ||
|
|
5f1038d7a4 | ||
|
|
6449cb7295 | ||
|
|
1fa0e81b8e | ||
|
|
b243a0a098 | ||
|
|
139253454c | ||
|
|
f05f586a8e | ||
|
|
9da71000d2 | ||
|
|
7224ac123f | ||
|
|
c53018942b | ||
|
|
56dffd9790 | ||
|
|
c5c3afc4f0 | ||
|
|
45eaf6fb3b | ||
|
|
8e4141ccc1 | ||
|
|
41c6accc16 | ||
|
|
2302d6e59f | ||
|
|
5848e7b21c | ||
|
|
2a2c0da200 |
+2
-1
@@ -31,4 +31,5 @@ forge*changelog.txt
|
||||
common/src/main/resources/assets/cobblemon/showdown
|
||||
|
||||
# Generated files
|
||||
*/generated/resources/*
|
||||
*/generated/resources/*
|
||||
/fabric/src/generated/resources/cobblemon-common.accesswidener
|
||||
|
||||
+6
-6
@@ -10,7 +10,7 @@ stages:
|
||||
build-job:
|
||||
stage: build
|
||||
script:
|
||||
- export GRADLE_OPTS="-Xmx3G -Xms3G"
|
||||
- export GRADLE_OPTS="-Xmx4G -Xms4G"
|
||||
- chmod +x ./gradlew
|
||||
- ./gradlew build
|
||||
cache:
|
||||
@@ -32,12 +32,12 @@ deploy-job:
|
||||
- fabric/build/libs/*.jar
|
||||
script:
|
||||
- echo "Collecting artifacts..."
|
||||
- mv forge/build/libs/*-remap.jar ./
|
||||
- mv fabric/build/libs/*-remap.jar ./
|
||||
- for f in *.jar; do mv "$f" "$(echo "$f" | sed s/+/b$CI_PIPELINE_IID+/ | sed s/-remap//)"; done
|
||||
- mv forge/build/libs/*+*.jar ./
|
||||
- mv fabric/build/libs/*+*.jar ./
|
||||
- for f in *.jar; do mv "$f" "$(echo "$f" | sed s/+/b$CI_PIPELINE_IID+/)"; done
|
||||
artifacts:
|
||||
expire_in: 28 days
|
||||
paths:
|
||||
- ./*.jar
|
||||
# - forge/build/libs/*-forge.jar
|
||||
# - fabric/build/libs/*-remap.jar
|
||||
# - forge/build/libs/*+*.jar
|
||||
# - fabric/build/libs/*+*.jar
|
||||
|
||||
+289
-13
@@ -1,30 +1,305 @@
|
||||
# Changelog
|
||||
## [1.3.1 (March 31st, 2023)](#1-3-1)
|
||||
|
||||
## 1.1.2
|
||||
### Additions
|
||||
- Reworked customisation of models, textures, and animations to make fakemon very easy to create.
|
||||
- Added 'nature' and 'pokeball' options to commands such as /spawnpokemon and /givepokemon.
|
||||
- Added support for datapack spawn files and spawn file presets.
|
||||
- Added Slugma, Magcargo, Nosepass, and Probopass.
|
||||
- Elgyem family now drops Chorus Fruit, Geodude family now drops Black Augurite.
|
||||
- Added missing spawn files for Golett and Bergmite family.
|
||||
- Apricorns can now be smelted into dyes.
|
||||
- Added animations to Staryu line and Porygon line.
|
||||
- Added faint animations to Klink line.
|
||||
- Add lava surface spawn preset.
|
||||
- Added an ``any`` evolution requirement allowing you to define ``possibilities`` of other evolution requirements, for example, this allows you to create an evolution that requires the Pokémon to be shiny or a female.
|
||||
- Added the `/spawnpokemonfrompool [amount]` or `/forcespawn [amount]` command to spawn Pokémon(s) in the surrounding area using the natural spawn rates/pool of that area, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.spawnpokemon` if a permission mod is present. On a successful execution of the command, the amount of Pokémon spawned will be the output.
|
||||
- Added the `/pokebox` and `/pokeboxall` commands to move Pokemon(s) to the PC from a Player's party, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.pokebox` if a permission mod is present. On a successful execution of the command the output will be the number of pokemon moved to the Player's PC.
|
||||
- Added the `/pc` command which opens up the PC UI the same way interacting with the block would, this will be a cheat command in the Minecraft permission system or use the permission `cobblemon.command.pc` if a permission mod is present.
|
||||
|
||||
### Changes
|
||||
- You can now click the portraits of other Pokémon in the starter selection screen to navigate directly to them.
|
||||
- You can now click the right and left arrow keys to navigate PC boxes.
|
||||
- Link Cables will now require Pokémon to hold any held item normally required for their evolution.
|
||||
- After a battle, the last Pokémon used now becomes the selected one in your party.
|
||||
- The `/teach` command can now only allow the Pokémon to be given moves in their learnset, this can be controlled with the permission `cobblemon.command.teach.bypass`, to account for that change the base command now requires the permission `cobblemon.command.teach.base`, this change is meant only for people using a mod capable of providing permissions such as [LuckPerms](https://luckperms.net/).
|
||||
- Apricorns will no longer collide with their block form when picked, this should improve the experience in automatic farms.
|
||||
- Increased spawn chances for many Pokémon requiring specific blocks to be nearby.
|
||||
- Put Cryogonal in more snowy biomes.
|
||||
- Ditto as well as the Eevee, Gible, and Riolu families have been made more common.
|
||||
- Lowered spawn rate of Gyarados on the surface of water.
|
||||
- Apricorn leaves can now be used in the [Composter](https://minecraft.fandom.com/wiki/Composter) block, these have the same chance to raise the compost pile the Minecraft leaves do.
|
||||
- Updated Gengar's model and texture.
|
||||
- Updated Swinub line model and animations.
|
||||
- Tweaked portrait frames for the Pidgey line and for Walking Wake.
|
||||
- Changed all buff shoulder effects to only give a level 1 buff instead of level 2.
|
||||
- Made Weavile a little bigger.
|
||||
- Changed the recipes for Mystic Water, Miracle Seed, and Charcoal Stick to utilise the evolution stones, as well as Never-Melt Ice having an alternate recipe using the Ice Stone.
|
||||
- Replaced the `Failed to handle` battle messages to `Missing interpretation` to make it more clear that mechanics do work just still pending dedicated messages.
|
||||
|
||||
### Fixes
|
||||
- Fixed killing a Dodrio killing your game. Dodrio will never look the same to us.
|
||||
- Fixed non-Fire-type Pokémon being immune to lava.
|
||||
- Fixed custom Pokémon not being usable in battle, properly. A last minute fix caused this to break again; what are these devs not paid for?
|
||||
- Fixed being locked in an endless healing queue if you broke the healing machine during use.
|
||||
- Fixed an issue with the experience calculation when the Exp. Share is held.
|
||||
- Fixed Friendship-based attacks not using friendship values from your Pokémon.
|
||||
- Fixed Link Cables consuming held items they shouldn't due to not validating the held item of a Pokémon.
|
||||
- Fixed a crash when Aromatherapy cured the status of party members.
|
||||
- Fixed moves learnt on evolution not being given when said evolution happens. If you were affected by this issue your existing Pokémon will now be able to relearn those moves.
|
||||
- Fixed console spam when rendering Pokémon model items.
|
||||
- Fixed battle messages for 50+ moves and abilities and items.
|
||||
- Fixed the possible duplicate when capturing Pokémon (probably, this one's hard to reproduce to confirm it's fixed).
|
||||
- Previously duplicated Pokémon are cleaned from PCs and parties on restart.
|
||||
- Fixed an issue with some particle effects applying after a Pokémon has died or on top of the wrong Pokémon when using specific mods.
|
||||
- Fixed Pokémon not looking at each other in battle.
|
||||
- Fixed Experience Candy and Experience Share attempting to bring Pokémon above level cap causing crashes.
|
||||
- Fixed level 100 Pokémon having experience go over the cap total amount they should have.
|
||||
- Fixed `/pokemonspawnat` having the argument positions reverted making it impossible for Brigadier to understand when to suggest coordinates. It is now the intended `/spawnpokemonat <pos> <properties>`.
|
||||
- Fixed performance issues with shouldered Pokémon in certain systems.
|
||||
- Fixed learnset issues for Pokémon whose only modern debut was LGPE/BDSP/LA.
|
||||
- Fixed shiny Zubat, Grimer, Omanyte, Elgyem, Delphox and Aegislash displaying their normal texture.
|
||||
- Fixed sleeping in beds allowing fainted Pokémon to receive experience after a battle ends somehow.
|
||||
- Fixed an issue where a Pokémon will claim to have learnt a new move they already have in their moveset when learnt at an earlier level in their previous evolution. I realize that's confusing.
|
||||
- Fixed Dispensers not being able to shear Wooloo. This will also extend to other mods that check if an entity is valid to shear.
|
||||
- Fixed the currently held item of your Pokémon not dropping to the ground when removing it if your inventory was full.
|
||||
- Fixed creative mode allowing you to make your Pokémon hold more than 1 of the same item.
|
||||
- Fixed a Pokémon duplication glitch when teleporting between worlds.
|
||||
- Fixed dedicated servers being able to reload Cobblemon data with the vanilla `/reload` command causing unintended behavior for clients.
|
||||
- Fixed underground Pokémon spawning above ground.
|
||||
- Fixed Pokémon portrait not reverting back to the Pokémon after a failed capture during battle.
|
||||
- Fixed edge texture artifacts on pane elements for Tentacool and Tentacruel models.
|
||||
- Fixed crash caused by Pokémon pathing
|
||||
- Fixed Pokémon not returning to their balls when being healed in a healing machine
|
||||
- Fixed all Gen IX Pokémon as well as forms added in PLA and Wyrdeer, Kleavor, Ursaluna, Basculegion, Sneasler, Overqwil, and Enamorus having 0 exp yields.
|
||||
- Fixed Irons Leaves having bluetooth back legs. If you saw it, you know what I mean.
|
||||
- Fixed Golurk not having shoulder plates on its shoulders.
|
||||
- Fixed some water Pokémon walking onto land from the water even though they are fish.
|
||||
- Fixed Porygon2 and PorygonZ being too small.
|
||||
- Fixed Snivy line head look animation.
|
||||
- Fixed Staryu line not being able to swim.
|
||||
- Fixed an incompatibility with [Thorium](https://modrinth.com/mod/thorium) patch for [MC-84873](https://bugs.mojang.com/browse/MC-84873).
|
||||
- Fixed Pidgeotto wings when walking.
|
||||
- Fixed Delphox walk animation.
|
||||
- Fixed Froakie line sleep animations in battle.
|
||||
- Fixed Pokémon missing the non-level up moves they could relearn when rejoining a world until a new move was added to their relearn list.
|
||||
- Fixed instantly fleeing from Pokémon set to be unfleeable.
|
||||
- Fixed Pumpkaboo line forms not working. (Currently sizes aren't visual but check base stats to see which size you have.)
|
||||
- Fixed a bug that caused already interpreted messages for moves to be mistaken as uninterpreted.
|
||||
|
||||
### Developer
|
||||
- Add events that are fired just before and after a Pokémon is released (ReleasePokemonEvent.Pre and .Post)
|
||||
|
||||
### Localization
|
||||
- Added complete translations for Japanese, Thai, and Canadian French.
|
||||
- Added partial translations for Russian, Ukrainian, Mexican Spanish, and Korean.
|
||||
- Updated every existing language's translation.
|
||||
- All the translators that contributed are amazing.
|
||||
|
||||
## [1.3.0 - The Foundation Update (March 17th, 2023)](#1-3-0)
|
||||
|
||||
### Dependencies
|
||||
- Upgraded Fabric API dependence to 0.75.1+1.19.2
|
||||
- Upgraded Architectury API dependence to 6.5.69
|
||||
- Cobblemon Forge now depends on Kotlin for Forge.
|
||||
|
||||
### Additions
|
||||
- Added new models and animations for Poké Balls and reworked their mechanics to feel much smoother instead of being pure frustration.
|
||||
- Added party scrolling via holding R and using the mouse wheel so you don't need to take your hand off your mouse.
|
||||
- Added a cap of Pokémon spawns in an area because waiting a while made things insane. This is controlled by a new `pokemonPerChunk` config option.
|
||||
- Added models and animations for heaps of Pokémon (101): Riolu, Lucario, Chimchar, Monferno, Infernape, Turtwig, Grotle, Torterra, Popplio, Brionne, Primarina, Treeko, Grovyle, Sceptile, Snivy, Servine, Serperior, Tepig, Pignite, Emboar, Oshawott, Dewott, Samurott, Grookey, Thwackey, Rillaboom, Scorbunny, Raboot, Cinderace, Sobble, Drizzile, Inteleon, Fennekin, Braixen, Delphox, Froakie, Frogadier, Greninja, Chespin, Quilladin, Chesnaught, Miltank, Torkoal, Kricketot, Kricketune, Heatmor, Durant, Wooloo, Dubwool, Pumpkaboo, Gourgeist, Sigilyph, Cryogonal, Whismur, Loudred, Exploud, Misdreavus, Mismagius, Tatsugiri, Eiscue, Luvdisc, Stantler, Wyrdeer, Gible, Gabite, Garchomp, Sneasel, Weavile, Elgyem, Beheeyem, Baltoy, Claydol, Nacli, Naclstack, Alcremie, Milcery, Dhelmise, Morelull, Shiinotic, Xerneas, Klink, Klang, Klinklang, Joltik, Galvantula, Honedge, Duoblade, Aegislash, Spiritomb, Mawile, Carvanha, Sharpedo, Seedot, Nuzleaf, Shiftry, Lotad, Lombre, Ludicolo, Pineco, Forretress, and Spinda.
|
||||
- Added generation 3, 4, 5, 6, 7, and 8 Starter Pokémon to the starter select screen.
|
||||
- Added particle effect support for model animations
|
||||
- Added particle effect and animation for Gastly.
|
||||
- Added sleep and faint animations to many Pokémon.
|
||||
- Added item holding for Pokémon. Any Minecraft item can be given to a Pokémon by holding shift and right-clicking them. Traditional Pokémon held items will have their expected battle effects.
|
||||
- Added heaps of held items with crafting recipes: Assault Vest, Big Root, Black Belt, Black Sludge, Charcoal, Choice Band, Choice Scarf, Choice Specs, Dragon Fang, Exp. Share, Focus Band, Hard Stone, Heavy-Duty Boots, Leftovers, Light Clay, Lucky Egg, Magnet, Miracle Seed, Muscle Band, Mystic Water, Never-Melt Ice, Poison Barb, Quick Claw, Rocky Helmet, Safety Goggles, Sharp Beak, Silk Scarf, Silver Powder, Soft Sand, Spell Tag, Twisted Spoon, and Wise Glasses.
|
||||
- Added heaps of evolution items with crafting recipes: Milcery's sweets items, Chipped Pot, Cracked Pot, Deep Sea Scale, Deep Sea Tooth, Dragon Scale, Galarica Cuff, Galarica Wreath, Peat Block, Prism Scale, Razor Claw, Razor Fang, Reaper Cloth, Sachet, Sweet Apple, Tart Apple, and Whipped Dream.
|
||||
- Existing evolution items all now either have a crafting recipe or drop from Pokémon.
|
||||
- Added the Item [tags](https://minecraft.fandom.com/wiki/Tag) `cobblemon:held/experience_share` and `cobblemon:held/lucky_egg` allowing you to mark any items you desire to have the effects implied in the tag name.
|
||||
- Added an interface that appears when interacting with your Pokémon while sneaking. The interface allows for interactive options such as shouldering and exchanging held items.
|
||||
- Added blinking animations to many Pokémon.
|
||||
- Added animated texture support.
|
||||
- Added translucent option for aspect layers.
|
||||
- Added glowing textures to many Pokémon and it looks amazing.
|
||||
- Added the Saturation shoulder effect.
|
||||
- Added the Haste shoulder effect, initially for Joltik.
|
||||
- Added the Water Breathing shoulder effect, initially for Wooper.
|
||||
- Added the Speed shoulder effect, initially for Pichu and Pikachu.
|
||||
- [Dispensers](https://minecraft.fandom.com/wiki/Dispenser) can now use shears to automatically harvest fully grown Apricorns.
|
||||
- Added milking to Miltank.
|
||||
- Added shearing to Wooloo and Dubwool.
|
||||
- Added data for generation 9 Pokémon species, moves, and ability data. They're all still Substitute models, but their moves and abilities work.
|
||||
- Added support for custom Pokémon to implement 'quirks' such as blinks.
|
||||
- Added sound effect for harvesting Apricorns.
|
||||
- Added icon to summary and PC interfaces to indicated if a Pokémon is shiny.
|
||||
- Added the ``/spawnpokemonat <pos> <properties>`` command, the ``pos`` argument uses the same syntax as the Minecraft [summon](https://minecraft.fandom.com/wiki/Commands/summon) command.
|
||||
- Added the `/giveallpokemon` command which is definitely safe and not insane.
|
||||
- Added compatibility with Carry On by preventing the mod being able to interact with Cobblemon entities, the mod caused too many gameplay detrimental features to stay enabled.
|
||||
- Added healing to your party when you sleep in a bed.
|
||||
- Added the 'ability' Pokémon Property so commands can specify the ability.
|
||||
- Added block tag support to the 'neededBaseBlocks' and 'neededNearbyBlocks' spawn condition.
|
||||
- Added a config option for disallowing players from damaging Pokémon by hand.
|
||||
- Apricorn seeds can now be used with the [Composter](https://minecraft.fandom.com/wiki/Composter), these have the layer increase chance of 65% like Apricorns and various Minecraft crops.
|
||||
- Added support for Pokémon species data appending making it so datapack developers no longer need to overwrite files.
|
||||
- Added an implementation of every [catch rate](https://bulbapedia.bulbagarden.net/wiki/Catch_rate) from generation 1 to 9, these can be used by changing the ``captureCalculator`` config value:
|
||||
- ``generation_1`` Sets the calculator to the generation 1 implementation.
|
||||
- ``generation_2`` Sets the calculator to the generation 2 implementation.
|
||||
- ``generation_2_fixed`` Sets the calculator to the generation 2 implementation with the status multiplier bug fixed.
|
||||
- ``generation_3_4`` Sets the calculator to the generation 3 and 4 implementation.
|
||||
- ``generation_5`` Sets the calculator to the generation 5 implementation.
|
||||
- ``generation_6`` Sets the calculator to the generation 6 implementation.
|
||||
- ``generation_7`` Sets the calculator to the generation 7 implementation.
|
||||
- ``generation_8`` Sets the calculator to the generation 8 implementation.
|
||||
- ``generation_9`` Sets the calculator to the generation 9 implementation.
|
||||
- ``cobblemon`` Sets the calculator to the custom Cobblemon implementation. This is the default value.
|
||||
- ``debug`` Sets the calculator to the debug/cheat implementation, every attempt will be a successful critical capture.
|
||||
|
||||
### Changes
|
||||
- Pokémon now save to the world by default, meaning the same Pokémon will remain in the world and not disappear after you log out and log back in. They still despawn over time though.
|
||||
- Significantly sped up the Poké Ball shake animation so it takes less time to try to catch Pokémon.
|
||||
- Update the PC and Healing Machine models and bounding boxes.
|
||||
- The Healing Machine and PC now emit light when fully charged or when turned on respectively.
|
||||
- The PC block screen will now turn on when being used.
|
||||
- The Healing Machine will now visually display its charge level using 6 stages.
|
||||
- The Healing Machine will now emit a redstone signal with the strength of 1 for every 10% charge it has when attached to a [Redstone Comparator](https://minecraft.fandom.com/wiki/Redstone_Comparator).
|
||||
- Made it so that particles are not shown whenever you have a shoulder Pokémon that gives potion effects.
|
||||
- Changed hitbox and size definitions for Decidueye, Blastoise, and Magmortar
|
||||
- Apricorns can now be harvested with Axes, the speed will scale with enchantments and tool material, only dropping the Apricorn if fully grown, these will still destroy the Apricorn so the manual harvest still is recommended unless you're just keen on destroying trees.
|
||||
- Apricorns are now a part of the vanilla tag ``minecraft:blocks/mineable/axe``.
|
||||
- Apricorns are now compatible with any mod that breaks a whole tree at once.
|
||||
- Apricorns no longer have a config value for the seed drop chance these are now a part of their loot table which can be found in ``cobblemon/loot_tables/blocks/<color>_apricorn.json``.
|
||||
- Advancements were redone to be slightly more interesting, with improved names, descriptions, and sorting.
|
||||
- Updated models and textures for Tentacool line, Gengar, Slowpoke line, Tyrogue line, Doduo line, Dratini, Dragonair, Quagsire, and Piplup line. There were probably others, the team lost track.
|
||||
- Improved sending out Pokémon at the start of battle so that they are positioned in a less annoying way.
|
||||
- Name Tags will no longer be used on Pokémon and Poke Ball entities, this prevents the item from being wasted.
|
||||
- Lowered spawn rate of Tauros.
|
||||
- Sableye now spawns near gem ores as well as amethyst.
|
||||
- Added evolution stones and items to item tags
|
||||
|
||||
### Fixes
|
||||
- Fixed catch rates being entirely too difficult.
|
||||
- Fixed various strange battle issues such as Flying types being vulnerable to Ground type moves and status effects hitting despite vulnerabilities.
|
||||
- Fixed shiny Gyarados not using the red Gyarados texture.
|
||||
- Improved the framing of all in-game Pokémon in the party and PC GUIs so they aren't halfway out of the screen or something else crazy.
|
||||
- Fixed incompatibility with Kotlin for Forge (by depending on Kotlin for Forge ourselves)
|
||||
- Fixed Gengar, Goodra, and many other Pokémon showing the types of an alternate form despite those not being modelled yet.
|
||||
- Fixed datapack Pokémon not being able to battle.
|
||||
- Fixed Pokémon always being created with a moveset as if they're level 1 instead of their current level.
|
||||
- Fixed an issue of Pokémon not rendering in GUIs on some Mac displays.
|
||||
- Fixed a soft-duplicate that could occur when a party Pokémon is pushed through a Nether Portal or left in a boat.
|
||||
- Fixed Pokémon that faint from poison appearing to be on full health and suckering you into false hope.
|
||||
- Fixed incorrect spawns of Tentacool, Tentacruel, Dragonite, Politoed, Tangrowth, Lickilicky, Electivire, and Magmortar.
|
||||
- Fixed crashes involving opening the Pokémon summary GUI with an empty party.
|
||||
- Fixed lower brightness settings causing Pokémon to appear much too dark in menus such as the party and PC.
|
||||
- Fixed Showdown sometimes failing to start, causing crashes.
|
||||
- Fixed Showdown initialization happening several times when you login, more depending on how many times you have relogged this session.
|
||||
- Fixed Showdown failing to update on first attempt. We totally weren't accidentally deleting our target directory or anything, nope.
|
||||
- Fixed HP recovery related battle actions not animating for the client nor updating the in-game Pokémon HP.
|
||||
- Fixed moves that force a switch such as Teleport and U-Turn soft locking battles.
|
||||
- Fixed missing battle text for Bide, Speed Boost, Belly Drum, Anger Point, and Haze.
|
||||
- Fixed battle messages for many field effects starting, ending, and actions caused by them such as blocking certain moves.
|
||||
- Improved battle messages for effects that prevent a move from being executed such as a Taunt, requiring a recharge, flinched, etc.
|
||||
- Fixed move names not being translated in battle messages.
|
||||
- Fixed stat change messages for boosts over 3 stages.
|
||||
- Fixed experience calculation not being completely accurate.
|
||||
- Fixed positioning of Poké Balls when rendered in Healing Machines.
|
||||
- Fixed a desync issue on servers where all Pokémon seemed like they were special forms when they weren't.
|
||||
- Fixed an incompatibility with [Exordium](https://www.curseforge.com/minecraft/mc-mods/exordium).
|
||||
- Fixed datapack Pokémon language key generation. A Pokémon under the namespace ``example`` named ``Pogemon`` will now correctly look for the lang key ``example.species.pogemon.name``.
|
||||
- Fixed client not receiving messages for the different "stages" for the move Bide.
|
||||
- Fixed the Medium Slow and Medium Fast experience group IDs, they're now ```medium_slow``` and ``medium_fast``. Any custom datapack Pokémon will require an update.
|
||||
- Fixed Pokémon friendship being capped to the maximum level config value instead of the friendship one when loading Pokémon data.
|
||||
- Fixed Poké Balls taking forever to capture Pokémon if you are underwater or up in the air where it takes a long time to hit the ground.
|
||||
- Fixed Pokémon being unable to spawn on blocks such as snow layers.
|
||||
- Fixed Pokémon spawning inside of trees.
|
||||
- Fixed Pokémon experience not loading after a restart and instead going back to the minimal amount for the current level.
|
||||
- Fixed being able to use ``/healpokemon`` in battle.
|
||||
- Fixed being able to select fainted party members in the switch menu causing the battle to lock.
|
||||
- Fixed ``/spawnpokemon`` command not supporting any command source other than players.
|
||||
- Fixed issues with Charizard's sleep pose.
|
||||
- Fixed players being able to use multiple healer machines at once.
|
||||
- Fixed Pokémon layers not rendering when a Pokémon is on your shoulder.
|
||||
- Fixed Caterpie and Weedle not moving or looking at players. That was meant to be Metapod and Kakuna; how embarrassing.
|
||||
- Fixed Pokémon not carrying over the correct equivalent original ability when evolving from stages that only had one ability.
|
||||
- Fixed Deerling and Sawsbuck not spawning with the correct season.
|
||||
- Fixed issue of not being able to drag the scroll bar in summary and battle interfaces.
|
||||
- Fixed optional aspects not saving and loading properly.
|
||||
- Fixed layering logic so multiple texture layers can exist on a Pokémon (probably).
|
||||
- Fixed not all Poké Balls being associated with the `cobblemon:pokeballs` item tag.
|
||||
- Fixed the `/pokemoneditother` command not working.
|
||||
- Fixed ambient sound file path for Porygon2.
|
||||
- Fixed forms not being able to unset the secondary type of a Pokémon in the stat JSON.
|
||||
- Fixed moves that haven't carried over from generation 8 onwards having the description they did in the generation 8 games instead of their last valid one.
|
||||
- Fixed shoulder mounted pokemon not returning to party on healer use and on evolution
|
||||
|
||||
### Developer
|
||||
- Reworked CatchRateModifier, as such, existing implementations need to be updated.
|
||||
- Fixed minimumDistanceBetweenEntities option being half of what it's set as.
|
||||
- Fixed the contents of CobblemonEvents, CobblemonBlocks etc having getters instead of just being public static properties.
|
||||
- Added ApricornHarvestEvent.
|
||||
- Added a new item for representing Pokémon within native UI menus or item frames which display as the Pokémon's model. It's called a PokemonItem, with static functions to build one.
|
||||
|
||||
### Localization
|
||||
- Added complete translations for French, German, Simplified Mandarin, Brazilian Portuguese, and Pirate English.
|
||||
- Added partial translations for Traditional Mandarin, Italian, and Spanish. We'd love more help with this!
|
||||
- Thank you to all of the fantastic volunteer translators for taking the time to help with this!
|
||||
|
||||
## [1.2.0 - The Customization Update (January 1st, 2023)](#1-2-0)
|
||||
### Additions
|
||||
- Added models for Natu and Xatu, Murkrow and Honchkrow, Wailmer and Wailord.
|
||||
- Added new PC interface and it is beautiful.
|
||||
- Reworked the battle system so that battles load faster, cause fewer bugs, and can run on shared server hosts. This is a very big change that also reduced the size of the mod by 50mb!
|
||||
- Added full resource pack / data pack customization of models, textures, animations, spawning, and spawn file presets to make custom Pokémon species and variations very easy to create. You can find the guide for creating custom Pokémon on [our website](https://cobblemon.com/guides/custompokemon.html)!
|
||||
- Added water surface spawning for Pokémon like Lapras.
|
||||
- Added emissive texture support to Pokémon render layers.
|
||||
- Added compatibility for Mod Menu ([CurseForge](https://www.curseforge.com/minecraft/mc-mods/modmenu), [Modrinth](https://modrinth.com/mod/modmenu)).
|
||||
- Added blank ambient Pokémon cries so cries can be added via resource packs.
|
||||
- Added new sounds for GUIs and item uses.
|
||||
- Added `nature` and `pokeball` options to commands such as `/spawnpokemon` and `/givepokemon`.
|
||||
|
||||
### Changes
|
||||
- Reinforced party and PC saving to make data corruption from crashes less bad.
|
||||
- Added a config option for whether the starter config will be exported, making it more maintainable as we add starter Pokémon.
|
||||
- Battles now start with the options menu open for convenience.
|
||||
- Doubled the default charge rate of healers. You'd need to reset your config under `./config/cobblemon/main.json` to see this change!
|
||||
- Changed the default Apricorn seed chance config value from 6% to 10%.
|
||||
- The mod now correctly reports our dependency on Architectury API so people don't get super confused when things don't work.
|
||||
- Pokémon now look at their opponents during battle.
|
||||
- Updated Sableye's animations to be super freaky.
|
||||
- Changed the healer advancements to make the healing machine's mechanics more obvious.
|
||||
|
||||
### Fixes
|
||||
- Fixed an incompatibility with [Porting Lib](https://github.com/Fabricators-of-Create/Porting-Lib) used by Fabric ports of mods such as Create or Twilight Forest.
|
||||
- Fixed HP and max HP values in the battle GUI not being correct.
|
||||
- Fixed some animations on snake-type Pokémon being mega slow.
|
||||
- Fixed some animations on snake-type Pokémon being super slow.
|
||||
- Fixed a typo in the English name for Calcium. Calcuim.
|
||||
- Fixed Pokémon gradually becoming rarer around you if you move long distances.
|
||||
- Fixed a shoulder mount crash on Fabric.
|
||||
- Fixed a rare issue where chunks would take a really long time to generate.
|
||||
- Fixed a singleplayer bug where battles wouldn't work after leaving then rejoining a world.
|
||||
- Fixed stat calculations for everything except HP. HP was fine though :).
|
||||
- Fixed a randomized Pokémon spawning in mountains that corrupted the data of whatever party or PC it got into. Yikes.
|
||||
- Fixed a rare crash involving literally random number generation. A random crash involving random numbers.
|
||||
- Fixed all regular Mewtwo having the stats and types of Mega Mewtwo X - same deal with many other Pokémon.
|
||||
- Fixed the framing of many Pokémon in GUIs.
|
||||
- Fixed texture glitches with Rattata and Nidoqueen (again!).
|
||||
- Fixed dropped item forms of all Pokéballs and the Healing Machine, and slightly adjusted all other display settings
|
||||
- Fixed issues with forms not showing the correct evolution in the evolution menu.
|
||||
- Fixed some alternate forms not having the alternate stats and types.
|
||||
- Fixed moves that only work in double battles not being selectable at all (such as Helping Hand and Aromatic Mist).
|
||||
- Fixed abilities not remaining legal in some forms.
|
||||
- Fixed Poké Ball capture effects not triggering after a successful capture, such as the Heal Ball's healing effect.
|
||||
- Fixed multiple-hit moves sending gibberish into the battle chat.
|
||||
- Fixed Pyukumuku not being appropriately scaled.
|
||||
- Fixed shiny and other variations of Pokémon not showing in the battle GUI.
|
||||
- Fixed Eevee being poorly positioned and un-animated on shoulders.
|
||||
- Fixed a Pokémon's hitbox not updating when it evolves while sent out.
|
||||
- Fixed a Pokémon's PP going from zero to above the maximum when entering another battle.
|
||||
|
||||
## 1.1.1 (November 27th, 2022)
|
||||
|
||||
## [1.1.1 (November 27th, 2022)](#1-1-1)
|
||||
### Fixes
|
||||
- Fixed a critical issue with servers where Pokémon data didn't properly synchronize and so you couldn't see any.
|
||||
|
||||
## 1.1.0 - The Swim and Sleep Update (November 27th, 2022)
|
||||
## [1.1.0 - The Swim and Sleep Update (November 27th, 2022)](#1-1-0)
|
||||
#### "Ideally not at the same time."
|
||||
|
||||
|
||||
### Additions
|
||||
- Added a new GUI for viewing party information, rearranging moves, and evolving Pokémon. It looks too good.
|
||||
- Starter Pokémon will sleep on top of you if sent out when you get on a bed.
|
||||
@@ -78,6 +353,7 @@
|
||||
- Statuses like sleep and frozen no longer last forever if it was carried over from a previous battle.
|
||||
|
||||
### Localization
|
||||
- Added species, ability, and move translations for ko_ko, jp_jp, fr_fr, es_es, it_it, and zh_cn.
|
||||
## 1.0.0 (2022-11-12)
|
||||
- Initial release.
|
||||
- Added species, ability, and move translations for `ko_ko`, `jp_jp`, `fr_fr`, `es_es`, `it_it`, and `zh_cn`.
|
||||
|
||||
## [1.0.0 (November 12th, 2022)](#1-0-0)
|
||||
- Initial release.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2022 Cobblemon Contributors
|
||||
Copyright (C) 2023 Cobblemon Contributors
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -39,7 +39,6 @@ loom {
|
||||
dependencies {
|
||||
minecraft("net.minecraft:minecraft:${rootProject.property("mc_version")}")
|
||||
mappings("net.fabricmc:yarn:${rootProject.property("yarn_version")}")
|
||||
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -19,13 +19,14 @@ tasks {
|
||||
archiveClassifier.set("dev-shadow")
|
||||
archiveBaseName.set("Cobblemon-${project.name}")
|
||||
configurations = listOf(bundle)
|
||||
mergeServiceFiles()
|
||||
}
|
||||
|
||||
remapJar {
|
||||
dependsOn(shadowJar)
|
||||
inputFile.set(shadowJar.flatMap { it.archiveFile })
|
||||
archiveBaseName.set("Cobblemon-${project.name}")
|
||||
archiveClassifier.set("${rootProject.version}-remap")
|
||||
archiveVersion.set("${rootProject.version}")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
id("maven-publish")
|
||||
id("dev.architectury.loom")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven("https://maven.impactdev.net/repository/development/") {
|
||||
name = "ImpactDev-Public"
|
||||
credentials {
|
||||
username = System.getenv("NEXUS_USER")
|
||||
password = System.getenv("NEXUS_PW")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>(project.name) {
|
||||
artifact(tasks.remapJar)
|
||||
artifact(tasks.remapSourcesJar)
|
||||
|
||||
@Suppress("UnstableApiUsage")
|
||||
loom.disableDeprecatedPomGeneration(this)
|
||||
|
||||
groupId = "com.cobblemon"
|
||||
artifactId = project.findProperty("maven.artifactId")?.toString() ?: project.name
|
||||
version = rootProject.version.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
plugins {
|
||||
base
|
||||
id("cobblemon.root-conventions")
|
||||
|
||||
+8
-30
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id("cobblemon.base-conventions")
|
||||
id("maven-publish")
|
||||
id("cobblemon.publish-conventions")
|
||||
}
|
||||
|
||||
architectury {
|
||||
@@ -8,7 +8,8 @@ architectury {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven(url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
|
||||
maven(url = "${rootProject.projectDir}/deps")
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -18,14 +19,13 @@ dependencies {
|
||||
modImplementation(libs.fabricLoader)
|
||||
modApi(libs.architectury)
|
||||
modApi(libs.molang)
|
||||
modApi(libs.mclib)
|
||||
|
||||
// For Showdown
|
||||
modCompileOnly(libs.javet) // Linux or Windows
|
||||
modCompileOnly(libs.javetMac) // Mac OS (x86_64 Only)
|
||||
modCompileOnly(libs.graal)
|
||||
|
||||
//shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
|
||||
|
||||
|
||||
testRuntimeOnly(libs.junitEngine)
|
||||
testImplementation(libs.junitApi)
|
||||
testImplementation(libs.junitParams)
|
||||
@@ -33,30 +33,8 @@ dependencies {
|
||||
testImplementation(libs.mockk)
|
||||
|
||||
compileOnly("net.luckperms:api:${rootProject.property("luckperms_version")}")
|
||||
|
||||
// For Showdown
|
||||
// modCompileOnly 'com.caoccao.javet:javet:1.0.6' // Linux or Windows
|
||||
// modCompileOnly 'com.caoccao.javet:javet-macos:1.0.6' // Mac OS (x86_64 Only)
|
||||
// modCompileOnly group: 'commons-io', name: 'commons-io', version: '2.6'
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven("https://maven.impactdev.net/repository/development/") {
|
||||
name = "ImpactDev-Public"
|
||||
credentials {
|
||||
username = System.getenv("NEXUS_USER")
|
||||
password = System.getenv("NEXUS_PW")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>("mod") {
|
||||
from(components["java"])
|
||||
groupId = "com.cobblemon"
|
||||
artifactId = "mod"
|
||||
version = rootProject.version.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
maven.artifactId = mod
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.mixin;
|
||||
|
||||
import com.cobblemon.mod.common.client.render.item.CobblemonBuiltinItemRenderer;
|
||||
import com.cobblemon.mod.common.client.render.item.CobblemonBuiltinItemRendererRegistry;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.item.BuiltinModelItemRenderer;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(BuiltinModelItemRenderer.class)
|
||||
public class BuiltinModelItemRendererMixin {
|
||||
|
||||
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
|
||||
private void cobblemon$useDynamicItemRenderer(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) {
|
||||
CobblemonBuiltinItemRenderer renderer = CobblemonBuiltinItemRendererRegistry.INSTANCE.rendererOf(stack.getItem());
|
||||
if (renderer != null) {
|
||||
renderer.render(stack, mode, matrices, vertexConsumers, light, overlay);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.mixin;
|
||||
|
||||
import com.cobblemon.mod.common.client.CobblemonClient;
|
||||
import com.cobblemon.mod.common.client.keybind.keybinds.PartySendBinding;
|
||||
import net.minecraft.client.Mouse;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Mouse.class)
|
||||
public class PartyScrollMixin {
|
||||
@Shadow
|
||||
private double eventDeltaWheel;
|
||||
|
||||
@Inject(
|
||||
method = "onMouseScroll",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
target="Lnet/minecraft/client/Mouse;eventDeltaWheel:D",
|
||||
opcode = Opcodes.PUTFIELD,
|
||||
ordinal = 2,
|
||||
shift = At.Shift.BEFORE
|
||||
),
|
||||
cancellable = true
|
||||
)
|
||||
public void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
|
||||
if (PartySendBinding.INSTANCE.getWasDown()) {
|
||||
int i = (int)eventDeltaWheel;
|
||||
if (i > 0) {
|
||||
while (i-- > 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(false);
|
||||
ci.cancel();
|
||||
eventDeltaWheel = 0;
|
||||
PartySendBinding.INSTANCE.actioned();
|
||||
} else if (i < 0) {
|
||||
while (i++ < 0) CobblemonClient.INSTANCE.getStorage().shiftSelected(true);
|
||||
ci.cancel();
|
||||
eventDeltaWheel = 0;
|
||||
PartySendBinding.INSTANCE.actioned();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -9,15 +9,25 @@
|
||||
package com.cobblemon.mod.common.mixin;
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon;
|
||||
import com.cobblemon.mod.common.CobblemonItems;
|
||||
import com.cobblemon.mod.common.api.events.CobblemonEvents;
|
||||
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent;
|
||||
import com.cobblemon.mod.common.api.storage.NoPokemonStoreException;
|
||||
import com.cobblemon.mod.common.api.storage.party.PartyStore;
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon;
|
||||
import com.cobblemon.mod.common.util.CompoundTagExtensionsKt;
|
||||
import com.cobblemon.mod.common.util.DataKeys;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.World;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -25,9 +35,13 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.cobblemon.mod.common.util.LocalizationUtilsKt.lang;
|
||||
|
||||
@Mixin(PlayerEntity.class)
|
||||
public abstract class PlayerMixin extends LivingEntity {
|
||||
|
||||
@@ -43,6 +57,11 @@ public abstract class PlayerMixin extends LivingEntity {
|
||||
|
||||
@Shadow public abstract boolean isSpectator();
|
||||
|
||||
@Shadow public abstract boolean giveItemStack(ItemStack stack);
|
||||
|
||||
@Shadow public abstract void sendMessage(Text message, boolean overlay);
|
||||
|
||||
|
||||
protected PlayerMixin(EntityType<? extends LivingEntity> p_20966_, World p_20967_) {
|
||||
super(p_20966_, p_20967_);
|
||||
}
|
||||
@@ -115,4 +134,32 @@ public abstract class PlayerMixin extends LivingEntity {
|
||||
return CompoundTagExtensionsKt.isPokemonEntity(nbt);
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "eatFood",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/player/PlayerEntity;getHungerManager()Lnet/minecraft/entity/player/HungerManager;",
|
||||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
public void onEatFood(World world, ItemStack stack, CallbackInfoReturnable<ItemStack> cir) {
|
||||
if (!getWorld().isClient) {
|
||||
if (stack.getItem() == Items.APPLE && getWorld().random.nextDouble() < Cobblemon.config.getAppleLeftoversChance()) {
|
||||
ItemStack leftovers = new ItemStack(CobblemonItems.LEFTOVERS.get());
|
||||
ServerPlayerEntity player = Objects.requireNonNull(getServer()).getPlayerManager().getPlayer(uuid);
|
||||
assert player != null;
|
||||
CobblemonEvents.LEFTOVERS_CREATED.postThen(
|
||||
new LeftoversCreatedEvent(player, leftovers),
|
||||
leftoversCreatedEvent -> null,
|
||||
leftoversCreatedEvent -> {
|
||||
if(!player.giveItemStack(leftoversCreatedEvent.getLeftovers())) {
|
||||
var itemPos = player.getRotationVector().multiply(0.5).add(getPos());
|
||||
getWorld().spawnEntity(new ItemEntity(getWorld(), itemPos.getX(), itemPos.getY(), itemPos.getZ(), leftoversCreatedEvent.getLeftovers()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -8,20 +8,25 @@
|
||||
|
||||
package com.cobblemon.mod.common.mixin;
|
||||
|
||||
import com.cobblemon.mod.common.tags.CobblemonBlockTags;
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonBlockTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.PointedDripstoneBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.Slice;
|
||||
|
||||
@Mixin(PointedDripstoneBlock.class)
|
||||
public abstract class PointedDripstoneBlockMixin {
|
||||
|
||||
@Redirect(method = "canGrow(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 0))
|
||||
@Redirect(
|
||||
method = "canGrow(Lnet/minecraft/block/BlockState;Lnet/minecraft/block/BlockState;)Z",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 0),
|
||||
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/block/Blocks;DRIPSTONE_BLOCK:Lnet/minecraft/block/Block;"))
|
||||
)
|
||||
private static boolean cobblemon$validateMoonStoneDripstone(BlockState instance, Block block) {
|
||||
return instance.isIn(CobblemonBlockTags.INSTANCE.getDRIPSTONE_GROWABLE());
|
||||
return instance.isIn(CobblemonBlockTags.DRIPSTONE_GROWABLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.mixin;
|
||||
|
||||
import com.cobblemon.mod.common.block.ApricornBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.dispenser.ShearsDispenserBehavior;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.event.GameEvent;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ShearsDispenserBehavior.class)
|
||||
public abstract class ShearsDispenserBehaviorMixin {
|
||||
|
||||
// This exists so we can execute our custom interaction only if no one redirected shears interactions to overwrite the vanilla ones.
|
||||
@Inject(method = "tryShearBlock", at = @At("HEAD"), cancellable = true)
|
||||
private static void cobblemon$tryApricornHarvest(ServerWorld world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
final BlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() instanceof ApricornBlock apricornBlock && state.get(ApricornBlock.Companion.getAGE()) == ApricornBlock.MAX_AGE) {
|
||||
world.playSound(null, pos, SoundEvents.ENTITY_SHEEP_SHEAR, SoundCategory.BLOCKS, 1F, 1F);
|
||||
apricornBlock.harvest(world, state, pos);
|
||||
world.emitGameEvent(null, GameEvent.SHEAR, pos);
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -29,7 +29,7 @@ import com.cobblemon.mod.common.api.net.serializers.StringSetDataSerializer
|
||||
import com.cobblemon.mod.common.api.net.serializers.Vec3DataSerializer
|
||||
import com.cobblemon.mod.common.api.permission.PermissionValidator
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculator
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CobblemonGen348CaptureCalculator
|
||||
import com.cobblemon.mod.common.api.pokeball.catching.calculators.CaptureCalculators
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
|
||||
import com.cobblemon.mod.common.api.pokemon.effect.ShoulderEffectRegistry
|
||||
import com.cobblemon.mod.common.api.pokemon.experience.ExperienceCalculator
|
||||
@@ -37,18 +37,16 @@ import com.cobblemon.mod.common.api.pokemon.experience.ExperienceGroups
|
||||
import com.cobblemon.mod.common.api.pokemon.experience.StandardExperienceCalculator
|
||||
import com.cobblemon.mod.common.api.pokemon.feature.ChoiceSpeciesFeatureProvider
|
||||
import com.cobblemon.mod.common.api.pokemon.feature.FlagSpeciesFeatureProvider
|
||||
import com.cobblemon.mod.common.api.pokemon.feature.GlobalSpeciesFeatures
|
||||
import com.cobblemon.mod.common.api.pokemon.feature.SpeciesFeatures
|
||||
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemProvider
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.EvCalculator
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Generation8EvCalculator
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.StatProvider
|
||||
import com.cobblemon.mod.common.api.properties.CustomPokemonProperty
|
||||
import com.cobblemon.mod.common.api.reactive.Observable.Companion.filter
|
||||
import com.cobblemon.mod.common.api.reactive.Observable.Companion.map
|
||||
import com.cobblemon.mod.common.api.reactive.Observable.Companion.takeFirst
|
||||
import com.cobblemon.mod.common.api.scheduling.ScheduledTaskTracker
|
||||
import com.cobblemon.mod.common.api.spawning.BestSpawner
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
|
||||
import com.cobblemon.mod.common.api.spawning.CobblemonSpawningProspector
|
||||
import com.cobblemon.mod.common.api.spawning.context.AreaContextResolver
|
||||
import com.cobblemon.mod.common.api.spawning.prospecting.SpawningProspector
|
||||
@@ -62,14 +60,16 @@ import com.cobblemon.mod.common.api.storage.factory.FileBackedPokemonStoreFactor
|
||||
import com.cobblemon.mod.common.api.storage.pc.PCStore
|
||||
import com.cobblemon.mod.common.api.storage.pc.link.PCLinkManager
|
||||
import com.cobblemon.mod.common.api.storage.player.PlayerDataStoreManager
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonEntityTypeTags
|
||||
import com.cobblemon.mod.common.battles.BattleFormat
|
||||
import com.cobblemon.mod.common.battles.BattleRegistry
|
||||
import com.cobblemon.mod.common.battles.BattleSide
|
||||
import com.cobblemon.mod.common.battles.ShowdownThread
|
||||
import com.cobblemon.mod.common.battles.actor.PokemonBattleActor
|
||||
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
|
||||
import com.cobblemon.mod.common.battles.runner.ShowdownConnection
|
||||
import com.cobblemon.mod.common.battles.runner.ShowdownService
|
||||
import com.cobblemon.mod.common.config.CobblemonConfig
|
||||
import com.cobblemon.mod.common.config.LastChangedVersion
|
||||
import com.cobblemon.mod.common.config.constraint.IntConstraint
|
||||
import com.cobblemon.mod.common.config.starter.StarterConfig
|
||||
import com.cobblemon.mod.common.data.CobblemonDataProvider
|
||||
@@ -78,14 +78,14 @@ import com.cobblemon.mod.common.events.ServerTickHandler
|
||||
import com.cobblemon.mod.common.item.PokeBallItem
|
||||
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
|
||||
import com.cobblemon.mod.common.net.serverhandling.ServerPacketRegistrar
|
||||
import com.cobblemon.mod.common.particle.CobblemonParticles
|
||||
import com.cobblemon.mod.common.permission.LaxPermissionValidator
|
||||
import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
import com.cobblemon.mod.common.pokemon.aspects.GENDER_ASPECT
|
||||
import com.cobblemon.mod.common.pokemon.aspects.SHINY_ASPECT
|
||||
import com.cobblemon.mod.common.pokemon.evolution.variants.BlockClickEvolution
|
||||
import com.cobblemon.mod.common.pokemon.feature.BattleCriticalHitsFeature
|
||||
import com.cobblemon.mod.common.pokemon.feature.DamageTakenFeature
|
||||
import com.cobblemon.mod.common.pokemon.feature.TagSeasonResolver
|
||||
import com.cobblemon.mod.common.pokemon.feature.*
|
||||
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
|
||||
import com.cobblemon.mod.common.pokemon.properties.HiddenAbilityPropertyType
|
||||
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
|
||||
import com.cobblemon.mod.common.pokemon.properties.UntradeableProperty
|
||||
@@ -93,17 +93,20 @@ import com.cobblemon.mod.common.pokemon.properties.tags.PokemonFlagProperty
|
||||
import com.cobblemon.mod.common.pokemon.stat.CobblemonStatProvider
|
||||
import com.cobblemon.mod.common.registry.CompletableRegistry
|
||||
import com.cobblemon.mod.common.starter.CobblemonStarterHandler
|
||||
import com.cobblemon.mod.common.util.DataKeys
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.cobblemon.mod.common.util.getServer
|
||||
import com.cobblemon.mod.common.util.ifDedicatedServer
|
||||
import com.cobblemon.mod.common.util.isLaterVersion
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import com.cobblemon.mod.common.util.removeAmountIf
|
||||
import com.cobblemon.mod.common.world.CobblemonGameRules
|
||||
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
|
||||
import com.cobblemon.mod.common.world.feature.CobblemonOrePlacedFeatures
|
||||
import com.cobblemon.mod.common.world.placement.CobblemonPlacementTypes
|
||||
import dev.architectury.event.EventResult
|
||||
import dev.architectury.event.events.common.CommandRegistrationEvent
|
||||
import dev.architectury.event.events.common.InteractionEvent
|
||||
import dev.architectury.event.events.common.PlayerEvent
|
||||
import dev.architectury.hooks.item.tool.AxeItemHooks
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
@@ -111,10 +114,12 @@ import java.io.FileWriter
|
||||
import java.io.PrintWriter
|
||||
import java.util.UUID
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.KMutableProperty
|
||||
import kotlin.reflect.full.memberProperties
|
||||
import kotlin.reflect.jvm.isAccessible
|
||||
import kotlin.reflect.jvm.javaField
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.entity.data.TrackedDataHandlerRegistry
|
||||
import net.minecraft.item.NameTagItem
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
import net.minecraft.util.WorldSavePath
|
||||
import net.minecraft.util.registry.RegistryKey
|
||||
@@ -123,18 +128,22 @@ import org.apache.logging.log4j.LogManager
|
||||
|
||||
object Cobblemon {
|
||||
const val MODID = "cobblemon"
|
||||
const val VERSION = "1.2.0"
|
||||
const val VERSION = "1.3.1"
|
||||
const val CONFIG_PATH = "config/$MODID/main.json"
|
||||
val LOGGER = LogManager.getLogger()
|
||||
|
||||
lateinit var implementation: CobblemonImplementation
|
||||
lateinit var showdown: ShowdownConnection
|
||||
var captureCalculator: CaptureCalculator = CobblemonGen348CaptureCalculator
|
||||
@Deprecated("This field is now a config value", ReplaceWith("Cobblemon.config.captureCalculator"))
|
||||
var captureCalculator: CaptureCalculator
|
||||
get() = this.config.captureCalculator
|
||||
set(value) {
|
||||
this.config.captureCalculator = value
|
||||
}
|
||||
var experienceCalculator: ExperienceCalculator = StandardExperienceCalculator
|
||||
var evYieldCalculator: EvCalculator = Generation8EvCalculator
|
||||
var starterHandler: StarterHandler = CobblemonStarterHandler()
|
||||
var isDedicatedServer = false
|
||||
var showdownThread = ShowdownThread()
|
||||
val showdownThread = ShowdownThread()
|
||||
lateinit var config: CobblemonConfig
|
||||
var prospector: SpawningProspector = CobblemonSpawningProspector
|
||||
var areaContextResolver: AreaContextResolver = object : AreaContextResolver {}
|
||||
@@ -148,11 +157,12 @@ object Cobblemon {
|
||||
var statProvider: StatProvider = CobblemonStatProvider
|
||||
var seasonResolver: SeasonResolver = TagSeasonResolver
|
||||
|
||||
fun preinitialize(implementation: CobblemonImplementation) {
|
||||
fun preInitialize(implementation: CobblemonImplementation) {
|
||||
DropEntry.register("command", CommandDropEntry::class.java)
|
||||
DropEntry.register("item", ItemDropEntry::class.java, isDefault = true)
|
||||
|
||||
ExperienceGroups.registerDefaults()
|
||||
CaptureCalculators.registerDefaults()
|
||||
|
||||
this.loadConfig()
|
||||
this.implementation = implementation
|
||||
@@ -166,6 +176,7 @@ object Cobblemon {
|
||||
CobblemonSounds.register()
|
||||
CobblemonFeatures.register()
|
||||
CobblemonGameRules.register()
|
||||
CobblemonParticles.register()
|
||||
|
||||
ShoulderEffectRegistry.register()
|
||||
|
||||
@@ -180,9 +191,16 @@ object Cobblemon {
|
||||
BattleRegistry.getBattleByParticipatingPlayer(it)?.stop()
|
||||
}
|
||||
LIVING_DEATH.pipe(filter { it is ServerPlayerEntity }, map { it as ServerPlayerEntity }).subscribe {
|
||||
PCLinkManager.removeLink(it.uuid)
|
||||
battleRegistry.getBattleByParticipatingPlayer(it)?.stop()
|
||||
}
|
||||
|
||||
InteractionEvent.INTERACT_ENTITY.register(InteractionEvent.InteractEntity { player, entity, hand ->
|
||||
if (player.getStackInHand(hand).item is NameTagItem && entity.type.isIn(CobblemonEntityTypeTags.CANNOT_HAVE_NAME_TAG))
|
||||
EventResult.interruptTrue()
|
||||
else
|
||||
EventResult.pass()
|
||||
})
|
||||
InteractionEvent.RIGHT_CLICK_BLOCK.register(InteractionEvent.RightClickBlock { pl, _, pos, _ ->
|
||||
val player = pl as? ServerPlayerEntity ?: return@RightClickBlock EventResult.pass()
|
||||
val block = player.world.getBlockState(pos).block
|
||||
@@ -195,13 +213,20 @@ object Cobblemon {
|
||||
}
|
||||
return@RightClickBlock EventResult.pass()
|
||||
})
|
||||
|
||||
PlayerEvent.CHANGE_DIMENSION.register(PlayerEvent.ChangeDimension{ player, _, _ ->
|
||||
player.party().forEach { pokemon -> pokemon.entity?.recallWithAnimation() }
|
||||
})
|
||||
|
||||
TrackedDataHandlerRegistry.register(Vec3DataSerializer)
|
||||
TrackedDataHandlerRegistry.register(StringSetDataSerializer)
|
||||
TrackedDataHandlerRegistry.register(PoseTypeDataSerializer)
|
||||
|
||||
HeldItemProvider.register(CobblemonHeldItemManager, Priority.LOWEST)
|
||||
}
|
||||
|
||||
fun initialize() {
|
||||
showdownThread.start()
|
||||
showdownThread.launch()
|
||||
|
||||
CompletableRegistry.allRegistriesCompleted.thenAccept {
|
||||
LOGGER.info("All registries loaded.")
|
||||
@@ -219,8 +244,12 @@ object Cobblemon {
|
||||
SpeciesFeatures.types["choice"] = ChoiceSpeciesFeatureProvider::class.java
|
||||
SpeciesFeatures.types["flag"] = FlagSpeciesFeatureProvider::class.java
|
||||
|
||||
GlobalSpeciesFeatures.register(DamageTakenFeature.ID) { DamageTakenFeature() }
|
||||
GlobalSpeciesFeatures.register(BattleCriticalHitsFeature.ID) { BattleCriticalHitsFeature() }
|
||||
SpeciesFeatures.register(
|
||||
DataKeys.CAN_BE_MILKED,
|
||||
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.CAN_BE_MILKED), default = true))
|
||||
SpeciesFeatures.register(
|
||||
DataKeys.HAS_BEEN_SHEARED,
|
||||
FlagSpeciesFeatureProvider(keys = listOf(DataKeys.HAS_BEEN_SHEARED), default = false))
|
||||
|
||||
CustomPokemonProperty.register(UntradeableProperty)
|
||||
CustomPokemonProperty.register(UncatchableProperty)
|
||||
@@ -261,7 +290,6 @@ object Cobblemon {
|
||||
SERVER_STOPPED.subscribe {
|
||||
storage.unregisterAll()
|
||||
playerData.saveAll()
|
||||
showdown.close()
|
||||
}
|
||||
SERVER_STARTED.subscribe {
|
||||
bestSpawner.onServerStarted()
|
||||
@@ -289,15 +317,13 @@ object Cobblemon {
|
||||
}
|
||||
}
|
||||
|
||||
showdownThread.showdownStarted.thenAccept {
|
||||
PokemonSpecies.observable.pipe(takeFirst()).subscribe {
|
||||
LOGGER.info("Starting dummy Showdown battle to force it to pre-load data.")
|
||||
battleRegistry.startBattle(
|
||||
BattleFormat.GEN_8_SINGLES,
|
||||
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F)),
|
||||
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F))
|
||||
).apply { mute = true }
|
||||
}
|
||||
PokemonSpecies.observable.subscribe {
|
||||
LOGGER.info("Starting dummy Showdown battle to force it to pre-load data.")
|
||||
battleRegistry.startBattle(
|
||||
BattleFormat.GEN_9_SINGLES,
|
||||
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F)),
|
||||
BattleSide(PokemonBattleActor(UUID.randomUUID(), BattlePokemon(Pokemon().initialize()), -1F))
|
||||
).apply { mute = true }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,44 +352,59 @@ object Cobblemon {
|
||||
exception.printStackTrace()
|
||||
}
|
||||
|
||||
this.config::class.memberProperties.forEach {
|
||||
// Member must have annotations and must be mutable
|
||||
if (it.annotations.isEmpty() || it !is KMutableProperty<*>) return@forEach
|
||||
val defaultConfig = CobblemonConfig()
|
||||
|
||||
var value = it.getter.call(config)
|
||||
for (annotation in it.annotations) {
|
||||
when (annotation) {
|
||||
CobblemonConfig::class.memberProperties.forEach {
|
||||
val field = it.javaField!!
|
||||
it.isAccessible = true
|
||||
field.annotations.forEach {
|
||||
when (it) {
|
||||
is LastChangedVersion -> {
|
||||
val defaultChangedVersion = it.version
|
||||
val lastSavedVersion = config.lastSavedVersion
|
||||
if (defaultChangedVersion.isLaterVersion(lastSavedVersion)) {
|
||||
field.set(config, field.get(defaultConfig))
|
||||
}
|
||||
}
|
||||
is IntConstraint -> {
|
||||
if (value !is Int) break
|
||||
value = value.coerceIn(annotation.min, annotation.max)
|
||||
it.setter.call(config, value)
|
||||
var value = field.get(config)
|
||||
if (value is Int) {
|
||||
value = value.coerceIn(it.min, it.max)
|
||||
field.set(config, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.config = CobblemonConfig()
|
||||
this.saveConfig()
|
||||
}
|
||||
|
||||
config.lastSavedVersion = VERSION
|
||||
this.saveConfig()
|
||||
|
||||
bestSpawner.loadConfig()
|
||||
PokemonSpecies.observable.subscribe { starterConfig = this.loadStarterConfig() }
|
||||
}
|
||||
|
||||
fun loadStarterConfig(): StarterConfig {
|
||||
val file = File("config/cobblemon/starters.json")
|
||||
file.parentFile.mkdirs()
|
||||
if (!file.exists()) {
|
||||
val config = StarterConfig()
|
||||
val pw = PrintWriter(file)
|
||||
StarterConfig.GSON.toJson(config, pw)
|
||||
pw.close()
|
||||
if (config.exportStarterConfig) {
|
||||
val file = File("config/cobblemon/starters.json")
|
||||
file.parentFile.mkdirs()
|
||||
if (!file.exists()) {
|
||||
val config = StarterConfig()
|
||||
val pw = PrintWriter(file)
|
||||
StarterConfig.GSON.toJson(config, pw)
|
||||
pw.close()
|
||||
return config
|
||||
}
|
||||
val reader = FileReader(file)
|
||||
val config = StarterConfig.GSON.fromJson(reader, StarterConfig::class.java)
|
||||
reader.close()
|
||||
return config
|
||||
} else {
|
||||
return StarterConfig()
|
||||
}
|
||||
val reader = FileReader(file)
|
||||
val config = StarterConfig.GSON.fromJson(reader, StarterConfig::class.java)
|
||||
reader.close()
|
||||
return config
|
||||
}
|
||||
|
||||
fun saveConfig() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -9,8 +9,8 @@
|
||||
package com.cobblemon.mod.common
|
||||
|
||||
import com.cobblemon.mod.common.registry.CompletableRegistry
|
||||
import com.cobblemon.mod.common.world.block.entity.HealingMachineBlockEntity
|
||||
import com.cobblemon.mod.common.world.block.entity.PCBlockEntity
|
||||
import com.cobblemon.mod.common.block.entity.HealingMachineBlockEntity
|
||||
import com.cobblemon.mod.common.block.entity.PCBlockEntity
|
||||
import dev.architectury.registry.registries.RegistrySupplier
|
||||
import java.util.function.Supplier
|
||||
import net.minecraft.block.entity.BlockEntityType
|
||||
@@ -21,12 +21,14 @@ object CobblemonBlockEntities : CompletableRegistry<BlockEntityType<*>>(Registry
|
||||
return queue(name, blockEntityType)
|
||||
}
|
||||
|
||||
@JvmField
|
||||
val HEALING_MACHINE = com.cobblemon.mod.common.CobblemonBlockEntities.register("healing_machine") {
|
||||
BlockEntityType.Builder.create(
|
||||
::HealingMachineBlockEntity,
|
||||
CobblemonBlocks.HEALING_MACHINE.get()
|
||||
).build(null)
|
||||
}
|
||||
@JvmField
|
||||
val PC = com.cobblemon.mod.common.CobblemonBlockEntities.register("pc") {
|
||||
BlockEntityType.Builder.create(
|
||||
::PCBlockEntity,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -10,132 +10,170 @@ package com.cobblemon.mod.common
|
||||
|
||||
import com.cobblemon.mod.common.api.apricorn.Apricorn
|
||||
import com.cobblemon.mod.common.registry.CompletableRegistry
|
||||
import com.cobblemon.mod.common.world.block.ApricornBlock
|
||||
import com.cobblemon.mod.common.world.block.ApricornSaplingBlock
|
||||
import com.cobblemon.mod.common.world.block.HealingMachineBlock
|
||||
import com.cobblemon.mod.common.world.block.PCBlock
|
||||
import com.cobblemon.mod.common.block.ApricornBlock
|
||||
import com.cobblemon.mod.common.block.ApricornSaplingBlock
|
||||
import com.cobblemon.mod.common.block.HealingMachineBlock
|
||||
import com.cobblemon.mod.common.block.PCBlock
|
||||
import dev.architectury.registry.registries.RegistrySupplier
|
||||
import net.minecraft.block.AbstractBlock
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.block.BlockState
|
||||
import net.minecraft.block.Blocks
|
||||
import net.minecraft.block.DoorBlock
|
||||
import net.minecraft.block.FenceBlock
|
||||
import net.minecraft.block.FenceGateBlock
|
||||
import net.minecraft.block.LeavesBlock
|
||||
import net.minecraft.block.MapColor
|
||||
import net.minecraft.block.Material
|
||||
import net.minecraft.block.OreBlock
|
||||
import net.minecraft.block.PillarBlock
|
||||
import net.minecraft.block.PressurePlateBlock
|
||||
import net.minecraft.block.SlabBlock
|
||||
import net.minecraft.block.StairsBlock
|
||||
import net.minecraft.block.TrapdoorBlock
|
||||
import net.minecraft.block.WoodenButtonBlock
|
||||
import net.minecraft.block.*
|
||||
import net.minecraft.entity.EntityType
|
||||
import net.minecraft.sound.BlockSoundGroup
|
||||
import net.minecraft.util.math.Direction
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider
|
||||
import net.minecraft.util.registry.Registry
|
||||
import java.util.function.ToIntFunction
|
||||
|
||||
object CobblemonBlocks : CompletableRegistry<Block>(Registry.BLOCK_KEY) {
|
||||
/**
|
||||
* Evolution Ores
|
||||
*/
|
||||
|
||||
@JvmField
|
||||
val DAWN_STONE_ORE = this.evolutionStoneOre("dawn_stone_ore")
|
||||
@JvmField
|
||||
val DUSK_STONE_ORE = this.evolutionStoneOre("dusk_stone_ore")
|
||||
@JvmField
|
||||
val FIRE_STONE_ORE = this.evolutionStoneOre("fire_stone_ore")
|
||||
@JvmField
|
||||
val ICE_STONE_ORE = this.evolutionStoneOre("ice_stone_ore")
|
||||
@JvmField
|
||||
val LEAF_STONE_ORE = this.evolutionStoneOre("leaf_stone_ore")
|
||||
@JvmField
|
||||
val MOON_STONE_ORE = this.evolutionStoneOre("moon_stone_ore")
|
||||
@JvmField
|
||||
val DRIPSTONE_MOON_STONE_ORE = this.evolutionStoneOre("dripstone_moon_stone_ore")
|
||||
@JvmField
|
||||
val SHINY_STONE_ORE = this.evolutionStoneOre("shiny_stone_ore")
|
||||
@JvmField
|
||||
val SUN_STONE_ORE = this.evolutionStoneOre("sun_stone_ore")
|
||||
@JvmField
|
||||
val THUNDER_STONE_ORE = this.evolutionStoneOre("thunder_stone_ore")
|
||||
@JvmField
|
||||
val WATER_STONE_ORE = this.evolutionStoneOre("water_stone_ore")
|
||||
|
||||
/**
|
||||
* Deepslate separator
|
||||
*/
|
||||
|
||||
@JvmField
|
||||
val DEEPSLATE_DAWN_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_dawn_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_DUSK_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_dusk_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_FIRE_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_fire_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_ICE_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_ice_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_LEAF_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_leaf_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_MOON_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_moon_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_SHINY_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_shiny_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_SUN_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_sun_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_THUNDER_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_thunder_stone_ore")
|
||||
@JvmField
|
||||
val DEEPSLATE_WATER_STONE_ORE = this.deepslateEvolutionStoneOre("deepslate_water_stone_ore")
|
||||
|
||||
/**
|
||||
* Apricorns
|
||||
*/
|
||||
|
||||
@JvmField
|
||||
val APRICORN_LOG = queue("apricorn_log") {
|
||||
log(
|
||||
MapColor.DIRT_BROWN,
|
||||
MapColor.BROWN
|
||||
)
|
||||
}
|
||||
@JvmField
|
||||
val STRIPPED_APRICORN_LOG = queue("stripped_apricorn_log") {
|
||||
log(
|
||||
MapColor.DIRT_BROWN,
|
||||
MapColor.DIRT_BROWN
|
||||
)
|
||||
}
|
||||
@JvmField
|
||||
val APRICORN_WOOD = queue("apricorn_wood") {
|
||||
log(
|
||||
MapColor.DIRT_BROWN,
|
||||
MapColor.DIRT_BROWN
|
||||
)
|
||||
}
|
||||
@JvmField
|
||||
val STRIPPED_APRICORN_WOOD = queue("stripped_apricorn_wood") {
|
||||
log(
|
||||
MapColor.DIRT_BROWN,
|
||||
MapColor.DIRT_BROWN
|
||||
)
|
||||
}
|
||||
@JvmField
|
||||
val APRICORN_PLANKS = queue("apricorn_planks") { Block(AbstractBlock.Settings.of(Material.WOOD, MapColor.DIRT_BROWN).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
|
||||
@JvmField
|
||||
val APRICORN_LEAVES = queue("apricorn_leaves") { com.cobblemon.mod.common.CobblemonBlocks.leaves(BlockSoundGroup.GRASS) }
|
||||
@JvmField
|
||||
val APRICORN_FENCE = queue("apricorn_fence") { FenceBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
|
||||
@JvmField
|
||||
val APRICORN_FENCE_GATE = queue("apricorn_fence_gate") { FenceGateBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
|
||||
@JvmField
|
||||
val APRICORN_BUTTON = queue("apricorn_button") { WoodenButtonBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD)) }
|
||||
@JvmField
|
||||
val APRICORN_PRESSURE_PLATE = queue("apricorn_pressure_plate") { PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).noCollision().strength(0.5f).sounds(BlockSoundGroup.WOOD)) }
|
||||
// Tag was removed be sure to add it back when implemented
|
||||
//val APRICORN_SIGN = queue("apricorn_sign") { StandingSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD), APRICORN_WOOD_TYPE) }
|
||||
//val APRICORN_WALL_SIGN = queue("apricorn_wall_sign") { WallSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD).dropsLike(APRICORN_SIGN), APRICORN_WOOD_TYPE) }
|
||||
// @JvmField
|
||||
// val APRICORN_SIGN = queue("apricorn_sign") { StandingSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD), APRICORN_WOOD_TYPE) }
|
||||
//@JvmField
|
||||
// val APRICORN_WALL_SIGN = queue("apricorn_wall_sign") { WallSignBlock(AbstractBlock.Settings.of(Material.WOOD).noCollission().strength(1.0f).sounds(BlockSoundGroup.WOOD).dropsLike(APRICORN_SIGN), APRICORN_WOOD_TYPE) }
|
||||
@JvmField
|
||||
val APRICORN_SLAB = queue("apricorn_slab") { SlabBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.OAK_TAN).strength(2.0f, 3.0f).sounds(BlockSoundGroup.WOOD)) }
|
||||
@JvmField
|
||||
val APRICORN_STAIRS = queue("apricorn_stairs") { StairsBlock(
|
||||
APRICORN_PLANKS.get().defaultState, AbstractBlock.Settings.copy(
|
||||
APRICORN_PLANKS.get())) }
|
||||
@JvmField
|
||||
val APRICORN_DOOR = queue("apricorn_door") { DoorBlock(AbstractBlock.Settings.of(Material.WOOD, APRICORN_PLANKS.get().defaultMapColor).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque()) }
|
||||
@JvmField
|
||||
val APRICORN_TRAPDOOR = queue("apricorn_trapdoor") { TrapdoorBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.OAK_TAN).strength(3.0F).sounds(BlockSoundGroup.WOOD).nonOpaque().allowsSpawning { _, _, _, _ -> false }) }
|
||||
|
||||
private val PLANT_PROPERTIES = AbstractBlock.Settings.of(Material.PLANT).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS)
|
||||
@JvmField
|
||||
val BLACK_APRICORN_SAPLING = queue("black_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.BLACK) }
|
||||
@JvmField
|
||||
val BLUE_APRICORN_SAPLING = queue("blue_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.BLUE) }
|
||||
@JvmField
|
||||
val GREEN_APRICORN_SAPLING = queue("green_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.GREEN) }
|
||||
@JvmField
|
||||
val PINK_APRICORN_SAPLING = queue("pink_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.PINK) }
|
||||
@JvmField
|
||||
val RED_APRICORN_SAPLING = queue("red_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.RED) }
|
||||
@JvmField
|
||||
val WHITE_APRICORN_SAPLING = queue("white_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.WHITE) }
|
||||
@JvmField
|
||||
val YELLOW_APRICORN_SAPLING = queue("yellow_apricorn_sapling") { ApricornSaplingBlock(PLANT_PROPERTIES, Apricorn.YELLOW) }
|
||||
|
||||
@JvmField
|
||||
val BLACK_APRICORN = registerApricornBlock("black_apricorn", Apricorn.BLACK)
|
||||
@JvmField
|
||||
val BLUE_APRICORN = registerApricornBlock("blue_apricorn", Apricorn.BLUE)
|
||||
@JvmField
|
||||
val GREEN_APRICORN = registerApricornBlock("green_apricorn", Apricorn.GREEN)
|
||||
@JvmField
|
||||
val PINK_APRICORN = registerApricornBlock("pink_apricorn", Apricorn.PINK)
|
||||
@JvmField
|
||||
val RED_APRICORN = registerApricornBlock("red_apricorn", Apricorn.RED)
|
||||
@JvmField
|
||||
val WHITE_APRICORN = registerApricornBlock("white_apricorn", Apricorn.WHITE)
|
||||
@JvmField
|
||||
val YELLOW_APRICORN = registerApricornBlock("yellow_apricorn", Apricorn.YELLOW)
|
||||
|
||||
val HEALING_MACHINE = queue("healing_machine") { HealingMachineBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2f).nonOpaque()) }
|
||||
val PC = queue("pc") { PCBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2F).nonOpaque()) }
|
||||
@JvmField
|
||||
val HEALING_MACHINE = queue("healing_machine") { HealingMachineBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2f).nonOpaque().luminance(ToIntFunction { state: BlockState -> if (state.get(HealingMachineBlock.CHARGE_LEVEL) >= HealingMachineBlock.MAX_CHARGE_LEVEL) 7 else 2 })) }
|
||||
@JvmField
|
||||
val PC = queue("pc") { PCBlock(AbstractBlock.Settings.of(Material.METAL, MapColor.IRON_GRAY).sounds(BlockSoundGroup.METAL).strength(2F).nonOpaque().luminance(ToIntFunction { state: BlockState -> if ((state.get(
|
||||
PCBlock.ON) as Boolean) && (state.get(PCBlock.PART) == PCBlock.PCPart.TOP)) 10 else 0 })) }
|
||||
|
||||
private fun registerApricornBlock(id: String, apricorn: Apricorn): RegistrySupplier<ApricornBlock> {
|
||||
return queue(id) { ApricornBlock(AbstractBlock.Settings.of(Material.PLANT).ticksRandomly().strength(0.2f, 3.0f).sounds(BlockSoundGroup.WOOD).nonOpaque(), apricorn) }
|
||||
return queue(id) { ApricornBlock(AbstractBlock.Settings.of(Material.PLANT, apricorn.mapColor()).ticksRandomly().strength(Blocks.OAK_LOG.hardness, Blocks.OAK_LOG.blastResistance).sounds(BlockSoundGroup.WOOD).nonOpaque(), apricorn) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -10,8 +10,16 @@ package com.cobblemon.mod.common
|
||||
|
||||
import java.util.function.Supplier
|
||||
import net.minecraft.client.model.TexturedModelData
|
||||
import net.minecraft.client.particle.ParticleFactory
|
||||
import net.minecraft.client.particle.SpriteProvider
|
||||
import net.minecraft.client.render.entity.model.EntityModelLayer
|
||||
import net.minecraft.particle.ParticleEffect
|
||||
import net.minecraft.particle.ParticleType
|
||||
|
||||
interface CobblemonClientImplementation {
|
||||
fun registerLayer(modelLayer: EntityModelLayer, supplier: Supplier<TexturedModelData>)
|
||||
fun <T : ParticleEffect> registerParticleFactory(
|
||||
type: ParticleType<T>,
|
||||
factory: (SpriteProvider) -> ParticleFactory<T>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -8,22 +8,7 @@
|
||||
|
||||
package com.cobblemon.mod.common
|
||||
|
||||
import com.cobblemon.mod.common.command.ChangeScaleAndSize
|
||||
import com.cobblemon.mod.common.command.CheckSpawnsCommand
|
||||
import com.cobblemon.mod.common.command.ClickTextCommand
|
||||
import com.cobblemon.mod.common.command.FriendshipCommand
|
||||
import com.cobblemon.mod.common.command.GetNBT
|
||||
import com.cobblemon.mod.common.command.GivePokemon
|
||||
import com.cobblemon.mod.common.command.HealPokemonCommand
|
||||
import com.cobblemon.mod.common.command.LevelUp
|
||||
import com.cobblemon.mod.common.command.OpenStarterScreenCommand
|
||||
import com.cobblemon.mod.common.command.PokemonEditCommand
|
||||
import com.cobblemon.mod.common.command.SpawnAllPokemon
|
||||
import com.cobblemon.mod.common.command.SpawnPokemon
|
||||
import com.cobblemon.mod.common.command.StopBattleCommand
|
||||
import com.cobblemon.mod.common.command.TakePokemon
|
||||
import com.cobblemon.mod.common.command.TeachCommand
|
||||
import com.cobblemon.mod.common.command.TestCommand
|
||||
import com.cobblemon.mod.common.command.*
|
||||
import com.mojang.brigadier.CommandDispatcher
|
||||
import net.minecraft.command.CommandRegistryAccess
|
||||
import net.minecraft.server.command.CommandManager
|
||||
@@ -36,6 +21,7 @@ object CobblemonCommands {
|
||||
TakePokemon.register(dispatcher)
|
||||
ChangeScaleAndSize.register(dispatcher)
|
||||
TestCommand.register(dispatcher)
|
||||
ReloadShowdownCommand.register(dispatcher)
|
||||
ClickTextCommand.register(dispatcher)
|
||||
PokemonEditCommand.register(dispatcher)
|
||||
TeachCommand.register(dispatcher)
|
||||
@@ -47,5 +33,10 @@ object CobblemonCommands {
|
||||
OpenStarterScreenCommand.register(dispatcher)
|
||||
SpawnAllPokemon.register(dispatcher)
|
||||
FriendshipCommand.register(dispatcher)
|
||||
GiveAllPokemon.register(dispatcher)
|
||||
HeldItemCommand.register(dispatcher, registry)
|
||||
PcCommand.register(dispatcher)
|
||||
SpawnPokemonFromPool.register(dispatcher)
|
||||
PokeboxCommand.register(dispatcher)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common
|
||||
import com.cobblemon.mod.common.api.events.CobblemonEvents
|
||||
import com.cobblemon.mod.common.api.events.entity.EntityAttributeEvent
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.entity.data.CobblemonTrackedDataHandlerRegistry
|
||||
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.registry.CompletableRegistry
|
||||
@@ -21,14 +22,14 @@ import net.minecraft.entity.Entity
|
||||
import net.minecraft.entity.EntityType
|
||||
import net.minecraft.entity.LivingEntity
|
||||
import net.minecraft.entity.SpawnGroup
|
||||
import net.minecraft.entity.attribute.DefaultAttributeContainer
|
||||
import net.minecraft.entity.attribute.EntityAttributes
|
||||
import net.minecraft.util.registry.Registry
|
||||
|
||||
object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TYPE_KEY) {
|
||||
|
||||
override fun register() {
|
||||
super.register()
|
||||
|
||||
CobblemonTrackedDataHandlerRegistry.register()
|
||||
EntityAttributeRegistry.register(
|
||||
{ POKEMON.get() },
|
||||
{
|
||||
@@ -52,6 +53,7 @@ object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TY
|
||||
return queue(name) { entityTypeBuilder.build(cobblemonResource("pokemon").toString()) }
|
||||
}
|
||||
|
||||
@JvmField
|
||||
val POKEMON = livingEntity(
|
||||
name = "pokemon",
|
||||
entityTypeBuilder = EntityType.Builder.create<PokemonEntity>(
|
||||
@@ -60,6 +62,7 @@ object CobblemonEntities : CompletableRegistry<EntityType<*>>(Registry.ENTITY_TY
|
||||
)
|
||||
)
|
||||
|
||||
@JvmField
|
||||
val EMPTY_POKEBALL = entity(
|
||||
name = "empty_pokeball",
|
||||
entityTypeBuilder = EntityType.Builder.create<EmptyPokeBallEntity>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -21,5 +21,6 @@ object CobblemonFeatures : CompletableRegistry<Feature<*>>(Registry.FEATURE_KEY)
|
||||
return queue(name, feature)
|
||||
}
|
||||
|
||||
@JvmField
|
||||
val APRICORN_TREE_FEATURE = register("apricorn_tree_feature") { ApricornTreeFeature(SingleStateFeatureConfig.CODEC) }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -12,9 +12,15 @@ import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
|
||||
interface CobblemonImplementation {
|
||||
val modAPI: ModAPI
|
||||
fun isModInstalled(id: String): Boolean
|
||||
}
|
||||
|
||||
enum class ModAPI {
|
||||
FABRIC,
|
||||
FORGE
|
||||
}
|
||||
|
||||
interface NetworkDelegate {
|
||||
|
||||
fun sendPacketToPlayer(player: ServerPlayerEntity, packet: NetworkPacket)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -9,158 +9,367 @@
|
||||
package com.cobblemon.mod.common
|
||||
|
||||
import com.cobblemon.mod.common.api.pokeball.PokeBalls
|
||||
import com.cobblemon.mod.common.api.pokemon.helditem.HeldItemProvider
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Stats
|
||||
import com.cobblemon.mod.common.item.ApricornItem
|
||||
import com.cobblemon.mod.common.item.CobblemonItem
|
||||
import com.cobblemon.mod.common.item.CobblemonItemGroups
|
||||
import com.cobblemon.mod.common.item.PokeBallItem
|
||||
import com.cobblemon.mod.common.item.*
|
||||
import com.cobblemon.mod.common.item.interactive.CandyItem
|
||||
import com.cobblemon.mod.common.item.interactive.LinkCableItem
|
||||
import com.cobblemon.mod.common.item.interactive.VitaminItem
|
||||
import com.cobblemon.mod.common.pokeball.PokeBall
|
||||
import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager
|
||||
import com.cobblemon.mod.common.registry.CompletableRegistry
|
||||
import dev.architectury.registry.registries.RegistrySupplier
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.item.AliasedBlockItem
|
||||
import net.minecraft.item.BlockItem
|
||||
import net.minecraft.item.Item
|
||||
import net.minecraft.item.ItemGroup
|
||||
import net.minecraft.block.ComposterBlock
|
||||
import net.minecraft.item.*
|
||||
import net.minecraft.util.registry.Registry
|
||||
|
||||
object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
|
||||
|
||||
init {
|
||||
this.completed.thenRun {
|
||||
val compostChance = ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.getFloat(Items.OAK_LEAVES)
|
||||
// Should always pass unless Mojang reworks leaves to no longer work in the Composter, in that case we already updated w.o doing anything
|
||||
if (compostChance != ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.defaultReturnValue()) {
|
||||
ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE[APRICORN_LEAVES.get()] = compostChance
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val pokeballs = mutableListOf<RegistrySupplier<PokeBallItem>>()
|
||||
|
||||
@JvmField
|
||||
val POKE_BALL = pokeballItem(PokeBalls.POKE_BALL)
|
||||
@JvmField
|
||||
val CITRINE_BALL = pokeballItem(PokeBalls.CITRINE_BALL)
|
||||
@JvmField
|
||||
val VERDANT_BALL = pokeballItem(PokeBalls.VERDANT_BALL)
|
||||
@JvmField
|
||||
val AZURE_BALL = pokeballItem(PokeBalls.AZURE_BALL)
|
||||
@JvmField
|
||||
val ROSEATE_BALL = pokeballItem(PokeBalls.ROSEATE_BALL)
|
||||
@JvmField
|
||||
val SLATE_BALL = pokeballItem(PokeBalls.SLATE_BALL)
|
||||
@JvmField
|
||||
val PREMIER_BALL = pokeballItem(PokeBalls.PREMIER_BALL)
|
||||
@JvmField
|
||||
val GREAT_BALL = pokeballItem(PokeBalls.GREAT_BALL)
|
||||
@JvmField
|
||||
val ULTRA_BALL = pokeballItem(PokeBalls.ULTRA_BALL)
|
||||
@JvmField
|
||||
val SAFARI_BALL = pokeballItem(PokeBalls.SAFARI_BALL)
|
||||
@JvmField
|
||||
val FAST_BALL = pokeballItem(PokeBalls.FAST_BALL)
|
||||
@JvmField
|
||||
val LEVEL_BALL = pokeballItem(PokeBalls.LEVEL_BALL)
|
||||
@JvmField
|
||||
val LURE_BALL = pokeballItem(PokeBalls.LURE_BALL)
|
||||
@JvmField
|
||||
val HEAVY_BALL = pokeballItem(PokeBalls.HEAVY_BALL)
|
||||
@JvmField
|
||||
val LOVE_BALL = pokeballItem(PokeBalls.LOVE_BALL)
|
||||
@JvmField
|
||||
val FRIEND_BALL = pokeballItem(PokeBalls.FRIEND_BALL)
|
||||
@JvmField
|
||||
val MOON_BALL = pokeballItem(PokeBalls.MOON_BALL)
|
||||
@JvmField
|
||||
val SPORT_BALL = pokeballItem(PokeBalls.SPORT_BALL)
|
||||
@JvmField
|
||||
val PARK_BALL = pokeballItem(PokeBalls.PARK_BALL)
|
||||
@JvmField
|
||||
val NET_BALL = pokeballItem(PokeBalls.NET_BALL)
|
||||
@JvmField
|
||||
val DIVE_BALL = pokeballItem(PokeBalls.DIVE_BALL)
|
||||
@JvmField
|
||||
val NEST_BALL = pokeballItem(PokeBalls.NEST_BALL)
|
||||
@JvmField
|
||||
val REPEAT_BALL = pokeballItem(PokeBalls.REPEAT_BALL)
|
||||
@JvmField
|
||||
val TIMER_BALL = pokeballItem(PokeBalls.TIMER_BALL)
|
||||
@JvmField
|
||||
val LUXURY_BALL = pokeballItem(PokeBalls.LUXURY_BALL)
|
||||
@JvmField
|
||||
val DUSK_BALL = pokeballItem(PokeBalls.DUSK_BALL)
|
||||
@JvmField
|
||||
val HEAL_BALL = pokeballItem(PokeBalls.HEAL_BALL)
|
||||
@JvmField
|
||||
val QUICK_BALL = pokeballItem(PokeBalls.QUICK_BALL)
|
||||
@JvmField
|
||||
val DREAM_BALL = pokeballItem(PokeBalls.DREAM_BALL)
|
||||
@JvmField
|
||||
val BEAST_BALL = pokeballItem(PokeBalls.BEAST_BALL)
|
||||
@JvmField
|
||||
val MASTER_BALL = pokeballItem(PokeBalls.MASTER_BALL)
|
||||
@JvmField
|
||||
val CHERISH_BALL = pokeballItem(PokeBalls.CHERISH_BALL)
|
||||
|
||||
@JvmField
|
||||
val RED_APRICORN = queue("red_apricorn") { ApricornItem(CobblemonBlocks.RED_APRICORN.get()) }
|
||||
@JvmField
|
||||
val YELLOW_APRICORN = queue("yellow_apricorn") { ApricornItem(CobblemonBlocks.YELLOW_APRICORN.get()) }
|
||||
@JvmField
|
||||
val GREEN_APRICORN = queue("green_apricorn") { ApricornItem(CobblemonBlocks.GREEN_APRICORN.get()) }
|
||||
@JvmField
|
||||
val BLUE_APRICORN = queue("blue_apricorn") { ApricornItem(CobblemonBlocks.BLUE_APRICORN.get()) }
|
||||
@JvmField
|
||||
val PINK_APRICORN = queue("pink_apricorn") { ApricornItem(CobblemonBlocks.PINK_APRICORN.get()) }
|
||||
@JvmField
|
||||
val BLACK_APRICORN = queue("black_apricorn") { ApricornItem(CobblemonBlocks.BLACK_APRICORN.get()) }
|
||||
@JvmField
|
||||
val WHITE_APRICORN = queue("white_apricorn") { ApricornItem(CobblemonBlocks.WHITE_APRICORN.get()) }
|
||||
|
||||
val RED_APRICORN_SEED = queue("red_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.RED_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val YELLOW_APRICORN_SEED = queue("yellow_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.YELLOW_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val GREEN_APRICORN_SEED = queue("green_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.GREEN_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val BLUE_APRICORN_SEED = queue("blue_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.BLUE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val PINK_APRICORN_SEED = queue("pink_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.PINK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val BLACK_APRICORN_SEED = queue("black_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.BLACK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
val WHITE_APRICORN_SEED = queue("white_apricorn_seed") { itemNameBlockItem(CobblemonBlocks.WHITE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val RED_APRICORN_SEED = queue("red_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.RED_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val YELLOW_APRICORN_SEED = queue("yellow_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.YELLOW_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val GREEN_APRICORN_SEED = queue("green_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.GREEN_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val BLUE_APRICORN_SEED = queue("blue_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.BLUE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val PINK_APRICORN_SEED = queue("pink_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.PINK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val BLACK_APRICORN_SEED = queue("black_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.BLACK_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
@JvmField
|
||||
val WHITE_APRICORN_SEED = queue("white_apricorn_seed") { ApricornSeedItem(CobblemonBlocks.WHITE_APRICORN_SAPLING.get(), ItemGroup.MISC) }
|
||||
|
||||
@JvmField
|
||||
val APRICORN_LOG = queue("apricorn_log") { blockItem(CobblemonBlocks.APRICORN_LOG.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val STRIPPED_APRICORN_LOG = queue("stripped_apricorn_log") { blockItem(CobblemonBlocks.STRIPPED_APRICORN_LOG.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val APRICORN_WOOD = queue("apricorn_wood") { blockItem(CobblemonBlocks.APRICORN_WOOD.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val STRIPPED_APRICORN_WOOD = queue("stripped_apricorn_wood") { blockItem(CobblemonBlocks.STRIPPED_APRICORN_WOOD.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val APRICORN_PLANKS = queue("apricorn_planks") { blockItem(CobblemonBlocks.APRICORN_PLANKS.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val APRICORN_LEAVES = queue("apricorn_leaves") { blockItem(CobblemonBlocks.APRICORN_LEAVES.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
|
||||
@JvmField
|
||||
val APRICORN_DOOR = queue("apricorn_door") { blockItem(CobblemonBlocks.APRICORN_DOOR.get(), ItemGroup.REDSTONE) }
|
||||
@JvmField
|
||||
val APRICORN_TRAPDOOR = queue("apricorn_trapdoor") { blockItem(CobblemonBlocks.APRICORN_TRAPDOOR.get(), ItemGroup.REDSTONE) }
|
||||
@JvmField
|
||||
val APRICORN_FENCE = queue("apricorn_fence") { blockItem(CobblemonBlocks.APRICORN_FENCE.get(), ItemGroup.DECORATIONS) }
|
||||
@JvmField
|
||||
val APRICORN_FENCE_GATE = queue("apricorn_fence_gate") { blockItem(CobblemonBlocks.APRICORN_FENCE_GATE.get(), ItemGroup.REDSTONE) }
|
||||
@JvmField
|
||||
val APRICORN_BUTTON = queue("apricorn_button") { blockItem(CobblemonBlocks.APRICORN_BUTTON.get(), ItemGroup.REDSTONE) }
|
||||
@JvmField
|
||||
val APRICORN_PRESSURE_PLATE = queue("apricorn_pressure_plate") { blockItem(CobblemonBlocks.APRICORN_PRESSURE_PLATE.get(), ItemGroup.REDSTONE) }
|
||||
//val APRICORN_SIGN = queue("apricorn_sign", SignItem(Item.Properties().stacksTo(16).tab(CreativeModeTab.TAB_DECORATIONS), CobblemonBlocks.APRICORN_SIGN, CobblemonBlocks.APRICORN_WALL_SIGN))
|
||||
//@JvmField
|
||||
// val APRICORN_SIGN = queue("apricorn_sign", SignItem(Item.Properties().stacksTo(16).tab(CreativeModeTab.TAB_DECORATIONS), CobblemonBlocks.APRICORN_SIGN, CobblemonBlocks.APRICORN_WALL_SIGN))
|
||||
@JvmField
|
||||
val APRICORN_SLAB = queue("apricorn_slab") { blockItem(CobblemonBlocks.APRICORN_SLAB.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val APRICORN_STAIRS = queue("apricorn_stairs") { blockItem(CobblemonBlocks.APRICORN_STAIRS.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
|
||||
@JvmField
|
||||
val HEALING_MACHINE = queue("healing_machine") { blockItem(CobblemonBlocks.HEALING_MACHINE.get(), ItemGroup.REDSTONE) }
|
||||
@JvmField
|
||||
val PC = queue("pc") { blockItem(CobblemonBlocks.PC.get(), ItemGroup.REDSTONE) }
|
||||
|
||||
// Evolution items
|
||||
val LINK_CABLE = queue("link_cable") { LinkCableItem() }
|
||||
val KINGS_ROCK = queue("kings_rock") { evolutionItem() }
|
||||
val METAL_COAT = queue("metal_coat") { evolutionItem() }
|
||||
val BLACK_AUGURITE = queue("black_augurite") { evolutionItem() }
|
||||
val PROTECTOR = queue("protector") { evolutionItem() }
|
||||
val OVAL_STONE = queue("oval_stone") { evolutionItem() }
|
||||
val DRAGON_SCALE = queue("dragon_scale") { evolutionItem() }
|
||||
val ELECTIRIZER = queue("electirizer") { evolutionItem() }
|
||||
val MAGMARIZER = queue("magmarizer") { evolutionItem() }
|
||||
val UPGRADE = queue("upgrade") { evolutionItem() }
|
||||
val DUBIOUS_DISC = queue("dubious_disc") { evolutionItem() }
|
||||
@JvmField val LINK_CABLE = this.queue("link_cable") { LinkCableItem() }
|
||||
@JvmField val DRAGON_SCALE = this.evolutionItem("dragon_scale")
|
||||
@JvmField val KINGS_ROCK = this.evolutionItem("kings_rock")
|
||||
@JvmField val METAL_COAT = this.evolutionItem("metal_coat")
|
||||
@JvmField val UPGRADE = this.evolutionItem("upgrade")
|
||||
@JvmField val DUBIOUS_DISC = this.evolutionItem("dubious_disc")
|
||||
@JvmField val DEEP_SEA_SCALE = this.evolutionItem("deep_sea_scale")
|
||||
@JvmField val DEEP_SEA_TOOTH = this.evolutionItem("deep_sea_tooth")
|
||||
@JvmField val ELECTIRIZER = this.evolutionItem("electirizer")
|
||||
@JvmField val MAGMARIZER = this.evolutionItem("magmarizer")
|
||||
@JvmField val OVAL_STONE = this.evolutionItem("oval_stone")
|
||||
@JvmField val PROTECTOR = this.evolutionItem("protector")
|
||||
@JvmField val REAPER_CLOTH = this.evolutionItem("reaper_cloth")
|
||||
@JvmField val PRISM_SCALE = this.evolutionItem("prism_scale")
|
||||
@JvmField val SACHET = this.evolutionItem("sachet")
|
||||
@JvmField val WHIPPED_DREAM = this.evolutionItem("whipped_dream")
|
||||
@JvmField val STRAWBERRY_SWEET = this.evolutionItem("strawberry_sweet")
|
||||
@JvmField val LOVE_SWEET = this.evolutionItem("love_sweet")
|
||||
@JvmField val BERRY_SWEET = this.evolutionItem("berry_sweet")
|
||||
@JvmField val CLOVER_SWEET = this.evolutionItem("clover_sweet")
|
||||
@JvmField val FLOWER_SWEET = this.evolutionItem("flower_sweet")
|
||||
@JvmField val STAR_SWEET = this.evolutionItem("star_sweet")
|
||||
@JvmField val RIBBON_SWEET = this.evolutionItem("ribbon_sweet")
|
||||
@JvmField val CHIPPED_POT = this.evolutionItem("chipped_pot")
|
||||
@JvmField val CRACKED_POT = this.evolutionItem("cracked_pot")
|
||||
@JvmField val SWEET_APPLE = this.evolutionItem("sweet_apple")
|
||||
@JvmField val TART_APPLE = this.evolutionItem("tart_apple")
|
||||
@JvmField val GALARICA_CUFF = this.evolutionItem("galarica_cuff")
|
||||
@JvmField val GALARICA_WREATH = this.evolutionItem("galarica_wreath")
|
||||
@JvmField val BLACK_AUGURITE = this.evolutionItem("black_augurite")
|
||||
@JvmField val PEAT_BLOCK = this.evolutionItem("peat_block")
|
||||
@JvmField val RAZOR_CLAW = this.evolutionItem("razor_claw")
|
||||
@JvmField val RAZOR_FANG = this.evolutionItem("razor_fang")
|
||||
// ToDo enable me when malicious armor goes in the game
|
||||
//@JvmField val AUSPICIOUS_ARMOR = this.heldItem("auspicious_armor")
|
||||
|
||||
// Medicine
|
||||
@JvmField
|
||||
val RARE_CANDY = queue("rare_candy") { CandyItem { _, pokemon -> pokemon.getExperienceToNextLevel() } }
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_XS = queue("exp_candy_xs") { CandyItem { _, _ -> CandyItem.DEFAULT_XS_CANDY_YIELD } }
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_S = queue("exp_candy_s") { CandyItem { _, _ -> CandyItem.DEFAULT_S_CANDY_YIELD } }
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_M = queue("exp_candy_m") { CandyItem { _, _ -> CandyItem.DEFAULT_M_CANDY_YIELD } }
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_L = queue("exp_candy_l") { CandyItem { _, _ -> CandyItem.DEFAULT_L_CANDY_YIELD } }
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_XL = queue("exp_candy_xl") { CandyItem { _, _ -> CandyItem.DEFAULT_XL_CANDY_YIELD } }
|
||||
@JvmField
|
||||
val CALCIUM = queue("calcium") { VitaminItem(Stats.SPECIAL_ATTACK) }
|
||||
@JvmField
|
||||
val CARBOS = queue("carbos") { VitaminItem(Stats.SPEED) }
|
||||
@JvmField
|
||||
val HP_UP = queue("hp_up") { VitaminItem(Stats.HP) }
|
||||
@JvmField
|
||||
val IRON = queue("iron") { VitaminItem(Stats.DEFENCE) }
|
||||
@JvmField
|
||||
val PROTEIN = queue("protein") { VitaminItem(Stats.ATTACK) }
|
||||
@JvmField
|
||||
val ZINC = queue("zinc") { VitaminItem(Stats.SPECIAL_DEFENCE) }
|
||||
|
||||
/**
|
||||
* Evolution Ores and Stones
|
||||
*/
|
||||
@JvmField
|
||||
val DAWN_STONE_ORE = queue("dawn_stone_ore") { blockItem(CobblemonBlocks.DAWN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DUSK_STONE_ORE = queue("dusk_stone_ore") { blockItem(CobblemonBlocks.DUSK_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val FIRE_STONE_ORE = queue("fire_stone_ore") { blockItem(CobblemonBlocks.FIRE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val ICE_STONE_ORE = queue("ice_stone_ore") { blockItem(CobblemonBlocks.ICE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val LEAF_STONE_ORE = queue("leaf_stone_ore") { blockItem(CobblemonBlocks.LEAF_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val MOON_STONE_ORE = queue("moon_stone_ore") { blockItem(CobblemonBlocks.MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val SHINY_STONE_ORE = queue("shiny_stone_ore") { blockItem(CobblemonBlocks.SHINY_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val SUN_STONE_ORE = queue("sun_stone_ore") { blockItem(CobblemonBlocks.SUN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val THUNDER_STONE_ORE = queue("thunder_stone_ore") { blockItem(CobblemonBlocks.THUNDER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val WATER_STONE_ORE = queue("water_stone_ore") { blockItem(CobblemonBlocks.WATER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_DAWN_STONE_ORE = queue("deepslate_dawn_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_DAWN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_DUSK_STONE_ORE = queue("deepslate_dusk_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_DUSK_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_FIRE_STONE_ORE = queue("deepslate_fire_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_FIRE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_ICE_STONE_ORE = queue("deepslate_ice_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_ICE_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_LEAF_STONE_ORE = queue("deepslate_leaf_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_LEAF_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_MOON_STONE_ORE = queue("deepslate_moon_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_SHINY_STONE_ORE = queue("deepslate_shiny_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_SHINY_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_SUN_STONE_ORE = queue("deepslate_sun_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_SUN_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_THUNDER_STONE_ORE = queue("deepslate_thunder_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_THUNDER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DEEPSLATE_WATER_STONE_ORE = queue("deepslate_water_stone_ore") { blockItem(CobblemonBlocks.DEEPSLATE_WATER_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
@JvmField
|
||||
val DRIPSTONE_MOON_STONE_ORE = queue("dripstone_moon_stone_ore") { blockItem(CobblemonBlocks.DRIPSTONE_MOON_STONE_ORE.get(), ItemGroup.BUILDING_BLOCKS) }
|
||||
val DAWN_STONE = queue("dawn_stone") { evolutionItem() }
|
||||
val DUSK_STONE = queue("dusk_stone") { evolutionItem() }
|
||||
val FIRE_STONE = queue("fire_stone") { evolutionItem() }
|
||||
val ICE_STONE = queue("ice_stone") { evolutionItem() }
|
||||
val LEAF_STONE = queue("leaf_stone") { evolutionItem() }
|
||||
val MOON_STONE = queue("moon_stone") { evolutionItem() }
|
||||
val SHINY_STONE = queue("shiny_stone") { evolutionItem() }
|
||||
val SUN_STONE = queue("sun_stone") { evolutionItem() }
|
||||
val THUNDER_STONE = queue("thunder_stone") { evolutionItem() }
|
||||
val WATER_STONE = queue("water_stone") { evolutionItem() }
|
||||
@JvmField
|
||||
val DAWN_STONE = this.evolutionItem("dawn_stone")
|
||||
@JvmField
|
||||
val DUSK_STONE = this.evolutionItem("dusk_stone")
|
||||
@JvmField
|
||||
val FIRE_STONE = this.evolutionItem("fire_stone")
|
||||
@JvmField
|
||||
val ICE_STONE = this.evolutionItem("ice_stone")
|
||||
@JvmField
|
||||
val LEAF_STONE = this.evolutionItem("leaf_stone")
|
||||
@JvmField
|
||||
val MOON_STONE = this.evolutionItem("moon_stone")
|
||||
@JvmField
|
||||
val SHINY_STONE = this.evolutionItem("shiny_stone")
|
||||
@JvmField
|
||||
val SUN_STONE = this.evolutionItem("sun_stone")
|
||||
@JvmField
|
||||
val THUNDER_STONE = this.evolutionItem("thunder_stone")
|
||||
@JvmField
|
||||
val WATER_STONE = this.evolutionItem("water_stone")
|
||||
|
||||
// Held Items
|
||||
@JvmField
|
||||
val ASSAULT_VEST = this.heldItem("assault_vest")
|
||||
@JvmField
|
||||
val BIG_ROOT = this.heldItem("big_root")
|
||||
@JvmField
|
||||
val BLACK_BELT = this.heldItem("black_belt")
|
||||
@JvmField
|
||||
val BLACK_GLASSES = this.heldItem("black_glasses")
|
||||
@JvmField
|
||||
val BLACK_SLUDGE = this.heldItem("black_sludge")
|
||||
@JvmField
|
||||
val CHARCOAL = this.heldItem("charcoal_stick", remappedName = "charcoal")
|
||||
@JvmField
|
||||
val CHOICE_BAND = this.heldItem("choice_band")
|
||||
@JvmField
|
||||
val CHOICE_SCARF = this.heldItem("choice_scarf")
|
||||
@JvmField
|
||||
val CHOICE_SPECS = this.heldItem("choice_specs")
|
||||
@JvmField
|
||||
val DRAGON_FANG = this.heldItem("dragon_fang")
|
||||
@JvmField
|
||||
val EXP_SHARE = this.heldItem("exp_share")
|
||||
@JvmField
|
||||
val FOCUS_BAND = this.heldItem("focus_band")
|
||||
@JvmField
|
||||
val HARD_STONE = this.heldItem("hard_stone")
|
||||
@JvmField
|
||||
val HEAVY_DUTY_BOOTS = this.heldItem("heavy_duty_boots")
|
||||
@JvmField
|
||||
val LEFTOVERS = this.heldItem("leftovers")
|
||||
@JvmField
|
||||
val LIGHT_CLAY = this.heldItem("light_clay")
|
||||
@JvmField
|
||||
val LUCKY_EGG = this.heldItem("lucky_egg")
|
||||
@JvmField
|
||||
val MAGNET = this.heldItem("magnet")
|
||||
@JvmField
|
||||
val MIRACLE_SEED = this.heldItem("miracle_seed")
|
||||
@JvmField
|
||||
val MUSCLE_BAND = this.heldItem("muscle_band")
|
||||
@JvmField
|
||||
val MYSTIC_WATER = this.heldItem("mystic_water")
|
||||
@JvmField
|
||||
val NEVER_MELT_ICE = this.heldItem("never_melt_ice")
|
||||
@JvmField
|
||||
val POISON_BARB = this.heldItem("poison_barb")
|
||||
@JvmField
|
||||
val QUICK_CLAW = this.heldItem("quick_claw")
|
||||
@JvmField
|
||||
val ROCKY_HELMET = this.heldItem("rocky_helmet")
|
||||
@JvmField
|
||||
val SAFETY_GOGGLES = this.heldItem("safety_goggles")
|
||||
@JvmField
|
||||
val SHARP_BEAK = this.heldItem("sharp_beak")
|
||||
@JvmField
|
||||
val SILK_SCARF = this.heldItem("silk_scarf")
|
||||
@JvmField
|
||||
val SILVER_POWDER = this.heldItem("silver_powder")
|
||||
@JvmField
|
||||
val SOFT_SAND = this.heldItem("soft_sand")
|
||||
@JvmField
|
||||
val SPELL_TAG = this.heldItem("spell_tag")
|
||||
@JvmField
|
||||
val TWISTED_SPOON = this.heldItem("twisted_spoon")
|
||||
@JvmField
|
||||
val WISE_GLASSES = this.heldItem("wise_glasses")
|
||||
|
||||
// Misc
|
||||
@JvmField
|
||||
val POKEMON_MODEL = queue("pokemon_model") { PokemonItem() }
|
||||
|
||||
fun pokeballs(): List<RegistrySupplier<PokeBallItem>> = this.pokeballs
|
||||
|
||||
@@ -172,9 +381,7 @@ object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
|
||||
return AliasedBlockItem(block, Item.Settings().group(tab))
|
||||
}
|
||||
|
||||
private fun evolutionItem(): CobblemonItem {
|
||||
return CobblemonItem(Item.Settings().group(CobblemonItemGroups.EVOLUTION_ITEM_GROUP))
|
||||
}
|
||||
private fun evolutionItem(name: String) = queue(name) { CobblemonItem(Item.Settings().group(CobblemonItemGroups.EVOLUTION_ITEM_GROUP)) }
|
||||
|
||||
private fun pokeballItem(pokeBall: PokeBall): RegistrySupplier<PokeBallItem> {
|
||||
val supplier = this.queue(pokeBall.name.path) { PokeBallItem(pokeBall) }
|
||||
@@ -183,4 +390,11 @@ object CobblemonItems : CompletableRegistry<Item>(Registry.ITEM_KEY) {
|
||||
return supplier
|
||||
}
|
||||
|
||||
private fun heldItem(name: String, remappedName: String? = null): RegistrySupplier<CobblemonItem> = queue(name) {
|
||||
val item = CobblemonItem(Item.Settings().group(CobblemonItemGroups.HELD_ITEM_GROUP))
|
||||
if (remappedName != null) {
|
||||
CobblemonHeldItemManager.registerRemap(item, remappedName)
|
||||
}
|
||||
return@queue item
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -28,30 +28,15 @@ import com.cobblemon.mod.common.net.messages.client.battle.BattleSetTeamPokemonP
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.BattleSwitchPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.BattleUpdateTeamPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.ChallengeNotificationPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.data.MovesRegistrySyncPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.data.*
|
||||
import com.cobblemon.mod.common.net.messages.client.data.PropertiesCompletionRegistrySyncPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.data.SpeciesRegistrySyncPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.AbilityUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.AspectsUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.BenchedMovesUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.CaughtBallUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.EVsUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.ExperienceUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.FriendshipUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.GenderUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.HealthUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.IVsUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.MoveSetUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.NatureUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.PokemonStateUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.ShinyUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.SpeciesUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.StatusUpdatePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.effect.SpawnSnowstormParticlePacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.*
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.AddEvolutionPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.ClearEvolutionsPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.pokemon.update.evolution.RemoveEvolutionPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.settings.ServerSettingsPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.sound.UnvalidatedPlaySoundS2CPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.starter.OpenStarterUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.starter.SetClientPlayerDataPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.RemoveClientPokemonPacket
|
||||
@@ -66,6 +51,7 @@ import com.cobblemon.mod.common.net.messages.client.storage.pc.MoveClientPCPokem
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.OpenPCPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCBoxPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.ui.InteractPokemonUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.client.ui.SummaryUIPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.BattleChallengePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.BenchMovePacket
|
||||
@@ -73,17 +59,14 @@ import com.cobblemon.mod.common.net.messages.server.RequestMoveSwapPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.SelectStarterPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.SendOutPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.battle.BattleSelectActionsPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.interact.InteractPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.pokemon.update.evolution.AcceptEvolutionPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.starter.RequestStarterScreenPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.SwapPCPartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.MovePartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.ReleasePartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.party.SwapPartyPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonToPartyPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePartyPokemonToPCPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.ReleasePCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.SwapPCPokemonPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.storage.pc.*
|
||||
import com.cobblemon.mod.common.util.getServer
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
@@ -148,6 +131,7 @@ object CobblemonNetwork {
|
||||
buildClientMessage<AbilityUpdatePacket>()
|
||||
buildClientMessage<EVsUpdatePacket>()
|
||||
buildClientMessage<IVsUpdatePacket>()
|
||||
buildClientMessage<HeldItemUpdatePacket>()
|
||||
|
||||
// Evolution start
|
||||
buildClientMessage<AddEvolutionPacket>()
|
||||
@@ -175,6 +159,7 @@ object CobblemonNetwork {
|
||||
|
||||
// UI Packets
|
||||
buildClientMessage<SummaryUIPacket>()
|
||||
buildClientMessage<InteractPokemonUIPacket>()
|
||||
|
||||
// Starter packets
|
||||
buildClientMessage<OpenStarterUIPacket>()
|
||||
@@ -202,11 +187,18 @@ object CobblemonNetwork {
|
||||
buildClientMessage<ServerSettingsPacket>()
|
||||
|
||||
// Data registries
|
||||
buildClientMessage<UnlockReloadPacket>()
|
||||
buildClientMessage<AbilityRegistrySyncPacket>()
|
||||
buildClientMessage<MovesRegistrySyncPacket>()
|
||||
buildClientMessage<SpeciesRegistrySyncPacket>()
|
||||
buildClientMessage<PropertiesCompletionRegistrySyncPacket>()
|
||||
|
||||
// Effects
|
||||
buildClientMessage<SpawnSnowstormParticlePacket>()
|
||||
|
||||
// Hax
|
||||
buildClientMessage<UnvalidatedPlaySoundS2CPacket>()
|
||||
|
||||
/**
|
||||
* Server Packets
|
||||
*/
|
||||
@@ -216,6 +208,9 @@ object CobblemonNetwork {
|
||||
buildServerMessage<AcceptEvolutionPacket>()
|
||||
// Evolution End
|
||||
|
||||
// Interaction Packets
|
||||
buildServerMessage<InteractPokemonPacket>()
|
||||
|
||||
// Storage Packets
|
||||
buildServerMessage<SendOutPokemonPacket>()
|
||||
buildServerMessage<RequestMoveSwapPacket>()
|
||||
@@ -226,6 +221,7 @@ object CobblemonNetwork {
|
||||
buildServerMessage<MovePartyPokemonToPCPacket>()
|
||||
buildServerMessage<ReleasePartyPokemonPacket>()
|
||||
buildServerMessage<ReleasePCPokemonPacket>()
|
||||
buildServerMessage<UnlinkPlayerFromPCPacket>()
|
||||
|
||||
// Starter packets
|
||||
buildServerMessage<SelectStarterPacket>()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -16,12 +16,42 @@ import net.minecraft.util.registry.Registry
|
||||
object CobblemonSounds : CompletableRegistry<SoundEvent>(Registry.SOUND_EVENT_KEY) {
|
||||
private fun queue(name: String) = queue(name) { SoundEvent(cobblemonResource(name)) }
|
||||
|
||||
@JvmField
|
||||
val GUI_CLICK = queue("gui.click")
|
||||
|
||||
@JvmField
|
||||
val PC_ON = queue("pc.on")
|
||||
@JvmField
|
||||
val PC_OFF = queue("pc.off")
|
||||
@JvmField
|
||||
val PC_GRAB = queue("pc.grab")
|
||||
@JvmField
|
||||
val PC_DROP = queue("pc.drop")
|
||||
@JvmField
|
||||
val PC_RELEASE = queue("pc.release")
|
||||
|
||||
@JvmField
|
||||
val HEALING_MACHINE_ACTIVE = queue("healing_machine.active")
|
||||
|
||||
@JvmField
|
||||
val POKE_BALL_CAPTURE_STARTED = queue("poke_ball.capture_started")
|
||||
@JvmField
|
||||
val POKE_BALL_CAPTURE_SUCCEEDED = queue("poke_ball.capture_succeeded")
|
||||
@JvmField
|
||||
val POKE_BALL_SHAKE = queue("poke_ball.shake")
|
||||
@JvmField
|
||||
val POKE_BALL_OPEN = queue("poke_ball.open")
|
||||
@JvmField
|
||||
val POKE_BALL_HIT = queue("poke_ball.hit")
|
||||
@JvmField
|
||||
val POKE_BALL_SEND_OUT = queue("poke_ball.send_out")
|
||||
@JvmField
|
||||
val POKE_BALL_RECALL = queue("poke_ball.recall")
|
||||
|
||||
@JvmField
|
||||
val ITEM_USE = queue("item.use")
|
||||
@JvmField
|
||||
val CAN_EVOLVE = queue("pokemon.can_evolve")
|
||||
@JvmField
|
||||
val EVOLVING = queue("pokemon.evolving")
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -18,7 +18,8 @@ package com.cobblemon.mod.common.api
|
||||
*/
|
||||
open class PrioritizedList<T> : Iterable<T> {
|
||||
protected val priorityMap = mutableMapOf<Priority, MutableList<T>>()
|
||||
protected val ordered = mutableListOf<T>()
|
||||
// Please don't change arraylist, we need insertion order
|
||||
protected val ordered = arrayListOf<T>()
|
||||
|
||||
val mapping: Map<Priority, List<T>>
|
||||
get() = priorityMap.toMap()
|
||||
@@ -31,7 +32,8 @@ open class PrioritizedList<T> : Iterable<T> {
|
||||
}
|
||||
|
||||
fun add(priority: Priority, value: T) {
|
||||
priorityMap.putIfAbsent(priority, mutableListOf())
|
||||
// Please don't change arraylist, we need insertion order
|
||||
priorityMap.putIfAbsent(priority, arrayListOf())
|
||||
priorityMap[priority]?.add(value)
|
||||
reorder()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -9,64 +9,41 @@
|
||||
package com.cobblemon.mod.common.api.abilities
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.data.JsonDataRegistry
|
||||
import com.cobblemon.mod.common.api.data.DataRegistry
|
||||
import com.cobblemon.mod.common.api.reactive.SimpleObservable
|
||||
import com.cobblemon.mod.common.battles.runner.ShowdownService
|
||||
import com.cobblemon.mod.common.net.messages.client.data.AbilityRegistrySyncPacket
|
||||
import com.cobblemon.mod.common.pokemon.abilities.HiddenAbilityType
|
||||
import com.cobblemon.mod.common.util.asTranslated
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
import com.google.gson.JsonElement
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import java.lang.reflect.Type
|
||||
import kotlin.io.path.Path
|
||||
import net.minecraft.resource.ResourceManager
|
||||
import net.minecraft.resource.ResourceType
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
import net.minecraft.text.MutableText
|
||||
import net.minecraft.util.Identifier
|
||||
|
||||
/**
|
||||
* Registry for all known Abilities
|
||||
*/
|
||||
object Abilities : JsonDataRegistry<AbilityTemplate> {
|
||||
object Abilities : DataRegistry {
|
||||
|
||||
override val id = cobblemonResource("abilities")
|
||||
override val type = ResourceType.SERVER_DATA
|
||||
override val observable = SimpleObservable<Abilities>()
|
||||
override val typeToken: TypeToken<AbilityTemplate> = TypeToken.get(AbilityTemplate::class.java)
|
||||
override val resourcePath = "abilities"
|
||||
override val gson: Gson = GsonBuilder()
|
||||
.disableHtmlEscaping()
|
||||
.setLenient()
|
||||
.setPrettyPrinting()
|
||||
.registerTypeAdapter(MutableText::class.java, MutableTextAdapter)
|
||||
.create()
|
||||
|
||||
val DUMMY = AbilityTemplate(name = "dummy")
|
||||
|
||||
private val allAbilities = mutableListOf<AbilityTemplate>()
|
||||
private val abilityMap = mutableMapOf<String, AbilityTemplate>()
|
||||
|
||||
object MutableTextAdapter : JsonDeserializer<MutableText> {
|
||||
override fun deserialize(json: JsonElement, type: Type, ctx: JsonDeserializationContext) = json.asString.asTranslated()
|
||||
}
|
||||
|
||||
override fun reload(data: Map<Identifier, AbilityTemplate>) {
|
||||
override fun reload(manager: ResourceManager) {
|
||||
PotentialAbility.types.clear()
|
||||
PotentialAbility.types.add(CommonAbilityType)
|
||||
PotentialAbility.types.add(HiddenAbilityType)
|
||||
|
||||
allAbilities.clear()
|
||||
abilityMap.clear()
|
||||
|
||||
data.forEach { (identifier, abilityTemplate) ->
|
||||
allAbilities.add(abilityTemplate)
|
||||
abilityMap[identifier.path] = abilityTemplate
|
||||
this.abilityMap.clear()
|
||||
val abilitiesJson = ShowdownService.get().getAbilityIds()
|
||||
for (i in 0 until abilitiesJson.size()) {
|
||||
val id = abilitiesJson[i].asString
|
||||
val ability = AbilityTemplate(id)
|
||||
this.register(ability)
|
||||
}
|
||||
|
||||
Cobblemon.LOGGER.info("Loaded {} abilities", this.allAbilities.size)
|
||||
Cobblemon.LOGGER.info("Loaded {} abilities", this.abilityMap.size)
|
||||
this.observable.emit(this)
|
||||
}
|
||||
|
||||
@@ -75,14 +52,19 @@ object Abilities : JsonDataRegistry<AbilityTemplate> {
|
||||
}
|
||||
|
||||
fun register(ability: AbilityTemplate): AbilityTemplate {
|
||||
abilityMap[ability.name.lowercase()] = ability
|
||||
allAbilities.add(ability)
|
||||
this.abilityMap[ability.name.lowercase()] = ability
|
||||
return ability
|
||||
}
|
||||
|
||||
fun all() = allAbilities.toList()
|
||||
fun first() = allAbilities.first()
|
||||
fun all() = this.abilityMap.values.toList()
|
||||
fun first() = this.abilityMap.values.first()
|
||||
fun get(name: String) = abilityMap[name.lowercase()]
|
||||
fun getOrException(name: String) = get(name)!!
|
||||
fun count() = allAbilities.size
|
||||
fun getOrException(name: String) = get(name) ?: throw IllegalArgumentException("Unable to find ability of name: $name")
|
||||
fun count() = this.abilityMap.size
|
||||
|
||||
internal fun receiveSyncPacket(abilities: Collection<AbilityTemplate>) {
|
||||
this.abilityMap.clear()
|
||||
abilities.forEach { ability -> this.register(ability) }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
package com.cobblemon.mod.common.api.abilities
|
||||
|
||||
import com.cobblemon.mod.common.api.Priority
|
||||
import com.cobblemon.mod.common.util.DataKeys
|
||||
import com.google.gson.JsonObject
|
||||
import net.minecraft.nbt.NbtCompound
|
||||
import net.minecraft.text.MutableText
|
||||
|
||||
/**
|
||||
* Representing an Ability with all its attributes
|
||||
@@ -21,27 +21,60 @@ import net.minecraft.text.MutableText
|
||||
* @author Qu
|
||||
* @since January 9th, 2022
|
||||
*/
|
||||
open class Ability internal constructor(var template: AbilityTemplate) {
|
||||
open class Ability internal constructor(var template: AbilityTemplate, var forced: Boolean) {
|
||||
|
||||
val name: String
|
||||
get() = template.name
|
||||
|
||||
val displayName: MutableText
|
||||
val displayName: String
|
||||
get() = template.displayName
|
||||
|
||||
val description: MutableText
|
||||
val description: String
|
||||
get() = template.description
|
||||
|
||||
/**
|
||||
* This represents the last known index of this backing ability in the species data.
|
||||
* If -1 the ability will attempt to find the correct index or reroll itself, this is done in order to be compatible with existing data
|
||||
* The value can be mutated however this is not recommended by API users.
|
||||
*/
|
||||
var index: Int = -1
|
||||
|
||||
/**
|
||||
* The last known priority of this ability in the species data.
|
||||
* The value can be mutated however this is not recommended by API users.
|
||||
*/
|
||||
var priority = Priority.LOWEST
|
||||
|
||||
open fun saveToNBT(nbt: NbtCompound): NbtCompound {
|
||||
nbt.putString(DataKeys.POKEMON_ABILITY_NAME, name)
|
||||
nbt.putBoolean(DataKeys.POKEMON_ABILITY_FORCED, forced)
|
||||
nbt.putInt(DataKeys.POKEMON_ABILITY_INDEX, index)
|
||||
nbt.putString(DataKeys.POKEMON_ABILITY_PRIORITY, priority.name)
|
||||
return nbt
|
||||
}
|
||||
|
||||
open fun saveToJSON(json: JsonObject): JsonObject {
|
||||
json.addProperty(DataKeys.POKEMON_ABILITY_NAME, name)
|
||||
json.addProperty(DataKeys.POKEMON_ABILITY_FORCED, forced)
|
||||
json.addProperty(DataKeys.POKEMON_ABILITY_INDEX, index)
|
||||
json.addProperty(DataKeys.POKEMON_ABILITY_PRIORITY, priority.name)
|
||||
return json
|
||||
}
|
||||
|
||||
open fun loadFromNBT(nbt: NbtCompound) = this
|
||||
open fun loadFromJSON(json: JsonObject) = this
|
||||
open fun loadFromNBT(nbt: NbtCompound): Ability {
|
||||
forced = nbt.getBoolean(DataKeys.POKEMON_ABILITY_FORCED)
|
||||
if (nbt.contains(DataKeys.POKEMON_ABILITY_INDEX) && nbt.contains(DataKeys.POKEMON_ABILITY_PRIORITY)) {
|
||||
this.index = nbt.getInt(DataKeys.POKEMON_ABILITY_INDEX)
|
||||
this.priority = Priority.valueOf(nbt.getString(DataKeys.POKEMON_ABILITY_PRIORITY))
|
||||
}
|
||||
return this
|
||||
}
|
||||
open fun loadFromJSON(json: JsonObject): Ability {
|
||||
forced = json.get(DataKeys.POKEMON_ABILITY_FORCED)?.asBoolean ?: false
|
||||
if (json.has(DataKeys.POKEMON_ABILITY_INDEX) && json.has(DataKeys.POKEMON_ABILITY_PRIORITY)) {
|
||||
this.index = json.get(DataKeys.POKEMON_ABILITY_INDEX).asInt
|
||||
this.priority = Priority.valueOf(json.get(DataKeys.POKEMON_ABILITY_PRIORITY).asString)
|
||||
}
|
||||
return this
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -22,15 +22,17 @@ import com.cobblemon.mod.common.pokemon.Species
|
||||
* @since July 28th, 2022
|
||||
*/
|
||||
open class AbilityPool : PrioritizedList<PotentialAbility>() {
|
||||
fun select(species: Species, aspects: Set<String>): Ability {
|
||||
fun select(species: Species, aspects: Set<String>): Pair<Ability, Priority> {
|
||||
for (priority in Priority.values()) {
|
||||
val potentialAbilities = priorityMap[priority]?.filter { it.isSatisfiedBy(aspects) } ?: continue
|
||||
if (potentialAbilities.isNotEmpty()) {
|
||||
return potentialAbilities.random().template.create()
|
||||
return potentialAbilities.random().template.create() to priority
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.error("Unable to select an ability from the pool for $species and aspects: ${aspects.joinToString()}")
|
||||
return Abilities.first().create()
|
||||
LOGGER.error("Usually this happens when a client is doing logic it shouldn't. Please show this to the Cobblemon developers!")
|
||||
Exception().printStackTrace()
|
||||
return Abilities.first().create() to Priority.LOWEST
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -8,10 +8,8 @@
|
||||
|
||||
package com.cobblemon.mod.common.api.abilities
|
||||
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import com.google.gson.JsonObject
|
||||
import net.minecraft.nbt.NbtCompound
|
||||
import net.minecraft.text.MutableText
|
||||
|
||||
/**
|
||||
* This represents the base of an Ability.
|
||||
@@ -21,14 +19,14 @@ import net.minecraft.text.MutableText
|
||||
*/
|
||||
class AbilityTemplate(
|
||||
val name: String = "",
|
||||
var builder: (AbilityTemplate) -> Ability = { Ability(it) },
|
||||
val displayName: MutableText = lang("ability.$name"),
|
||||
val description: MutableText = lang("ability.$name.desc")
|
||||
var builder: (AbilityTemplate, forced: Boolean) -> Ability = { template, forced -> Ability(template, forced) },
|
||||
val displayName: String = "cobblemon.ability.$name",
|
||||
val description: String = "cobblemon.ability.$name.desc"
|
||||
) {
|
||||
/**
|
||||
* Returns the Ability or if applicable the extension connected to this template
|
||||
*/
|
||||
fun create() = builder(this)
|
||||
fun create(forced: Boolean = false) = builder(this, forced)
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,12 +34,12 @@ class AbilityTemplate(
|
||||
*
|
||||
* Ability extensions need to write and read their needed data from here.
|
||||
*/
|
||||
fun create(nbt: NbtCompound) = builder(this).loadFromNBT(nbt)
|
||||
fun create(nbt: NbtCompound) = create().loadFromNBT(nbt)
|
||||
|
||||
/**
|
||||
* Returns the Ability and loads the given JSON object into it.
|
||||
*
|
||||
* Ability extensions need to write and read their needed data from here.
|
||||
*/
|
||||
fun create(json: JsonObject) = builder(this).loadFromJSON(json)
|
||||
fun create(json: JsonObject) = create().loadFromJSON(json)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -11,8 +11,9 @@ package com.cobblemon.mod.common.api.apricorn
|
||||
import com.cobblemon.mod.common.CobblemonBlocks
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.item.ApricornItem
|
||||
import com.cobblemon.mod.common.world.block.ApricornBlock
|
||||
import com.cobblemon.mod.common.world.block.ApricornSaplingBlock
|
||||
import com.cobblemon.mod.common.block.ApricornBlock
|
||||
import com.cobblemon.mod.common.block.ApricornSaplingBlock
|
||||
import net.minecraft.block.MapColor
|
||||
import net.minecraft.item.BlockItem
|
||||
|
||||
/**
|
||||
@@ -71,4 +72,14 @@ enum class Apricorn {
|
||||
YELLOW -> CobblemonBlocks.YELLOW_APRICORN_SAPLING.get()
|
||||
}
|
||||
|
||||
fun mapColor(): MapColor = when(this) {
|
||||
BLACK -> MapColor.BLACK
|
||||
BLUE -> MapColor.BLUE
|
||||
GREEN -> MapColor.GREEN
|
||||
PINK -> MapColor.PINK
|
||||
RED -> MapColor.RED
|
||||
WHITE -> MapColor.WHITE
|
||||
YELLOW -> MapColor.YELLOW
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.battles.interpreter
|
||||
|
||||
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
|
||||
import com.cobblemon.mod.common.battles.ActiveBattlePokemon
|
||||
|
||||
/**
|
||||
* A class responsible for parsing a raw simulator protocol message received from Showdown.
|
||||
* For more information see the [Showdown protocol](https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md).
|
||||
*
|
||||
* @constructor Creates a battle message with the given raw message.
|
||||
*
|
||||
* @param rawMessage The raw message received from Showdown.
|
||||
*
|
||||
* @author Licious
|
||||
* @since December 31st, 2022
|
||||
*/
|
||||
class BattleMessage(rawMessage: String) {
|
||||
|
||||
/**
|
||||
* The ID of the action received in the message.
|
||||
*/
|
||||
var id = ""
|
||||
private set
|
||||
|
||||
/**
|
||||
* The raw message received.
|
||||
*/
|
||||
var rawMessage: String = rawMessage
|
||||
private set
|
||||
|
||||
/**
|
||||
* A collection of the individual arguments the message had.
|
||||
*/
|
||||
private val args = arrayListOf<String>()
|
||||
|
||||
/**
|
||||
* A collection of the optional arguments the message had.
|
||||
*/
|
||||
private val optionalArguments = hashMapOf<String, String>()
|
||||
|
||||
/**
|
||||
* Pattern to match the start of an optional argument.
|
||||
*/
|
||||
private val optionalArgumentMatcher = Regex("^\\$OPTIONAL_ARG_START([^]]+)$OPTIONAL_ARG_END")
|
||||
|
||||
init {
|
||||
this.parse(rawMessage)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an argument at the given [index].
|
||||
*
|
||||
* @param index The index of the expected argument.
|
||||
* @return The argument if existing or null.
|
||||
*/
|
||||
fun argumentAt(index: Int): String? = this.args.getOrNull(index)
|
||||
|
||||
/**
|
||||
* Get an optional argument with the given [name].
|
||||
* This returns the data of the argument only.
|
||||
*
|
||||
* @param name The name of the optional argument.
|
||||
* @return The argument data if existing or null.
|
||||
*/
|
||||
fun optionalArgument(name: String): String? = this.optionalArguments[name.lowercase()]
|
||||
|
||||
/**
|
||||
* Checks if an optional argument is present.
|
||||
* [optionalArgument] is null safe, this method is meant as a way to check 'flags' as some optional arguments contain no data.
|
||||
*
|
||||
* @param name The name of the optional argument.
|
||||
* @return True if the argument is present.
|
||||
*/
|
||||
fun hasOptionalArgument(name: String): Boolean = this.optionalArgument(name) != null
|
||||
|
||||
/**
|
||||
* Clears the parsed arguments and parses the message again with the new given [rawMessage].
|
||||
*
|
||||
* @param rawMessage The raw message received from Showdown.
|
||||
* @return This instance of the battle message updated.
|
||||
*/
|
||||
fun parse(rawMessage: String): BattleMessage {
|
||||
var message = rawMessage.trim()
|
||||
this.id = ""
|
||||
this.args.clear()
|
||||
this.optionalArguments.clear()
|
||||
this.rawMessage = message
|
||||
if (!message.startsWith(SEPARATOR) || message == SEPARATOR) {
|
||||
return this
|
||||
}
|
||||
message = this.push(message)
|
||||
this.id = message.substringBefore(SEPARATOR)
|
||||
message = this.push(message)
|
||||
while (message.isNotBlank()) {
|
||||
val currentData = message.substringBefore(SEPARATOR)
|
||||
val optionalArgumentID = this.optionalArgumentMatcher.find(currentData)
|
||||
if (optionalArgumentID != null) {
|
||||
val id = optionalArgumentID.value.removePrefix(OPTIONAL_ARG_START).removeSuffix(OPTIONAL_ARG_END).lowercase()
|
||||
val value = currentData.substringAfter(optionalArgumentID.value).trim()
|
||||
this.optionalArguments[id] = value
|
||||
}
|
||||
else {
|
||||
this.args.add(currentData)
|
||||
}
|
||||
message = this.push(message)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries an argument at the given [index] for a 'pnx' that will be parsed into a [BattleActor] and [ActiveBattlePokemon].
|
||||
*
|
||||
* @param index The index of the argument containing the [BattleActor] and [ActiveBattlePokemon].
|
||||
* @param battle The [PokemonBattle] being queried.
|
||||
* @return A pair of [BattleActor] and [ActiveBattlePokemon] if the argument exists and successfully parses them otherwise null.
|
||||
*/
|
||||
fun actorAndActivePokemon(index: Int, battle: PokemonBattle): Pair<BattleActor, ActiveBattlePokemon>? {
|
||||
val pnx = this.argumentAt(index)?.takeIf { it.length >= 3 }?.substring(0, 3) ?: return null
|
||||
return this.actorAndActivePokemon(pnx, battle)
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to parse an [Effect] from an argument at the given [index].
|
||||
*
|
||||
* @param index The index of the expected argument.
|
||||
* @return The parsed [Effect] or null.
|
||||
*/
|
||||
fun effectAt(index: Int): Effect? {
|
||||
val data = this.argumentAt(index) ?: return null
|
||||
return Effect.parse(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to parse an [Effect] from an optional argument.
|
||||
*
|
||||
* @param argumentName The name of the optional argument.
|
||||
* @return The parsed [Effect] or null.
|
||||
*/
|
||||
fun effect(argumentName: String = "from"): Effect? {
|
||||
val data = this.optionalArgument(argumentName) ?: return null
|
||||
return Effect.parse(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries an optional argument with given [argumentName] for a 'pnx' that will be parsed into a [BattleActor] and [ActiveBattlePokemon].
|
||||
*
|
||||
* @param battle The [PokemonBattle] being queried.
|
||||
* @param argumentName The name of the optional argument.
|
||||
* @return A pair of [BattleActor] and [ActiveBattlePokemon] if the argument exists and successfully parses them otherwise null.
|
||||
*/
|
||||
fun actorAndActivePokemonFromOptional(battle: PokemonBattle, argumentName: String = "of"): Pair<BattleActor, ActiveBattlePokemon>? {
|
||||
val pnx = this.optionalArgument(argumentName)?.substring(0, 3) ?: return null
|
||||
return this.actorAndActivePokemon(pnx, battle)
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes the given string down into the next argument.
|
||||
*
|
||||
* @param message The current state of the message.
|
||||
* @return A substring of [message] after the first [SEPARATOR] or empty if no [SEPARATOR] remains.
|
||||
*/
|
||||
private fun push(message: String): String = message.substringAfter(SEPARATOR, "")
|
||||
|
||||
/**
|
||||
* A utility to wrap [PokemonBattle.getActorAndActiveSlotFromPNX] to make it nullable instead of throwing an exception.
|
||||
*
|
||||
* @param pnx The raw pnx.
|
||||
* @param battle The [PokemonBattle] being queried.
|
||||
* @returnA pair of [BattleActor] and [ActiveBattlePokemon] if [PokemonBattle.getActorAndActiveSlotFromPNX] executes without any exception being thrown or else null.
|
||||
*/
|
||||
private fun actorAndActivePokemon(pnx: String, battle: PokemonBattle): Pair<BattleActor, ActiveBattlePokemon>? = try {
|
||||
battle.getActorAndActiveSlotFromPNX(pnx)
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private const val SEPARATOR = "|"
|
||||
private const val OPTIONAL_ARG_START = "["
|
||||
private const val OPTIONAL_ARG_END = "]"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.battles.interpreter
|
||||
|
||||
import com.cobblemon.mod.common.api.abilities.Abilities
|
||||
import com.cobblemon.mod.common.api.data.ShowdownIdentifiable
|
||||
import com.cobblemon.mod.common.api.moves.Moves
|
||||
import com.cobblemon.mod.common.battles.interpreter.CobblemonEffect
|
||||
|
||||
/**
|
||||
* A representation of an effect received from Showdown inside a [BattleMessage].
|
||||
*
|
||||
* @author Licious
|
||||
* @since December 31st, 2022
|
||||
*/
|
||||
interface Effect {
|
||||
|
||||
/**
|
||||
* The literal ID of this [Effect].
|
||||
*/
|
||||
val id: String
|
||||
|
||||
/**
|
||||
* The [Effect.Type] of this [Effect].
|
||||
*/
|
||||
val type: Type
|
||||
|
||||
/**
|
||||
* The raw literal data received when parsing this [Effect].
|
||||
*/
|
||||
val rawData: String
|
||||
|
||||
/**
|
||||
* Represents the type of the [Effect].
|
||||
*
|
||||
* @property prefix The literal prefix used to identify the type by the Showdown simulator protocol.
|
||||
*
|
||||
* @author Licious
|
||||
* @since December 31st, 2022
|
||||
*/
|
||||
enum class Type(val prefix: String) {
|
||||
|
||||
ABILITY("ability:"),
|
||||
ITEM("item:"),
|
||||
MOVE("move:"),
|
||||
PURE(""),
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* Creates an [Effect].
|
||||
*
|
||||
* @param id The ID of the effect, this may be validated
|
||||
* @param type The [Effect.Type].
|
||||
* @param rawData The received string in the battle message.
|
||||
* @return An [Effect] containing the given data of the given [type].
|
||||
*/
|
||||
private fun of(id: String, type: Type, rawData: String): Effect = CobblemonEffect(id, type, rawData)
|
||||
|
||||
/**
|
||||
* Creates an [Effect] with type [Effect.Type.ABILITY].
|
||||
*
|
||||
* @param id The ID of the effect, meant to be present in [Abilities].
|
||||
* @param rawData The received string in the battle message.
|
||||
* @return An [Effect] containing the given data of [Effect.Type.ABILITY].
|
||||
*
|
||||
* @throws IllegalArgumentException If the [id] cannot be found in the [Abilities] registry.
|
||||
*/
|
||||
fun ability(id: String, rawData: String): Effect {
|
||||
if (Abilities.get(id) == null) {
|
||||
throw IllegalArgumentException("Cannot instance ability effect with ID $id")
|
||||
}
|
||||
return of(id, Type.ABILITY, rawData)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an [Effect] with type [Effect.Type.ITEM].
|
||||
*
|
||||
* @param id The ID of the effect. This should be trusted as Showdown keeps the held items on their end.
|
||||
* @param rawData The received string in the battle message.
|
||||
* @return An [Effect] containing the given data of [Effect.Type.ITEM].
|
||||
*/
|
||||
fun item(id: String, rawData: String): Effect = of(id, Type.ITEM, rawData)
|
||||
|
||||
/**
|
||||
* Creates an [Effect] with type [Effect.Type.MOVE].
|
||||
*
|
||||
* @param id The ID of the effect, meant to be present in [Moves].
|
||||
* @param rawData The received string in the battle message.
|
||||
* @return An [Effect] containing the given data of [Effect.Type.MOVE].
|
||||
*
|
||||
* @throws IllegalArgumentException If the [id] cannot be found in the [Moves] registry.
|
||||
*/
|
||||
fun move(id: String, rawData: String): Effect {
|
||||
if (Moves.getByName(id) == null) {
|
||||
throw IllegalArgumentException("Cannot instance move effect with ID $id")
|
||||
}
|
||||
return of(id, Type.MOVE, rawData)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a "pure" [Effect].
|
||||
* This is the representation of a purely literal effect by Showdown.
|
||||
*
|
||||
* @param id The ID of the effect.
|
||||
* @param rawData The received string in the battle message.
|
||||
* @return An [Effect] containing the given data of [Effect.Type.PURE].
|
||||
*/
|
||||
fun pure(id: String, rawData: String): Effect = of(id, Type.PURE, rawData)
|
||||
|
||||
/**
|
||||
* Parses an [Effect] from the given [rawData].
|
||||
*
|
||||
* @param rawData The raw data expecting to create an [Effect].
|
||||
* @return The parsed [Effect] or null if the raw data is blank or the parsed effect throws an [IllegalArgumentException].
|
||||
*
|
||||
* @throws IllegalArgumentException if the parsed type doesn't allow the resulting ID.
|
||||
*/
|
||||
fun parse(rawData: String): Effect? {
|
||||
if (rawData.isBlank()) {
|
||||
return null
|
||||
}
|
||||
return try {
|
||||
when {
|
||||
rawData.startsWith(Type.ABILITY.prefix) -> ability(rawData.lowercase().substringAfter(Type.ABILITY.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
|
||||
rawData.startsWith(Type.ITEM.prefix) -> item(rawData.lowercase().substringAfter(Type.ITEM.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
|
||||
rawData.startsWith(Type.MOVE.prefix) -> move(rawData.lowercase().substringAfter(Type.MOVE.prefix).replace(ShowdownIdentifiable.REGEX, ""), rawData)
|
||||
else -> pure(rawData.lowercase().replace(ShowdownIdentifiable.REGEX, ""), rawData)
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+115
-35
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -10,29 +10,33 @@ package com.cobblemon.mod.common.api.battles.model
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.Cobblemon.LOGGER
|
||||
import com.cobblemon.mod.common.Cobblemon.showdown
|
||||
import com.cobblemon.mod.common.CobblemonNetwork
|
||||
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.ActorType
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.EntityBackedBattleActor
|
||||
import com.cobblemon.mod.common.api.battles.model.actor.FleeableBattleActor
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
|
||||
import com.cobblemon.mod.common.api.text.red
|
||||
import com.cobblemon.mod.common.api.text.yellow
|
||||
import com.cobblemon.mod.common.battles.ActiveBattlePokemon
|
||||
import com.cobblemon.mod.common.battles.BattleCaptureAction
|
||||
import com.cobblemon.mod.common.battles.BattleFormat
|
||||
import com.cobblemon.mod.common.battles.BattleRegistry
|
||||
import com.cobblemon.mod.common.battles.BattleSide
|
||||
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
|
||||
import com.cobblemon.mod.common.battles.dispatch.BattleDispatch
|
||||
import com.cobblemon.mod.common.battles.dispatch.DispatchResult
|
||||
import com.cobblemon.mod.common.battles.dispatch.GO
|
||||
import com.cobblemon.mod.common.battles.dispatch.WaitDispatch
|
||||
import com.cobblemon.mod.common.battles.runner.ShowdownService
|
||||
import com.cobblemon.mod.common.net.messages.client.battle.BattleEndPacket
|
||||
import com.cobblemon.mod.common.pokemon.feature.BattleCriticalHitsFeature
|
||||
import com.cobblemon.mod.common.util.DataKeys
|
||||
import com.cobblemon.mod.common.pokemon.evolution.progress.DefeatEvolutionProgress
|
||||
import com.cobblemon.mod.common.util.battleLang
|
||||
import com.cobblemon.mod.common.util.getPlayer
|
||||
import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonObject
|
||||
import com.cobblemon.mod.common.util.party
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import net.minecraft.text.Text
|
||||
@@ -50,12 +54,13 @@ open class PokemonBattle(
|
||||
) {
|
||||
/** Whether or not logging will be silenced for this battle. */
|
||||
var mute = true
|
||||
|
||||
init {
|
||||
side1.battle = this
|
||||
side2.battle = this
|
||||
this.actors.forEach { actor ->
|
||||
actor.pokemonList.forEach { battlePokemon ->
|
||||
battlePokemon.effectedPokemon.getFeature<BattleCriticalHitsFeature>(BattleCriticalHitsFeature.ID)?.reset()
|
||||
battlePokemon.criticalHits = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +89,7 @@ open class PokemonBattle(
|
||||
|
||||
var dispatchResult = GO
|
||||
val dispatches = ConcurrentLinkedQueue<BattleDispatch>()
|
||||
val afterDispatches = mutableListOf<() -> Unit>()
|
||||
|
||||
val captureActions = mutableListOf<BattleCaptureAction>()
|
||||
|
||||
@@ -148,17 +154,8 @@ open class PokemonBattle(
|
||||
}
|
||||
|
||||
fun writeShowdownAction(vararg messages: String) {
|
||||
val jsonArray = JsonArray()
|
||||
for (message in messages) {
|
||||
jsonArray.add(message)
|
||||
}
|
||||
val request = JsonObject()
|
||||
request.addProperty(DataKeys.REQUEST_TYPE, DataKeys.REQUEST_BATTLE_SEND_MESSAGE)
|
||||
request.addProperty(DataKeys.REQUEST_BATTLE_ID, battleId.toString())
|
||||
request.add(DataKeys.REQUEST_MESSAGES, jsonArray)
|
||||
val json = BattleRegistry.gson.toJson(request)
|
||||
log(json)
|
||||
showdown.write(json)
|
||||
log(messages.joinToString("\n"))
|
||||
ShowdownService.get().send(battleId, messages.toList().toTypedArray())
|
||||
}
|
||||
|
||||
fun turn(newTurnNumber: Int) {
|
||||
@@ -175,15 +172,33 @@ open class PokemonBattle(
|
||||
|
||||
fun end() {
|
||||
ended = true
|
||||
for (actor in actors) {
|
||||
for (pokemon in actor.pokemonList.filter { it.health > 0 }) {
|
||||
if (pokemon.facedOpponents.isNotEmpty() /* TODO exp share held item check */) {
|
||||
val experience = Cobblemon.experienceCalculator.calculate(pokemon)
|
||||
if (experience > 0) {
|
||||
actor.awardExperience(pokemon, (experience * Cobblemon.config.experienceMultiplier).toInt())
|
||||
}
|
||||
Cobblemon.evYieldCalculator.calculate(pokemon).forEach { (stat, amount) ->
|
||||
pokemon.originalPokemon.evs.add(stat, amount)
|
||||
this.actors.forEach { actor ->
|
||||
val faintedPokemons = actor.pokemonList.filter { it.health <= 0 }
|
||||
actor.getSide().getOppositeSide().actors.forEach { opponent ->
|
||||
val opponentNonFaintedPokemons = opponent.pokemonList.filter { it.health > 0 }
|
||||
faintedPokemons.forEach { faintedPokemon ->
|
||||
for (opponentPokemon in opponentNonFaintedPokemons) {
|
||||
val facedFainted = opponentPokemon.facedOpponents.contains(faintedPokemon)
|
||||
val defeatProgress = DefeatEvolutionProgress()
|
||||
val pokemon = opponentPokemon.effectedPokemon
|
||||
if (facedFainted && defeatProgress.shouldKeep(pokemon)) {
|
||||
val progress = pokemon.evolutionProxy.current().progressFirstOrCreate({ it is DefeatEvolutionProgress && it.currentProgress().target.matches(faintedPokemon.effectedPokemon) }) { defeatProgress }
|
||||
progress.updateProgress(DefeatEvolutionProgress.Progress(progress.currentProgress().target, progress.currentProgress().amount + 1))
|
||||
}
|
||||
val multiplier = when {
|
||||
// ToDo when Exp. All is implement if enabled && !facedFainted return 2.0, probably should be a configurable value too, this will have priority over the Exp. Share
|
||||
!facedFainted && pokemon.heldItemNoCopy().isIn(CobblemonItemTags.EXPERIENCE_SHARE) -> Cobblemon.config.experienceShareMultiplier
|
||||
// ToDo when Exp. All is implemented the facedFainted and else can be collapsed into the 1.0 return value
|
||||
facedFainted -> 1.0
|
||||
else -> continue
|
||||
}
|
||||
val experience = Cobblemon.experienceCalculator.calculate(opponentPokemon, faintedPokemon, multiplier)
|
||||
if (experience > 0) {
|
||||
opponent.awardExperience(opponentPokemon, experience)
|
||||
}
|
||||
Cobblemon.evYieldCalculator.calculate(opponentPokemon).forEach { (stat, amount) ->
|
||||
pokemon.evs.add(stat, amount)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,6 +223,20 @@ open class PokemonBattle(
|
||||
sendSpectatorUpdate(packet)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a packet depending on the side of an actor.
|
||||
*
|
||||
* @param source The actor that triggered the necessity for this update.
|
||||
* @param allyPacket The packet sent to the [source] and their allies.
|
||||
* @param opponentPacket The packet sent to the opposing actors.
|
||||
* @param spectatorsAsAlly If the spectators receive the [allyPacket] or the [opponentPacket], default is false.
|
||||
*/
|
||||
fun sendSidedUpdate(source: BattleActor, allyPacket: NetworkPacket, opponentPacket: NetworkPacket, spectatorsAsAlly: Boolean = false) {
|
||||
source.getSide().actors.forEach { it.sendUpdate(allyPacket) }
|
||||
source.getSide().getOppositeSide().actors.forEach { it.sendUpdate(opponentPacket) }
|
||||
sendSpectatorUpdate(if (spectatorsAsAlly) allyPacket else opponentPacket)
|
||||
}
|
||||
|
||||
fun sendToActors(packet: NetworkPacket) {
|
||||
CobblemonNetwork.sendToPlayers(actors.flatMap { it.getPlayerUUIDs().mapNotNull { it.getPlayer() } }, packet)
|
||||
}
|
||||
@@ -232,6 +261,13 @@ open class PokemonBattle(
|
||||
}
|
||||
}
|
||||
|
||||
fun dispatchWaiting(delaySeconds: Float = 1F, dispatcher: () -> Unit) {
|
||||
dispatch {
|
||||
dispatcher()
|
||||
WaitDispatch(delaySeconds)
|
||||
}
|
||||
}
|
||||
|
||||
fun dispatchInsert(dispatcher: () -> Iterable<BattleDispatch>) {
|
||||
dispatch {
|
||||
val newDispatches = dispatcher()
|
||||
@@ -247,12 +283,21 @@ open class PokemonBattle(
|
||||
dispatches.add(dispatcher)
|
||||
}
|
||||
|
||||
fun doWhenClear(action: () -> Unit) {
|
||||
afterDispatches.add(action)
|
||||
}
|
||||
|
||||
fun tick() {
|
||||
while (dispatchResult.canProceed()) {
|
||||
val dispatch = dispatches.poll() ?: break
|
||||
dispatchResult = dispatch(this)
|
||||
}
|
||||
|
||||
if (dispatches.isEmpty()) {
|
||||
afterDispatches.toList().forEach { it() }
|
||||
afterDispatches.clear()
|
||||
}
|
||||
|
||||
if (started && isPvW && !ended) {
|
||||
checkFlee()
|
||||
}
|
||||
@@ -264,15 +309,18 @@ open class PokemonBattle(
|
||||
.filterIsInstance<FleeableBattleActor>()
|
||||
.filter { it.getWorldAndPosition() != null }
|
||||
.none { pokemonActor ->
|
||||
val (world, pos) = pokemonActor.getWorldAndPosition()!!
|
||||
val nearestPlayerActorDistance = actors
|
||||
.filter { it.type == ActorType.PLAYER }
|
||||
.filterIsInstance<EntityBackedBattleActor<*>>()
|
||||
.mapNotNull { it.entity }
|
||||
.filter { it.world == world }
|
||||
.minOfOrNull { pos.distanceTo(it.pos) }
|
||||
if (pokemonActor.fleeDistance == -1F) true
|
||||
else {
|
||||
val (world, pos) = pokemonActor.getWorldAndPosition()!!
|
||||
val nearestPlayerActorDistance = actors.asSequence()
|
||||
.filter { it.type == ActorType.PLAYER }
|
||||
.filterIsInstance<EntityBackedBattleActor<*>>()
|
||||
.mapNotNull { it.entity }
|
||||
.filter { it.world == world }
|
||||
.minOfOrNull { pos.distanceTo(it.pos) }
|
||||
|
||||
nearestPlayerActorDistance != null && nearestPlayerActorDistance < pokemonActor.fleeDistance
|
||||
nearestPlayerActorDistance != null && nearestPlayerActorDistance < pokemonActor.fleeDistance
|
||||
}
|
||||
}
|
||||
|
||||
if (wildPokemonOutOfRange) {
|
||||
@@ -293,4 +341,36 @@ open class PokemonBattle(
|
||||
actors.forEach { it.responses.clear() ; it.request = null }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a [Text] representation of an error to interpret a battle message.
|
||||
* This also logs the error, the goal of this function is to make sure users see missing interpretations and report them to us.
|
||||
* Logging is independent of [mute].
|
||||
*
|
||||
* @param message The [BattleMessage] that wasn't able to find a lang interpretation.
|
||||
* @return The generated [Text] meant to notify the client.
|
||||
*/
|
||||
internal fun createUnimplemented(message: BattleMessage): Text {
|
||||
LOGGER.error("Missing interpretation on '{}' action {}", message.id, message.rawMessage)
|
||||
return Text.literal("Missing interpretation on '${message.id}' action ${message.rawMessage}").red()
|
||||
}
|
||||
|
||||
/**
|
||||
* A variant of [createUnimplemented].
|
||||
* This will log both the public and private message however the clients will no longer receive the full raw message in order to prevent extra information they shouldn't see.
|
||||
*
|
||||
* @param publicMessage The public variant of [BattleMessage] that wasn't able to find a lang interpretation.
|
||||
* @param privateMessage The private variant of [BattleMessage] that wasn't able to find a lang interpretation.
|
||||
* @return The generated [Text] meant to notify the client.
|
||||
*
|
||||
* @throws IllegalArgumentException if the [publicMessage] and [privateMessage] don't have a matching [BattleMessage.id].
|
||||
*/
|
||||
internal fun createUnimplementedSplit(publicMessage: BattleMessage, privateMessage: BattleMessage): Text {
|
||||
if (publicMessage.id != privateMessage.id) {
|
||||
throw IllegalArgumentException("Messages do not match")
|
||||
}
|
||||
LOGGER.error("Missing interpretation on '{}' action: \nPublic » {}\nPrivate » {}", publicMessage.id, publicMessage.rawMessage, privateMessage.rawMessage)
|
||||
return Text.literal("Missing interpretation on '${publicMessage.id}' action please report to the developers").red()
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+11
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -115,6 +115,16 @@ abstract class BattleActor(
|
||||
}
|
||||
|
||||
abstract fun getName(): MutableText
|
||||
|
||||
/**
|
||||
* Appends the given name to this owner as the prefix.
|
||||
* NPC and player actors expect to append their [getName] while wild Pokémon append nothing.
|
||||
*
|
||||
* @param name The name of an object being appended, typically a Pokémon nickname received from showdown.
|
||||
* @return A [MutableText] of the [name] append with owner prefix.
|
||||
*/
|
||||
abstract fun nameOwned(name: String): MutableText
|
||||
|
||||
open fun sendMessage(component: Text) {
|
||||
sendUpdate(BattleMessagePacket(component))
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.codec
|
||||
|
||||
import com.mojang.datafixers.util.Pair
|
||||
import com.mojang.serialization.Codec
|
||||
import com.mojang.serialization.DataResult
|
||||
import com.mojang.serialization.DynamicOps
|
||||
import com.mojang.serialization.codecs.PrimitiveCodec
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder
|
||||
import net.minecraft.network.PacketByteBuf
|
||||
|
||||
class MappedCodec<A : CodecMapped, K>(
|
||||
val codecRetriever: (K) -> Codec<out A>,
|
||||
val keyName: String = "type",
|
||||
val keyFromString: (String) -> K
|
||||
) : Codec<A> {
|
||||
override fun <T> encode(input: A, ops: DynamicOps<T>, prefix: T): DataResult<T> {
|
||||
return input.encode(ops)
|
||||
}
|
||||
|
||||
override fun <T> decode(ops: DynamicOps<T>, input: T): DataResult<Pair<A, T>> {
|
||||
val thingCodec: Codec<ThingWithType> = RecordCodecBuilder.create { instance ->
|
||||
instance
|
||||
.group(PrimitiveCodec.STRING.fieldOf(keyName).forGetter { it.string })
|
||||
.apply(instance, ::ThingWithType)
|
||||
}
|
||||
val thingWithType = thingCodec.decode(ops, input).map { it.first }
|
||||
val key = thingWithType.get().left().get().string
|
||||
val codec = codecRetriever(keyFromString(key))
|
||||
return codec.decode(ops, input).map { Pair(it.first, it.second) }
|
||||
}
|
||||
}
|
||||
|
||||
private class ThingWithType(val string: String)
|
||||
|
||||
interface CodecMapped {
|
||||
fun <T> encode(ops: DynamicOps<T>): DataResult<T>
|
||||
fun readFromBuffer(buffer: PacketByteBuf)
|
||||
fun writeToBuffer(buffer: PacketByteBuf)
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.data
|
||||
|
||||
import com.cobblemon.mod.common.api.codec.CodecMapped
|
||||
import com.cobblemon.mod.common.api.codec.MappedCodec
|
||||
import com.mojang.serialization.Codec
|
||||
import java.lang.IllegalArgumentException
|
||||
import net.minecraft.network.PacketByteBuf
|
||||
|
||||
/**
|
||||
* A utility class to help give Codec support for map adapted class hierarchies.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since January 21st, 2023
|
||||
*/
|
||||
abstract class ArbitrarilyMappedSerializableCompanion<T : CodecMapped, K>(
|
||||
val keyFromString: (String) -> K,
|
||||
val stringFromKey: (K) -> String,
|
||||
val keyFromValue: (T) -> K
|
||||
) {
|
||||
val codec: MappedCodec<T, K> = MappedCodec(codecRetriever = { subtypes[it]!!.codec }, keyFromString = keyFromString)
|
||||
private val subtypes = mutableMapOf<K, RegisteredSubtype<out T>>()
|
||||
|
||||
fun <E : T> registerSubtype(key: K, clazz: Class<E>, codec: Codec<E>) {
|
||||
subtypes[key] = RegisteredSubtype(clazz, codec)
|
||||
}
|
||||
|
||||
fun writeToBuffer(buffer: PacketByteBuf, value: T) {
|
||||
val typeString = stringFromKey(keyFromValue(value))
|
||||
buffer.writeString(typeString)
|
||||
value.writeToBuffer(buffer)
|
||||
}
|
||||
|
||||
fun readFromBuffer(buffer: PacketByteBuf): T {
|
||||
val typeString = buffer.readString()
|
||||
val clazz = subtypes[keyFromString(typeString)]?.clazz ?: throw IllegalArgumentException("Unrecognized subtype: $typeString")
|
||||
val value = clazz.getDeclaredConstructor().newInstance()
|
||||
value.readFromBuffer(buffer)
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
class RegisteredSubtype<T>(val clazz: Class<out T>, val codec: Codec<out T>)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.data
|
||||
|
||||
/**
|
||||
* Represents an object that has a showdown ID attached to itself.
|
||||
*
|
||||
* @author Licious
|
||||
* @since January 28th, 2022
|
||||
*/
|
||||
interface ShowdownIdentifiable {
|
||||
|
||||
/**
|
||||
* Converts the implementation to literal Showdown ID.
|
||||
*
|
||||
* @return The literal Showdown ID.
|
||||
*/
|
||||
fun showdownId(): String
|
||||
|
||||
companion object {
|
||||
|
||||
internal val REGEX = Regex("[^a-z0-9]+")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -16,4 +16,5 @@ interface PokemonSideDelegate : EntitySideDelegate<PokemonEntity> {
|
||||
fun changePokemon(pokemon: Pokemon)
|
||||
fun drop(source: DamageSource?) {}
|
||||
fun updatePostDeath() {}
|
||||
fun handleStatus(status: Byte) {}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -11,6 +11,11 @@ package com.cobblemon.mod.common.api.events
|
||||
import com.cobblemon.mod.common.api.events.battles.BattleVictoryEvent
|
||||
import com.cobblemon.mod.common.api.events.drops.LootDroppedEvent
|
||||
import com.cobblemon.mod.common.api.events.entity.EntityAttributeEvent
|
||||
import com.cobblemon.mod.common.api.events.entity.PokemonEntityLoadEvent
|
||||
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveEvent
|
||||
import com.cobblemon.mod.common.api.events.entity.PokemonEntitySaveToWorldEvent
|
||||
import com.cobblemon.mod.common.api.events.farming.ApricornHarvestEvent
|
||||
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent
|
||||
import com.cobblemon.mod.common.api.events.net.MessageBuiltEvent
|
||||
import com.cobblemon.mod.common.api.events.pokemon.ExperienceGainedPostEvent
|
||||
import com.cobblemon.mod.common.api.events.pokemon.ExperienceGainedPreEvent
|
||||
@@ -24,6 +29,7 @@ import com.cobblemon.mod.common.api.events.pokemon.evolution.EvolutionCompleteEv
|
||||
import com.cobblemon.mod.common.api.events.pokemon.evolution.EvolutionDisplayEvent
|
||||
import com.cobblemon.mod.common.api.events.pokemon.interaction.ExperienceCandyUseEvent
|
||||
import com.cobblemon.mod.common.api.events.starter.StarterChosenEvent
|
||||
import com.cobblemon.mod.common.api.events.storage.ReleasePokemonEvent
|
||||
import com.cobblemon.mod.common.api.reactive.CancelableObservable
|
||||
import com.cobblemon.mod.common.api.reactive.EventObservable
|
||||
import com.cobblemon.mod.common.api.reactive.SimpleObservable
|
||||
@@ -42,41 +48,86 @@ import net.minecraft.entity.LivingEntity
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
|
||||
object CobblemonEvents {
|
||||
@JvmField
|
||||
val MESSAGE_BUILT = EventObservable<MessageBuiltEvent<*>>()
|
||||
@JvmField
|
||||
val DATA_SYNCHRONIZED = SimpleObservable<ServerPlayerEntity>()
|
||||
@JvmField
|
||||
val ENTITY_ATTRIBUTE = EventObservable<EntityAttributeEvent>()
|
||||
@JvmField
|
||||
val SHOULDER_MOUNT = CancelableObservable<ShoulderMountEvent>()
|
||||
@JvmField
|
||||
val FRIENDSHIP_UPDATED = EventObservable<FriendshipUpdatedEvent>()
|
||||
@JvmField
|
||||
val POKEMON_FAINTED = EventObservable<PokemonFaintedEvent>()
|
||||
@JvmField
|
||||
val EVOLUTION_ACCEPTED = CancelableObservable<EvolutionAcceptedEvent>()
|
||||
@JvmField
|
||||
val EVOLUTION_DISPLAY = EventObservable<EvolutionDisplayEvent>()
|
||||
@JvmField
|
||||
val EVOLUTION_COMPLETE = EventObservable<EvolutionCompleteEvent>()
|
||||
|
||||
@JvmField
|
||||
val POKEMON_CAPTURED = EventObservable<PokemonCapturedEvent>()
|
||||
// @JvmField
|
||||
// val EGG_HATCH = EventObservable<HatchEggEvent>()
|
||||
@JvmField
|
||||
val BATTLE_VICTORY = EventObservable<BattleVictoryEvent>()
|
||||
|
||||
@JvmField
|
||||
val LEVEL_UP_EVENT = EventObservable<LevelUpEvent>()
|
||||
|
||||
@JvmField
|
||||
val POKEMON_ENTITY_SAVE = EventObservable<PokemonEntitySaveEvent>()
|
||||
@JvmField
|
||||
val POKEMON_ENTITY_LOAD = CancelableObservable<PokemonEntityLoadEvent>()
|
||||
@JvmField
|
||||
val POKEMON_ENTITY_SAVE_TO_WORLD = CancelableObservable<PokemonEntitySaveToWorldEvent>()
|
||||
|
||||
@JvmField
|
||||
val EXPERIENCE_GAINED_EVENT_PRE = CancelableObservable<ExperienceGainedPreEvent>()
|
||||
@JvmField
|
||||
val EXPERIENCE_GAINED_EVENT_POST = EventObservable<ExperienceGainedPostEvent>()
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_USE_PRE = CancelableObservable<ExperienceCandyUseEvent.Pre>()
|
||||
@JvmField
|
||||
val EXPERIENCE_CANDY_USE_POST = EventObservable<ExperienceCandyUseEvent.Post>()
|
||||
|
||||
@JvmField
|
||||
val POKEMON_RELEASED_EVENT_PRE = CancelableObservable<ReleasePokemonEvent.Pre>()
|
||||
@JvmField
|
||||
val POKEMON_RELEASED_EVENT_POST = EventObservable<ReleasePokemonEvent.Post>()
|
||||
|
||||
@JvmField
|
||||
val LOOT_DROPPED = CancelableObservable<LootDroppedEvent>()
|
||||
@JvmField
|
||||
val STARTER_CHOSEN = CancelableObservable<StarterChosenEvent>()
|
||||
|
||||
@JvmField
|
||||
val APRICORN_HARVESTED = EventObservable<ApricornHarvestEvent>()
|
||||
@JvmField
|
||||
val LEFTOVERS_CREATED = CancelableObservable<LeftoversCreatedEvent>()
|
||||
|
||||
@JvmField
|
||||
val SERVER_STARTING = LifecycleEvent.SERVER_STARTING.asServerObservable()
|
||||
@JvmField
|
||||
val SERVER_STOPPING = LifecycleEvent.SERVER_STOPPING.asServerObservable()
|
||||
|
||||
@JvmField
|
||||
val SERVER_STARTED = LifecycleEvent.SERVER_STARTED.asServerObservable()
|
||||
@JvmField
|
||||
val SERVER_STOPPED = LifecycleEvent.SERVER_STOPPED.asServerObservable()
|
||||
|
||||
@JvmField
|
||||
val TICK_PRE = TickEvent.SERVER_PRE.asTickObservable()
|
||||
@JvmField
|
||||
val TICK_POST = TickEvent.SERVER_POST.asTickObservable()
|
||||
|
||||
@JvmField
|
||||
val PLAYER_JOIN = PlayerEvent.PLAYER_JOIN.asObservable<PlayerJoin, ServerPlayerEntity> { obs -> PlayerJoin { obs.emit(it) } }
|
||||
@JvmField
|
||||
val PLAYER_QUIT = PlayerEvent.PLAYER_QUIT.asObservable<PlayerQuit, ServerPlayerEntity> { obs -> PlayerQuit { obs.emit(it) } }
|
||||
|
||||
@JvmField
|
||||
val LIVING_DEATH = EntityEvent.LIVING_DEATH.asObservable<LivingDeath, LivingEntity> { obs -> LivingDeath { entity, source -> obs.emit(entity); EventResult.pass() } }
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.events.entity
|
||||
|
||||
import com.cobblemon.mod.common.api.events.Cancelable
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import net.minecraft.nbt.NbtCompound
|
||||
|
||||
/**
|
||||
* An event fired when a [PokemonEntity] is being loaded from NBT. This could be from sending a Pokémon
|
||||
* through a portal or saved into the world. Subscribers to this event should read from the NBT and apply
|
||||
* any changes that are relevant to the entity.
|
||||
*
|
||||
* Cancelling this event will dispose of the Pokémon after it loads. Use this when the existence of this
|
||||
* entity is no longer appropriate, such as if it was an event Pokémon that has expired.
|
||||
*
|
||||
* @property pokemonEntity The entity being loaded from NBT. All other native loading has been done by this time.
|
||||
* @property nbt The NBT the entity is being loaded from.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since January 7th, 2022
|
||||
*/
|
||||
data class PokemonEntityLoadEvent(val pokemonEntity: PokemonEntity, val nbt: NbtCompound) : Cancelable()
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.events.entity
|
||||
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import net.minecraft.nbt.NbtCompound
|
||||
|
||||
/**
|
||||
* Event fired when a Pokémon is being saved to NBT. This could be for
|
||||
* teleporting across worlds or for saving to the world or probably other
|
||||
* things.
|
||||
*
|
||||
* This event exists so that you can save additional information about a
|
||||
* Pokémon into entity NBT so that you can handle the [PokemonEntityLoadEvent]
|
||||
* later and restore that unique state. For example, an entity might be some
|
||||
* kind of boss, and you want to restore those properties after a world
|
||||
* reload.
|
||||
*
|
||||
* @property pokemonEntity The Pokémon entity being saved.
|
||||
* @property nbt The [NbtCompound] that the Pokémon is being saved to.
|
||||
* You should add or remove from this for whatever you
|
||||
* want to accomplish. The existing contents will be all
|
||||
* of what Cobblemon saves natively.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since January 6th, 2023
|
||||
*/
|
||||
data class PokemonEntitySaveEvent(val pokemonEntity: PokemonEntity, val nbt: NbtCompound)
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.events.entity
|
||||
|
||||
import com.cobblemon.mod.common.api.events.Cancelable
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
|
||||
/**
|
||||
* Event fired when a Pokémon is about to be saved to the world. Cancel this event if the Pokémon
|
||||
* should not be saved to the world.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since January 7th, 2022
|
||||
*/
|
||||
class PokemonEntitySaveToWorldEvent(val pokemonEntity: PokemonEntity) : Cancelable()
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.events.farming
|
||||
|
||||
import net.minecraft.block.BlockState
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
import net.minecraft.server.world.ServerWorld
|
||||
import net.minecraft.util.math.BlockPos
|
||||
|
||||
/**
|
||||
* Event fired when an Apricorn is harvested.
|
||||
*/
|
||||
class ApricornHarvestEvent(
|
||||
val player: ServerPlayerEntity,
|
||||
val world: ServerWorld,
|
||||
val pos: BlockPos
|
||||
) {
|
||||
fun getBlock(): BlockState {
|
||||
return world.getBlockState(pos)
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.events.item
|
||||
|
||||
import com.cobblemon.mod.common.api.events.Cancelable
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.server.network.ServerPlayerEntity
|
||||
|
||||
/**
|
||||
* Fired when eating an apple triggers the creation of a Leftovers. The stack that will be given
|
||||
* can be changed via [leftovers]. Cancelling the event will prevent a Leftovers from being given.
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since March 11th, 2023
|
||||
*/
|
||||
class LeftoversCreatedEvent(val playerEntity: ServerPlayerEntity, var leftovers: ItemStack) : Cancelable()
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -15,7 +15,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon
|
||||
|
||||
/**
|
||||
* Event fired when experience is about to be gained. Cancelling this event prevents
|
||||
* any experience being added, and the amount of experience cna be hcanged from [experience].
|
||||
* any experience being added, and the amount of experience can be changed from [experience].
|
||||
*
|
||||
* @author Hiroku
|
||||
* @since August 5th, 2022
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Cobblemon Contributors
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user