mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Compare commits
765 Commits
Author | SHA1 | Date | |
---|---|---|---|
3aa58f54dc | |||
5c12a95151 | |||
5f07c5df1c | |||
5f33ef35e3 | |||
ec949840b2 | |||
e45e84b236 | |||
dfe68c9788 | |||
35b8f0bf25 | |||
d4dc1c8a0c | |||
517f9a3c3a | |||
636c35dcf1 | |||
d22f0da1de | |||
310de5a2b2 | |||
f84abcd1fe | |||
b5dd147ec7 | |||
0dd68e587f | |||
330e93e5e3 | |||
2020fcd18e | |||
456d9a722a | |||
344c980cff | |||
167492087f | |||
db215283a2 | |||
6a507bb149 | |||
a72e6ee706 | |||
89ea7f0a76 | |||
a6ca37429c | |||
4bf9fb278b | |||
15d81154e6 | |||
93e5c80962 | |||
7aa8bd18d3 | |||
53067c26d7 | |||
04581e2700 | |||
93597dcd50 | |||
778814a35e | |||
3cd1da196a | |||
365d4a1592 | |||
2d7f37ac47 | |||
50fcdd6e7e | |||
10317527e4 | |||
46ac4cbca1 | |||
cb9e79b398 | |||
2f1fad2745 | |||
44182dccbd | |||
2f3d2d4a0b | |||
8ac7f7f11f | |||
dbe7caab7b | |||
b581fab31a | |||
7b7dfc36d1 | |||
d63d6b73f6 | |||
a860ccd259 | |||
2bb497b716 | |||
613bd40601 | |||
398b636759 | |||
1257378198 | |||
758a68aa2c | |||
bfce478e72 | |||
681dd469a2 | |||
3edbea8545 | |||
ada8cbb545 | |||
0ac5e03ce9 | |||
9b02b8e51e | |||
6c7dada232 | |||
25bc95cd1e | |||
213bf8366a | |||
4e693e91e6 | |||
a1622fa345 | |||
0ec869932f | |||
79acaa3253 | |||
da3742b39e | |||
d26fcf7dee | |||
812424a619 | |||
1bdc61dd5f | |||
86fc33fe26 | |||
70eb41470c | |||
3a5709bf5e | |||
5ad66c3c9b | |||
7885b54824 | |||
532dc0fb6f | |||
54ccc330d5 | |||
e12618c705 | |||
7d5f2eac8d | |||
e964dd2ca8 | |||
dbb594f130 | |||
8f434b9edd | |||
34972c3327 | |||
037c34d961 | |||
4518d9d9ce | |||
1a5228e7a6 | |||
495bfda044 | |||
41b1fa7b48 | |||
e689fd545b | |||
889cd5e206 | |||
e1ddf90695 | |||
2f325b8c91 | |||
ac4f00be81 | |||
914450c30b | |||
25554f0d61 | |||
e1a61cb51a | |||
fe5620f097 | |||
faef4e8736 | |||
0d19f6c968 | |||
ecf662bf74 | |||
8cba2e0346 | |||
dfc8a6ffdd | |||
262728b091 | |||
4572ec8175 | |||
0f6949ac34 | |||
df8e0cf1f5 | |||
ad87c11ae1 | |||
fa82cb26d8 | |||
fd2a7797bd | |||
e5a2cfb65f | |||
b96bb7d824 | |||
896cca0778 | |||
59cf8e95f0 | |||
99038c752c | |||
88afedd1e8 | |||
c43e21235d | |||
3f7e7352fb | |||
32d6ea0fba | |||
28c787371a | |||
dba14c9f08 | |||
0e35ee8cb7 | |||
da5b7f47df | |||
d418dd7a09 | |||
f3209ccc33 | |||
4a4c28cd8c | |||
eba8d77034 | |||
13e4772f98 | |||
4bc2f28c6d | |||
663469dfa7 | |||
963abb718f | |||
1f2fb73297 | |||
ff55b520b9 | |||
cedd8abf0c | |||
496732999c | |||
6a8105f5a0 | |||
0a566f8218 | |||
829dd02eea | |||
b11c350b2b | |||
f624e36faf | |||
14ce9c10bb | |||
b27aaaeeb2 | |||
f1083bd9c4 | |||
199fa61aef | |||
af82a6bbe1 | |||
004f7ef82e | |||
89ebd2b880 | |||
799183e13e | |||
260ac47588 | |||
4ff4434a22 | |||
5d8bb84269 | |||
9eebfa7cc3 | |||
d3021c6281 | |||
9097d6c4d3 | |||
da43ae82fe | |||
60b405d944 | |||
92a752053d | |||
0537c66849 | |||
d94995e161 | |||
58bc08838b | |||
fc0619ee6e | |||
a5764b3ae9 | |||
8bf469f7fc | |||
3b9a5c5ccc | |||
4c36ca58e2 | |||
a67fa5c007 | |||
839a789180 | |||
e61c3e8bf6 | |||
7ce6c8aa13 | |||
9abcc99c10 | |||
5c8a625d88 | |||
259f0425a9 | |||
9cdea43794 | |||
e007fad5b8 | |||
5cf2fcbbb7 | |||
9e6cbb5b6a | |||
64b3d02974 | |||
640df1003c | |||
2b402e525a | |||
e2871fad8e | |||
41d02003c2 | |||
156ecd9bd8 | |||
fa7736efbb | |||
d71a7ff2fa | |||
8184a6b114 | |||
b8d44ff162 | |||
f6611a38bc | |||
24ed823d96 | |||
f624871b3f | |||
9cd6b3e1c7 | |||
aad1eb5b3e | |||
bff5bf25ae | |||
cda90fd7f1 | |||
9f44adf04a | |||
c4793241f5 | |||
7532c609fb | |||
13f28d8454 | |||
5a97c378fc | |||
e5d62ec901 | |||
cfd975009e | |||
73257ffde7 | |||
8252bea699 | |||
ea935a1af5 | |||
e8a5fa8a37 | |||
db734675d8 | |||
6ede56015d | |||
5334099fbf | |||
82e9072223 | |||
2c11742f9e | |||
bd4a63b668 | |||
cd36af46bf | |||
aa7d55e21d | |||
31e8efa6d1 | |||
facca13139 | |||
fffeeddca6 | |||
e6ba3ce8a6 | |||
11cae2f0c0 | |||
f5a18df835 | |||
1cc7027f92 | |||
8776b71d63 | |||
0b9d0f3cdc | |||
e419d76367 | |||
36cde9f352 | |||
05c602a044 | |||
0db7e57a15 | |||
205e47c0c4 | |||
e328d00cca | |||
ccbcc14600 | |||
e544bc0d4b | |||
fd27227cc7 | |||
b42966f61b | |||
ca86ec2ec2 | |||
97b6183404 | |||
0587d03c03 | |||
c7f1b605f2 | |||
f069df65a8 | |||
1e624e7bb9 | |||
f16a530849 | |||
7137b8a8a4 | |||
ab57914322 | |||
260869c0d5 | |||
9135877da1 | |||
07cb603231 | |||
f59094e6d6 | |||
d8acae5495 | |||
239fe909be | |||
c22576a266 | |||
bac788fd00 | |||
f6d96c5827 | |||
b1458db47b | |||
2d2c9379cd | |||
3400771770 | |||
e12ecaf629 | |||
1303cbfe02 | |||
ad4a211cba | |||
d1e56c4611 | |||
d9bbab54f4 | |||
07cf4eb7a9 | |||
50a7663369 | |||
651ef500a3 | |||
30f2e75278 | |||
2cfc25b4f8 | |||
5bded9cff8 | |||
5816ff85ba | |||
8f7d8347ee | |||
3614d9a78d | |||
818d0e19ab | |||
17720041a3 | |||
c329ff7d4f | |||
8794292788 | |||
0a39e580e9 | |||
c4580dd56d | |||
fab81d28bc | |||
039478223e | |||
64b5db4bf2 | |||
c85f4256c7 | |||
1192b8bdf1 | |||
6dcd2a4ece | |||
3fff0a0656 | |||
e1e1bfa5e3 | |||
1eedac87b2 | |||
cda3e6f4dc | |||
e6a58e2690 | |||
27350c4673 | |||
0d5704b156 | |||
f355044626 | |||
4794ba236a | |||
6490a49c70 | |||
5cd7e11b29 | |||
08e3b8ffdc | |||
9232f4509c | |||
cef77907c6 | |||
06ec8b8397 | |||
ee08286eca | |||
a83211f96a | |||
0b3c4ee496 | |||
54de518634 | |||
a908197907 | |||
3e23a568ca | |||
dadc5c1b87 | |||
a37d740111 | |||
2de0ec02ba | |||
d83820477f | |||
8726604899 | |||
9cbe378e8c | |||
494660102e | |||
216138a37e | |||
b08c38f8f9 | |||
911b6feaf9 | |||
2cb6990698 | |||
f7d66613df | |||
95c32d26df | |||
9e1f6a2486 | |||
76994f15ac | |||
cf73d74bd0 | |||
37a8d95464 | |||
9a4b72add5 | |||
919534d978 | |||
cb598155a4 | |||
00888fdc55 | |||
77795ae3bc | |||
f39fc7e525 | |||
77f7595e0e | |||
e8d3a25028 | |||
1370930ea9 | |||
70c3008b7b | |||
46930b98b7 | |||
92be8c8ec0 | |||
62069bc7af | |||
26230c1f9b | |||
a9fafbc5eb | |||
b8778cb791 | |||
73c5fe5cf9 | |||
b3cfa5a3a0 | |||
6127a02a8b | |||
dbca36e5e2 | |||
1171bae691 | |||
494f8e8251 | |||
3c9af56e06 | |||
40a2211a5a | |||
0196aa21d7 | |||
833f3e574b | |||
a386ff8ce7 | |||
e6c3b0fc0d | |||
9568364277 | |||
73d4ff6b52 | |||
7e98aa1497 | |||
f00c69c513 | |||
50a4c42f3f | |||
6b61efcfc8 | |||
1a99938e4b | |||
a4d68fb32b | |||
5682cc8d53 | |||
4eb59c0372 | |||
3486db3f1b | |||
733d530ed0 | |||
c10ce84035 | |||
82d9e481d2 | |||
d27c7f7141 | |||
394c999710 | |||
6399dacba7 | |||
b6bbf655d7 | |||
3d2c018442 | |||
da8c54cf8b | |||
8e984a1bc3 | |||
124e60301a | |||
4d13c48e5c | |||
9159e8f002 | |||
f5aa461945 | |||
16817ff301 | |||
18863b1098 | |||
e3cffca34b | |||
d20d9fb689 | |||
7b1ae2a822 | |||
8ecf5e02b9 | |||
39c607cbd5 | |||
d867ffc60d | |||
c57eb26fd5 | |||
c35d91a104 | |||
9fc260fb1a | |||
73d0f799c2 | |||
ecb2e6e3af | |||
7b75b6928d | |||
753a8a6937 | |||
bc76b1cafe | |||
00e415fc79 | |||
dbbe1f2d5c | |||
740f0a2314 | |||
7fdfe947b0 | |||
b7c4379700 | |||
20b7418916 | |||
85521f5e7a | |||
f37ea6a203 | |||
abf8081ebc | |||
8594cb3e74 | |||
d155de35ed | |||
e37c8e3a5d | |||
e38c0c0fe1 | |||
ce27c03774 | |||
c4a8781b5c | |||
dbab8b5733 | |||
2b08bbc7b1 | |||
17037f5e9c | |||
fee3c17148 | |||
25e6cb74b3 | |||
8d2e59222e | |||
cd778661c2 | |||
c2afc05e7c | |||
9be95bf263 | |||
4b65e1cbe1 | |||
5caae37768 | |||
92e1811b06 | |||
293c2710d0 | |||
8a7017fd6b | |||
15f8886958 | |||
3226a9dc6a | |||
1a1e3ff63b | |||
ea413d0882 | |||
0890b5fc99 | |||
163ed225f2 | |||
a4a6d3e094 | |||
ecbf3e9722 | |||
47a959dace | |||
3968f85c82 | |||
d8188b807a | |||
8e68655fc7 | |||
6d109bfc6f | |||
b7a5a53c9d | |||
76bd0f452c | |||
363556e9b6 | |||
6f08853b29 | |||
42d8357821 | |||
f2ac63d235 | |||
5d17405b92 | |||
3dd53ad998 | |||
a303c4b294 | |||
fa56290bb4 | |||
01d6cbe9c3 | |||
f682c16740 | |||
74c09dc202 | |||
0917b67573 | |||
5cb0eafcb2 | |||
221e6db47d | |||
8d06018d81 | |||
600e16d9f6 | |||
4340349db7 | |||
6105198313 | |||
c96ba13c23 | |||
c8d0cb315b | |||
be9c413a9e | |||
3e4366b30d | |||
7f3460190b | |||
10d44292e1 | |||
70f81334ae | |||
ead572fab9 | |||
ef8e286277 | |||
ba5a5981a0 | |||
c428596009 | |||
a81d8dd6d5 | |||
5bcbef90ea | |||
1c67f094e3 | |||
99d350914e | |||
49a9e0a880 | |||
7b152def7d | |||
3eb78fb0ff | |||
38c759c86e | |||
314ce1d012 | |||
7fcd40df15 | |||
ba39327b28 | |||
8d2e3894ef | |||
8ee0fbccc5 | |||
fe4354959b | |||
19377c86a4 | |||
fb23aade34 | |||
57e9fe78a3 | |||
6b97281c58 | |||
da67a085fc | |||
e2fc7cdf88 | |||
635bb08fb9 | |||
308d9ce3a8 | |||
5a76c38363 | |||
54530da6c1 | |||
dd55a0bccd | |||
f03bd982b5 | |||
025cb73bf5 | |||
2a6ffb5aa9 | |||
d53b84386f | |||
a7ed933b37 | |||
29cc9283f8 | |||
e60962c31f | |||
f6b5301e17 | |||
73b923e3a1 | |||
d2e4eb40b3 | |||
6a31628e78 | |||
bfb1ad1327 | |||
dfa603c335 | |||
eef979db4c | |||
6166c90bfd | |||
35d1d0080a | |||
3bacb1a9cb | |||
898af49e97 | |||
3061eb4157 | |||
b8d1d8f212 | |||
8c6189775b | |||
932418b951 | |||
95812252d6 | |||
7dec912d15 | |||
dbd36d66ae | |||
40b4166a6e | |||
51d18ffb89 | |||
af3c7b7c76 | |||
3511ac010d | |||
cac3c356a5 | |||
07f19dd4a1 | |||
17a17c31f3 | |||
75742b487f | |||
4e9a2b6d8c | |||
4ea907ae1a | |||
8b912c1363 | |||
080209c469 | |||
5b11ddee35 | |||
3b7ded0ba3 | |||
c5d3e9be76 | |||
714f4dc023 | |||
a86bcd5110 | |||
7ffc477d76 | |||
4cb0b319c0 | |||
5ebe9859e9 | |||
cd2b60a860 | |||
5edff79f5f | |||
0c91d568b4 | |||
35fabc7765 | |||
b5a98a993f | |||
0840ba8067 | |||
274cf58ccf | |||
1bce5d0bc2 | |||
0d5d5e21a8 | |||
a145e18c1e | |||
d1ca779c1a | |||
abbb8bbf55 | |||
86c7870427 | |||
48080b7f90 | |||
b216fb8910 | |||
d3171d6a8e | |||
c063a4da29 | |||
cc79dfa64c | |||
d6b9950901 | |||
1815fe5b46 | |||
3e993250d8 | |||
1163ac1d7a | |||
9a51ba697a | |||
32ad9d0c1a | |||
3d840e969d | |||
d1b70bd400 | |||
29f002b32c | |||
da17ade575 | |||
f0c36f3413 | |||
77d8f133f1 | |||
43ebb23085 | |||
e198c8fa8b | |||
cc3285c8fe | |||
305c63ba4d | |||
acaa0e33b0 | |||
f63857deed | |||
eda3d9b5e4 | |||
c3872619cd | |||
39cc590829 | |||
f347345bb3 | |||
bb05cfb36c | |||
7d5c3c9b46 | |||
cff2d37add | |||
447477c5fb | |||
abdbb2bf0e | |||
783c13926f | |||
45329ddf67 | |||
20af789963 | |||
93cb9390e0 | |||
0aed7f86f5 | |||
bf44bd016d | |||
04e4a36653 | |||
7439e1971d | |||
b961b4e003 | |||
d9eac8fc0a | |||
aeeee5eb53 | |||
13994055d9 | |||
247875e3d5 | |||
ee60a7bc36 | |||
348c2a599b | |||
562b47a1e5 | |||
4e060bc13f | |||
2807f14fcd | |||
f0539f4898 | |||
63d7e7b811 | |||
4da06078ed | |||
8a6381c3fa | |||
d0d61597c7 | |||
7a2a4e2aa3 | |||
e41a2c0792 | |||
11a6e04a28 | |||
70b1ac856d | |||
d724374d1a | |||
a19143cae7 | |||
1be6783c34 | |||
092edc9d43 | |||
2ba8eac27f | |||
25ff90b2c6 | |||
b912ae78bc | |||
677d43028a | |||
7bfb55ec9a | |||
2f61d42518 | |||
dbb669b156 | |||
4d0e8741fe | |||
53dc6e2050 | |||
807b860cfe | |||
d756500928 | |||
7ef27a1a21 | |||
6b4d8b91c6 | |||
8f5eb7ef37 | |||
0ea9a08963 | |||
18a1bfe4dd | |||
2d3562c687 | |||
cb40484a2e | |||
e75a08a5a3 | |||
95dfff727e | |||
d55889d85f | |||
99f65f19ac | |||
581eeee01d | |||
17341d7406 | |||
04c0cd142d | |||
7a747d6f93 | |||
e93d034a4e | |||
5a08a10448 | |||
622f93df45 | |||
b788982d60 | |||
26faf4a952 | |||
670bf2b9d1 | |||
f5491346ce | |||
73d3f9f7f7 | |||
d874be99a6 | |||
1767cbe80d | |||
64fbf5025a | |||
aaa01bb6f8 | |||
50d71809e1 | |||
6839712394 | |||
9b5ae7ec75 | |||
94eb64c2be | |||
3fae57508b | |||
a883c35fd0 | |||
740398282f | |||
9d14bc54d6 | |||
bd69c66d03 | |||
c58a1bf9b7 | |||
59c310b914 | |||
790fcc4ebb | |||
5430f19e7a | |||
1cf4cf8614 | |||
55cccff850 | |||
03e70e68f4 | |||
7c52b4c93d | |||
3f31dbde57 | |||
1bfd6f2a90 | |||
c7a5b8b0b4 | |||
11fc16617a | |||
77a4393c7b | |||
f714ed6e90 | |||
7fc45bc5c3 | |||
ab4b1be363 | |||
3c7f68dc1e | |||
15fa1056b7 | |||
feac2df088 | |||
4c2015fd0f | |||
16482e6a95 | |||
ae9115ad0d | |||
6b090d653c | |||
012f015e7d | |||
6925451f3f | |||
46054803d5 | |||
a9f99240b5 | |||
a16b44ea12 | |||
cd48d8272c | |||
6d09460abc | |||
0ca07ad075 | |||
60b183b0d9 | |||
dbf4054b1f | |||
82e4ef6d48 | |||
d0d300a6f8 | |||
6161155660 | |||
2a5561fcd1 | |||
5d531b56db | |||
3568c7b1c7 | |||
862c844759 | |||
42954c1d72 | |||
4c5f6eb1b7 | |||
02bc43b440 | |||
5832f42783 | |||
7c1f038f20 | |||
a42f68d3cf | |||
b6f3f6120b | |||
96d3f4f78b | |||
6756203aec | |||
adb78679c5 | |||
b60731607d | |||
0058bfcd23 | |||
9f31b479e1 | |||
eb161f8e1c | |||
80f8a27094 | |||
341c480e13 | |||
971ad04299 | |||
025b72e2f2 | |||
cf538afb84 | |||
7ff91337ad | |||
63e5867727 | |||
c38779f1fd | |||
14bae72dd5 | |||
f35b43613d | |||
3d0fa10437 | |||
76e5ea385b | |||
5a351d3caf | |||
bb93d4f8de | |||
66818e178a | |||
f782a478c4 | |||
c06b4830d1 | |||
6d64ef8d74 | |||
c5498bb3fa | |||
59334d652f | |||
5c81da9b1e | |||
b08affc4c6 | |||
cb49f1e835 | |||
f6a0f4aa82 | |||
de09c8c082 | |||
0ac87989dc | |||
13ea984b12 | |||
3878f58847 | |||
d7a35a5302 | |||
d850a84d0d | |||
22d9260a3b | |||
3c90ed13b9 | |||
396efbac7e | |||
00644dd529 | |||
c2c210e25a | |||
86c4e936cb | |||
3b103dcd62 | |||
48dfc5b232 | |||
39360f127a | |||
25890e76e2 | |||
810bdeb965 | |||
b6b3dcc1aa | |||
e0818e7e52 | |||
d0c4463773 | |||
7521160f53 | |||
4f5190e3f8 | |||
3c941dd992 | |||
89f457b397 | |||
2bdbb9794c | |||
898009a91b | |||
793f93afdb | |||
64506ea3ae | |||
4a35516441 | |||
74b9922a28 | |||
088fbf65b1 | |||
fa70127241 | |||
fc76d04dcb | |||
15ae323bcb | |||
353bae87a7 |
8
.github/FUNDING.yml
vendored
Normal file
8
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: pocketminemp
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: https://github.com/pmmp/PocketMine-MP#donate
|
2
.github/ISSUE_TEMPLATE/help---support.md
vendored
2
.github/ISSUE_TEMPLATE/help---support.md
vendored
@ -11,4 +11,4 @@ We don't accept support requests on the issue tracker. Please try the following
|
||||
|
||||
Documentation: http://pmmp.rtfd.io
|
||||
Forums: https://forums.pmmp.io
|
||||
Discord: https://discord.gg/bge7dYQ
|
||||
Discord: https://discord.gg/bmSAZBG
|
||||
|
4
.github/support.yml
vendored
4
.github/support.yml
vendored
@ -5,10 +5,10 @@ supportLabel: "Support request"
|
||||
# Comment to post on issues marked as support requests. Add a link
|
||||
# to a support page, or set to `false` to disable
|
||||
supportComment: >
|
||||
Thanks, but this issue tracker not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
|
||||
Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
|
||||
|
||||
|
||||
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bge7dYQ) | [Forums](https://forums.pmmp.io)
|
||||
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io)
|
||||
|
||||
# Whether to close issues marked as support requests
|
||||
close: true
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@ server.properties
|
||||
memory_dumps/*
|
||||
resource_packs/
|
||||
server.lock
|
||||
/phpstan.neon
|
||||
|
||||
# Common IDEs
|
||||
.idea/
|
||||
|
5
.gitmodules
vendored
5
.gitmodules
vendored
@ -2,11 +2,14 @@
|
||||
path = src/pocketmine/lang/locale
|
||||
url = https://github.com/pmmp/PocketMine-Language.git
|
||||
[submodule "tests/preprocessor"]
|
||||
path = tests/preprocessor
|
||||
path = build/preprocessor
|
||||
url = https://github.com/pmmp/preprocessor.git
|
||||
[submodule "tests/plugins/PocketMine-DevTools"]
|
||||
path = tests/plugins/PocketMine-DevTools
|
||||
url = https://github.com/pmmp/PocketMine-DevTools.git
|
||||
[submodule "build/php"]
|
||||
path = build/php
|
||||
url = https://github.com/pmmp/php-build-scripts.git
|
||||
[submodule "src/pocketmine/resources/vanilla"]
|
||||
path = src/pocketmine/resources/vanilla
|
||||
url = https://github.com/pmmp/BedrockData.git
|
||||
|
13
.travis.yml
13
.travis.yml
@ -5,21 +5,30 @@ php:
|
||||
- 7.3
|
||||
|
||||
before_script:
|
||||
- phpenv config-rm xdebug.ini
|
||||
# - pecl install channel://pecl.php.net/pthreads-3.1.6
|
||||
- echo | pecl install channel://pecl.php.net/yaml-2.0.4
|
||||
- git clone https://github.com/pmmp/pthreads.git
|
||||
- cd pthreads
|
||||
- git checkout 6ca019c58b4fa09ee2ff490f2444e34bef0773d0
|
||||
- git checkout 1b7da492b944146fa9680f6399bd9c6c6c6095e0
|
||||
- phpize
|
||||
- ./configure
|
||||
- make
|
||||
- make install
|
||||
- cd ..
|
||||
- echo "extension=pthreads.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- composer install
|
||||
|
||||
script:
|
||||
- composer install --prefer-dist
|
||||
- ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G
|
||||
- ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit
|
||||
- composer install --no-dev --prefer-dist
|
||||
- ./tests/travis.sh -t4
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache/files
|
||||
- $HOME/.composer/cache/vcs
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
38
BUILDING.md
Normal file
38
BUILDING.md
Normal file
@ -0,0 +1,38 @@
|
||||
# Building
|
||||
## Pre-requisites
|
||||
- A bash shell (git bash is sufficient for Windows)
|
||||
- [`git`](https://git-scm.com) available in your shell
|
||||
- PHP 7.2 or newer available in your shell
|
||||
- [`composer`](https://getcomposer.org) available in your shell
|
||||
|
||||
## Custom PHP binaries
|
||||
Because PocketMine-MP requires several non-standard PHP extensions and configuration, PMMP provides scripts to build custom binaries for running PocketMine-MP, as well as prebuilt binaries.
|
||||
|
||||
- [Prebuilt binaries](https://jenkins.pmmp.io/job/PHP-7.3-Aggregate)
|
||||
- [Compile scripts](https://github.com/pmmp/php-build-scripts) are provided as a submodule in the path `build/php`
|
||||
|
||||
If you use a custom binary, you'll need to replace `composer` usages in this guide with `path/to/your/php path/to/your/composer.phar`.
|
||||
|
||||
## Setting up environment
|
||||
1. `git clone --recursive https://github.com/pmmp/PocketMine-MP.git`
|
||||
2. `composer install`
|
||||
|
||||
## Checking out a different branch to build
|
||||
1. `git checkout <branch to checkout>`
|
||||
2. `git submodule update --init`
|
||||
3. Re-run `composer install` to synchronize dependencies.
|
||||
|
||||
## Optimizing for release builds
|
||||
1. Add the flags `--no-dev --classmap-authoritative` to your `composer install` command. This will reduce build size and improve autoloading speed.
|
||||
2. Preprocess the source code by running `build/preprocessor/PreProcessor.php`. Usage instructions are provided in `build/preprocessor/README.md`.
|
||||
|
||||
### Note
|
||||
Preprocessor requires that the `cpp` (c preprocessor) is available in your PATH.
|
||||
|
||||
## Building `PocketMine-MP.phar`
|
||||
Run `build/server.phar` using your preferred PHP binary. It'll drop a `PocketMine-MP.phar` into the current working directory.
|
||||
|
||||
You can also use the `--out` option to change the output filename.
|
||||
|
||||
## Running PocketMine-MP from source code
|
||||
Run `src/pocketmine/PocketMine.php` using your preferred PHP binary.
|
58
README.md
58
README.md
@ -1,53 +1,35 @@
|
||||
# [](https://pmmp.io)
|
||||
|
||||
__A highly customisable, open source server software for Minecraft: Bedrock Edition written in PHP__
|
||||
<p align="center">
|
||||
<a href="https://pmmp.io"><img src="http://cdn.pocketmine.net/img/PocketMine-MP-h.png"></img></a><br>
|
||||
<b>A highly customisable, open source server software for Minecraft: Bedrock Edition written in PHP</b>
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.org/pmmp/PocketMine-MP)
|
||||
|
||||
### Setup, help & support, FAQs
|
||||
Head over to the [documentation site](http://pmmp.readthedocs.org/).
|
||||
If you don't find what you're looking for there, [talk to a human](#discussion). Please do not use our issue tracker for support requests.
|
||||
## Getting started
|
||||
- [Documentation](http://pmmp.readthedocs.org/)
|
||||
- [Installation instructions](https://pmmp.readthedocs.io/en/rtfd/installation.html)
|
||||
- [Docker image](https://hub.docker.com/r/pmmp/pocketmine-mp)
|
||||
- [Plugin repository](https://poggit.pmmp.io/plugins)
|
||||
|
||||
### Discussion
|
||||
## Discussion/Help
|
||||
- [Forums](https://forums.pmmp.io/)
|
||||
- [Community Discord](https://discord.gg/bge7dYQ)
|
||||
- [Discord](https://discord.gg/bmSAZBG)
|
||||
- [StackOverflow](https://stackoverflow.com/tags/pocketmine)
|
||||
|
||||
### Plugins
|
||||
There are a very wide range of already-written plugins available which you can use to customise your server. Check out [Poggit](https://poggit.pmmp.io), or just search GitHub.
|
||||
|
||||
### For developers
|
||||
## For developers
|
||||
* [Building and running from source](BUILDING.md)
|
||||
* [Latest API documentation](https://jenkins.pmmp.io/job/PocketMine-MP-doc/doxygen/) - Doxygen documentation generated from development
|
||||
* [DevTools](https://github.com/pmmp/PocketMine-DevTools/) - Development tools plugin for creating plugins
|
||||
* [ExamplePlugin](https://github.com/pmmp/ExamplePlugin/) - Example plugin demonstrating some basic API features
|
||||
* [Contributing Guidelines](CONTRIBUTING.md)
|
||||
|
||||
### Can I contribute?
|
||||
Yes you can! Contributions are welcomed provided that they comply with our [Contributing Guidelines](CONTRIBUTING.md). Please ensure you read the relevant sections of the guidelines carefully before making a Pull Request or opening an Issue.
|
||||
|
||||
### Where can I get the latest .phar?
|
||||
- Latest release builds can be found in our [GitHub releases](https://github.com/pmmp/PocketMine-MP/releases).
|
||||
- Latest bleeding-edge development builds (and other builds in the build job channels) can be found on our [Jenkins server](https://jenkins.pmmp.io/).
|
||||
|
||||
**Note: Please avoid development builds unless there is no other alternative for what you need.** Development builds are subject to changes at any time without notice, and it is likely that your server or plugins might break without warning.
|
||||
|
||||
### Donate
|
||||
Donations help support the development of the project and pay for our expenses.
|
||||
- Bitcoin Cash (BCH): `qz9p8dqkv0r7aahdatu5uewqfkvstrglv58f8yle07`
|
||||
- Bitcoin (BTC): `1PVAyDJ2g7kcjCxAC3C89oxpV2ZYcLad8T`
|
||||
## Donate
|
||||
- Bitcoin Cash (BCH): `qq3r46hn6ljnhnqnfwxt5pg3g447eq9jhvw5ddfear`
|
||||
- Bitcoin (BTC): `171u8K9e4FtU6j3e5sqNoxKUgEw9qWQdRV`
|
||||
- Stellar Lumens (XLM): `GAAC5WZ33HCTE3BFJFZJXONMEIBNHFLBXM2HJVAZHXXPYA3HP5XPPS7T`
|
||||
- [Patreon](https://www.patreon.com/pocketminemp)
|
||||
|
||||
## Licensing information
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
This project is licensed under LGPL-3.0. Please see the [LICENSE](/LICENSE) file for details.
|
||||
|
||||
pmmp/PocketMine are not affiliated with Mojang. All brands and trademarks belong to their respective owners. PocketMine-MP is not a Mojang-approved software, nor is it associated with Mojang.
|
||||
|
91
build/make-release.php
Normal file
91
build/make-release.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\build\make_release;
|
||||
|
||||
use pocketmine\utils\VersionString;
|
||||
use function dirname;
|
||||
use function fgets;
|
||||
use function file_get_contents;
|
||||
use function file_put_contents;
|
||||
use function preg_replace;
|
||||
use function sleep;
|
||||
use function sprintf;
|
||||
use function system;
|
||||
use const pocketmine\BASE_VERSION;
|
||||
use const STDIN;
|
||||
|
||||
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
|
||||
function replaceVersion(string $versionInfoPath, string $newVersion, bool $isDev) : void{
|
||||
$versionInfo = file_get_contents($versionInfoPath);
|
||||
$versionInfo = preg_replace(
|
||||
$pattern = '/^const BASE_VERSION = "(\d+)\.(\d+)\.(\d+)(?:-(.*))?";$/m',
|
||||
'const BASE_VERSION = "' . $newVersion . '";',
|
||||
$versionInfo
|
||||
);
|
||||
$versionInfo = preg_replace(
|
||||
'/^const IS_DEVELOPMENT_BUILD = (?:true|false);$/m',
|
||||
'const IS_DEVELOPMENT_BUILD = ' . ($isDev ? 'true' : 'false') . ';',
|
||||
$versionInfo
|
||||
);
|
||||
file_put_contents($versionInfoPath, $versionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $argv
|
||||
* @phpstan-param list<string> $argv
|
||||
*/
|
||||
function main(array $argv) : void{
|
||||
if(isset($argv[1])){
|
||||
$currentVer = new VersionString($argv[1]);
|
||||
}else{
|
||||
$currentVer = new VersionString(BASE_VERSION);
|
||||
}
|
||||
$nextVer = new VersionString(sprintf(
|
||||
"%u.%u.%u",
|
||||
$currentVer->getMajor(),
|
||||
$currentVer->getMinor(),
|
||||
$currentVer->getPatch() + 1
|
||||
));
|
||||
|
||||
$versionInfoPath = dirname(__DIR__) . '/src/pocketmine/VersionInfo.php';
|
||||
replaceVersion($versionInfoPath, $currentVer->getBaseVersion(), false);
|
||||
|
||||
echo "please add appropriate notes to the changelog and press enter...";
|
||||
fgets(STDIN);
|
||||
system('git add "' . dirname(__DIR__) . '/changelogs"');
|
||||
system('git commit -m "Release ' . $currentVer->getBaseVersion() . '" --include "' . $versionInfoPath . '"');
|
||||
system('git tag ' . $currentVer->getBaseVersion());
|
||||
replaceVersion($versionInfoPath, $nextVer->getBaseVersion(), true);
|
||||
system('git add "' . $versionInfoPath . '"');
|
||||
system('git commit -m "' . $nextVer->getBaseVersion() . ' is next" --include "' . $versionInfoPath . '"');
|
||||
echo "pushing changes in 5 seconds\n";
|
||||
sleep(5);
|
||||
system('git push origin HEAD ' . $currentVer->getBaseVersion());
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
main($argv);
|
||||
}
|
1
build/php
Submodule
1
build/php
Submodule
Submodule build/php added at e145515864
1
build/preprocessor
Submodule
1
build/preprocessor
Submodule
Submodule build/preprocessor added at da363df5f1
174
build/server-phar.php
Normal file
174
build/server-phar.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\build\server_phar;
|
||||
|
||||
use pocketmine\utils\Git;
|
||||
use function array_map;
|
||||
use function count;
|
||||
use function defined;
|
||||
use function dirname;
|
||||
use function file_exists;
|
||||
use function getcwd;
|
||||
use function getopt;
|
||||
use function implode;
|
||||
use function ini_get;
|
||||
use function microtime;
|
||||
use function preg_quote;
|
||||
use function realpath;
|
||||
use function round;
|
||||
use function rtrim;
|
||||
use function sprintf;
|
||||
use function str_replace;
|
||||
use function unlink;
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
/**
|
||||
* @param string[] $strings
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
function preg_quote_array(array $strings, string $delim = null) : array{
|
||||
return array_map(function(string $str) use ($delim) : string{ return preg_quote($str, $delim); }, $strings);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $includedPaths
|
||||
* @param mixed[] $metadata
|
||||
* @phpstan-param array<string, mixed> $metadata
|
||||
*
|
||||
* @return \Generator|string[]
|
||||
*/
|
||||
function buildPhar(string $pharPath, string $basePath, array $includedPaths, array $metadata, string $stub, int $signatureAlgo = \Phar::SHA1, ?int $compression = null){
|
||||
$basePath = rtrim(str_replace("/", DIRECTORY_SEPARATOR, $basePath), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
||||
$includedPaths = array_map(function(string $path) : string{
|
||||
return rtrim(str_replace("/", DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
||||
}, $includedPaths);
|
||||
yield "Creating output file $pharPath";
|
||||
if(file_exists($pharPath)){
|
||||
yield "Phar file already exists, overwriting...";
|
||||
try{
|
||||
\Phar::unlinkArchive($pharPath);
|
||||
}catch(\PharException $e){
|
||||
//unlinkArchive() doesn't like dodgy phars
|
||||
unlink($pharPath);
|
||||
}
|
||||
}
|
||||
|
||||
yield "Adding files...";
|
||||
|
||||
$start = microtime(true);
|
||||
$phar = new \Phar($pharPath);
|
||||
$phar->setMetadata($metadata);
|
||||
$phar->setStub($stub);
|
||||
$phar->setSignatureAlgorithm($signatureAlgo);
|
||||
$phar->startBuffering();
|
||||
|
||||
//If paths contain any of these, they will be excluded
|
||||
$excludedSubstrings = preg_quote_array([
|
||||
realpath($pharPath), //don't add the phar to itself
|
||||
], '/');
|
||||
|
||||
$folderPatterns = preg_quote_array([
|
||||
DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR,
|
||||
DIRECTORY_SEPARATOR . '.' //"Hidden" files, git dirs etc
|
||||
], '/');
|
||||
|
||||
//Only exclude these within the basedir, otherwise the project won't get built if it itself is in a directory that matches these patterns
|
||||
$basePattern = preg_quote(rtrim($basePath, DIRECTORY_SEPARATOR), '/');
|
||||
foreach($folderPatterns as $p){
|
||||
$excludedSubstrings[] = $basePattern . '.*' . $p;
|
||||
}
|
||||
|
||||
$regex = sprintf('/^(?!.*(%s))^%s(%s).*/i',
|
||||
implode('|', $excludedSubstrings), //String may not contain any of these substrings
|
||||
preg_quote($basePath, '/'), //String must start with this path...
|
||||
implode('|', preg_quote_array($includedPaths, '/')) //... and must be followed by one of these relative paths, if any were specified. If none, this will produce a null capturing group which will allow anything.
|
||||
);
|
||||
|
||||
$directory = new \RecursiveDirectoryIterator($basePath, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS | \FilesystemIterator::CURRENT_AS_PATHNAME); //can't use fileinfo because of symlinks
|
||||
$iterator = new \RecursiveIteratorIterator($directory);
|
||||
$regexIterator = new \RegexIterator($iterator, $regex);
|
||||
|
||||
$count = count($phar->buildFromIterator($regexIterator, $basePath));
|
||||
yield "Added $count files";
|
||||
|
||||
if($compression !== null){
|
||||
yield "Compressing files...";
|
||||
$phar->compressFiles($compression);
|
||||
yield "Finished compression";
|
||||
}
|
||||
$phar->stopBuffering();
|
||||
|
||||
yield "Done in " . round(microtime(true) - $start, 3) . "s";
|
||||
}
|
||||
|
||||
function main() : void{
|
||||
if(ini_get("phar.readonly") == 1){
|
||||
echo "Set phar.readonly to 0 with -dphar.readonly=0" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$opts = getopt("", ["out:", "git:"]);
|
||||
if(isset($opts["git"])){
|
||||
$gitHash = $opts["git"];
|
||||
}else{
|
||||
$gitHash = Git::getRepositoryStatePretty(dirname(__DIR__));
|
||||
echo "Git hash detected as $gitHash" . PHP_EOL;
|
||||
}
|
||||
foreach(buildPhar(
|
||||
$opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar",
|
||||
dirname(__DIR__) . DIRECTORY_SEPARATOR,
|
||||
[
|
||||
'src',
|
||||
'vendor'
|
||||
],
|
||||
[
|
||||
'git' => $gitHash
|
||||
],
|
||||
<<<'STUB'
|
||||
<?php
|
||||
|
||||
$tmpDir = sys_get_temp_dir();
|
||||
if(!is_readable($tmpDir) or !is_writable($tmpDir)){
|
||||
echo "ERROR: tmpdir $tmpDir is not accessible." . PHP_EOL;
|
||||
echo "Check that the directory exists, and that the current user has read/write permissions for it." . PHP_EOL;
|
||||
echo "Alternatively, set 'sys_temp_dir' to a different directory in your php.ini file." . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require("phar://" . __FILE__ . "/src/pocketmine/PocketMine.php");
|
||||
__HALT_COMPILER();
|
||||
STUB
|
||||
,
|
||||
\Phar::SHA1,
|
||||
\Phar::GZ
|
||||
) as $line){
|
||||
echo $line . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
main();
|
||||
}
|
182
changelogs/1.3.md
Normal file
182
changelogs/1.3.md
Normal file
@ -0,0 +1,182 @@
|
||||
# 1.3.3
|
||||
- Minecraft: Pocket Edition alpha 0.7.2 compatible!
|
||||
- Unicode support
|
||||
- Fixed /difficulty command
|
||||
- Fixed a few flying kicks
|
||||
- Fixed async. operations thread
|
||||
- Added whitelist enabled property to Query
|
||||
|
||||
# 1.3.4
|
||||
**This is a compatibility update for Minecraft: Pocket Edition v0.7.3 alpha.**
|
||||
|
||||
Double chests do not work yet, we will fix more bugs and add them when MCPE 0.7.4 is released. There were too many bugs in 0.7.3 to test double chests properly.
|
||||
|
||||
#### Including in this release:
|
||||
- Fixed armor crash
|
||||
- Fixed ghost armor
|
||||
- Fixed packets being received after player disconnection
|
||||
- Fixed player count bug
|
||||
- Added compatibility with encrypted login
|
||||
- Fixed flying check on fences
|
||||
- Fixed players connecting with empty usernames
|
||||
- Fixed several crashes related to Items
|
||||
- Added temporal water flowing. Really buggy
|
||||
- Automatic recovery of index-corrupted maps
|
||||
- Fixed hotbar reset when changing armor
|
||||
- Fixed some hotbar reset bugs on block placement
|
||||
- Added basic tool durability and breaking
|
||||
- Chests now have opening/closing animation.
|
||||
- Fixed /difficulty
|
||||
- In-game player list is now handled correctly
|
||||
- Player entities are saved in all worlds to remove join/leave spam
|
||||
- Quartz slabs
|
||||
|
||||
# 1.3.5
|
||||
#### Including in this release:
|
||||
- Fixed block durability (blocks being replaced)
|
||||
- Added armor replacing (changing the armor while you have other)
|
||||
- Added proper Player object cleanups as a fix to a memory leak
|
||||
|
||||
# 1.3.7
|
||||
**This update is compatible with Minecraft: Pocket Edition v0.7.4 alpha.** Older versions won't work.
|
||||
|
||||
In Minecraft: PE 0.7.4 you can add External servers directly. [How to add servers](https://github.com/PocketMine/PocketMine-MP/wiki/How-to-add-servers)
|
||||
|
||||

|
||||
|
||||
### Changelog
|
||||
- **Updated for 0.7.4 alpha**
|
||||
- **New API version 10**
|
||||
- Adds Tile methods
|
||||
- Changes message events to use new Minecraft protocol
|
||||
- Added Level::getSafeSpawn()
|
||||
- Linux now uses PHP 5.5.3
|
||||
- Removed water updating
|
||||
- Fixes for Player teleporting
|
||||
- Removed invalid Cookie and fish items
|
||||
- Fixed Stone brick and quartz slab recipes
|
||||
- Shears now are used to drop leaves
|
||||
- Fixed a crash on Windows XP
|
||||
- Cake is removed when the bottom block is broken
|
||||
- Added new NBT parser/writer
|
||||
- Fixed chests and furnaces drops when broken.
|
||||
- Fixed signs not spawning on world load
|
||||
- Fixed actions not being deleted (memory leak)
|
||||
- Chests now are spawned correctly
|
||||
- Double chests
|
||||
- Added random x,z offset to item drops
|
||||
|
||||
# 1.3.8
|
||||
This release consists of a few bugfixes and several features added. It is compatible with MCPE 0.7.4 and 0.7.5
|
||||
|
||||
**Changelog:**
|
||||
- No API changes
|
||||
- Fixed x,y,z indexes when opening a Furnace
|
||||
- Fixed invalid fix for CPU usage limiter on idle
|
||||
- Fixed cross-compiling
|
||||
- Fixed some Stonecutter recipes
|
||||
- Fixed a few items stack sizes
|
||||
- Fixed TimeAPI bugs
|
||||
- Forces position on teleport, blocks fast teleport mods
|
||||
- Fixed some blocks havin a send lag on place/break
|
||||
- Fixed Sign Posts not deleting the Tile data when broken by update
|
||||
- Fixed Ice converting to Water on creative mode
|
||||
- Added beds
|
||||
- Added scheduled teleport on spawn to fix spawning underground
|
||||
- Added date to console logs
|
||||
|
||||
# 1.3.9
|
||||
This release is compatible with MCPE 0.7.4 and 0.7.5.
|
||||
|
||||
**Changelog:**
|
||||
- Fixed server crash related to beds
|
||||
- Player movement is less laggy
|
||||
- Added new text formatting system for future updates
|
||||
- New Terminal Emulator for Windows
|
||||
- More colors! Less warnings!
|
||||
|
||||
# 1.3.10
|
||||
**Changelog:**
|
||||
- Added door sounds
|
||||
- Fixed bed sleeping position offset
|
||||
- Added explosions
|
||||
- Flint & Steel on Creative Mode (replaces Eggs)
|
||||
- Changed the Sword and Hoe to the diamond tier on the Creative inventory
|
||||
- Fixed colors on MacOS
|
||||
- Water flow
|
||||
- Fixed Windows console input not being accepted when using special keys
|
||||
- Added a way to disable console colors
|
||||
- Updated PHP to 5.5.6, pthreads to 0.0.55, and cURL
|
||||
- Armor drops
|
||||
- Fixed plugin issues
|
||||
- Fixed some block drops
|
||||
- Fixed a crash when @all is used in console, and only usable for OPs
|
||||
- Fixed some issues regarding teleporting
|
||||
- deop no longer op the player again
|
||||
|
||||
# 1.3.11
|
||||
And here it comes the stable release for **MCPE v0.8.1 alpha**. We decided to remove the improved networking that was delaying this release, but you should see it in the next one. Minecarts couldn't be added for the same reason as mobs, but we will try to implement "fake" minecarts that behave correctly inside rails, but not outside of them.
|
||||
|
||||
Starting with this release, all PocketMine-MP versions will be given a codename. This one received the codename 「甘いビートルート」_(Amai Beetroot)_.
|
||||
|
||||
**Changelog:**
|
||||
- Fixed existing Packets of Death
|
||||
- Fixed lots of bugs related to crafting
|
||||
- Fixed block placement bugs
|
||||
- Redstone ore drops redstone dust
|
||||
- Sideway logs
|
||||
- Sponges
|
||||
- Added new wooden planks & stairs
|
||||
- Added iron bars, cobblestone walls and pumpkins
|
||||
- Added carpets, hay bales and coal blocks
|
||||
- Added potatoes, carrots and beetroots
|
||||
- Additional tall grass drops
|
||||
- Achievements
|
||||
- Added multiple orders for _/gamemode_ command
|
||||
- Chat plugins can work with each other #975
|
||||
- Fixed internal world chunks bug
|
||||
- Private messages are now hidden on console except when the console is the target/origin
|
||||
- PHP plugins are now loaded with include()
|
||||
- Fixed plugin paths
|
||||
- Added source SHA1 sum to crash reports
|
||||
- Added Level::startTime() and Level::stopTime()
|
||||
- Fixed server not being able to start on several OS when offline
|
||||
- More small fixes and small additions
|
||||
|
||||
For more information, check the [complete changelog](https://github.com/PocketMine/PocketMine-MP/compare/Alpha_1.3.10...Alpha_1.3.11).
|
||||
|
||||
# 1.3.12
|
||||
Before starting to rewrite even more parts of the code, we are releasing the last version of the Alpha_1.3.x Amai Beetroot「甘いビートルート」. Next one will be Alpha_1.4 with more rewrite!
|
||||
We have included the new Event API that will be used on the next release, but now it is only used to hook on packets.
|
||||
|
||||
**API Changelog:**
|
||||
- **Full network rewrite.** Plugins can work with packets easily now.
|
||||
- **New Event API,** only implemented for packets right now.
|
||||
- Added player.block.place.bypass and player.block.break.bypass
|
||||
- Level included in data for event item.drop
|
||||
- Added Utils::getUniqueID()
|
||||
- **Added default support in PHP binaries for MySQLi**
|
||||
- Removed Spyc
|
||||
- Call Plugin::__destruct() on PluginAPI::__destruct()
|
||||
- Added more OS detection on Utils::getOS()
|
||||
|
||||
**Changelog:**
|
||||
- New set-up wizard in multiple languages. Help translate it to more languages on http://translate.pocketmine.net/
|
||||
- Updated pthreads and PHP binaries
|
||||
- New font for MinTTY console on Windows
|
||||
- Send partial hotbar history
|
||||
- Fixed Tile saving indexes
|
||||
- Fixed a few teleport bugs
|
||||
- Improved crash dumps
|
||||
- Increased apple health restore
|
||||
- Fixed players being invincible after death
|
||||
- Fixed Level::unloadChunk() not using saveEnabled
|
||||
- Show player name on bad username kick
|
||||
- Fixed item duplication on void #1100
|
||||
- OPs can bypass the player limit
|
||||
- Fixed item replacing on furnace #1114
|
||||
- Fixed multiple small bugs #1058 #1032 #854 #823 #1135 #1150 #1172 #1173 #486 #466 #483
|
||||
- Fixed PHP compilation on 64-bit linux #519 #861 #940 #505 #590 #761 #129
|
||||
- Included OPCache to optimize opcodes
|
||||
|
||||
If you are on Linux, you can use `wget -q -O - http://cdn.pocketmine.net/installer.sh | bash -s - -v Alpha_1.3.12` to update. If you are on a MacOS, use `curl -sL http://cdn.pocketmine.net/installer.sh | bash -s - -v Alpha_1.3.12`
|
1278
changelogs/1.4.md
Normal file
1278
changelogs/1.4.md
Normal file
File diff suppressed because it is too large
Load Diff
72
changelogs/1.6.md
Normal file
72
changelogs/1.6.md
Normal file
@ -0,0 +1,72 @@
|
||||
# 1.6.1dev-87
|
||||
**For Minecraft PE 0.16.0.5 alpha**
|
||||
|
||||
**THIS IS A PRE RELEASE. Do not use it in production unless you are sure you know what you are doing.**
|
||||
|
||||
Only changes since the 1.6dev tag will be documented here. Changes between 1.4.1 and 1.6dev are far too extensive to document effectively.
|
||||
|
||||
## Core
|
||||
- New RNG, based on XorShift128 from the php-random library. This fixes issue with repeating terrain on 32-bit systems. _Note however that new generation into existing worlds will not be seamless._
|
||||
- Block and Item IDs have been moved to interfaces for better consistency
|
||||
- Better method for synchronisation of client/server time (less packet spam)
|
||||
- Utils::getRandomBytes() has been deprecated in favour of php7's random_bytes() function.
|
||||
- `<player>.dat` saving/reading can now be disabled in `pocketmine.yml` (set `player.save-player-data` to `false`)
|
||||
|
||||
## Gameplay/game features
|
||||
- Added Flower Pots
|
||||
- Containers can now be opened in creative
|
||||
- Trapdoors can now be placed without a supporting block
|
||||
|
||||
## API
|
||||
|
||||
This release has API changes, bumping the version to 2.1.0.
|
||||
|
||||
### Entity metadata (0.16)
|
||||
|
||||
Many changes have been made to entity metadata. Many true/false data properties are now entity status flags, such as NoAI, NametagVisible and various others. Entity status flags can be set using:
|
||||
`$entity->setDataFlag(Entity::DATA_FLAGS, Entity::INSERT_DATA_FLAG_NAME, true/false);`
|
||||
|
||||
**Breaking** changes are detailed here. Additions are not documented. https://gist.github.com/dktapps/76b291b7a861762b54f7a8b834389883
|
||||
|
||||
**NOTE: It's strongly recommended to use provided API methods where possible instead of tampering with metadata directly.**
|
||||
|
||||
### AsyncTask API additions
|
||||
- Main thread local storage: Developers can pass any data including objects to the constructor of AsyncTask such that the data can be retrieved after the AsyncTask completes using the new `AsyncTask::fetchLocal()` method, or use the `AsyncTask::peekLocal()` method to get the data without removing it.
|
||||
- Progress updates: Developers can use the new `AsyncTask::publishProgress() method and override`AsyncTask::onProgressUpdated()` to handle AsyncTask progress information in the main thread.
|
||||
|
||||
Refer to #1 and #100 for details.
|
||||
|
||||
### WeakPosition
|
||||
|
||||
WeakPosition was added in 1.6.1 to fix bugs with unloading levels which have player spawn points set in them. This type of position holds a level ID instead of a direct reference. Use this when your position may outlive the level it is in.
|
||||
|
||||
### Removal of Item/NBT circular dependency
|
||||
|
||||
Refer to #121 for details.
|
||||
|
||||
### Other
|
||||
- Added Player->sendWhisper() (#73).
|
||||
- Removed LargeExplodeParticle due to incorrect name - use HugeExplodeParticle. Added HugeExplodeSeedParticle and BlockForceFieldParticle (7314aaf7f7bdae582f674c085c7ae879985bf847)
|
||||
|
||||
## Fixes
|
||||
- Fixed the infamous hotbar spaz bug
|
||||
- Creative/spectator inventory now sends correctly
|
||||
- Fixed spectator flight controls
|
||||
- Fixed issues with items going past the end of the regular inventory
|
||||
- Fixed furnace client crashes
|
||||
- Fixed inventory windows for anvils and enchanting tables
|
||||
- Fixed kicked for walking on lily pads (#blameshoghicp)
|
||||
- Fixed a nasty entity-related memory leak on chunk unload
|
||||
- Fixed sleeping players floating above beds and teleportation of sleeping players.
|
||||
- Fixed a bug in Level::updateAround() where only one block would update
|
||||
- Fixed some slab placement issues (#31)
|
||||
- Fixed crash loading 1.11 worlds (#32)
|
||||
- Fixed broken `--disable-readline` command-line option (#34)
|
||||
- Fixed world unload crash when players have spawnpoints set in that world (#24)
|
||||
- Fixed start.sh detection of system PHP binaries (#66)
|
||||
- Fixed anvil rotation when placed and variant drops (d696049a0ad5e3b878a8f902e4ef75f19ec8cecc)
|
||||
- /timings command is now more verbose about paste errors (#95)
|
||||
- Fixed server crash at shutdown when RCON is enabled (#101)
|
||||
- Fixed server name is always "Minecraft: PE Server" when running setup wizard (92bd1a755d4b171b687538db83893b9bd9c70420)
|
||||
- Fixed CraftItemEvent->getInput() does not return used items (7eb9530346e953d1555623ff871086f85447b6c6)
|
||||
- Fixed useless ServerKiller (#122)
|
1155
changelogs/3.0-alpha.md
Normal file
1155
changelogs/3.0-alpha.md
Normal file
File diff suppressed because it is too large
Load Diff
264
changelogs/3.0.md
Normal file
264
changelogs/3.0.md
Normal file
@ -0,0 +1,264 @@
|
||||
**For Minecraft: Bedrock Edition 1.4.0**
|
||||
|
||||
Plugin scheduler rewrite, RCON rewrite, performance improvements, improved idle memory usage
|
||||
|
||||
**While this release is nominally not an alpha, it is still not feature complete and does not include all gameplay features. Please do not create issues for missing gameplay features.**
|
||||
|
||||
This build has breaking API changes.
|
||||
This release is the first to use the new merged versioning system. The PocketMine-MP version and the API version are now one and the same.
|
||||
|
||||
Please use our issue tracker to report bugs.
|
||||
|
||||
# 3.0.0
|
||||
## Core
|
||||
### General
|
||||
- This release introduces a new dependency library called `Snooze`, which PocketMine-MP utilizes for managing notifications between threads. This library is currently utilized by command reading, RCON and RakLib, allowing faster response times to commands, reduced network latency, and better performance due to lack of need for polling.
|
||||
- Fixed race condition causing `ServerKiller` to sometimes kill the server for no reason on shutdown.
|
||||
|
||||
### Dependency libraries
|
||||
Requires the following libraries:
|
||||
- [`pocketmine/raklib` `^0.12.0`](https://github.com/pmmp/RakLib/releases/0.12.0)
|
||||
- [`pocketmine/spl` `^0.3.0`](https://github.com/pmmp/SPL/releases/0.3.0)
|
||||
- [`pocketmine/binaryutils` `^0.1.0`](https://github.com/pmmp/BinaryUtils/releases/0.1.0)
|
||||
- [`pocketmine/nbt` `^0.2.0`](https://github.com/pmmp/NBT/releases/0.2.0)
|
||||
- [`pocketmine/math` `^0.2.0`](https://github.com/pmmp/Math/releases/0.2.0)
|
||||
- [`pocketmine/snooze` `^0.1.0`](https://github.com/pmmp/Snooze/releases/0.1.0)
|
||||
|
||||
These libraries may individually have changes which are not recorded here. See their independent repository releases for their changelogs.
|
||||
|
||||
### Async pooling
|
||||
- Async workers are now started dynamically when they are needed only, instead of being started immediately on startup. This allows reducing idle memory usage.
|
||||
- AsyncPool now appropriately shuts down the workers when instructed to, instead of leaving it up to the ThreadManager to clean it up. This eliminates debug messages of shutting down async workers on server shutdown.
|
||||
- Default maximum async worker memory limit has been lowered from 1024MB to 256MB.
|
||||
- Async workers are now started using the options `PTHREADS_INHERIT_CONSTANTS | PTHREADS_INHERIT_INI`, which reduces idle memory wastage and works around some bugs in pthreads.
|
||||
|
||||
### Entities
|
||||
- Fixed entities not being despawned when flagged, if they weren't scheduled for an update.
|
||||
|
||||
### Levels
|
||||
- Seed handling is now always consistent between `pocketmine.yml` and `server.properties`.
|
||||
- Fixed generation bugs in imported LevelDB worlds where the classpath was saved into level.dat.
|
||||
- Generators for levels are no longer created on the main thread, reducing memory usage.
|
||||
|
||||
### Plugins
|
||||
- Plugin data is now stored under `<data dir>/plugin_data` by default on new installations, instead of in `<plugins dir>`. This behaviour does not affect existing installations by default - if you want to enable it, set `plugins.legacy-data-dir` to `false` in `pocketmine.yml`.
|
||||
|
||||
### RCON
|
||||
RCON has been almost completely rewritten in this release.
|
||||
- Now event-driven (using Snooze) instead of poll-based, improving performance.
|
||||
- Fixed segmentation fault when stopping the server with RCON enabled.
|
||||
|
||||
## API
|
||||
**WARNING: Dependency library API changes are not listed here. See their individual release notes for changes (linked above in the Core section).**
|
||||
|
||||
### API versioning changes for plugins
|
||||
The way that the API versioning is done has changed. Now the API version is synonymous with the PocketMine-MP version.
|
||||
Plugin compatibility is determined by the following:
|
||||
- Take the base version, and strip any metadata (everything after the `+` sign, for example `3.0.0+dev.1191` becomes `3.0.0`).
|
||||
- Assert that:
|
||||
- The major versions is the same
|
||||
- The server's minor version is greater than or equal to the plugin's
|
||||
- The server's patch version is greater than or equal to the plugin's
|
||||
|
||||
Currently there is no support for locking version by metadata, although this could be implemented if it is a wanted feature.
|
||||
|
||||
### General
|
||||
- `Server->getCodename()` and `\pocketmine\CODENAME` have been removed.
|
||||
- Added API method `Server->getTickSleeper()`, which returns a `\pocketmine\snooze\SleeperHandler` instance.
|
||||
- `Server->getIp()` now returns `0.0.0.0` if not set.
|
||||
|
||||
### Block
|
||||
- Added `Block->getXpDropForTool()`.
|
||||
|
||||
### Entity
|
||||
- Calling `scheduleUpdate()` on an `Entity` after it has been `close()`d will now cause an exception to be thrown.
|
||||
- `Entity->motionX`, `Entity->motionY` `Entity->motionZ` have been removed in favour of an `Entity->motion` `Vector3` field. This also applies for the `lastMotion` fields.
|
||||
- `Entity->isInsideOfWater()` has been renamed to `isUnderwater()`.
|
||||
|
||||
### Events
|
||||
- Added support for `@softDepend` annotation on event handlers, which allows the event handler to not be registered if the dependency plugin is not loaded.
|
||||
- Added support for `@notHandler` annotation for `Listener` methods to indicate that such methods are not event handlers.
|
||||
- Typehints have been applied to the events API to PHP 7.2 standards.
|
||||
- Fixed preventing effect expiry using `EntityEffectRemoveEvent` not being reflected on the client.
|
||||
- `EntityDamageEvent` API has significant changes. The general purpose of this is to split up base damage from modifiers.
|
||||
- Added methods `getBaseDamage()`, `setBaseDamage()`, `getOriginalBaseDamage()`, `getModifiers()`, `getOriginalModifiers()`
|
||||
- `setDamage()` renamed to `setModifier()`, and type parameter is now mandatory
|
||||
- `getDamage()` renamed to `getModifier()`, and type parameter is now mandatory
|
||||
- `getOriginalDamage()` renamed to `getOriginalModifier()`, and type parameter is now mandatory
|
||||
- Removed `MODIFIER_BASE` constant
|
||||
- Constructors now accept: `float baseDamage`, `float[] modifiers` instead of just `float[] modifiers`
|
||||
- Added `BlockBreakEvent->getXpDropAmount()` and `BlockBreakEvent->setXpDropAmount()`.
|
||||
|
||||
### Inventory
|
||||
- `InventoryTransaction->getCreationTime()` has been removed.
|
||||
- `EntityInventoryChangeEvent` and `EntityArmorChangeEvent` are no longer fired during entity inventory intialization.
|
||||
|
||||
### Item
|
||||
- Methods `isPickaxe()`, `isAxe()`, `isSword()`, `isShovel()`, `isHoe()`, `isShears()` have been removed. These should be replaced with `instanceof` checks for the relevant classes.
|
||||
- Removed `Item->useOn()`. This has been superseded by new methods used for handling durability changes.
|
||||
- Added hooks `Item->onDestroyBlock()` and `Item->onAttackEntity()`. These are called when a player uses the item to destroy a block or attack an entity respectively. This is used in the core code for updating durability.
|
||||
- `Item->pop()` now accepts an optional count parameter.
|
||||
- `Enchantment` now has separated primary items (which can be enchanted directly) and secondary items (which can be enchanted on an anvil). The constructor of `Enchantment` has been updated to reflect this.
|
||||
- Removed `Enchantment->getSlot()` and `Enchantment->hasSlot()`.
|
||||
- Added `Enchantment->getPrimaryItemFlags()`, `Enchantment->hasPrimaryItemFlag()`, `Enchantment->getSecondaryItemFlags()` and `Enchantment->hasSecondaryItemFlag()`
|
||||
|
||||
### Level
|
||||
- `Biome` classes have been moved to `pocketmine\level\biome` namespace. This is in preparation for future work on Levels which requires biome information (such as weather conditions).
|
||||
- `WeakPosition` has been removed.
|
||||
- Added `Level->getBiome()`.
|
||||
- `Level->getSafeSpawn()` now always returns a `Position` instance.
|
||||
- `Level->getBlockExtraData()` and `Level->setBlockExtraData()` have been removed (as well as their associated `Chunk` methods).
|
||||
- `ChunkManager->isInWorld()` now accepts integers instead of floats.
|
||||
- Added `SubChunkIteratorManager->invalidate()`.
|
||||
|
||||
#### Generator
|
||||
- `BiomeSelector` has been refactored to make it simpler and more robust.
|
||||
- Generator-management methods `registerDefaultGenerators()`, `addGenerator()`, `getGeneratorList()`, `getGenerator()`, and `getGeneratorName()` have been moved from `Generator` to a new `GeneratorManager` class.
|
||||
- Static noise functions in the `Generator` base class have been moved to `Noise` instance methods.
|
||||
- Added static method `Generator::convertSeed()`, which converts an int or string into a numeric seed for generation.
|
||||
|
||||
### Network
|
||||
- `SourceInterface->process()` no longer returns a value.
|
||||
|
||||
### Plugin
|
||||
- `PluginBase->getResources()` now returns an associative array where the index is the path to the resource relative to the plugin's `resources` directory.
|
||||
- `PluginLoader`s have been almost completely rewritten to make them simpler and more robust.
|
||||
- `PluginManager->registerInterface()` does not return anything, and now accepts a `PluginLoader` instance instead of a `string`.
|
||||
- `PluginLoader`:
|
||||
- `getPluginFilters()`, `enablePlugin()` and `disablePlugin()` are removed.
|
||||
- `loadPlugin()` responsibilities are now solely confined to doing whatever is necessary to make the plugin's classes visible by the server, and does not emit log messages or check for data directories.
|
||||
- Added method `getAccessProtocol()` which determines what prefix to apply to the plugin path to access the files inside it (for example `phar://`).
|
||||
- `PluginBase->init()` and `PluginBase->isInitialized()` have been removed.
|
||||
- `Plugin` interface now declares a signature for the constructor which implementations must comply with.
|
||||
- `Plugin` interface now declares `setEnabled()`.
|
||||
- It is now possible to create a custom `Plugin` implementation without requiring a custom `PluginLoader`.
|
||||
|
||||
### Scheduler
|
||||
This release features major changes to how plugin task scheduling works.
|
||||
- Removed `Server->getScheduler()`. All plugins now have their own scheduler which is accessible using `Plugin->getScheduler()`. Aside from being syntactically more concise and pleasant, this also allows much more effective management of tasks when plugins are disabled.
|
||||
- Removed `PluginTask` class, because it's now unnecessary. Previously it was required to allow the server to delete tasks associated with a plugin when the plugin was disabled. With plugin-owned schedulers, this is no longer a requirement. Plugins may now utilize the `Task` class as a base if they like.
|
||||
- Added `Server->getAsyncPool()`. Since the global scheduler does not exist any more, it does not manage the server's `AsyncPool` any more. Additionally, `ServerScheduler` was previously bloated by a lot of `AsyncTask` related methods, which are now not necessary because direct access to `AsyncPool` is granted instead.
|
||||
- `ServerScheduler`:
|
||||
- `ServerScheduler` has been renamed to `TaskScheduler` since it is now a general-purpose task scheduler which is non-dependent on the user. This allows much greater flexibility and also makes it possible to unit-test.
|
||||
- All `AsyncTask`/`AsyncPool` related methods have been removed - the task scheduler does not manage the async pool anymore.
|
||||
- Calls to `Server->getScheduler()->scheduleAsyncTask()` should be replaced with `Server->getAsyncPool()->submitTask()`.
|
||||
- Calls to `Server->getScheduler()->scheduleAsyncTaskToWorker()` should be replaced with and `Server->getAsyncPool()->submitTaskToWorker()`.
|
||||
|
||||
### Tile
|
||||
- Calling `scheduleUpdate()` on a `Tile` after it has been `close()`d will now cause an exception to be thrown.
|
||||
- Tile NBT is now ephemeral and is not retained after creating the tile.
|
||||
- `Tile->namedtag` has been removed.
|
||||
- `Tile->saveNBT()` now returns a new `CompoundTag` containing saved data.
|
||||
- Added new protected methods `Tile->readSaveData()` and `Tile->writeSaveData()`. These should be overridden to add or read tile-specific data, instead of overriding `saveNBT()` and `__construct()`.
|
||||
|
||||
### Utils
|
||||
- Added `MainLogger->getFormat()` and `MainLogger->setFormat()` to allow manipulating console output format.
|
||||
|
||||
## Gameplay
|
||||
### General
|
||||
- Fixed a range of block collision issues stemming from off-by-one errors when fetching areas.
|
||||
|
||||
### Blocks
|
||||
- Fixed a crash which occurred when leaving a bed which was broken and replaced during sleep.
|
||||
- Fixed dark oak and acacia saplings growing into oak trees - now they will not grow at all (they need to be implemented).
|
||||
- Saplings now take light level into account when trying to grow.
|
||||
- Ores and other blocks now drop experience when broken with an appropriate tool.
|
||||
|
||||
### Entities
|
||||
- Fixed dropped items not being correctly destroyed by fire, cacti and other damage sources.
|
||||
|
||||
### Generation
|
||||
- Grass no longer generates as the top layer of ground cover in river biomes.
|
||||
- Ocean biomes now use gravel instead of grass+dirt for ground cover.
|
||||
- Reduced maximum elevation of plains biomes to make them less bumpy.
|
||||
- Snow layers and other can-be-flowed-into blocks no longer generate underwater.
|
||||
|
||||
### Items
|
||||
- Buckets are no longer able to delete any block by replacing it with water.
|
||||
- Dried Kelp, Bleach, Nautilus Shell and Heart of the Sea items are registered (although crafting recipes for these are not yet available).
|
||||
- Implemented `Vanishing` enchantment.
|
||||
- Implemented Totems.
|
||||
|
||||
### World
|
||||
- Fixed explosions sometimes leaving behind air blocks with non-zero damage values.
|
||||
|
||||
# 3.0.1
|
||||
- Fixed error when players move things around in the crafting grid after plugins cancel `PlayerInteractEvent` on crafting tables.
|
||||
|
||||
# 3.0.2
|
||||
- Fixed memory dumps not showing private properties of parent classes.
|
||||
- Fixed a memory leak when cancelling all tasks in the `TaskScheduler`.
|
||||
- Fixed scheduled task timings showing `Unknown` as the plugin name.
|
||||
|
||||
# 3.0.3
|
||||
- Fixed possible crash in Sign when placed by a plugin.
|
||||
- Fixed slightly-damaged and very-damaged anvils dropping incorrect items.
|
||||
- `Living->applyPostDamageEffects()` is no longer called if the mob died from an attack.
|
||||
- Cooldown for mob attack is now reset prior to applying post-damage effects.
|
||||
- Added constant `ItemIds::MUTTON` to resolve crashes using PC worlds.
|
||||
- Fixed emerald ore not dropping XP when broken with a valid tool.
|
||||
- Fixed mobs getting crazy vertical knockback if attacked while airborne.
|
||||
- Fixed XP orbs continuing to follow dead players.
|
||||
|
||||
# 3.0.4
|
||||
- Fixed RCON spamming the console when a client does not disconnect correctly.
|
||||
- Fixed dropping chunk cache unnecessarily when no blocks need to be updated on a chunk.
|
||||
- Fixed outdated block updates getting sent on chunks replaced using `setBlock()`.
|
||||
|
||||
# 3.0.5
|
||||
- Fixed not being able to place blocks where a player died and has not yet respawned (#2265).
|
||||
- Fixed mob death animation not being played when `Entity->kill()` is called directly or `/kill` is used.
|
||||
- Fixed viewers of different halves of double chests not seeing changes made by viewers who opened the other half (#2261).
|
||||
- Fixed bugs setting items into wrong indexes when double chest halves have differently sized inventories.
|
||||
- Fixed `getConfig()` crashing when called when the plugin's data directory doesn't exist.
|
||||
- Fixed a possible exploit with keychain signing for XBL login.
|
||||
|
||||
# 3.0.6
|
||||
- Fixed invalid keys in `.properties` config files being considered as invalid strings.
|
||||
- Fixed whitespace between key and value `key = value` being invalid in `.properties` config files.
|
||||
- Fixed a bug in exception message when an invalid permission type is written for a command in plugin.yml.
|
||||
- Properly fixed newline issues when parsing event handler annotations - `@notHandler` will now work as expected when CRLF line endings are used.
|
||||
- Fixed `PluginManager->registerEvents()` registering functions as event handlers declared by parent classes which are not `Listener` instances (#2293).
|
||||
|
||||
# 3.0.7
|
||||
- Fixed setting spawn points in un-generated chunks causing the player to fall out of the world.
|
||||
- Fixed spawn protection deactivating when there are no ops set (this was an unwanted/unexpected feature, so it's considered a bug).
|
||||
- Fixed cursor items not getting dropped when closing the inventory or dying.
|
||||
- Fixed more issues with blocks with invalid metadata appearing as update! blocks.
|
||||
- `Entity->setNameTagAlwaysVisible()` now works (although nametags will still not be shown if the entity is invisible, due to a behavioural change in Minecraft PE).
|
||||
- Fixed errors passing zero motions to projectiles in some cases.
|
||||
|
||||
# 3.0.8
|
||||
- Fixed player on-ground state not updating when moving horizontally. This allowed fly hacks with the built in anti-cheat, and also affected some third party anti-cheat plugins due to the effect on `inAirTicks`.
|
||||
- Fixed knockback. PC 1.9-style knockback was mistakenly introduced in 3.0.3. This has now been reverted back to the old 1.8-style behaviour.
|
||||
|
||||
# 3.0.9
|
||||
- Cleaned up odd behaviour of `/kill` due to old broken code.
|
||||
- Fixed patch level check for plugin APIs not allowing lesser patch versions on greater minor versions.
|
||||
- Fixed `/timings paste`. This now reports directly to the timings host instead of using Ubuntu Pastebin.
|
||||
- Minor code cleanups in various places.
|
||||
- Zip resource packs will now give slightly less useless errors - errors for broken manifest have been separated from those with fields missing, and now reports why decoding failed if it failed.
|
||||
|
||||
# 3.0.10
|
||||
- Syntax error crashdumps will no longer be reported to the crash archive.
|
||||
- Chunk sending is now fault-tolerant. Before this release, any error on a worker during async chunk sending (such as memory errors caused by pthreads) would cause that chunk to never get sent, resulting in invisible and missing chunks. Levels will now attempt to retry chunk prepare when a task crashes, which should fix most invisible chunk bugs.
|
||||
- `MainLogger` now logs exception stack traces in a synchronized block to ensure that they are coherent when log messages are emitted from multiple threads at once.
|
||||
- `AsyncTask->isCrashed()` now returns `true` if a fatal error occurred during the task execution.
|
||||
|
||||
# 3.0.11
|
||||
- `DropItemAction` will now consider itself invalid if attempting to drop a null item.
|
||||
- Fixed leaking globally broadcasted Level packets when no players are on the server.
|
||||
- Fixed title bar not being cleared on server stop on some terminals.
|
||||
- Fixed `FallingBlock` saving corrupted data.
|
||||
- Fixed the structure of `GuiDataPickItemPacket`.
|
||||
- Cleaned up some code in `OfflinePlayer`.
|
||||
- Splash potions no longer apply effects to dead (but not yet respawned) players.
|
||||
- Coal ore no longer drops XP when mined with a silk touch tool.
|
||||
- Item entities now cannot be picked up when a negative pickup delay is used.
|
||||
|
||||
# 3.0.12
|
||||
- `Config` keys which are considered bools by YAML 1.1 will no longer be transformed into 1 or 0.
|
||||
- Fixed painting motives not getting saved.
|
||||
- Fixed cacti spewing items when placed in some invalid locations.
|
||||
- Fixed entity fire damage not applying in the void.
|
||||
- Fixed entities not getting updated appropriately in some conditions.
|
68
changelogs/3.1.md
Normal file
68
changelogs/3.1.md
Normal file
@ -0,0 +1,68 @@
|
||||
**For Minecraft: Bedrock Edition 1.5.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on this build and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**This build contains changes to the **protocol** which are not covered by the API version. To lock your plugin to a specific protocol version, declare the `mcpe-protocol` attribute in your `plugin.yml`.
|
||||
|
||||
# 3.1.0
|
||||
- Support for Minecraft: Bedrock Edition version 1.5.0
|
||||
|
||||
# 3.1.1
|
||||
- Fixed player on-ground state not updating when moving horizontally. This allowed fly hacks with the built in anti-cheat, and also affected some third party anti-cheat plugins due to the effect on `inAirTicks`.
|
||||
- Fixed knockback. PC 1.9-style knockback was mistakenly introduced in 3.0.3. This has now been reverted back to the old 1.8-style behaviour.
|
||||
|
||||
# 3.1.2
|
||||
- Cleaned up odd behaviour of `/kill` due to old broken code.
|
||||
- Fixed patch level check for plugin APIs not allowing lesser patch versions on greater minor versions.
|
||||
- Fixed `/timings paste`. This now reports directly to the timings host instead of using Ubuntu Pastebin.
|
||||
- Minor code cleanups in various places.
|
||||
- Zip resource packs will now give slightly less useless errors - errors for broken manifest have been separated from those with fields missing, and now reports why decoding failed if it failed.
|
||||
- Added constant `Entity::DATA_FLAG_SHOW_TRIDENT_ROPE`.
|
||||
|
||||
# 3.1.3
|
||||
- Syntax error crashdumps will no longer be reported to the crash archive.
|
||||
- Chunk sending is now fault-tolerant. Before this release, any error on a worker during async chunk sending (such as memory errors caused by pthreads) would cause that chunk to never get sent, resulting in invisible and missing chunks. Levels will now attempt to retry chunk prepare when a task crashes, which should fix most invisible chunk bugs.
|
||||
- `MainLogger` now logs exception stack traces in a synchronized block to ensure that they are coherent when log messages are emitted from multiple threads at once.
|
||||
- `AsyncTask->isCrashed()` now returns `true` if a fatal error occurred during the task execution.
|
||||
|
||||
# 3.1.4
|
||||
- `DropItemAction` will now consider itself invalid if attempting to drop a null item.
|
||||
- Fixed leaking globally broadcasted Level packets when no players are on the server.
|
||||
- Fixed title bar not being cleared on server stop on some terminals.
|
||||
- Fixed `FallingBlock` saving corrupted data.
|
||||
- Fixed the structure of `GuiDataPickItemPacket`.
|
||||
- Cleaned up some code in `OfflinePlayer`.
|
||||
- Splash potions no longer apply effects to dead (but not yet respawned) players.
|
||||
- Coal ore no longer drops XP when mined with a silk touch tool.
|
||||
- Item entities now cannot be picked up when a negative pickup delay is used.
|
||||
- Fixed extra byte at the end of `PlayerSkinPacket` not being read (1.5 protocol change that somehow got lost).
|
||||
|
||||
# 3.1.5
|
||||
- `Config` keys which are considered bools by YAML 1.1 will no longer be transformed into 1 or 0.
|
||||
- Fixed painting motives not getting saved.
|
||||
- Fixed cacti spewing items when placed in some invalid locations.
|
||||
- Fixed entity fire damage not applying in the void.
|
||||
- Fixed entities not getting updated appropriately in some conditions.
|
||||
|
||||
# 3.1.6
|
||||
- Fixed players disconnected during login verification getting leaked and not destroyed correctly.
|
||||
- Updated NBT dependency to 0.2.1 to receive bug fixes (see https://github.com/pmmp/NBT/releases/tag/0.2.1).
|
||||
|
||||
# 3.1.7
|
||||
- Errors thrown during level tick will now crash the server instead of spamming the console.
|
||||
- Fixed arrows despawning too soon after hitting the ground.
|
||||
- Fixed projectiles despawning before colliding if they were airborne for > 60 seconds.
|
||||
|
||||
# 3.1.8
|
||||
- Fixed levels unloaded during an earlier level's tick on the same tick causing a crash.
|
||||
- PermissibleBase->clearPermissions() now properly unsubscribes from all permissions.
|
||||
- Fixed incorrect break check for standing torch.
|
||||
- Fixed drops for brewing stand.
|
||||
- Fixed block picking brewing stand, bed, double slab, cake, farmland, and mob heads giving the wrong items.
|
||||
- Fixed blocks not placing correctly when clicking on redstone ore.
|
||||
- Fixed unknown PC items in tile inventories crashing the server - now they'll be quietly removed instead.
|
||||
- Fixed server freezing when eating chorus fruit from high altitude.
|
||||
- `readline` is now disabled by default on Windows and must be explicitly enabled with `--enable-readline` due to thread-safety issues.
|
||||
- Fixed server crash when trying to use non-implemented splash potions.
|
||||
- Removed incorrect maximum region file size cap which may have caused some worlds to be incorrectly detected as corrupted.
|
20
changelogs/3.10.md
Normal file
20
changelogs/3.10.md
Normal file
@ -0,0 +1,20 @@
|
||||
**For Minecraft: Bedrock Edition 1.13.0**
|
||||
|
||||
### Note about API versions
|
||||
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
|
||||
Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
|
||||
|
||||
# 3.10.0
|
||||
- Added support for Minecraft: Bedrock Edition 1.13.0
|
||||
- Removed compatibility with 1.12.0
|
||||
|
||||
## Note about skins
|
||||
PocketMine-MP **does not support skins made in the Charactor Creator** (known as Persona skins), due to technical changes which would require premature backwards compatibility breaks. The dev team has decided not to support Persona yet.
|
||||
These skins will be **replaced with a random solid-colour skin. This is not a bug.**
|
||||
Skins chosen from the Classic tab (classic skins) will continue to work as normal.
|
||||
|
||||
# 3.10.1
|
||||
- Fixed custom plugin-created skins being invisible when no geometry name was specified.
|
||||
- Updated RakLib to 0.12.6 to fix security bugs.
|
97
changelogs/3.11.md
Normal file
97
changelogs/3.11.md
Normal file
@ -0,0 +1,97 @@
|
||||
**For Minecraft: Bedrock Edition 1.14.0**
|
||||
|
||||
### Note about API versions
|
||||
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
|
||||
Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
|
||||
|
||||
# 3.11.0
|
||||
- Added support for Minecraft: Bedrock Edition 1.14.0
|
||||
- Removed compatibility with 1.13.0
|
||||
|
||||
# 3.11.1
|
||||
- Fixed blocks with incorrect properties when placed or interacted with.
|
||||
|
||||
# 3.11.2
|
||||
## Core
|
||||
- PHPStan 0.12.3 with level 5 is now used for automated static analysis.
|
||||
- Fixed a possible crash when plugins override the `EnderChest` tile class with something incompatible.
|
||||
- Fixed disconnected players being considered as never played.
|
||||
- Fixed enchantments with IDs outside the range 0-255 in item NBT crashing the server.
|
||||
- Fixed particles rendering incorrectly.
|
||||
- Timings handlers are no longer able to underflow; they now throw exceptions when attempting to be stopped more times than they were started.
|
||||
- Fixed explosion rays getting stuck in empty subchunks (possible incorrect behaviour in large caves).
|
||||
- Fixed bad tile/entity NBT data being propagated from world providers in some cases.
|
||||
- Fixed a possible crash when detecting timezone on CentOS.
|
||||
- Fixed many cases of incorrectly documented types in the API found by PHPStan.
|
||||
- Generation tasks no longer assume that generator instances stored in TLS are always valid, fixing a possible crash.
|
||||
|
||||
## Protocol
|
||||
- Fixed skin animation image corruption in LoginPacket handling caused by incorrect data handling.
|
||||
- Fixed skin animation extra data not being decoded from LoginPacket.
|
||||
- `SkinImage` now throws `InvalidArgumentException` if it receives an unexpected amount of bytes for the given image heigh/width.
|
||||
- Fixed broken code in `PlayerAuthInputPacket::create()`.
|
||||
- Removed some dead constants from `NetworkInventoryAction`.
|
||||
|
||||
# 3.11.3
|
||||
- Fixed some PHPStan false-positives in release builds.
|
||||
- Git hash is now correctly detected for source builds when the working directory is not the repository root.
|
||||
- Added a specialized build script `build/server-phar.php` for creating server phars.
|
||||
- Fixed timings crashing the server.
|
||||
- Timings chains now work correctly.
|
||||
- Fixed some minor timing errors in chained timings.
|
||||
- Forcing resource packs no longer causes removal of client-sided resource packs. If this behaviour is desired, use a vanilla resource pack at the bottom of your resource stack (as was necessary for non-forced packs).
|
||||
- Added documentation to the API to clarify that effect durations are in ticks.
|
||||
|
||||
# 3.11.4
|
||||
- Fixed performance issue in leaf decay.
|
||||
- Fixed entity position desync when entities stop moving, but still have velocity on the client.
|
||||
- Fixed a crash when encountering truncated `level.dat` files in LevelDB worlds.
|
||||
- Core code is now analyzed using PHPStan level 6.
|
||||
- The core constants `pocketmine\PATH` and `pocketmine\RESOURCE_PATH` are now unconditionally available when including the Composer autoloader.
|
||||
- Populate type information in lots of places where it was previously missing; this will improve the quality of static analysis for plugins.
|
||||
- `MainLogger::logException()` now logs previous exceptions recursively.
|
||||
- `MainLogger::logException()` now always logs exceptions as `critical`.
|
||||
|
||||
# 3.11.5
|
||||
- PHPStan and PHPUnit are now managed as Composer dev dependencies.
|
||||
- Core code is now analyzed using PHPStan level 6 (full, including iterable types checking).
|
||||
- Improved type information available to PHPStan in many areas.
|
||||
- Mass-removal of useless PHPDoc.
|
||||
- Fixed incorrect documentation of `Internet::getURL()`, `Internet::postURL()` and `Internet::simpleCurl()`.
|
||||
- Fixed crash on use of case-mismatched recursive command aliases.
|
||||
- Basic build instructions are now provided in `BUILDING.md`.
|
||||
- `build/server-phar.php` now uses GZIP compression on created phars, providing a 75% size reduction.
|
||||
- `ClientboundMapItemDataPacket` now uses `MapDecoration` objects for decorations instead of associative arrays.
|
||||
- Updated Composer dependencies to get bug fixes in `pocketmine/nbt` and other libraries.
|
||||
- Packages `pocketmine/classloader` and `pocketmine/log` are now required; these provide classes previously part of `pocketmine/spl`. This change has no effect on API compatibility.
|
||||
|
||||
# 3.11.6
|
||||
- Core code, tests and build scripts are now analyzed using `phpstan-strict-rules` and `phpstan-phpunit` rules.
|
||||
- Added more PHPStan-specific type annotations to improve static analysis.
|
||||
- Fixed more incorrect PHPDoc types.
|
||||
- Added a workaround for player movement not working since 1.14.30.
|
||||
- Fixed lava and water buckets being edible since 1.13.
|
||||
- `AutoUpdater` is now created before any plugins are loaded.
|
||||
- Fixed trees not generating below y=2 in custom generators.
|
||||
- Fixed crash when opening a chest improperly unpaired from its pair (destroyed, setBlock(), unloaded, etc.).
|
||||
- `ThreadManager` is now lazily initialized.
|
||||
- Removed raw NBT storage from `Item` internals. The following methods are now deprecated:
|
||||
- `Item::setCompoundTag()`
|
||||
|
||||
# 3.11.7
|
||||
- Build system: Fixed crash reports of Jenkins builds being rejected by the crash archive as invalid.
|
||||
- Introduced a new dependency on `pocketmine/log-pthreads`, which contains classes separated from `pocketmine/log`.
|
||||
- Fixed minimum composer stability preventing any newer version of `pocketmine/pocketmine-mp` being installed than 3.3.4 by replacing `daverandom/callback-validator` with [`pocketmine/callback-validator`](https://github.com/pmmp/CallbackValidator).
|
||||
- Fixed every player seeing eating particles when any player eats.
|
||||
- Fixed setting held item not working during `BlockBreakEvent`, `PlayerInteractEvent` and `EntityDamageEvent`.
|
||||
- Fixed some incorrect documented types in `PlayerQuitEvent` reported by PHPStan.
|
||||
- Fixed documentation of `Item->pop()` return value.
|
||||
- Fixed server crash on encountering corrupted compressed data stored in region files.
|
||||
- Protocol: Split screen header is now properly accounted for during decoding. Note that split screen is still not supported natively, but their packets can be decoded properly now.
|
||||
- Protocol: Fixed wrong order of fields in `UpdateTradePacket`.
|
||||
- Protocol: Fixed loss of `fullSkinId` when decoding network skins.
|
||||
- Fixed RCON not being able to bind to port after a fast server restart.
|
||||
|
||||
|
121
changelogs/3.2.md
Normal file
121
changelogs/3.2.md
Normal file
@ -0,0 +1,121 @@
|
||||
**For Minecraft: Bedrock Edition 1.6.0**
|
||||
|
||||
This is a minor feature release, including support for Minecraft Bedrock 1.6.0, some new minor gameplay features and some API deprecations and additions.
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on this build and do not need API bumps.
|
||||
|
||||
However, some API features have been deprecated in this version. Plugin developers do not need to do anything about these deprecations immediately, however they may raise harmless warnings if used.
|
||||
|
||||
Features marked **`@deprecated`** are **recommended** not to be used, but will continue to work for any future 3.x.y versions. They will be removed in the next major release (4.0).
|
||||
|
||||
# 3.2.0
|
||||
### Core
|
||||
- `Level` generators are now registered only when needed instead of as soon as a worker starts. This drastically reduces memory consumption on servers with lots of workers.
|
||||
- Async workers are now garbage-collected along with everything else on the default schedule. Idle workers with 0 queued tasks will be shutdown and removed from the pool to reduce memory usage.
|
||||
- UPnP error messages are now more informative of troubleshooting steps.
|
||||
- Errors are no longer caught in cases where they are unrecoverable.
|
||||
|
||||
### API
|
||||
#### Entity
|
||||
- Arrow pickup mode can now be controlled via `Arrow->setPickupMode()`. This accepts one of three `Arrow` constants: `PICKUP_NONE`, `PICKUP_ANY`, `PICKUP_CREATIVE`.
|
||||
- Added new API methods `Projectile->getBaseDamage()` and `Projectile->setBaseDamage()`.
|
||||
- Added new API methods `Entity->getScoreTag()` and `Entity->setScoreTag()`.
|
||||
|
||||
#### Events
|
||||
- The `Listener` interface has now received in-depth documentation about its behaviour and uses. See the top of the `Listener` class to read it.
|
||||
- It is now possible to declare `@ignoreCancelled` on an event handler without specifying `true` or `false`. If no value is found, `true` will be assumed.
|
||||
- `ServerCommandEvent` and `RemoteServerCommandEvent` are now **`@deprecated`** and their usage discouraged. A new generic `CommandEvent` has been introduced in its place, which allows capturing commands from any type of command sender. This was done in response to difficulties of code duplication when wanting to intercept commands from both console and players.
|
||||
- `EntityDamageEvent`
|
||||
- Added `MODIFIER_WEAPON_ENCHANTMENTS` constant for attack damage bonuses due to enchantments like Sharpness.
|
||||
- Added new API methods `getAttackCooldown()` and `setAttackCooldown()` to allow controlling Living entities attack cooldown times (default 10 ticks).
|
||||
- `PlayerDeathEvent`: Added new static method `deriveMessage()`.
|
||||
- `PlayerKickEvent`: Added new method `setReason()`.
|
||||
|
||||
#### Forms
|
||||
- Added a new `pocketmine\form\Form` interface. Implementing this interface permits custom form implementations to make use of `Player->sendForm()`, eliminating the need to handle packets directly and also solving the form ID collision problem.
|
||||
|
||||
#### Items
|
||||
- `Item` and `ItemFactory` now support negative item IDs (needed for future extended blocks support).
|
||||
- Updated `ItemIds` interface with new constants.
|
||||
|
||||
#### Permission
|
||||
- Added a new `PermissionManager` class which encapsulates all of the permission-management functionality originally bloating `PluginManager`. The API is identical to that of `PluginManager`'s permission API. All methods moved to `PermissionManager` have **`@deprecated`** redirects remaining behind in `PluginManager`, which will be removed in the next major release (4.0).
|
||||
|
||||
#### Plugin
|
||||
- `PluginBase->getConfig()` will now automatically save the default config if it does not already exist.
|
||||
- Plugin data directories will now be automatically created on plugin load, eliminating the need for boilerplate `@mkdir($this->getDataFolder())` calls at the top of every plugin.
|
||||
|
||||
#### Tile
|
||||
- `Tile::createNBT()` will now throw a `BadMethodCallException` when called directly.
|
||||
|
||||
#### Utils
|
||||
- `Utils::getURL()`, `Utils::postURL()`, `Utils::simpleCurl()` and `Utils::getIP()` have been moved to a new `pocketmine\utils\Internet` class. The original methods are **`@deprecated`** and will be removed for the next major version (4.0).
|
||||
- Removed the ability for `Config` to be asynchronously saved. This was discussed for removal because of various problems that it causes. It was deemed not worth fixing since `Config` saving should not be significant enough to cause problems anyway. See #2298 for details.
|
||||
|
||||
#### Server
|
||||
- Deprecated `level` parameter of `findEntity()`. This parameter was premature optimization. Code using it will continue to work as before.
|
||||
|
||||
### Gameplay
|
||||
#### General
|
||||
- Air bubbles are now regenerated at the same speed as vanilla UpdateAquatic, instead of instantly when leaving water.
|
||||
- Implemented Conduit Power effect.
|
||||
|
||||
#### Enchantments
|
||||
- Implemented the following enchantments: Thorns, Sharpness, Knockback, Fire Aspect, Power, Punch, Flame, Infinity, Mending.
|
||||
|
||||
#### Items
|
||||
- Added the following new items: `Scute`
|
||||
|
||||
# 3.2.1
|
||||
- Fixed `VerifyLoginTask` completion bug when players get disconnected prior to the task completing.
|
||||
- Fixed client crash issue due to outdated runtime ID mappings.
|
||||
|
||||
# 3.2.2
|
||||
- Updated NBT dependency to 0.2.1 to receive bug fixes (see https://github.com/pmmp/NBT/releases/tag/0.2.1).
|
||||
|
||||
# 3.2.3
|
||||
- Errors thrown during level tick will now crash the server instead of spamming the console.
|
||||
- Fixed arrows despawning too soon after hitting the ground.
|
||||
- Fixed projectiles despawning before colliding if they were airborne for > 60 seconds.
|
||||
- Fixed crash related to Flame enchantment when the player shooting the arrow was on fire.
|
||||
|
||||
# 3.2.4
|
||||
- Fixed levels unloaded during an earlier level's tick on the same tick causing a crash.
|
||||
- PermissibleBase->clearPermissions() now properly unsubscribes from all permissions.
|
||||
- Fixed incorrect break check for standing torch.
|
||||
- Fixed drops for brewing stand.
|
||||
- Fixed block picking brewing stand, bed, double slab, cake, farmland, and mob heads giving the wrong items.
|
||||
- Fixed blocks not placing correctly when clicking on redstone ore.
|
||||
- Fixed unknown PC items in tile inventories crashing the server - now they'll be quietly removed instead.
|
||||
- Fixed server freezing when eating chorus fruit from high altitude.
|
||||
- `readline` is now disabled by default on Windows and must be explicitly enabled with `--enable-readline` due to thread-safety issues.
|
||||
- Fixed server crash when trying to use non-implemented splash potions.
|
||||
- Removed incorrect maximum region file size cap which may have caused some worlds to be incorrectly detected as corrupted.
|
||||
|
||||
# 3.2.5
|
||||
- `Player->sendForm()` now throws a proper exception when failing to JSON-encode `Form` objects given to it.
|
||||
- Fixed crash when handling later packets in a batch when an earlier packet triggered termination of the player's connection.
|
||||
- Fixed a race condition causing progress updates in `AsyncTasks` to be lost when published near completion.
|
||||
- Fixed bad decoding for some packets with unsupported structures.
|
||||
- Crash dumps no longer report 20 empty lines when an error occurs in `eval()`'d code.
|
||||
- `pocketmine/nbt` dependency updated to `0.2.2` to fix bugs (see NBT repo for changelog).
|
||||
|
||||
# 3.2.6
|
||||
- Chunk ticking no longer occurs in chunks which have an adjacent unloaded chunks, fixing things like grass ticking triggering unintentional chunk loading.
|
||||
- Fixed some lighting propagation issues where step count is the same but light level is different.
|
||||
- Fixed full-chunk light repopulation producing broken lighting when the generator hasn't been registered on a worker.
|
||||
- Fixed a missing field in `MoveEntityDeltaPacket`.
|
||||
- Added client-sided rate limiting for crashdump reporting to mitigate involuntary DDoS of the crash archive.
|
||||
- Fixed a bug in `start.cmd` where quotes would appear around the "couldn't find installation" message.
|
||||
|
||||
# 3.2.7
|
||||
- Added a network-layer check for item NBT size to avoid unexplained client-sided crashes due to length overflow.
|
||||
- Fixed some desync bugs with double chests when one half of a double chest is unloaded.
|
||||
- Anonymous class timings will now have a cleaned path for the identifier relative to the plugins directory.
|
||||
- Anonymous class timings now render correctly on timings.pmmp.io.
|
||||
- Fixed empty garbage subchunks not getting removed from long-life chunks.
|
||||
- `start.ps1`, `start.sh` and `start.cmd` no longer recognize source-code installations. Since source-code installations should only be used by developers who know what they are doing anyway, this was considered unwise to keep.
|
||||
- Fixed a bug/oversight in network chunk preparation that caused chunk prepare to be 4x slower than necessary.
|
||||
- `Chunk->fastSerialize()` now doesn't serialize useless data (data is omitted based on chunk flags). This significantly reduces the amount of useless data getting copied for generation, population and light calculation.
|
||||
- `TaskHandler->cancel()` was incorrectly marked as `@internal` in 2014. This has been fixed. Plugin developers should in fact prefer `TaskHandler->cancel()` since it does not require a task to have a circular dependency on its own executor.
|
44
changelogs/3.3.md
Normal file
44
changelogs/3.3.md
Normal file
@ -0,0 +1,44 @@
|
||||
**For Minecraft: Bedrock Edition 1.7.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the bug fixes in this build.
|
||||
|
||||
# 3.3.0
|
||||
- Compatibility with Minecraft: Bedrock Edition 1.7.0
|
||||
- Removed compatibility with 1.6.0
|
||||
- `Player->sendForm()` now throws a proper exception when failing to JSON-encode `Form` objects given to it.
|
||||
- Fixed crash when handling later packets in a batch when an earlier packet triggered termination of the player's connection.
|
||||
- Fixed a race condition causing progress updates in `AsyncTasks` to be lost when published near completion.
|
||||
- Fixed bad decoding for some packets with unsupported structures.
|
||||
- Crash dumps no longer report 20 empty lines when an error occurs in `eval()`'d code.
|
||||
- `pocketmine/nbt` dependency updated to `0.2.2` to fix bugs (see NBT repo for changelog).
|
||||
|
||||
# 3.3.1
|
||||
- Chunk ticking no longer occurs in chunks which have an adjacent unloaded chunks, fixing things like grass ticking triggering unintentional chunk loading.
|
||||
- Fixed some lighting propagation issues where step count is the same but light level is different.
|
||||
- Fixed full-chunk light repopulation producing broken lighting when the generator hasn't been registered on a worker.
|
||||
- Fixed a missing field in `MoveEntityDeltaPacket`.
|
||||
- Added client-sided rate limiting for crashdump reporting to mitigate involuntary DDoS of the crash archive.
|
||||
- Fixed a bug in `start.cmd` where quotes would appear around the "couldn't find installation" message.
|
||||
|
||||
# 3.3.2
|
||||
- Added a network-layer check for item NBT size to avoid unexplained client-sided crashes due to length overflow.
|
||||
- Fixed some desync bugs with double chests when one half of a double chest is unloaded.
|
||||
- Anonymous class timings will now have a cleaned path for the identifier relative to the plugins directory.
|
||||
- Anonymous class timings now render correctly on timings.pmmp.io.
|
||||
- Fixed empty garbage subchunks not getting removed from long-life chunks.
|
||||
- `start.ps1`, `start.sh` and `start.cmd` no longer recognize source-code installations. Since source-code installations should only be used by developers who know what they are doing anyway, this was considered unwise to keep.
|
||||
- Fixed a bug/oversight in network chunk preparation that caused chunk prepare to be 4x slower than necessary.
|
||||
- `Chunk->fastSerialize()` now doesn't serialize useless data (data is omitted based on chunk flags). This significantly reduces the amount of useless data getting copied for generation, population and light calculation.
|
||||
- `TaskHandler->cancel()` was incorrectly marked as `@internal` in 2014. This has been fixed. Plugin developers should in fact prefer `TaskHandler->cancel()` since it does not require a task to have a circular dependency on its own executor.
|
||||
|
||||
# 3.3.3
|
||||
- Development build error messages are now more user friendly.
|
||||
- Fixed meta-only changes not getting saved correctly in `SubChunk->setBlock()`.
|
||||
- Server will now sleep for up to 120 seconds on a crash if the uptime was less than 120 seconds. This delay is intended to reduce crash archive spam and can be skipped by the user if attended by pressing CTRL+C.
|
||||
- Fixed preprocessed builds sometimes having `new ` calls treated as function calls.
|
||||
- Fixed a rare corruption case where player data could be written incorrectly due to a race condition.
|
||||
- `DataPacket` will now throw errors when attempting to read/write nonexisting fields to make it easier to debug protocol change errors.
|
||||
|
||||
# 3.3.4
|
||||
- Fixed an undefined `DataPacket` field making the previous release unusable.
|
97
changelogs/3.4.md
Normal file
97
changelogs/3.4.md
Normal file
@ -0,0 +1,97 @@
|
||||
**For Minecraft: Bedrock Edition 1.7.0**
|
||||
|
||||
This is a cumulative minor release featuring performance improvements, memory usage improvements, some new minor gameplay features, some API deprecations and additions, and significant changes to error handling.
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
|
||||
|
||||
However, some API features have been deprecated in this version. Plugin developers do not need to do anything about these deprecations immediately, however they may raise harmless warnings if used.
|
||||
|
||||
Features marked **`@deprecated`** are **recommended** not to be used, but will continue to work for any future 3.x.y versions. They will be removed in the next major release (4.0).
|
||||
|
||||
# 3.4.0
|
||||
## Core changes
|
||||
### Performance & memory improvements
|
||||
- Entity `EXHAUSTION` attribute is no longer synced to the client, which reduces network traffic for survival players and reduces client-sided lag.
|
||||
- A redundant call was removed from an `Event` call hot path which improves event calling performance by ~15% per event handler executed.
|
||||
- Light updates are now batched together and executed on the end of each tick. The effects of this are noticeable when setting a large number of blocks in a close area - significant performance improvements should be noticeable for world editors (the ones that didn't disable light updates) and liquid flow is now significantly less expensive.
|
||||
- Internal enhancements have been made to subchunk light array interfacing to reduce branching and improve access performance.
|
||||
- Memory usage of most chunks has dropped by ~30-40% due to some improvements to internal storage of unlit subchunks. In real terms this translates to ~30% memory usage reduction for a freshly generated world.
|
||||
|
||||
### Error handling
|
||||
The most notable core change in this release revolves around error handling. Internals have been cleaned up substantially to improve the server behaviour under occurrence of unexpected behaviour. The goal of this is to improve consistency and quality while reducing undefined runtime behaviour.
|
||||
The following changes have been made:
|
||||
- Throwing **unexpected** `Throwable`s in the following cases will now cause a server crash (except on network (this will be changed in the future)):
|
||||
- Event handlers
|
||||
- `Task->onRun()` on a scheduler
|
||||
- `AsyncTask->onCompletion()`
|
||||
- `Command->execute()` and `CommandExecutor->onCommand()`
|
||||
- Unexpected `Throwable`s thrown during packet handling will now cause the target player to be disconnected with an `Internal server error` message.
|
||||
|
||||
### Other changes
|
||||
- Anti-flight has been removed, along with the `allow-flight` directive in `server.properties`.
|
||||
- Server language is now controlled by the `language` directive in `server.properties`.
|
||||
- Added `unban` and `unban-ip` as aliases of `pardon` and `pardon-ip` commands respectively.
|
||||
|
||||
## API changes
|
||||
### Block
|
||||
- `BlockSpreadEvent` is now fired when lava or water tries to flow into a block.
|
||||
- `BlockFormEvent` is now fired when lava and water collide to form cobblestone, obsidian or stone.
|
||||
|
||||
### Event
|
||||
- Added new method `Event->call()`. This should be used instead of `PluginManager->callEvent()` in plugins only supporting 3.4+.
|
||||
- `PluginManager->callEvent()` has been `@deprecated`.
|
||||
|
||||
### Level
|
||||
- Attempting to unload a level during its tick will now throw an `InvalidStateException`.
|
||||
- Added the following new methods:
|
||||
- `Level->broadcastPacketToViewers()`
|
||||
- `Level->getViewersForPosition()`
|
||||
- `Level->broadcastGlobalPacket()`
|
||||
- `Level->getChunkAtPosition()`
|
||||
- `Level->isInLoadedTerrain()`
|
||||
- `Level->addGlobalPacket()` has been `@deprecated`.
|
||||
- `LightUpdate` now allows calling `setAndUpdateLight()` for the same position multiple times (needed for light update batching).
|
||||
|
||||
### Permission
|
||||
- `Permission::getByName()` now throws an exception on invalid values instead of silently returning `DEFAULT_FALSE`. This may cause new errors to appear if your plugins had broken permission defaults in `plugin.yml`.
|
||||
|
||||
### Player
|
||||
- `addWindow()` now has stricter validity checks and will now throw exceptions in the following cases: No window IDs left to use, and when a forced window ID collides with an existing window.
|
||||
- The public `$speed` field has been removed (this was only used by anti-cheat which has now been removed).
|
||||
|
||||
### Scheduler
|
||||
- `AsyncTask->setResult()` has had the `$serialize` parameter removed - now it will automatically serialize (or not) as appropriate.
|
||||
- Added a new `ClosureTask` which allows concisely scheduling closure execution on a `TaskScheduler`.
|
||||
- `TaskScheduler->__construct()` `$logger` parameter has been `@deprecated` and will be removed in a future major version.
|
||||
|
||||
### Server
|
||||
- Added new method `Server->hasOfflinePlayerData(string $name) : bool`.
|
||||
- `Server->getAllowFlight()` has been `@deprecated`.
|
||||
|
||||
### Utils
|
||||
- `Config->save()` will no longer catch unexpected exceptions thrown while encoding data.
|
||||
|
||||
## Gameplay changes
|
||||
### Blocks
|
||||
- Rail connectivity has been implemented for normal, powered, detector and activator rails (but there are currently no minecarts).
|
||||
|
||||
# 3.4.1
|
||||
- Updated crashdump format to be compatible with newest CA. This version or newer is required if you want to be able to submit crashdumps to crash.pmmp.io.
|
||||
|
||||
# 3.4.2
|
||||
- `DataPacket` errors when writing to undefined fields are now more clear.
|
||||
- Fixed trees being able to overwrite the log parts of other trees.
|
||||
- Fixed `Player->sendForm()` not working during `PlayerJoinEvent`.
|
||||
- `Entity->setScale()` now explicitly requires a scale larger than 0.
|
||||
- Adding invisible `FloatingTextParticle` to a level no longer causes an error.
|
||||
|
||||
# 3.4.3
|
||||
- Fixed burning TNT setting hurt entities on fire when exploding.
|
||||
- `~` relative coordinates now work in the `/particle` command.
|
||||
- Various boring fixes to error stack trace reporting.
|
||||
- `Level->setChunk()` no longer deletes tiles and entities when replacing a chunk with itself.
|
||||
- Fixed a generator race condition causing rare appearances of half-trees on the client in freshly generated terrain.
|
||||
- `Attribute->resetToDefault()` now fits the default per the min/max bounds, fixing crashes when the bounds are changed to exclude the default.
|
||||
- Fixed a crash with LevelDB worlds when the `TAG_2D_MAPS` tag is missing.
|
||||
- Fixed `Utils::getCoreCount()` crashing on some Debian variants.
|
149
changelogs/3.5.md
Normal file
149
changelogs/3.5.md
Normal file
@ -0,0 +1,149 @@
|
||||
**For Minecraft: Bedrock Edition 1.8.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
# 3.5.0
|
||||
- Compatibility with Minecraft: Bedrock Edition 1.8.0
|
||||
- Removed compatibility with 1.7.0
|
||||
|
||||
# 3.5.1
|
||||
- Fixed internal server errors when attempting to craft.
|
||||
- `DataPacket` errors when writing to undefined fields are now more clear.
|
||||
- Fixed trees being able to overwrite the log parts of other trees.
|
||||
- Fixed `Player->sendForm()` not working during `PlayerJoinEvent`.
|
||||
- `Entity->setScale()` now explicitly requires a scale larger than 0.
|
||||
- Adding invisible `FloatingTextParticle` to a level no longer causes an error.
|
||||
|
||||
# 3.5.2
|
||||
- Updated some misc protocol magic numbers.
|
||||
- Fixed burning TNT setting hurt entities on fire when exploding.
|
||||
- `~` relative coordinates now work in the `/particle` command.
|
||||
- Various boring fixes to error stack trace reporting.
|
||||
- `Level->setChunk()` no longer deletes tiles and entities when replacing a chunk with itself.
|
||||
- Fixed a generator race condition causing rare appearances of half-trees on the client in freshly generated terrain.
|
||||
- `Attribute->resetToDefault()` now fits the default per the min/max bounds, fixing crashes when the bounds are changed to exclude the default.
|
||||
- Fixed a crash with LevelDB worlds when the `TAG_2D_MAPS` tag is missing.
|
||||
- Fixed `Utils::getCoreCount()` crashing on some Debian variants.
|
||||
|
||||
# 3.5.3
|
||||
- Rewritten documentation of `PlayerPreLoginEvent`, `PlayerLoginEvent` and `PlayerJoinEvent`. They are now much more detailed and no longer misleading.
|
||||
- Chest items block-picked from double chests will no longer place chests that crash the server when opened.
|
||||
- Ender chests now make the correct sounds when opening and closing.
|
||||
- Fixed Sign errors when a buggy or malicious client sent broken NBT with the wrong tags or wrong number of lines.
|
||||
- Resource packs with comments in the manifest will now load correctly. (MOJANG!!!)
|
||||
- Placement of unknown blocks is now disallowed. This solves a range of problems with invalid blocks in the world, such as #2260 .
|
||||
- Errors thrown during `PlayerQuitEvent` or other `Player->close()` errors will now crash the server instead of causing cryptic bugs later on.
|
||||
- Fixed large chunks (>= 1044476 bytes) becoming corrupted when saved in Region-based worlds - now an exception is thrown instead.
|
||||
- Reduced the range of exceptions caught during chunk loading. Now, only chunk corruption errors are caught, and anything else will produce a crash.
|
||||
- Removed catch-all block on chunk saving. Unexpected errors thrown during chunk save will now create a crash.
|
||||
- Fixed some asserts in packet decode methods.
|
||||
- `Attribute` now throws exceptions with more informative messages on errors.
|
||||
- Properly handled some remaining `Uninitialized string offset` bugs when decoding packets.
|
||||
- Fixed chunk updates taking several seconds to show up on the client. This bug was most apparent during generation and some world editing tools using asynchronous tasks.
|
||||
- Fixed CPU waste ordering chunks for non-moving players.
|
||||
|
||||
# 3.5.4
|
||||
### Fixes
|
||||
- Fixed server crash when a block update occurs on a torch with corrupted metadata.
|
||||
- Added a hack to mitigate client-side right-click spam bug. This mostly eliminates spam of `PlayerInteractEvent` on right-click.
|
||||
- Players will no longer see commands they don't have permission to use in client-sided hints when typing a `/` in the chat window.
|
||||
- `Event->isCancelled()` and `Event->setCancelled()` now throw more informative errors.
|
||||
- Errors thrown during a network interface processing will now _actually_ crash the server.
|
||||
|
||||
### API changes
|
||||
- Deprecated `NetworkInterfaceCrashEvent`. Nobody should have been using this anyway.
|
||||
- Deprecated `Network->processInterface()`
|
||||
- Deprecated `SourceInterface->emergencyShutdown()`
|
||||
|
||||
# 3.5.5
|
||||
- Mobs no longer spawn with their heads facing a different direction to their bodies.
|
||||
- Added a console message when the crash strangler sleeps to stop crash spam.
|
||||
- Fixed crash in `/title` command `times` subcommand when not enough arguments were passed.
|
||||
- AsyncWorkers will now not be shut down on GC unless they have not been used for the last 5 minutes. This reduces lag spikes on garbage collection.
|
||||
- Fixed some unhandled error cases in `AddEntityPacket` encoding.
|
||||
- Fixed `LogicException` descendents being thrown from some packet decoding methods when encountering bad userdata.
|
||||
- Player network inventory transaction processing now catches more specific errors.
|
||||
- Fixed missing decode for `TakeItemEntityPacket`.
|
||||
- Fixed `/gc` and `/status` truncating memory statistics - now they report to 0.01 precision.
|
||||
- Global functions and constants are now imported to improve performance.
|
||||
- Fixed a typo in `pocketmine.command.op.take` description.
|
||||
- Ice no longer creates water when a creative player breaks it.
|
||||
- `spawn-mobs` and `spawn-animals` no longer appear in generated `server.properties` on a newly-installed server.
|
||||
- Added a hack to disable pre-spawn client-sided movement.
|
||||
- Assertions enabled warning now always shows when `zend.assertions` is not `-1`. The config option to disable this warning has been removed.
|
||||
- `/status`,`/dumpmemory` and `/gc` are now enabled by default. The `debug.commands` config option has been removed.
|
||||
- Crash dumps are now more thorough at catching plugin-related crashes.
|
||||
|
||||
# 3.5.6
|
||||
- Fixed `#`-commenting properties in `.properties` files not working.
|
||||
- `pocketmine.yml` now permits writing `worldname:` with no generation settings in the `worlds` section to force a world to be loaded.
|
||||
- Fixed Bow force being too low - now it's consistent with Minecraft Java (but not with Bedrock due to a vanilla bug).
|
||||
- Fixed `recursion detected` bug when encoding crashdumps in some cases.
|
||||
- Items with too-large NBT tags on network will now have their tags ignored when sending over network, instead of crashing the server. This is a workaround for a protocol bug which will be addressed in a future Minecraft release.
|
||||
- `/enchant` no longer crashes the server when out-of-bounds enchantment levels are used.
|
||||
- Fixed some crashes loading Region-based worlds when encountering unexpected EOF.
|
||||
- `Entity->fireTicks` is now protected (but accessible by magic method for BC purposes) and will now throw an exception when written to if the value is > 32767 or < 0.
|
||||
- Fixed Signs asserting on corrupted world data with more than 4 lines of text per sign.
|
||||
|
||||
# 3.5.7
|
||||
- Fixed several bugs in RCON packet receive that would allow an attacker to block or crash the RCON thread, denying service to other legitimate RCON clients.
|
||||
- Fixed RCON connections not working (timing out with no response) on some platforms.
|
||||
- Logins are now permitted to have up to 60 seconds clock drift on the `nbf` and `exp` timestamps in the login JWT.
|
||||
- Fixed XP orbs following players who switched to a location spatially nearby in a different world.
|
||||
- `Player->removeWindow()` now throws `InvalidArgumentException` instead of `BadMethodCallException` when trying to non-forcefully remove a fixed window ID.
|
||||
|
||||
# 3.5.8
|
||||
- Fixed player XP not dropping if a player was fast enough to respawn.
|
||||
- Player XP drop amount now matches vanilla (7x level points, incurs some loss of points for higher levels)
|
||||
- Fixed Doxygen configuration including test sources.
|
||||
- Improved performance of block-cache accesses.
|
||||
- Improved performance of random block-ticking.
|
||||
- Closure tasks will now show the correctly formatted name on timings.
|
||||
- Fixed a crash when a local update happens next to an `ItemFrame` with invalid metadata.
|
||||
- Fixed player being subscribed to broadcast permissions too early when permissions are modified before spawn.
|
||||
- Block-picking is now disallowed on unknown blocks.
|
||||
- Internal IP detection now works correctly on all platforms.
|
||||
- Fixed UPnP portforwarding not working correctly when multiple network adapters are installed.
|
||||
- Starting or stopping flight now resets fall distance and in-air ticks.
|
||||
- Fixed falling causing starvation.
|
||||
- Fixed crops consuming bone meal when fully grown.
|
||||
- Users are no longer able to avoid agreeing to the license by restarting the server.
|
||||
- Explosions no longer create broken double chests which crash the server. Existing chests affected by this bug will continue to crash. This will be addressed in a future release.
|
||||
- Cactus and sugarcane no longer grow through non-air blocks.
|
||||
- Fixed a memory leak in `setChunk()` when the `unload` parameter is true.
|
||||
- Generator will now crash if preset is invalid, instead of producing unexpected results.
|
||||
|
||||
# 3.5.9
|
||||
- Fixed a `setChunk()` bug introduced by 3.5.8.
|
||||
- Applied a hack to disable client-sided automatic regeneration.
|
||||
- `Level->getChunkPlayers()` is now deprecated.
|
||||
|
||||
# 3.5.10
|
||||
- Some internal `Level` functions are now correctly marked `@internal`.
|
||||
- Fixed splash potion distance being measured from player feet instead of eye height.
|
||||
- Fixed tall grass being unplaceable on dirt.
|
||||
- A debug message is now recorded when a chunk is loaded with no associated loaders.
|
||||
- Composer dependencies have been updated to fix bugs in some dependencies.
|
||||
|
||||
# 3.5.11
|
||||
- Fixed crashing when items with negative IDs are found in the inventory (caused by downgrading from dev builds).
|
||||
- Updated creative inventory and crafting recipes.
|
||||
|
||||
# 3.5.12
|
||||
- Fixed crash when too-large values are given to `/effect` for duration.
|
||||
- `/op` and other commands no longer crash when an invalid player name is given.
|
||||
- Startup time no longer includes the time spent in the setup wizard.
|
||||
- `TextFormat::clean()` is now UTF-8 aware, and will scrub any invalid UTF-8 characters from the given string.
|
||||
- Fixed `TextFormat::clean()` not fully removing ANSI escape codes in some cases.
|
||||
- Fixed Korean command arguments failing to parse.
|
||||
- `Sign->setText()` and `Sign->setLine()` now enforce that the given text must be UTF-8 text, or an exception will be thrown.
|
||||
- Sign text is now processed by `mb_scrub()` immediately after loading to remove invalid UTF-8 characters that could crash the client.
|
||||
- `Human->exhaust()` no longer underflows when the hunger attribute has a fractional value.
|
||||
|
||||
# 3.5.13
|
||||
- Added a hack to disable client sided AI for non-moving entities. This fixes items floating in water despite it not being implemented server-side yet.
|
||||
- Fixed max health not working as expected on respawn if changed by plugins.
|
||||
- Fixed Item Frame hardness (0.25 instead of 0).
|
||||
- Fire Aspect tools will now light TNT when right-clicked with.
|
||||
- Fixed incorrect nullable typehints on `TaskScheduler` return values.
|
65
changelogs/3.6.md
Normal file
65
changelogs/3.6.md
Normal file
@ -0,0 +1,65 @@
|
||||
**For Minecraft: Bedrock Edition 1.9.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
This changelog **does not account for protocol changes**. If your plugin uses the protocol, you're not shielded by API change constraints.
|
||||
|
||||
# 3.6.0
|
||||
- Compatibility with Minecraft: Bedrock Edition 1.9.0
|
||||
- Removed compatibility with 1.8.0
|
||||
- `Item->getCompoundTag()` is now `@deprecated`.
|
||||
- `Item->setCompoundTag()` now accepts NULL as a possible value.
|
||||
- `ItemFactory::fromString()` now accepts NULL for the `tags` parameter.
|
||||
|
||||
# 3.6.1
|
||||
- Fixed crashing when items with negative IDs are found in the inventory (caused by downgrading from dev builds).
|
||||
- Updated creative inventory and crafting recipes.
|
||||
- Fixed handling for some new blocks which magically appeared without appropriate implementations (extra meta values).
|
||||
|
||||
# 3.6.2
|
||||
- Fixed client-sided crash when upper-case letters appear in command names.
|
||||
- Fixed crash when too-large values are given to `/effect` for duration.
|
||||
- `/op` and other commands no longer crash when an invalid player name is given.
|
||||
- Startup time no longer includes the time spent in the setup wizard.
|
||||
- `TextFormat::clean()` is now UTF-8 aware, and will scrub any invalid UTF-8 characters from the given string.
|
||||
- Fixed `TextFormat::clean()` not fully removing ANSI escape codes in some cases.
|
||||
- Fixed Korean command arguments failing to parse.
|
||||
- `Sign->setText()` and `Sign->setLine()` now enforce that the given text must be UTF-8 text, or an exception will be thrown.
|
||||
- Sign text is now processed by `mb_scrub()` immediately after loading to remove invalid UTF-8 characters that could crash the client.
|
||||
- `Human->exhaust()` no longer underflows when the hunger attribute has a fractional value.
|
||||
|
||||
# 3.6.3
|
||||
- Added a hack to disable client sided AI for non-moving entities. This fixes items floating in water despite it not being implemented server-side yet.
|
||||
- Fixed max health not working as expected on respawn if changed by plugins.
|
||||
- Fixed Item Frame hardness (0.25 instead of 0).
|
||||
- Fire Aspect tools will now light TNT when right-clicked with.
|
||||
- Fixed incorrect nullable typehints on `TaskScheduler` return values.
|
||||
|
||||
# 3.6.4
|
||||
- `NetworkStackLatencyPacket` unhandled debug has been silenced.
|
||||
- Fixed `Player->removeWindow()` removing GUI or crashing clients when removing a window which was not added.
|
||||
- Fixed packed ice dropping itself when mined without a silk touch pickaxe.
|
||||
- Fixed players not taking fall damage when falling off the side of a ladder when their AABB was intersecting with the ladder's full block area.
|
||||
- Fixed arrows reloaded from disk never despawning.
|
||||
- Fixed player XP not dropping on death.
|
||||
- Fixed player's held slot being out of sync when respawning.
|
||||
- Fixed items with different NBT being considered stackable in some cases by `BaseInventory->canAddItem()`.
|
||||
|
||||
# 3.6.5
|
||||
- Fixed stdout silence on crash if a crash occurs when PHP output buffering is enabled.
|
||||
- Fixed `RegionLoader` considering a range of invalid chunk coordinates as valid.
|
||||
- Fixed `RegionLoader` causing region header corruption when an oversized chunk was discovered. This was causing entire regions to be discarded next time they were freshly loaded.
|
||||
- Fixed performance issue loading old LevelDB worlds (from before MCPE 1.0) due to unmodified chunks being converted every time they were loaded.
|
||||
- Added new debug messages when a world takes too long (longer than 50ms) to complete a tick.
|
||||
- Debug messages are now logged when autosave kicks in (with time measurements), which helps debugging unexplained lag spikes.
|
||||
- Level "auto tick rate" anti-feature and its associated `pocketmine.yml` settings have been removed (see #2665). The settings will persist in old configurations, but will be ignored by this version and future versions.
|
||||
- The `/save-all` command now outputs custom (non-vanilla) messages informing the user how long it took to complete autosaving.
|
||||
- The word `level` has been replaced with `world` (where appropriate) throughout language strings and general user interface messages.
|
||||
|
||||
# 3.6.6
|
||||
- Fixed protocol argument types for commands.
|
||||
- Autosave debug message will now report in milliseconds when the time taken is less than 1 second.
|
||||
- Flatworld presets now allow `*` as a multiplier symbol (fixes PC compatibility).
|
||||
- Network runtimeIDs for blocks are now randomized to prevent things (like plugins) relying on them.
|
||||
- Updated NBT dependency to 0.2.7 for some bug fixes.
|
33
changelogs/3.7.md
Normal file
33
changelogs/3.7.md
Normal file
@ -0,0 +1,33 @@
|
||||
**For Minecraft: Bedrock Edition 1.10.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
This changelog **does not account for protocol changes**. If your plugin uses the protocol, you're not shielded by API change constraints.
|
||||
|
||||
# 3.7.0
|
||||
- Compatibility with Minecraft: Bedrock Edition 1.10.0
|
||||
- Removed compatibility with 1.9.0
|
||||
|
||||
# 3.7.1
|
||||
- Fixed protocol argument types for commands.
|
||||
- Autosave debug message will now report in milliseconds when the time taken is less than 1 second.
|
||||
- Flatworld presets now allow `*` as a multiplier symbol (fixes PC compatibility).
|
||||
- Network runtimeIDs for blocks are now randomized to prevent things (like plugins) relying on them.
|
||||
- Updated NBT dependency to 0.2.7 for some bug fixes.
|
||||
|
||||
# 3.7.2
|
||||
- Fixed a memory leak when `PlayerLoginEvent` is cancelled.
|
||||
- Fixed permissions `pocketmine.command.ban.list`, `pocketmine.command.difficulty`, `pocketmine.command.whitelist.enable` and `pocketmine.command.whitelist.disable` always being granted to operators.
|
||||
- Fixed some commands outputting `commands.generic.permission` instead of the proper message when running commands that the sender doesn't have permission to use.
|
||||
- Worlds with unknown generator types will now refuse to load instead of getting incorrect terrain generation ruining them.
|
||||
- `TextFormat::tokenize()` no longer corrupts Unicode sequences.
|
||||
- `TextFormat::clean()` now removes non-printable Unicode code points in the private-use area.
|
||||
- Running two servers in the same data directory is no longer allowed and will gracefully halt instead of corrupting your data.
|
||||
- Sign text length is now soft-capped at 1000 characters.
|
||||
|
||||
# 3.7.3
|
||||
- World save timings now include saves that are triggered by chunk unloading.
|
||||
- Fixed several network denial-of-service bugs.
|
||||
- A warning is now emitted when the `ChunkUtils` extension is not loaded.
|
||||
- Moved version constants to a separate `VersionInfo` file for easier parsing and handling.
|
69
changelogs/3.8.md
Normal file
69
changelogs/3.8.md
Normal file
@ -0,0 +1,69 @@
|
||||
**For Minecraft: Bedrock Edition 1.11.0**
|
||||
|
||||
### Note
|
||||
Plugins compatible with any previous 3.x.y version will also run on these releases and do not need API bumps. Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
This changelog **does not account for protocol changes**. If your plugin uses the protocol, you're not shielded by API change constraints.
|
||||
|
||||
# 3.8.0
|
||||
- Compatibility with Minecraft: Bedrock Edition 1.11.0
|
||||
- Removed compatibility with 1.10.0
|
||||
|
||||
# 3.8.1
|
||||
- Fixed furnace smelting recipes not working.
|
||||
- Reduced legacy hacks dealing with `BatchPacket` to fix possible ID collisions.
|
||||
- Reduced release phar size by minifying JSON data blobs.
|
||||
- Moved some MCPE-specific JSON blobs to submodule.
|
||||
|
||||
# 3.8.2
|
||||
- Fixed --enable-ansi and --disable-ansi not being respected on threads.
|
||||
- Fixed a crash that could occur when decoding `AvailableCommandsPacket`.
|
||||
- Fixed a crash when loading worlds with entities with missing `Motion` NBT tag.
|
||||
- Fixed a crash when world time overflows signed int64 max.
|
||||
- Fixed world generators and providers being registered too late (this was causing plugin issues).
|
||||
- Updated RakLib version to get a security fix.
|
||||
- Fixed errors when custom clients fill the wrong information in `ResourcePackClientResponsePacket`.
|
||||
- Fixed `setImmobile()` getting overridden directly after `PlayerJoinEvent`.
|
||||
- Fixed air being breakable by creative players.
|
||||
- Fixed performance loss caused by bugs in the preprocessor.
|
||||
|
||||
# 3.8.3
|
||||
- Fixed infinite recursion when using `Entity->close()` during `EntityDespawnEvent`.
|
||||
- Fixed crash reports caused by folder plugins being reported to the crash archive.
|
||||
- Fixed spawning entities on unloaded chunks during spawn sequence (possible client crash cause).
|
||||
- Fixed `/time query` output message.
|
||||
- Fixed `Server->hasOfflinePlayerData()` being case-sensitive.
|
||||
- Improved error messages for skin validation in some places.
|
||||
- Fixed classic stonecutter hardness.
|
||||
- Fixed iron trapdoors being considered a valid furnace fuel.
|
||||
- Fixed apple dropping from leaves happening less frequently than intended.
|
||||
- Fixed tall plants like sunflower being replaceable by the top half.
|
||||
|
||||
# 3.8.4
|
||||
- Plugin load order is now randomised to remove the ability to implicitly depend on filesystem-specific ordering.
|
||||
- Packet logging in debug messages now uses base64 instead of hex (uses less space).
|
||||
- Array and string size are now shown in error stack trace logs.
|
||||
- Stack traces now render a maximum of 80 characters when making string parameters printable.
|
||||
- Improved documentation for some transaction classes.
|
||||
- Action order in inventory transactions is now randomised to prevent dependencies on any accidental or client-dependent ordering. Since the transaction system is specifically designed to avoid depending on order, this does not affect any core functionality.
|
||||
|
||||
# 3.8.5
|
||||
- Moved preprocessor to build/ directory.
|
||||
- Added documentation for `Server->getPlayer()`, `Server->getPlayerExact()` and `Server->matchPlayer()`.
|
||||
- `server.lock` now contains the PID of the currently-running server.
|
||||
- PID of server is now reported in the error message when attempting to run two servers from the same data directory at once.
|
||||
- Fixed sluggish playercount updating on MOTD.
|
||||
- Added new MultiRecipe UUIDs.
|
||||
- Added an extra field to `StartGamePacket` to resolve minor incompatibility issues on different 1.11.x patch versions.
|
||||
|
||||
# 3.8.6
|
||||
- Fixed `Entity->isNameTagAlwaysVisible()` not working.
|
||||
- Log messages are now cleaned of invalid UTF-8 sequences before emitting them.
|
||||
- Fixed negative integers being considered as strings for world seeds.
|
||||
- Fixed out-of-bounds access on invalid inventory data in player data saves.
|
||||
- Fixed crash when custom liquids have flow decays which aren't factors of 4.
|
||||
- Fixed `Entity->noDamageTicks` not working when the entity had no previous damage cause.
|
||||
|
||||
# 3.8.7
|
||||
- Improved documentation of `Player->getDisplayName()` and `Player::isValidUserName()`.
|
||||
- Fixed a bug in `SetScorePacket` decoding causing the entry list to always be empty.
|
129
changelogs/3.9.md
Normal file
129
changelogs/3.9.md
Normal file
@ -0,0 +1,129 @@
|
||||
**For Minecraft: Bedrock Edition 1.12.0**
|
||||
|
||||
### Note about API versions
|
||||
Plugins which don't touch the protocol and compatible with any previous 3.x.y version will also run on these releases and do not need API bumps.
|
||||
Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
|
||||
|
||||
# 3.9.0
|
||||
- Added support for Minecraft: Bedrock Edition 1.12.0
|
||||
- Removed compatibility with 1.11.0
|
||||
|
||||
## Protocol
|
||||
- The following classes in the `\pocketmine\network\mcpe\protocol` namespace have been renamed:
|
||||
- `AddEntityPacket` -> `AddActorPacket`
|
||||
- `AddItemEntityPacket` -> `AddItemActorPacket`
|
||||
- `AvailableEntityIdentifiersPacket` -> `AvailableActorIdentifiersPacket`
|
||||
- `BlockEntityDataPacket` -> `BlockActorDataPacket`
|
||||
- `EntityEventPacket` -> `ActorEventPacket`
|
||||
- `EntityFallPacket` -> `ActorFallPacket`
|
||||
- `EntityPickRequestPacket` -> `ActorPickRequestPacket`
|
||||
- `MoveEntityAbsolutePacket` -> `MoveActorAbsolutePacket`
|
||||
- `MoveEntityDeltaPacket` -> `MoveActorDeltaPacket`
|
||||
- `RemoveEntityPacket` -> `RemoveActorPacket`
|
||||
- `SetEntityDataPacket` -> `SetActorDataPacket`
|
||||
- `SetEntityLinkPacket` -> `SetActorLinkPacket`
|
||||
- `SetEntityMotionPacket` -> `SetActorMotionPacket`
|
||||
- `TakeItemEntityPacket` -> `TakeItemActorPacket`
|
||||
- The following classes in the `\pocketmine\network\mcpe\protocol` namespace have been removed:
|
||||
- `FullChunkDataPacket`
|
||||
- The following classes in the `\pocketmine\network\mcpe\protocol` namespace have been added:
|
||||
- `AddEntityPacket` (not to be confused with the old one)
|
||||
- `ClientCacheBlobStatusPacket`
|
||||
- `ClientCacheMissResponsePacket`
|
||||
- `ClientCacheStatusPacket`
|
||||
- `LevelChunkPacket`
|
||||
- `RemoveEntityPacket` (not to be confused with the old one)
|
||||
- `StructureTemplateDataExportRequestPacket`
|
||||
- `StructureTemplateDataExportResponsePacket`
|
||||
|
||||
# 3.9.1
|
||||
- Fixed resource packs not working on 1.12 clients.
|
||||
- Fixed some particles displaying incorrectly (some still don't render at all).
|
||||
- Fixed `Entity->setFireTicks()` with a value of `0` setting the on-fire flag.
|
||||
- Silenced a debug message which appeared every time a player right-clicked a block.
|
||||
- Updated constants for `LevelSoundEventPacket`.
|
||||
|
||||
# 3.9.2
|
||||
- Logger warnings for illegal player movements have been lowered to debug.
|
||||
- TNT explosions now start from the center instead of the base. This fixes unexpected results when TNT is lit on top of obsidian.
|
||||
- Fixed the `loadbefore` directive in `plugin.yml` sometimes being ignored.
|
||||
- Fixed `Item->setCustomName()` with an empty string leaving behind an empty tag.
|
||||
- Fixed incorrect positioning of bucket empty sound.
|
||||
- Fixed some incorrect tag parsing in `/give` involving quoted numbers.
|
||||
|
||||
# 3.9.3
|
||||
- Fixed a memory leak on async task removal in error conditions.
|
||||
- Fixed scheduled block updates (for example liquid) triggering chunk reloading. This could cause a significant performance issue in some conditions.
|
||||
- Fixed some minor cosmetic issues in documentation.
|
||||
|
||||
# 3.9.4
|
||||
- Fixed a memory leak when scheduled updates were pending on a chunk being unloaded.
|
||||
- Fixed plugin detection in crashdumps. Previously `src/pocketmine` anywhere in the path would cause the error to be considered a core crash, regardless of the preceding path.
|
||||
- Fixed entity metadata types for 1.12. The SLOT type was removed and a COMPOUND_TAG type added. This change involves changes to internal API which may break plugins. **See the warning at the top of this changelog about API versioning.**
|
||||
- Fixed random and base populator amounts of trees and tallgrass never being initialized. This bug had no obvious effect, but may have become a problem in future PHP versions.
|
||||
- The following internal methods have been marked as `@deprecated` and documentation warnings added:
|
||||
- `Entity->getBlocksAround()`
|
||||
- `Entity->despawnFrom()`
|
||||
- `Entity->despawnFromAll()`
|
||||
- Fixed plugin `softdepend` not influencing load order when a soft-depended plugin had an unresolved soft dependency of its own.
|
||||
- Fixed endless falling of sand on top of fences.
|
||||
|
||||
# 3.9.5
|
||||
- Fixed some issues with multiple consecutive commas inside quotes in form responses.
|
||||
- Fixed server crash when the manifest json does not contain a json object in a resource pack.
|
||||
- Ender pearls no longer collide with blocks that do not have any collision boxes.
|
||||
|
||||
# 3.9.6
|
||||
- Updated Composer dependencies to their latest versions.
|
||||
- Prevent clients repeating the resource pack sequence. This fixes error spam with bugged 1.12 clients.
|
||||
- `Internet::simpleCurl()` now includes the PocketMine-MP version in the user-agent string.
|
||||
- Spawn protection is now disabled by default in the setup wizard.
|
||||
- Default difficulty is now NORMAL(2) instead of EASY(1).
|
||||
- Fixed crashing on corrupted world manifest and unsupported world formats.
|
||||
- Fixed `/transferserver` being usable without appropriate permissions.
|
||||
- `RegionLoader->removeChunk()` now writes the region header as appropriate.
|
||||
- Fixed performance issue when loading large regions (bug in header validation).
|
||||
- Fixed skin geometry being removed when the JSON contained comments.
|
||||
- Added new constants to `EventPacket`.
|
||||
- Added encode/decode for `StructureTemplateDataExportRequestPacket` and `StructureTemplateDataExportResponsePacket`.
|
||||
- Fixed broken type asserts in `LevelChunkPacket::withCache()` and `ClientCacheMissResponsePacket::create()`.
|
||||
- `types\CommandParameter` field `byte1` has been renamed to `flags`.
|
||||
- Cleaned up public interface of `AvailableCommandsPacket`, removing fields which exposed details of the encoding scheme.
|
||||
- Improved documentation for the following API methods:
|
||||
- `pocketmine\item\Item`:
|
||||
- `addCreativeItem()`
|
||||
- `removeCreativeItem()`
|
||||
- `clearCreativeItems()`
|
||||
- `pocketmine\level\Explosion`:
|
||||
- `explodeA()`
|
||||
- `explodeB()`
|
||||
- Fixed various cosmetic documentation inconsistencies in the core and dependencies.
|
||||
|
||||
# 3.9.7
|
||||
- Fixed a crash that could occur during timezone detection.
|
||||
- Squid no longer spin around constantly in enclosed spaces. Their performance impact is reduced.
|
||||
- Cleaned up the bootstrap file.
|
||||
|
||||
# 3.9.8
|
||||
- Added [PHPStan](https://github.com/phpstan/phpstan) configuration. PHPStan is now used on CI for automated QA, which should improve stability and quality going forward.
|
||||
- The following constants are now autoloaded when loading the Composer autoloader:
|
||||
- `pocketmine\NAME`
|
||||
- `pocketmine\BASE_VERSION`
|
||||
- `pocketmine\IS_DEVELOPMENT_BUILD`
|
||||
- `pocketmine\BUILD_NUMBER`
|
||||
- `INT32_MIN`
|
||||
- `INT32_MAX`
|
||||
- `INT32_MASK`
|
||||
- Fixed memory leaks and crashes caused by plugin use of `Player->showPlayer()` and `Entity->spawnTo()`.
|
||||
- Fixed crashes that could occur when tile classes were overridden with classes incompatible with the originals.
|
||||
- Fixed improper handling of non-Compound root NBT tags on network itemstack decoding.
|
||||
- Fixed paintings dropping multiple items when destroyed by block updates.
|
||||
- Fixed `var_dump()` not showing private and protected properties of `DataPacket` subclasses.
|
||||
- Fixed overloads with zero arguments being missing when decoding `AvailableCommandsPacket`.
|
||||
- `CraftingDataPacket` now retains the `cleanRecipes` field when decoding.
|
||||
- Fixed `Block->getMetadata()` returning null (non-iterable).
|
||||
- `PlayerChatEvent` documentation has been updated to specify that `CommandSender` recipients are accepted. This behaviour was already present in previous versions, but incorrectly documented.
|
||||
- Fixed various issues with PHPDoc comments reported by PHPStan.
|
||||
- Fixed various minor code nits reported by PHPStan.
|
@ -17,56 +17,44 @@
|
||||
"ext-openssl": "*",
|
||||
"ext-pcre": "*",
|
||||
"ext-phar": "*",
|
||||
"ext-pthreads": ">=3.1.7dev",
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-reflection": "*",
|
||||
"ext-sockets": "*",
|
||||
"ext-spl": "*",
|
||||
"ext-yaml": ">=2.0.0",
|
||||
"ext-zip": "*",
|
||||
"ext-zlib": ">=1.2.11",
|
||||
"pocketmine/raklib": "^0.12.0",
|
||||
"pocketmine/spl": "^0.3.0",
|
||||
"pocketmine/binaryutils": "^0.1.0",
|
||||
"pocketmine/nbt": "^0.2.6",
|
||||
"pocketmine/raklib": "^0.12.7",
|
||||
"pocketmine/spl": "^0.4.0",
|
||||
"pocketmine/binaryutils": "^0.1.9",
|
||||
"pocketmine/nbt": "^0.2.10",
|
||||
"pocketmine/math": "^0.2.0",
|
||||
"pocketmine/snooze": "^0.1.0",
|
||||
"daverandom/callback-validator": "dev-master",
|
||||
"adhocore/json-comment": "^0.0.7"
|
||||
"pocketmine/classloader": "^0.1.0",
|
||||
"pocketmine/log": "^0.2.0",
|
||||
"pocketmine/log-pthreads": "^0.1.0",
|
||||
"pocketmine/callback-validator": "^1.0.1",
|
||||
"adhocore/json-comment": "^0.1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.14",
|
||||
"irstea/phpunit-shim": "^8.5",
|
||||
"phpstan/phpstan-phpunit": "^0.12.6",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"": ["src"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src/pocketmine/CoreConstants.php",
|
||||
"src/pocketmine/GlobalConstants.php",
|
||||
"src/pocketmine/VersionInfo.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"pocketmine\\": "tests/phpunit/"
|
||||
}
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/RakLib"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/SPL"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/BinaryUtils"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/NBT"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/Math"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/pmmp/Snooze"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
514
composer.lock
generated
514
composer.lock
generated
@ -4,27 +4,27 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2f5313e4ebd7b62c785cf683b27464b4",
|
||||
"content-hash": "6870d7b85559a32e2929692e0a0da169",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/json-comment",
|
||||
"version": "v0.0.7",
|
||||
"version": "0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/adhocore/php-json-comment.git",
|
||||
"reference": "135356c7e7336ef59924f1d921c770045f937a76"
|
||||
"reference": "8448076039389f558f39ad0553aab87db3f81614"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/adhocore/php-json-comment/zipball/135356c7e7336ef59924f1d921c770045f937a76",
|
||||
"reference": "135356c7e7336ef59924f1d921c770045f937a76",
|
||||
"url": "https://api.github.com/repos/adhocore/php-json-comment/zipball/8448076039389f558f39ad0553aab87db3f81614",
|
||||
"reference": "8448076039389f558f39ad0553aab87db3f81614",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.5"
|
||||
"phpunit/phpunit": "^6.5 || ^7.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -48,28 +48,65 @@
|
||||
"json",
|
||||
"strip-comment"
|
||||
],
|
||||
"time": "2018-08-01T12:27:26+00:00"
|
||||
"time": "2020-01-03T13:51:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "daverandom/callback-validator",
|
||||
"version": "dev-master",
|
||||
"name": "pocketmine/binaryutils",
|
||||
"version": "0.1.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DaveRandom/CallbackValidator.git",
|
||||
"reference": "d87a08cddbc6099816ed01e50ce25cdfc43b542f"
|
||||
"url": "https://github.com/pmmp/BinaryUtils.git",
|
||||
"reference": "e8cb65db1b7998eebb739b124f2a989fe87366eb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/DaveRandom/CallbackValidator/zipball/d87a08cddbc6099816ed01e50ce25cdfc43b542f",
|
||||
"reference": "d87a08cddbc6099816ed01e50ce25cdfc43b542f",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/e8cb65db1b7998eebb739b124f2a989fe87366eb",
|
||||
"reference": "e8cb65db1b7998eebb739b124f2a989fe87366eb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php-64bit": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"pocketmine\\utils\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Classes and methods for conveniently handling binary data",
|
||||
"time": "2020-01-28T12:09:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/callback-validator",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/CallbackValidator.git",
|
||||
"reference": "4aef6bb25f97d0b830ba0b4f66834b1a9c86fc9a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/CallbackValidator/zipball/4aef6bb25f97d0b830ba0b4f66834b1a9c86fc9a",
|
||||
"reference": "4aef6bb25f97d0b830ba0b4f66834b1a9c86fc9a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-reflection": "*",
|
||||
"php": ">=7.0"
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"replace": {
|
||||
"daverandom/callback-validator": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.0"
|
||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -87,96 +124,179 @@
|
||||
"email": "cw@daverandom.com"
|
||||
}
|
||||
],
|
||||
"description": "Tools for validating callback signatures",
|
||||
"time": "2017-04-03T15:22:41+00:00"
|
||||
"description": "Fork of daverandom/callback-validator - Tools for validating callback signatures",
|
||||
"time": "2020-03-17T12:04:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/binaryutils",
|
||||
"version": "0.1.8",
|
||||
"name": "pocketmine/classloader",
|
||||
"version": "0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/BinaryUtils.git",
|
||||
"reference": "33f511715d22418c03368b49b45a6c25d6b33806"
|
||||
"url": "https://github.com/pmmp/ClassLoader.git",
|
||||
"reference": "4ccdb30e48f030bfcad04bb0a208d198ec631993"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/33f511715d22418c03368b49b45a6c25d6b33806",
|
||||
"reference": "33f511715d22418c03368b49b45a6c25d6b33806",
|
||||
"url": "https://api.github.com/repos/pmmp/ClassLoader/zipball/4ccdb30e48f030bfcad04bb0a208d198ec631993",
|
||||
"reference": "4ccdb30e48f030bfcad04bb0a208d198ec631993",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php-64bit": "*"
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-reflection": "*",
|
||||
"php": ">=7.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"pocketmine\\utils\\": "src/"
|
||||
}
|
||||
"classmap": [
|
||||
"./src"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Classes and methods for conveniently handling binary data",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.8",
|
||||
"issues": "https://github.com/pmmp/BinaryUtils/issues"
|
||||
},
|
||||
"time": "2019-01-16T17:31:44+00:00"
|
||||
"description": "Ad-hoc autoloading components used by PocketMine-MP",
|
||||
"time": "2020-01-31T14:25:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/math",
|
||||
"version": "0.2.2",
|
||||
"name": "pocketmine/log",
|
||||
"version": "0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Math.git",
|
||||
"reference": "b755d3fb7025c4ddb7d9d6df0ba7e0b65125e51c"
|
||||
"url": "https://github.com/pmmp/Log.git",
|
||||
"reference": "e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Math/zipball/b755d3fb7025c4ddb7d9d6df0ba7e0b65125e51c",
|
||||
"reference": "b755d3fb7025c4ddb7d9d6df0ba7e0b65125e51c",
|
||||
"url": "https://api.github.com/repos/pmmp/Log/zipball/e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa",
|
||||
"reference": "e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"./src"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Logging components used by PocketMine-MP and related projects",
|
||||
"time": "2020-03-31T15:43:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/log-pthreads",
|
||||
"version": "0.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/LogPthreads.git",
|
||||
"reference": "9bbcef398b01487ab47c234a6a7054722abbe067"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/LogPthreads/zipball/9bbcef398b01487ab47c234a6a7054722abbe067",
|
||||
"reference": "9bbcef398b01487ab47c234a6a7054722abbe067",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"php": ">=7.2",
|
||||
"pocketmine/log": "^0.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.18"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"./src"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Logging components specialized for pthreads used by PocketMine-MP and related projects",
|
||||
"time": "2020-03-31T16:17:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/math",
|
||||
"version": "0.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Math.git",
|
||||
"reference": "b1c28b236df8b795d7b06cf8421f9962b12ac410"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Math/zipball/b1c28b236df8b795d7b06cf8421f9962b12ac410",
|
||||
"reference": "b1c28b236df8b795d7b06cf8421f9962b12ac410",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.0",
|
||||
"php-64bit": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"pocketmine\\math\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "PHP library containing math related code used in PocketMine-MP",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/Math/tree/0.2.2",
|
||||
"issues": "https://github.com/pmmp/Math/issues"
|
||||
},
|
||||
"time": "2019-01-04T15:42:36+00:00"
|
||||
"time": "2020-01-28T14:11:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/nbt",
|
||||
"version": "0.2.7",
|
||||
"version": "0.2.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/NBT.git",
|
||||
"reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a"
|
||||
"reference": "6fc56f864a5375471f6e2d0f9f89f2462a1d8433"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a",
|
||||
"reference": "2f176c9f2fd9b31db8bc2ada2f38990157ec8f1a",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/6fc56f864a5375471f6e2d0f9f89f2462a1d8433",
|
||||
"reference": "6fc56f864a5375471f6e2d0f9f89f2462a1d8433",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-zlib": "*",
|
||||
"php": ">=7.2.0",
|
||||
"php-64bit": "*",
|
||||
"pocketmine/binaryutils": "^0.1.0"
|
||||
"pocketmine/binaryutils": "^0.1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"irstea/phpunit-shim": "^7.5",
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -184,45 +304,41 @@
|
||||
"pocketmine\\nbt\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"pocketmine\\nbt\\": "tests/phpunit/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "PHP library for working with Named Binary Tags",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/NBT/tree/0.2.7",
|
||||
"issues": "https://github.com/pmmp/NBT/issues"
|
||||
},
|
||||
"time": "2019-03-29T19:39:42+00:00"
|
||||
"time": "2020-01-28T17:03:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/raklib",
|
||||
"version": "0.12.3",
|
||||
"version": "0.12.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/RakLib.git",
|
||||
"reference": "9df7dbcdafeb29403af6a7fa22c8785f758a1145"
|
||||
"reference": "9fea763ffc922db083e4528d4acd0b13d0ea83a4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/9df7dbcdafeb29403af6a7fa22c8785f758a1145",
|
||||
"reference": "9df7dbcdafeb29403af6a7fa22c8785f758a1145",
|
||||
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/9fea763ffc922db083e4528d4acd0b13d0ea83a4",
|
||||
"reference": "9fea763ffc922db083e4528d4acd0b13d0ea83a4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-bcmath": "*",
|
||||
"ext-pthreads": ">=3.1.7dev",
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-sockets": "*",
|
||||
"php": ">=7.2.0",
|
||||
"php-64bit": "*",
|
||||
"php-ipv6": "*",
|
||||
"pocketmine/binaryutils": "^0.1.0",
|
||||
"pocketmine/snooze": "^0.1.0",
|
||||
"pocketmine/spl": "^0.3.0"
|
||||
"pocketmine/binaryutils": "^0.1.9",
|
||||
"pocketmine/log": "^0.2.0",
|
||||
"pocketmine/log-pthreads": "^0.1.0",
|
||||
"pocketmine/snooze": "^0.1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.18",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -230,90 +346,286 @@
|
||||
"raklib\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-3.0"
|
||||
],
|
||||
"description": "A RakNet server implementation written in PHP",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/RakLib/tree/0.12.3",
|
||||
"issues": "https://github.com/pmmp/RakLib/issues"
|
||||
},
|
||||
"time": "2019-04-21T12:15:38+00:00"
|
||||
"time": "2020-03-31T17:28:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/snooze",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Snooze.git",
|
||||
"reference": "b7bd231bdb75e69300cac89ccd515fc731c38c40"
|
||||
"reference": "88420da3d9335dbcb3ee2decfd5e5453d057dcdf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Snooze/zipball/b7bd231bdb75e69300cac89ccd515fc731c38c40",
|
||||
"reference": "b7bd231bdb75e69300cac89ccd515fc731c38c40",
|
||||
"url": "https://api.github.com/repos/pmmp/Snooze/zipball/88420da3d9335dbcb3ee2decfd5e5453d057dcdf",
|
||||
"reference": "88420da3d9335dbcb3ee2decfd5e5453d057dcdf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": ">=3.1.7dev",
|
||||
"php-64bit": ">=7.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"pocketmine\\snooze\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Thread notification management library for code using the pthreads extension",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/Snooze/tree/0.1.1",
|
||||
"issues": "https://github.com/pmmp/Snooze/issues"
|
||||
},
|
||||
"time": "2019-01-04T15:54:45+00:00"
|
||||
"time": "2020-01-28T19:08:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/spl",
|
||||
"version": "0.3.2",
|
||||
"version": "0.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/SPL.git",
|
||||
"reference": "7fd53857cd000491ba69e8db865792a024dd2c49"
|
||||
"reference": "ff0579a0be41bbe65d3637607715c0f87728a838"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/SPL/zipball/7fd53857cd000491ba69e8db865792a024dd2c49",
|
||||
"reference": "7fd53857cd000491ba69e8db865792a024dd2c49",
|
||||
"url": "https://api.github.com/repos/pmmp/SPL/zipball/ff0579a0be41bbe65d3637607715c0f87728a838",
|
||||
"reference": "ff0579a0be41bbe65d3637607715c0f87728a838",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"exclude-from-classmap": [
|
||||
"stubs"
|
||||
],
|
||||
"classmap": [
|
||||
"./"
|
||||
"./src"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0"
|
||||
],
|
||||
"description": "Standard library files required by PocketMine-MP and related projects",
|
||||
"support": {
|
||||
"source": "https://github.com/pmmp/SPL/tree/0.3.2"
|
||||
},
|
||||
"time": "2018-08-12T15:17:39+00:00"
|
||||
"time": "2020-01-31T16:18:03+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "irstea/phpunit-shim",
|
||||
"version": "8.5.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://gitlab.irstea.fr/pole-is/tools/phpunit-shim.git",
|
||||
"reference": "b55d058d7ad3cf516068f22138a5b8fb724605db"
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": "^7.2"
|
||||
},
|
||||
"replace": {
|
||||
"phpunit/phpunit": "self.version"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-soap": "*",
|
||||
"ext-xdebug": "*"
|
||||
},
|
||||
"bin": [
|
||||
"phpunit"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"exclude-from-classmap": [
|
||||
"phpunit"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "Shim repository for phpunit/phpunit",
|
||||
"homepage": "https://phpunit.de/",
|
||||
"keywords": [
|
||||
"phpunit",
|
||||
"shim",
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2020-04-01T02:21:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "0.12.18",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "1ce27fe29c8660a27926127d350d53d80c4d4286"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/1ce27fe29c8660a27926127d350d53d80c4d4286",
|
||||
"reference": "1ce27fe29c8660a27926127d350d53d80c4d4286",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1"
|
||||
},
|
||||
"bin": [
|
||||
"phpstan",
|
||||
"phpstan.phar"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.12-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "PHPStan - PHP Static Analysis Tool",
|
||||
"time": "2020-03-22T16:51:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-phpunit",
|
||||
"version": "0.12.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan-phpunit.git",
|
||||
"reference": "26394996368b6d033d012547d3197f4e07e23021"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/26394996368b6d033d012547d3197f4e07e23021",
|
||||
"reference": "26394996368b6d033d012547d3197f4e07e23021",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~7.1",
|
||||
"phpstan/phpstan": "^0.12.4"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"consistence/coding-standard": "^3.5",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
||||
"ergebnis/composer-normalize": "^2.0.2",
|
||||
"jakub-onderka/php-parallel-lint": "^1.0",
|
||||
"phing/phing": "^2.16.0",
|
||||
"phpstan/phpstan-strict-rules": "^0.12",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"satooshi/php-coveralls": "^1.0",
|
||||
"slevomat/coding-standard": "^4.7.2"
|
||||
},
|
||||
"type": "phpstan-extension",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.12-dev"
|
||||
},
|
||||
"phpstan": {
|
||||
"includes": [
|
||||
"extension.neon",
|
||||
"rules.neon"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PHPStan\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "PHPUnit extensions and rules for PHPStan",
|
||||
"time": "2020-01-10T12:07:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-strict-rules",
|
||||
"version": "0.12.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
||||
"reference": "a670a59aff7cf96f75d21b974860ada10e25b2ee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/a670a59aff7cf96f75d21b974860ada10e25b2ee",
|
||||
"reference": "a670a59aff7cf96f75d21b974860ada10e25b2ee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~7.1",
|
||||
"phpstan/phpstan": "^0.12.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"consistence/coding-standard": "^3.0.1",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
|
||||
"ergebnis/composer-normalize": "^2.0.2",
|
||||
"jakub-onderka/php-parallel-lint": "^1.0",
|
||||
"phing/phing": "^2.16.0",
|
||||
"phpstan/phpstan-phpunit": "^0.12",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"slevomat/coding-standard": "^4.5.2"
|
||||
},
|
||||
"type": "phpstan-extension",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.12-dev"
|
||||
},
|
||||
"phpstan": {
|
||||
"includes": [
|
||||
"rules.neon"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PHPStan\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Extra strict and opinionated rules for PHPStan",
|
||||
"time": "2020-01-20T13:08:52+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {
|
||||
"ext-pthreads": 20,
|
||||
"daverandom/callback-validator": 20
|
||||
},
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
@ -329,7 +641,7 @@
|
||||
"ext-openssl": "*",
|
||||
"ext-pcre": "*",
|
||||
"ext-phar": "*",
|
||||
"ext-pthreads": ">=3.1.7dev",
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-reflection": "*",
|
||||
"ext-sockets": "*",
|
||||
"ext-spl": "*",
|
||||
|
File diff suppressed because it is too large
Load Diff
190
phpstan.neon.dist
Normal file
190
phpstan.neon.dist
Normal file
@ -0,0 +1,190 @@
|
||||
includes:
|
||||
- tests/phpstan/configs/com-dotnet-magic.neon
|
||||
- tests/phpstan/configs/custom-leveldb.neon
|
||||
- tests/phpstan/configs/gc-hacks.neon
|
||||
- tests/phpstan/configs/php-bugs.neon
|
||||
- tests/phpstan/configs/phpstan-bugs.neon
|
||||
- tests/phpstan/configs/phpunit-wiring-tests.neon
|
||||
- tests/phpstan/configs/pthreads-bugs.neon
|
||||
- tests/phpstan/configs/runtime-type-checks.neon
|
||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
- vendor/phpstan/phpstan-phpunit/rules.neon
|
||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||
|
||||
parameters:
|
||||
level: 6
|
||||
autoload_files:
|
||||
- tests/phpstan/bootstrap.php
|
||||
- src/pocketmine/PocketMine.php
|
||||
- build/make-release.php
|
||||
- build/server-phar.php
|
||||
- vendor/irstea/phpunit-shim/phpunit
|
||||
paths:
|
||||
- src
|
||||
- build/make-release.php
|
||||
- build/server-phar.php
|
||||
- tests/phpunit
|
||||
dynamicConstantNames:
|
||||
- pocketmine\IS_DEVELOPMENT_BUILD
|
||||
- pocketmine\DEBUG
|
||||
stubFiles:
|
||||
- tests/phpstan/stubs/pthreads.stub
|
||||
- tests/phpstan/stubs/chunkutils.stub
|
||||
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
|
||||
staticReflectionClassNamePatterns:
|
||||
- "#^COM$#"
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Instanceof between pocketmine\\\\plugin\\\\PluginManager and pocketmine\\\\plugin\\\\PluginManager will always evaluate to true\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/CrashDump.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\Player\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\entity\\\\Human\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Cannot instantiate interface pocketmine\\\\level\\\\format\\\\io\\\\LevelProvider\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Server.php
|
||||
|
||||
-
|
||||
message: "#^Instanceof between pocketmine\\\\plugin\\\\PluginManager and pocketmine\\\\plugin\\\\PluginManager will always evaluate to true\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Server.php
|
||||
|
||||
-
|
||||
message: "#^Instanceof between pocketmine\\\\scheduler\\\\AsyncPool and pocketmine\\\\scheduler\\\\AsyncPool will always evaluate to true\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Server.php
|
||||
|
||||
-
|
||||
message: "#^Instanceof between pocketmine\\\\command\\\\CommandReader and pocketmine\\\\command\\\\CommandReader will always evaluate to true\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Server.php
|
||||
|
||||
-
|
||||
message: "#^Instanceof between pocketmine\\\\network\\\\Network and pocketmine\\\\network\\\\Network will always evaluate to true\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/Server.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\block\\\\[A-Za-z\\d]+\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\block\\\\Block\\.$#"
|
||||
path: src/pocketmine/block
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\block\\\\Block\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\level\\\\Position\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/block/Block.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method pocketmine\\\\command\\\\CommandSender\\:\\:teleport\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/command/defaults/TeleportCommand.php
|
||||
# comment: "not actually possible, but high cost to fix warning"
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\EntityDeathEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\Living but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/EntityDeathEvent.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\EntityShootBowEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\Living but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/EntityShootBowEvent.php
|
||||
|
||||
-
|
||||
message: "#^Property pocketmine\\\\event\\\\entity\\\\EntityShootBowEvent\\:\\:\\$projectile \\(pocketmine\\\\entity\\\\projectile\\\\Projectile\\) does not accept pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/EntityShootBowEvent.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\ItemDespawnEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\object\\\\ItemEntity but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/ItemDespawnEvent.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\ItemSpawnEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\object\\\\ItemEntity but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/ItemSpawnEvent.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\ProjectileHitEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\projectile\\\\Projectile but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/ProjectileHitEvent.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\event\\\\entity\\\\ProjectileLaunchEvent\\:\\:getEntity\\(\\) should return pocketmine\\\\entity\\\\projectile\\\\Projectile but returns pocketmine\\\\entity\\\\Entity\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/event/entity/ProjectileLaunchEvent.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\inventory\\\\DoubleChestInventory\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\inventory\\\\ChestInventory\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/inventory/DoubleChestInventory.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\inventory\\\\EnderChestInventory\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\inventory\\\\ChestInventory\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/inventory/EnderChestInventory.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\item\\\\GoldenAppleEnchanted\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\item\\\\GoldenApple\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/item/GoldenAppleEnchanted.php
|
||||
|
||||
-
|
||||
message: "#^pocketmine\\\\item\\\\WrittenBook\\:\\:__construct\\(\\) does not call parent constructor from pocketmine\\\\item\\\\WritableBook\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/item/WrittenBook.php
|
||||
|
||||
-
|
||||
message: "#^Variable property access on \\$this\\(pocketmine\\\\level\\\\generator\\\\PopulationTask\\)\\.$#"
|
||||
count: 4
|
||||
path: src/pocketmine/level/generator/PopulationTask.php
|
||||
|
||||
-
|
||||
message: "#^Constructor of class pocketmine\\\\level\\\\generator\\\\hell\\\\Nether has an unused parameter \\$options\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/level/generator/hell/Nether.php
|
||||
|
||||
-
|
||||
message: "#^Constructor of class pocketmine\\\\level\\\\generator\\\\normal\\\\Normal has an unused parameter \\$options\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/level/generator/normal/Normal.php
|
||||
|
||||
-
|
||||
message: "#^Variable method call on pocketmine\\\\event\\\\Listener\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/plugin/MethodEventExecutor.php
|
||||
|
||||
-
|
||||
message: "#^Constructor of class pocketmine\\\\scheduler\\\\TaskScheduler has an unused parameter \\$logger\\.$#"
|
||||
count: 1
|
||||
path: src/pocketmine/scheduler/TaskScheduler.php
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\COMPOSER_AUTOLOADER_PATH not found\\.$#"
|
||||
path: src
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\DATA not found\\.$#"
|
||||
path: src
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\GIT_COMMIT not found\\.$#"
|
||||
path: src
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\PLUGIN_PATH not found\\.$#"
|
||||
path: src
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\START_TIME not found\\.$#"
|
||||
path: src
|
||||
|
||||
-
|
||||
message: "#^Constant pocketmine\\\\VERSION not found\\.$#"
|
||||
path: src
|
||||
|
@ -30,9 +30,7 @@ use pocketmine\utils\TextFormat;
|
||||
* Handles the achievement list and a bit more
|
||||
*/
|
||||
abstract class Achievement{
|
||||
/**
|
||||
* @var array[]
|
||||
*/
|
||||
/** @var array[] */
|
||||
public static $list = [
|
||||
/*"openInventory" => array(
|
||||
"name" => "Taking Inventory",
|
||||
@ -106,13 +104,6 @@ abstract class Achievement{
|
||||
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
* @param string $achievementId
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function broadcast(Player $player, string $achievementId) : bool{
|
||||
if(isset(Achievement::$list[$achievementId])){
|
||||
$translation = new TranslationContainer("chat.type.achievement", [$player->getDisplayName(), TextFormat::GREEN . Achievement::$list[$achievementId]["name"] . TextFormat::RESET]);
|
||||
@ -129,11 +120,7 @@ abstract class Achievement{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $achievementId
|
||||
* @param string $achievementName
|
||||
* @param array $requires
|
||||
*
|
||||
* @return bool
|
||||
* @param string[] $requires
|
||||
*/
|
||||
public static function add(string $achievementId, string $achievementName, array $requires = []) : bool{
|
||||
if(!isset(Achievement::$list[$achievementId])){
|
||||
|
@ -25,12 +25,16 @@ namespace pocketmine;
|
||||
|
||||
abstract class Collectable extends \Threaded{
|
||||
|
||||
/** @var bool */
|
||||
private $isGarbage = false;
|
||||
|
||||
public function isGarbage() : bool{
|
||||
return $this->isGarbage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setGarbage(){
|
||||
$this->isGarbage = true;
|
||||
}
|
||||
|
37
src/pocketmine/CoreConstants.php
Normal file
37
src/pocketmine/CoreConstants.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine;
|
||||
|
||||
use function define;
|
||||
use function defined;
|
||||
use function dirname;
|
||||
|
||||
// composer autoload doesn't use require_once and also pthreads can inherit things
|
||||
if(defined('pocketmine\_CORE_CONSTANTS_INCLUDED')){
|
||||
return;
|
||||
}
|
||||
define('pocketmine\_CORE_CONSTANTS_INCLUDED', true);
|
||||
|
||||
define('pocketmine\PATH', dirname(__DIR__, 2) . '/');
|
||||
define('pocketmine\RESOURCE_PATH', __DIR__ . '/resources/');
|
@ -96,8 +96,14 @@ class CrashDump{
|
||||
|
||||
/** @var Server */
|
||||
private $server;
|
||||
/** @var resource */
|
||||
private $fp;
|
||||
/** @var int */
|
||||
private $time;
|
||||
/**
|
||||
* @var mixed[]
|
||||
* @phpstan-var array<string, mixed>
|
||||
*/
|
||||
private $data = [];
|
||||
/** @var string */
|
||||
private $encodedData = "";
|
||||
@ -134,15 +140,22 @@ class CrashDump{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEncodedData(){
|
||||
return $this->encodedData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[]
|
||||
* @phpstan-return array<string, mixed>
|
||||
*/
|
||||
public function getData() : array{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
private function encodeData(){
|
||||
private function encodeData() : void{
|
||||
$this->addLine();
|
||||
$this->addLine("----------------------REPORT THE DATA BELOW THIS LINE-----------------------");
|
||||
$this->addLine();
|
||||
@ -158,7 +171,7 @@ class CrashDump{
|
||||
$this->addLine("===END CRASH DUMP===");
|
||||
}
|
||||
|
||||
private function pluginsData(){
|
||||
private function pluginsData() : void{
|
||||
if($this->server->getPluginManager() instanceof PluginManager){
|
||||
$this->addLine();
|
||||
$this->addLine("Loaded plugins:");
|
||||
@ -182,7 +195,7 @@ class CrashDump{
|
||||
}
|
||||
}
|
||||
|
||||
private function extraData(){
|
||||
private function extraData() : void{
|
||||
global $argv;
|
||||
|
||||
if($this->server->getProperty("auto-report.send-settings", true) !== false){
|
||||
@ -209,7 +222,7 @@ class CrashDump{
|
||||
}
|
||||
}
|
||||
|
||||
private function baseCrash(){
|
||||
private function baseCrash() : void{
|
||||
global $lastExceptionError, $lastError;
|
||||
|
||||
if(isset($lastExceptionError)){
|
||||
@ -291,7 +304,7 @@ class CrashDump{
|
||||
|
||||
private function determinePluginFromFile(string $filePath, bool $crashFrame) : bool{
|
||||
$frameCleanPath = Utils::cleanPath($filePath); //this will be empty in phar stub
|
||||
if($frameCleanPath !== "" and strpos($frameCleanPath, "src/pocketmine/") === false and strpos($frameCleanPath, "vendor/pocketmine/") === false and file_exists($filePath)){
|
||||
if(strpos($frameCleanPath, "plugins") === 0 and file_exists($filePath)){
|
||||
$this->addLine();
|
||||
if($crashFrame){
|
||||
$this->addLine("THIS CRASH WAS CAUSED BY A PLUGIN");
|
||||
@ -317,7 +330,7 @@ class CrashDump{
|
||||
return false;
|
||||
}
|
||||
|
||||
private function generalData(){
|
||||
private function generalData() : void{
|
||||
$version = new VersionString(\pocketmine\BASE_VERSION, \pocketmine\IS_DEVELOPMENT_BUILD, \pocketmine\BUILD_NUMBER);
|
||||
$this->data["general"] = [];
|
||||
$this->data["general"]["name"] = $this->server->getName();
|
||||
@ -333,17 +346,27 @@ class CrashDump{
|
||||
$this->data["general"]["php_os"] = PHP_OS;
|
||||
$this->data["general"]["os"] = Utils::getOS();
|
||||
$this->addLine($this->server->getName() . " version: " . $version->getFullVersion(true) . " [Protocol " . ProtocolInfo::CURRENT_PROTOCOL . "]");
|
||||
$this->addLine("Git commit: " . GIT_COMMIT);
|
||||
$this->addLine("Git commit: " . \pocketmine\GIT_COMMIT);
|
||||
$this->addLine("uname -a: " . php_uname("a"));
|
||||
$this->addLine("PHP Version: " . phpversion());
|
||||
$this->addLine("Zend version: " . zend_version());
|
||||
$this->addLine("OS : " . PHP_OS . ", " . Utils::getOS());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $line
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addLine($line = ""){
|
||||
fwrite($this->fp, $line . PHP_EOL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($str){
|
||||
fwrite($this->fp, $str);
|
||||
}
|
||||
|
32
src/pocketmine/GlobalConstants.php
Normal file
32
src/pocketmine/GlobalConstants.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// composer autoload doesn't use require_once and also pthreads can inherit things
|
||||
if(defined('pocketmine\_GLOBAL_CONSTANTS_INCLUDED')){
|
||||
return;
|
||||
}
|
||||
define('pocketmine\_GLOBAL_CONSTANTS_INCLUDED', true);
|
||||
|
||||
const INT32_MIN = -0x80000000;
|
||||
const INT32_MAX = 0x7fffffff;
|
||||
const INT32_MASK = 0xffffffff;
|
@ -27,33 +27,21 @@ use pocketmine\permission\ServerOperator;
|
||||
|
||||
interface IPlayer extends ServerOperator{
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isOnline() : bool;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() : string;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isBanned() : bool;
|
||||
|
||||
/**
|
||||
* @param bool $banned
|
||||
* @return void
|
||||
*/
|
||||
public function setBanned(bool $banned);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isWhitelisted() : bool;
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
* @return void
|
||||
*/
|
||||
public function setWhitelisted(bool $value);
|
||||
|
||||
@ -72,9 +60,6 @@ interface IPlayer extends ServerOperator{
|
||||
*/
|
||||
public function getLastPlayed();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPlayedBefore() : bool;
|
||||
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ class MemoryManager{
|
||||
$this->init();
|
||||
}
|
||||
|
||||
private function init(){
|
||||
private function init() : void{
|
||||
$this->memoryLimit = ((int) $this->server->getProperty("memory.main-limit", 0)) * 1024 * 1024;
|
||||
|
||||
$defaultMemory = 1024;
|
||||
@ -169,38 +169,25 @@ class MemoryManager{
|
||||
gc_enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isLowMemory() : bool{
|
||||
return $this->lowMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canUseChunkCache() : bool{
|
||||
return !$this->lowMemory or !$this->lowMemDisableChunkCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowed chunk radius based on the current memory usage.
|
||||
*
|
||||
* @param int $distance
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getViewDistance(int $distance) : int{
|
||||
return ($this->lowMemory and $this->lowMemChunkRadiusOverride > 0) ? (int) min($this->lowMemChunkRadiusOverride, $distance) : $distance;
|
||||
return ($this->lowMemory and $this->lowMemChunkRadiusOverride > 0) ? min($this->lowMemChunkRadiusOverride, $distance) : $distance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers garbage collection and cache cleanup to try and free memory.
|
||||
*
|
||||
* @param int $memory
|
||||
* @param int $limit
|
||||
* @param bool $global
|
||||
* @param int $triggerCount
|
||||
* @return void
|
||||
*/
|
||||
public function trigger(int $memory, int $limit, bool $global = false, int $triggerCount = 0){
|
||||
$this->server->getLogger()->debug(sprintf("[Memory Manager] %sLow memory triggered, limit %gMB, using %gMB",
|
||||
@ -230,6 +217,8 @@ class MemoryManager{
|
||||
|
||||
/**
|
||||
* Called every tick to update the memory manager state.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function check(){
|
||||
Timings::$memoryManagerTimer->startTiming();
|
||||
@ -268,9 +257,6 @@ class MemoryManager{
|
||||
Timings::$memoryManagerTimer->stopTiming();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function triggerGarbageCollector() : int{
|
||||
Timings::$garbageCollectorTimer->startTiming();
|
||||
|
||||
@ -294,9 +280,7 @@ class MemoryManager{
|
||||
/**
|
||||
* Dumps the server memory into the specified output folder.
|
||||
*
|
||||
* @param string $outputFolder
|
||||
* @param int $maxNesting
|
||||
* @param int $maxStringSize
|
||||
* @return void
|
||||
*/
|
||||
public function dumpServerMemory(string $outputFolder, int $maxNesting, int $maxStringSize){
|
||||
$this->server->getLogger()->notice("[Dump] After the memory dump is done, the server might crash");
|
||||
@ -314,11 +298,8 @@ class MemoryManager{
|
||||
* Static memory dumper accessible from any thread.
|
||||
*
|
||||
* @param mixed $startingObject
|
||||
* @param string $outputFolder
|
||||
* @param int $maxNesting
|
||||
* @param int $maxStringSize
|
||||
* @param \Logger $logger
|
||||
*
|
||||
* @return void
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function dumpMemory($startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger){
|
||||
@ -356,7 +337,7 @@ class MemoryManager{
|
||||
}
|
||||
|
||||
$staticCount++;
|
||||
self::continueDump($property->getValue(), $staticProperties[$className][$property->getName()], $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
$staticProperties[$className][$property->getName()] = self::continueDump($property->getValue(), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
}
|
||||
|
||||
if(count($staticProperties[$className]) === 0){
|
||||
@ -389,14 +370,14 @@ class MemoryManager{
|
||||
}
|
||||
|
||||
$globalCount++;
|
||||
self::continueDump($value, $globalVariables[$varName], $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
$globalVariables[$varName] = self::continueDump($value, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
}
|
||||
|
||||
file_put_contents($outputFolder . "/globalVariables.js", json_encode($globalVariables, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
$logger->info("[Dump] Wrote $globalCount global variables");
|
||||
}
|
||||
|
||||
self::continueDump($startingObject, $data, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
$data = self::continueDump($startingObject, $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
|
||||
do{
|
||||
$continue = false;
|
||||
@ -444,14 +425,13 @@ class MemoryManager{
|
||||
$property->setAccessible(true);
|
||||
}
|
||||
|
||||
self::continueDump($property->getValue($object), $info["properties"][$name], $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
$info["properties"][$name] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize);
|
||||
}
|
||||
}
|
||||
|
||||
fwrite($obData, "$hash@$className: " . json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");
|
||||
}
|
||||
|
||||
|
||||
}while($continue);
|
||||
|
||||
$logger->info("[Dump] Wrote " . count($objects) . " objects");
|
||||
@ -472,17 +452,14 @@ class MemoryManager{
|
||||
|
||||
/**
|
||||
* @param mixed $from
|
||||
* @param mixed &$data
|
||||
* @param object[] &$objects
|
||||
* @param int[] &$refCounts
|
||||
* @param int $recursion
|
||||
* @param int $maxNesting
|
||||
* @param int $maxStringSize
|
||||
* @param object[] $objects reference parameter
|
||||
* @param int[] $refCounts reference parameter
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private static function continueDump($from, &$data, array &$objects, array &$refCounts, int $recursion, int $maxNesting, int $maxStringSize){
|
||||
private static function continueDump($from, array &$objects, array &$refCounts, int $recursion, int $maxNesting, int $maxStringSize){
|
||||
if($maxNesting <= 0){
|
||||
$data = "(error) NESTING LIMIT REACHED";
|
||||
return;
|
||||
return "(error) NESTING LIMIT REACHED";
|
||||
}
|
||||
|
||||
--$maxNesting;
|
||||
@ -498,12 +475,11 @@ class MemoryManager{
|
||||
$data = "(object) $hash@" . get_class($from);
|
||||
}elseif(is_array($from)){
|
||||
if($recursion >= 5){
|
||||
$data = "(error) ARRAY RECURSION LIMIT REACHED";
|
||||
return;
|
||||
return "(error) ARRAY RECURSION LIMIT REACHED";
|
||||
}
|
||||
$data = [];
|
||||
foreach($from as $key => $value){
|
||||
self::continueDump($value, $data[$key], $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize);
|
||||
$data[$key] = self::continueDump($value, $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize);
|
||||
}
|
||||
}elseif(is_string($from)){
|
||||
$data = "(string) len(" . strlen($from) . ") " . substr(Utils::printable($from), 0, $maxStringSize);
|
||||
@ -512,5 +488,7 @@ class MemoryManager{
|
||||
}else{
|
||||
$data = $from;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@ -37,10 +37,6 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
/** @var CompoundTag|null */
|
||||
private $namedtag = null;
|
||||
|
||||
/**
|
||||
* @param Server $server
|
||||
* @param string $name
|
||||
*/
|
||||
public function __construct(Server $server, string $name){
|
||||
$this->server = $server;
|
||||
$this->name = $name;
|
||||
@ -57,6 +53,9 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Server
|
||||
*/
|
||||
public function getServer(){
|
||||
return $this->server;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,13 +21,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace {
|
||||
const INT32_MIN = -0x80000000;
|
||||
const INT32_MAX = 0x7fffffff;
|
||||
}
|
||||
|
||||
namespace pocketmine {
|
||||
|
||||
use pocketmine\utils\Git;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\ServerKiller;
|
||||
use pocketmine\utils\Terminal;
|
||||
@ -40,6 +36,10 @@ namespace pocketmine {
|
||||
|
||||
const MIN_PHP_VERSION = "7.2.0";
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function critical_error($message){
|
||||
echo "[ERROR] $message" . PHP_EOL;
|
||||
}
|
||||
@ -57,18 +57,18 @@ namespace pocketmine {
|
||||
if(version_compare(MIN_PHP_VERSION, PHP_VERSION) > 0){
|
||||
//If PHP version isn't high enough, anything below might break, so don't bother checking it.
|
||||
return [
|
||||
\pocketmine\NAME . " requires PHP >= " . MIN_PHP_VERSION . ", but you have PHP " . PHP_VERSION . "."
|
||||
"PHP >= " . MIN_PHP_VERSION . " is required, but you have PHP " . PHP_VERSION . "."
|
||||
];
|
||||
}
|
||||
|
||||
$messages = [];
|
||||
|
||||
if(PHP_INT_SIZE < 8){
|
||||
$messages[] = "Running " . \pocketmine\NAME . " with 32-bit systems/PHP is no longer supported. Please upgrade to a 64-bit system, or use a 64-bit PHP binary if this is a 64-bit system.";
|
||||
$messages[] = "32-bit systems/PHP are no longer supported. Please upgrade to a 64-bit system, or use a 64-bit PHP binary if this is a 64-bit system.";
|
||||
}
|
||||
|
||||
if(php_sapi_name() !== "cli"){
|
||||
$messages[] = "You must run " . \pocketmine\NAME . " using the CLI.";
|
||||
$messages[] = "Only PHP CLI is supported.";
|
||||
}
|
||||
|
||||
$extensions = [
|
||||
@ -102,8 +102,8 @@ namespace pocketmine {
|
||||
if(substr_count($pthreads_version, ".") < 2){
|
||||
$pthreads_version = "0.$pthreads_version";
|
||||
}
|
||||
if(version_compare($pthreads_version, "3.1.7dev") < 0){
|
||||
$messages[] = "pthreads >= 3.1.7dev is required, while you have $pthreads_version.";
|
||||
if(version_compare($pthreads_version, "3.2.0") < 0){
|
||||
$messages[] = "pthreads >= 3.2.0 is required, while you have $pthreads_version.";
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,160 +121,178 @@ namespace pocketmine {
|
||||
return $messages;
|
||||
}
|
||||
|
||||
if(!empty($messages = check_platform_dependencies())){
|
||||
echo PHP_EOL;
|
||||
$binary = version_compare(PHP_VERSION, "5.4") >= 0 ? PHP_BINARY : "unknown";
|
||||
critical_error("Selected PHP binary ($binary) does not satisfy some requirements.");
|
||||
foreach($messages as $m){
|
||||
echo " - $m" . PHP_EOL;
|
||||
}
|
||||
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
|
||||
echo PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
unset($messages);
|
||||
|
||||
error_reporting(-1);
|
||||
|
||||
if(\Phar::running(true) !== ""){
|
||||
define('pocketmine\PATH', \Phar::running(true) . "/");
|
||||
}else{
|
||||
define('pocketmine\PATH', dirname(__FILE__, 3) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
$opts = getopt("", ["bootstrap:"]);
|
||||
if(isset($opts["bootstrap"])){
|
||||
$bootstrap = realpath($opts["bootstrap"]) ?: $opts["bootstrap"];
|
||||
}else{
|
||||
$bootstrap = \pocketmine\PATH . 'vendor/autoload.php';
|
||||
}
|
||||
define('pocketmine\COMPOSER_AUTOLOADER_PATH', $bootstrap);
|
||||
|
||||
if(\pocketmine\COMPOSER_AUTOLOADER_PATH !== false and is_file(\pocketmine\COMPOSER_AUTOLOADER_PATH)){
|
||||
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
|
||||
}else{
|
||||
critical_error("Composer autoloader not found at " . $bootstrap);
|
||||
critical_error("Please install/update Composer dependencies or use provided builds.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
set_error_handler([Utils::class, 'errorExceptionHandler']);
|
||||
|
||||
/*
|
||||
* We now use the Composer autoloader, but this autoloader is still for loading plugins.
|
||||
/**
|
||||
* @param \Logger $logger
|
||||
* @return void
|
||||
*/
|
||||
$autoloader = new \BaseClassLoader();
|
||||
$autoloader->register(false);
|
||||
|
||||
set_time_limit(0); //Who set it to 30 seconds?!?!
|
||||
|
||||
ini_set("allow_url_fopen", '1');
|
||||
ini_set("display_errors", '1');
|
||||
ini_set("display_startup_errors", '1');
|
||||
ini_set("default_charset", "utf-8");
|
||||
|
||||
ini_set("memory_limit", '-1');
|
||||
|
||||
define('pocketmine\RESOURCE_PATH', \pocketmine\PATH . 'src' . DIRECTORY_SEPARATOR . 'pocketmine' . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR);
|
||||
|
||||
$opts = getopt("", ["data:", "plugins:", "no-wizard"]);
|
||||
|
||||
define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR);
|
||||
define('pocketmine\PLUGIN_PATH', isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
|
||||
|
||||
if(!file_exists(\pocketmine\DATA)){
|
||||
mkdir(\pocketmine\DATA, 0777, true);
|
||||
function emit_performance_warnings(\Logger $logger){
|
||||
if(extension_loaded("xdebug")){
|
||||
$logger->warning("Xdebug extension is enabled. This has a major impact on performance.");
|
||||
}
|
||||
if(!extension_loaded("pocketmine_chunkutils")){
|
||||
$logger->warning("ChunkUtils extension is missing. Anvil-format worlds will experience degraded performance.");
|
||||
}
|
||||
if(((int) ini_get('zend.assertions')) !== -1){
|
||||
$logger->warning("Debugging assertions are enabled. This may degrade performance. To disable them, set `zend.assertions = -1` in php.ini.");
|
||||
}
|
||||
if(\Phar::running(true) === ""){
|
||||
$logger->warning("Non-packaged installation detected. This will degrade autoloading speed and make startup times longer.");
|
||||
}
|
||||
}
|
||||
|
||||
define('pocketmine\LOCK_FILE_PATH', \pocketmine\DATA . 'server.lock');
|
||||
define('pocketmine\LOCK_FILE', fopen(\pocketmine\LOCK_FILE_PATH, "cb"));
|
||||
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
|
||||
critical_error("Another " . \pocketmine\NAME . " instance is already using this folder (" . realpath(\pocketmine\DATA) . ").");
|
||||
critical_error("Please stop the other server first before running a new one.");
|
||||
exit(1);
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
function set_ini_entries(){
|
||||
ini_set("allow_url_fopen", '1');
|
||||
ini_set("display_errors", '1');
|
||||
ini_set("display_startup_errors", '1');
|
||||
ini_set("default_charset", "utf-8");
|
||||
ini_set('assert.exception', '1');
|
||||
}
|
||||
|
||||
//Logger has a dependency on timezone
|
||||
$tzError = Timezone::init();
|
||||
|
||||
$logger = new MainLogger(\pocketmine\DATA . "server.log");
|
||||
$logger->registerStatic();
|
||||
|
||||
foreach($tzError as $e){
|
||||
$logger->warning($e);
|
||||
}
|
||||
unset($tzError);
|
||||
|
||||
if(extension_loaded("xdebug")){
|
||||
$logger->warning(PHP_EOL . PHP_EOL . PHP_EOL . "\tYou are running " . \pocketmine\NAME . " with xdebug enabled. This has a major impact on performance." . PHP_EOL . PHP_EOL);
|
||||
}
|
||||
if(!extension_loaded("pocketmine_chunkutils")){
|
||||
$logger->warning("ChunkUtils extension is missing. Anvil-format worlds will experience degraded performance.");
|
||||
}
|
||||
|
||||
if(\Phar::running(true) === ""){
|
||||
$logger->warning("Non-packaged " . \pocketmine\NAME . " installation detected. Consider using a phar in production for better performance.");
|
||||
}
|
||||
|
||||
$version = new VersionString(\pocketmine\BASE_VERSION, \pocketmine\IS_DEVELOPMENT_BUILD, \pocketmine\BUILD_NUMBER);
|
||||
define('pocketmine\VERSION', $version->getFullVersion(true));
|
||||
|
||||
$gitHash = str_repeat("00", 20);
|
||||
|
||||
if(\Phar::running(true) === ""){
|
||||
if(Utils::execute("git rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){
|
||||
$gitHash = trim($out);
|
||||
if(Utils::execute("git diff --quiet") === 1 or Utils::execute("git diff --cached --quiet") === 1){ //Locally-modified
|
||||
$gitHash .= "-dirty";
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
function server(){
|
||||
if(count($messages = check_platform_dependencies()) > 0){
|
||||
echo PHP_EOL;
|
||||
$binary = version_compare(PHP_VERSION, "5.4") >= 0 ? PHP_BINARY : "unknown";
|
||||
critical_error("Selected PHP binary ($binary) does not satisfy some requirements.");
|
||||
foreach($messages as $m){
|
||||
echo " - $m" . PHP_EOL;
|
||||
}
|
||||
critical_error("Please recompile PHP with the needed configuration, or refer to the installation instructions at http://pmmp.rtfd.io/en/rtfd/installation.html.");
|
||||
echo PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
}else{
|
||||
$phar = new \Phar(\Phar::running(false));
|
||||
$meta = $phar->getMetadata();
|
||||
if(isset($meta["git"])){
|
||||
$gitHash = $meta["git"];
|
||||
unset($messages);
|
||||
|
||||
error_reporting(-1);
|
||||
set_ini_entries();
|
||||
|
||||
$opts = getopt("", ["bootstrap:"]);
|
||||
if(isset($opts["bootstrap"])){
|
||||
$bootstrap = ($real = realpath($opts["bootstrap"])) !== false ? $real : $opts["bootstrap"];
|
||||
}else{
|
||||
$bootstrap = dirname(__FILE__, 3) . '/vendor/autoload.php';
|
||||
}
|
||||
}
|
||||
define('pocketmine\COMPOSER_AUTOLOADER_PATH', $bootstrap);
|
||||
|
||||
define('pocketmine\GIT_COMMIT', $gitHash);
|
||||
if(\pocketmine\COMPOSER_AUTOLOADER_PATH !== false and is_file(\pocketmine\COMPOSER_AUTOLOADER_PATH)){
|
||||
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
|
||||
}else{
|
||||
critical_error("Composer autoloader not found at " . $bootstrap);
|
||||
critical_error("Please install/update Composer dependencies or use provided builds.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
set_error_handler([Utils::class, 'errorExceptionHandler']);
|
||||
|
||||
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
|
||||
@ini_set("opcache.mmap_base", bin2hex(random_bytes(8))); //Fix OPCache address errors
|
||||
$version = new VersionString(\pocketmine\BASE_VERSION, \pocketmine\IS_DEVELOPMENT_BUILD, \pocketmine\BUILD_NUMBER);
|
||||
define('pocketmine\VERSION', $version->getFullVersion(true));
|
||||
|
||||
$exitCode = 0;
|
||||
do{
|
||||
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
|
||||
$installer = new SetupWizard();
|
||||
if(!$installer->run()){
|
||||
$exitCode = -1;
|
||||
break;
|
||||
$gitHash = str_repeat("00", 20);
|
||||
|
||||
if(\Phar::running(true) === ""){
|
||||
$gitHash = Git::getRepositoryStatePretty(\pocketmine\PATH);
|
||||
}else{
|
||||
$phar = new \Phar(\Phar::running(false));
|
||||
$meta = $phar->getMetadata();
|
||||
if(isset($meta["git"])){
|
||||
$gitHash = $meta["git"];
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: move this to a Server field
|
||||
define('pocketmine\START_TIME', microtime(true));
|
||||
ThreadManager::init();
|
||||
new Server($autoloader, $logger, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
||||
define('pocketmine\GIT_COMMIT', $gitHash);
|
||||
|
||||
$logger->info("Stopping other threads");
|
||||
$opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-ansi", "disable-ansi"]);
|
||||
|
||||
$killer = new ServerKiller(8);
|
||||
$killer->start(PTHREADS_INHERIT_NONE);
|
||||
usleep(10000); //Fixes ServerKiller not being able to start on single-core machines
|
||||
define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR);
|
||||
define('pocketmine\PLUGIN_PATH', isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
|
||||
|
||||
if(ThreadManager::getInstance()->stopAll() > 0){
|
||||
if(\pocketmine\DEBUG > 1){
|
||||
echo "Some threads could not be stopped, performing a force-kill" . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
Utils::kill(getmypid());
|
||||
if(!file_exists(\pocketmine\DATA)){
|
||||
mkdir(\pocketmine\DATA, 0777, true);
|
||||
}
|
||||
}while(false);
|
||||
|
||||
$logger->shutdown();
|
||||
$logger->join();
|
||||
define('pocketmine\LOCK_FILE', fopen(\pocketmine\DATA . 'server.lock', "a+b"));
|
||||
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
|
||||
//wait for a shared lock to avoid race conditions if two servers started at the same time - this makes sure the
|
||||
//other server wrote its PID and released exclusive lock before we get our lock
|
||||
flock(\pocketmine\LOCK_FILE, LOCK_SH);
|
||||
$pid = stream_get_contents(\pocketmine\LOCK_FILE);
|
||||
critical_error("Another " . \pocketmine\NAME . " instance (PID $pid) is already using this folder (" . realpath(\pocketmine\DATA) . ").");
|
||||
critical_error("Please stop the other server first before running a new one.");
|
||||
exit(1);
|
||||
}
|
||||
ftruncate(\pocketmine\LOCK_FILE, 0);
|
||||
fwrite(\pocketmine\LOCK_FILE, (string) getmypid());
|
||||
fflush(\pocketmine\LOCK_FILE);
|
||||
flock(\pocketmine\LOCK_FILE, LOCK_SH); //prevent acquiring an exclusive lock from another process, but allow reading
|
||||
|
||||
echo Terminal::$FORMAT_RESET . PHP_EOL;
|
||||
//Logger has a dependency on timezone
|
||||
$tzError = Timezone::init();
|
||||
|
||||
exit($exitCode);
|
||||
if(isset($opts["enable-ansi"])){
|
||||
Terminal::init(true);
|
||||
}elseif(isset($opts["disable-ansi"])){
|
||||
Terminal::init(false);
|
||||
}else{
|
||||
Terminal::init();
|
||||
}
|
||||
|
||||
$logger = new MainLogger(\pocketmine\DATA . "server.log");
|
||||
$logger->registerStatic();
|
||||
|
||||
foreach($tzError as $e){
|
||||
$logger->warning($e);
|
||||
}
|
||||
unset($tzError);
|
||||
|
||||
emit_performance_warnings($logger);
|
||||
|
||||
$exitCode = 0;
|
||||
do{
|
||||
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
|
||||
$installer = new SetupWizard();
|
||||
if(!$installer->run()){
|
||||
$exitCode = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: move this to a Server field
|
||||
define('pocketmine\START_TIME', microtime(true));
|
||||
|
||||
/*
|
||||
* We now use the Composer autoloader, but this autoloader is still for loading plugins.
|
||||
*/
|
||||
$autoloader = new \BaseClassLoader();
|
||||
$autoloader->register(false);
|
||||
|
||||
new Server($autoloader, $logger, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
||||
|
||||
$logger->info("Stopping other threads");
|
||||
|
||||
$killer = new ServerKiller(8);
|
||||
$killer->start(PTHREADS_INHERIT_NONE);
|
||||
usleep(10000); //Fixes ServerKiller not being able to start on single-core machines
|
||||
|
||||
if(ThreadManager::getInstance()->stopAll() > 0){
|
||||
$logger->debug("Some threads could not be stopped, performing a force-kill");
|
||||
Utils::kill(getmypid());
|
||||
}
|
||||
}while(false);
|
||||
|
||||
$logger->shutdown();
|
||||
$logger->join();
|
||||
|
||||
echo Terminal::$FORMAT_RESET . PHP_EOL;
|
||||
|
||||
exit($exitCode);
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
\pocketmine\server();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,6 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine;
|
||||
|
||||
use const PTHREADS_INHERIT_ALL;
|
||||
|
||||
/**
|
||||
* This class must be extended by all custom threading classes
|
||||
*/
|
||||
@ -33,12 +35,19 @@ abstract class Thread extends \Thread{
|
||||
/** @var string|null */
|
||||
protected $composerAutoloaderPath;
|
||||
|
||||
/** @var bool */
|
||||
protected $isKilled = false;
|
||||
|
||||
/**
|
||||
* @return \ClassLoader|null
|
||||
*/
|
||||
public function getClassLoader(){
|
||||
return $this->classLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setClassLoader(\ClassLoader $loader = null){
|
||||
$this->composerAutoloaderPath = \pocketmine\COMPOSER_AUTOLOADER_PATH;
|
||||
|
||||
@ -54,6 +63,8 @@ abstract class Thread extends \Thread{
|
||||
* WARNING: This method MUST be called from any descendent threads' run() method to make autoloading usable.
|
||||
* If you do not do this, you will not be able to use new classes that were not loaded when the thread was started
|
||||
* (unless you are using a custom autoloader).
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerClassLoader(){
|
||||
if($this->composerAutoloaderPath !== null){
|
||||
@ -64,7 +75,12 @@ abstract class Thread extends \Thread{
|
||||
}
|
||||
}
|
||||
|
||||
public function start(?int $options = \PTHREADS_INHERIT_ALL){
|
||||
/**
|
||||
* @param int|null $options TODO: pthreads bug
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function start(?int $options = PTHREADS_INHERIT_ALL){
|
||||
ThreadManager::getInstance()->add($this);
|
||||
|
||||
if($this->getClassLoader() === null){
|
||||
@ -75,6 +91,8 @@ abstract class Thread extends \Thread{
|
||||
|
||||
/**
|
||||
* Stops the thread using the best way possible. Try to stop it yourself before calling this.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function quit(){
|
||||
$this->isKilled = true;
|
||||
|
@ -28,9 +28,13 @@ use function spl_object_hash;
|
||||
|
||||
class ThreadManager extends \Volatile{
|
||||
|
||||
/** @var ThreadManager */
|
||||
/** @var ThreadManager|null */
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @return void
|
||||
*/
|
||||
public static function init(){
|
||||
self::$instance = new ThreadManager();
|
||||
}
|
||||
@ -39,24 +43,31 @@ class ThreadManager extends \Volatile{
|
||||
* @return ThreadManager
|
||||
*/
|
||||
public static function getInstance(){
|
||||
if(self::$instance === null){
|
||||
self::$instance = new ThreadManager();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Worker|Thread $thread
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($thread){
|
||||
if($thread instanceof Thread or $thread instanceof Worker){
|
||||
$this->{spl_object_hash($thread)} = $thread;
|
||||
$this[spl_object_hash($thread)] = $thread;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Worker|Thread $thread
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function remove($thread){
|
||||
if($thread instanceof Thread or $thread instanceof Worker){
|
||||
unset($this->{spl_object_hash($thread)});
|
||||
unset($this[spl_object_hash($thread)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine;
|
||||
|
||||
use function defined;
|
||||
|
||||
// composer autoload doesn't use require_once and also pthreads can inherit things
|
||||
// TODO: drop this file and use a final class with constants
|
||||
if(defined('pocketmine\_VERSION_INFO_INCLUDED')){
|
||||
return;
|
||||
}
|
||||
const _VERSION_INFO_INCLUDED = true;
|
||||
|
||||
const NAME = "PocketMine-MP";
|
||||
const BASE_VERSION = "3.7.3";
|
||||
const BASE_VERSION = "3.11.7";
|
||||
const IS_DEVELOPMENT_BUILD = false;
|
||||
const BUILD_NUMBER = 0;
|
||||
|
@ -23,6 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine;
|
||||
|
||||
use const PTHREADS_INHERIT_ALL;
|
||||
|
||||
/**
|
||||
* This class must be extended by all custom threading classes
|
||||
*/
|
||||
@ -33,12 +35,19 @@ abstract class Worker extends \Worker{
|
||||
/** @var string|null */
|
||||
protected $composerAutoloaderPath;
|
||||
|
||||
/** @var bool */
|
||||
protected $isKilled = false;
|
||||
|
||||
/**
|
||||
* @return \ClassLoader|null
|
||||
*/
|
||||
public function getClassLoader(){
|
||||
return $this->classLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setClassLoader(\ClassLoader $loader = null){
|
||||
$this->composerAutoloaderPath = \pocketmine\COMPOSER_AUTOLOADER_PATH;
|
||||
|
||||
@ -54,6 +63,8 @@ abstract class Worker extends \Worker{
|
||||
* WARNING: This method MUST be called from any descendent threads' run() method to make autoloading usable.
|
||||
* If you do not do this, you will not be able to use new classes that were not loaded when the thread was started
|
||||
* (unless you are using a custom autoloader).
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerClassLoader(){
|
||||
if($this->composerAutoloaderPath !== null){
|
||||
@ -64,7 +75,12 @@ abstract class Worker extends \Worker{
|
||||
}
|
||||
}
|
||||
|
||||
public function start(?int $options = \PTHREADS_INHERIT_ALL){
|
||||
/**
|
||||
* @param int|null $options TODO: pthreads bug
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function start(?int $options = PTHREADS_INHERIT_ALL){
|
||||
ThreadManager::getInstance()->add($this);
|
||||
|
||||
if($this->getClassLoader() === null){
|
||||
@ -75,6 +91,8 @@ abstract class Worker extends \Worker{
|
||||
|
||||
/**
|
||||
* Stops the thread using the best way possible. Try to stop it yourself before calling this.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function quit(){
|
||||
$this->isKilled = true;
|
||||
|
@ -26,7 +26,6 @@ namespace pocketmine\block;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
|
||||
|
||||
/**
|
||||
* Air block
|
||||
*/
|
||||
|
@ -78,7 +78,7 @@ class Anvil extends Fallable{
|
||||
public function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
$inset = 0.125;
|
||||
|
||||
if($this->meta & 0x01){ //east/west
|
||||
if(($this->meta & 0x01) !== 0){ //east/west
|
||||
return new AxisAlignedBB(
|
||||
$this->x,
|
||||
$this->y,
|
||||
|
@ -99,6 +99,11 @@ abstract class BaseRail extends Flowable{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $connections
|
||||
* @param int[][] $lookup
|
||||
* @phpstan-param array<int, list<int>> $lookup
|
||||
*/
|
||||
protected static function searchState(array $connections, array $lookup) : int{
|
||||
$meta = array_search($connections, $lookup, true);
|
||||
if($meta === false){
|
||||
@ -114,9 +119,7 @@ abstract class BaseRail extends Flowable{
|
||||
/**
|
||||
* Returns a meta value for the rail with the given connections.
|
||||
*
|
||||
* @param array $connections
|
||||
*
|
||||
* @return int
|
||||
* @param int[] $connections
|
||||
*
|
||||
* @throws \InvalidArgumentException if no state matches the given connections
|
||||
*/
|
||||
@ -164,6 +167,12 @@ abstract class BaseRail extends Flowable{
|
||||
return $connections;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $constraints
|
||||
*
|
||||
* @return true[]
|
||||
* @phpstan-return array<int, true>
|
||||
*/
|
||||
private function getPossibleConnectionDirections(array $constraints) : array{
|
||||
switch(count($constraints)){
|
||||
case 0:
|
||||
@ -188,6 +197,10 @@ abstract class BaseRail extends Flowable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true[]
|
||||
* @phpstan-return array<int, true>
|
||||
*/
|
||||
protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{
|
||||
$opposite = Vector3::getOppositeSide($constraint & ~self::FLAG_ASCEND);
|
||||
|
||||
@ -247,6 +260,9 @@ abstract class BaseRail extends Flowable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $connections
|
||||
*/
|
||||
private function updateState(array $connections) : void{
|
||||
if(count($connections) === 1){
|
||||
$connections[] = Vector3::getOppositeSide($connections[0] & ~self::FLAG_ASCEND);
|
||||
|
@ -69,13 +69,13 @@ class Bed extends Transparent{
|
||||
return ($this->meta & self::BITFLAG_HEAD) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isOccupied() : bool{
|
||||
return ($this->meta & self::BITFLAG_OCCUPIED) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setOccupied(bool $occupied = true){
|
||||
if($occupied){
|
||||
$this->meta |= self::BITFLAG_OCCUPIED;
|
||||
@ -90,12 +90,6 @@ class Bed extends Transparent{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $meta
|
||||
* @param bool $isHead
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getOtherHalfSide(int $meta, bool $isHead = false) : int{
|
||||
$rotation = $meta & 0x03;
|
||||
$side = -1;
|
||||
@ -122,9 +116,6 @@ class Bed extends Transparent{
|
||||
return $side;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Bed|null
|
||||
*/
|
||||
public function getOtherHalf() : ?Bed{
|
||||
$other = $this->getSide(self::getOtherHalfSide($this->meta, $this->isHeadPart()));
|
||||
if($other instanceof Bed and $other->getId() === $this->getId() and $other->isHeadPart() !== $this->isHeadPart() and (($other->getDamage() & 0x03) === ($this->getDamage() & 0x03))){
|
||||
|
@ -40,6 +40,7 @@ use pocketmine\network\mcpe\protocol\types\RuntimeBlockMapping;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\plugin\Plugin;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
use function get_class;
|
||||
use const PHP_INT_MAX;
|
||||
|
||||
@ -49,12 +50,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* Returns a new Block instance with the specified ID, meta and position.
|
||||
*
|
||||
* This function redirects to {@link BlockFactory#get}.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param Position|null $pos
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
public static function get(int $id, int $meta = 0, Position $pos = null) : Block{
|
||||
return BlockFactory::get($id, $meta, $pos);
|
||||
@ -69,10 +64,9 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/** @var int|null */
|
||||
protected $itemId;
|
||||
|
||||
/** @var AxisAlignedBB */
|
||||
/** @var AxisAlignedBB|null */
|
||||
protected $boundingBox = null;
|
||||
|
||||
|
||||
/** @var AxisAlignedBB[]|null */
|
||||
protected $collisionBoxes = null;
|
||||
|
||||
@ -89,16 +83,10 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
$this->itemId = $itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() : string{
|
||||
return $this->fallbackName ?? "Unknown";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
final public function getId() : int{
|
||||
return $this->id;
|
||||
}
|
||||
@ -106,8 +94,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns the ID of the item form of the block.
|
||||
* Used for drops for blocks (some blocks such as doors have a different item ID).
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getItemId() : int{
|
||||
return $this->itemId ?? $this->getId();
|
||||
@ -115,22 +101,15 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return int
|
||||
*/
|
||||
public function getRuntimeId() : int{
|
||||
return RuntimeBlockMapping::toStaticRuntimeId($this->getId(), $this->getDamage());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
final public function getDamage() : int{
|
||||
return $this->meta;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $meta
|
||||
*/
|
||||
final public function setDamage(int $meta) : void{
|
||||
if($meta < 0 or $meta > 0xf){
|
||||
throw new \InvalidArgumentException("Block damage values must be 0-15, not $meta");
|
||||
@ -144,8 +123,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
*
|
||||
* If your block should not have any meta value when it's dropped as an item, override this to return 0 in
|
||||
* descendent classes.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getVariantBitmask() : int{
|
||||
return -1;
|
||||
@ -153,24 +130,18 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns the block meta, stripped of non-variant flags.
|
||||
* @return int
|
||||
*/
|
||||
public function getVariant() : int{
|
||||
return $this->meta & $this->getVariantBitmask();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* AKA: Block->isPlaceable
|
||||
* @return bool
|
||||
*/
|
||||
public function canBePlaced() : bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeReplaced() : bool{
|
||||
return false;
|
||||
}
|
||||
@ -181,15 +152,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Places the Block, using block space and block target, and side. Returns if the block has been placed.
|
||||
*
|
||||
* @param Item $item
|
||||
* @param Block $blockReplace
|
||||
* @param Block $blockClicked
|
||||
* @param int $face
|
||||
* @param Vector3 $clickVector
|
||||
* @param Player|null $player
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
return $this->getLevel()->setBlock($this, $this, true, true);
|
||||
@ -197,18 +159,11 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns if the block can be broken with an specific Item
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isBreakable(Item $item) : bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getToolType() : int{
|
||||
return BlockToolType::TYPE_NONE;
|
||||
}
|
||||
@ -222,8 +177,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* Otherwise, 1 should be returned if a tool is required, 0 if not.
|
||||
*
|
||||
* @see Item::getBlockToolHarvestLevel()
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getToolHarvestLevel() : int{
|
||||
return 0;
|
||||
@ -235,10 +188,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
*
|
||||
* In most cases this is also used to determine whether block drops should be created or not, except in some
|
||||
* special cases such as vines.
|
||||
*
|
||||
* @param Item $tool
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCompatibleWithTool(Item $tool) : bool{
|
||||
if($this->getHardness() < 0){
|
||||
@ -253,23 +202,14 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Do the actions needed so the block is broken with the Item
|
||||
*
|
||||
* @param Item $item
|
||||
* @param Player|null $player
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onBreak(Item $item, Player $player = null) : bool{
|
||||
return $this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), true, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the seconds that this block takes to be broken using an specific Item
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return float
|
||||
* @throws \InvalidArgumentException if the item efficiency is not a positive number
|
||||
*/
|
||||
public function getBreakTime(Item $item) : float{
|
||||
@ -299,8 +239,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns whether random block updates will be done on this block.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function ticksRandomly() : bool{
|
||||
return false;
|
||||
@ -323,11 +261,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Do actions when activated by Item. Returns if it has done anything
|
||||
*
|
||||
* @param Item $item
|
||||
* @param Player|null $player
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onActivate(Item $item, Player $player = null) : bool{
|
||||
return false;
|
||||
@ -335,7 +268,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns a base value used to compute block break times.
|
||||
* @return float
|
||||
*/
|
||||
public function getHardness() : float{
|
||||
return 10;
|
||||
@ -343,15 +275,11 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns the block's resistance to explosions. Usually 5x hardness.
|
||||
* @return float
|
||||
*/
|
||||
public function getBlastResistance() : float{
|
||||
return $this->getHardness() * 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getFrictionFactor() : float{
|
||||
return 0.6;
|
||||
}
|
||||
@ -379,16 +307,11 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* Examples of this behaviour include leaves and cobwebs.
|
||||
*
|
||||
* Light-diffusing blocks are included by the heightmap.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function diffusesSkyLight() : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isTransparent() : bool{
|
||||
return false;
|
||||
}
|
||||
@ -399,7 +322,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* AKA: Block->isFlowable
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeFlowedInto() : bool{
|
||||
return false;
|
||||
@ -415,21 +337,17 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns whether entities can climb up this block.
|
||||
* @return bool
|
||||
*/
|
||||
public function canClimb() : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function addVelocityToEntity(Entity $entity, Vector3 $vector) : void{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block position to a new Position object
|
||||
*
|
||||
* @param Position $v
|
||||
*/
|
||||
final public function position(Position $v) : void{
|
||||
$this->x = (int) $v->x;
|
||||
@ -442,8 +360,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns an array of Item objects to be dropped
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return Item[]
|
||||
*/
|
||||
public function getDrops(Item $item) : array{
|
||||
@ -461,8 +377,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns an array of Items to be dropped when the block is broken using the correct tool type.
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return Item[]
|
||||
*/
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
@ -474,8 +388,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns an array of Items to be dropped when the block is broken using a compatible Silk Touch-enchanted tool.
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return Item[]
|
||||
*/
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
@ -486,10 +398,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns how much XP will be dropped by breaking this block with the given item.
|
||||
*
|
||||
* @param Item $item
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getXpDropForTool(Item $item) : int{
|
||||
if($item->hasEnchantment(Enchantment::SILK_TOUCH) or !$this->isCompatibleWithTool($item)){
|
||||
@ -501,8 +409,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns how much XP this block will drop when broken with an appropriate tool.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function getXpDropAmount() : int{
|
||||
return 0;
|
||||
@ -511,8 +417,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns whether Silk Touch enchanted tools will cause this block to drop as itself. Since most blocks drop
|
||||
* themselves anyway, this is implicitly true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAffectedBySilkTouch() : bool{
|
||||
return true;
|
||||
@ -520,7 +424,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns the item that players will equip when middle-clicking on this block.
|
||||
* @return Item
|
||||
*/
|
||||
public function getPickedItem() : Item{
|
||||
return ItemFactory::get($this->getItemId(), $this->getVariant());
|
||||
@ -528,7 +431,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns the time in ticks which the block will fuel a furnace for.
|
||||
* @return int
|
||||
*/
|
||||
public function getFuelTime() : int{
|
||||
return 0;
|
||||
@ -537,8 +439,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns the chance that the block will catch fire from nearby fire sources. Higher values lead to faster catching
|
||||
* fire.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFlameEncouragement() : int{
|
||||
return 0;
|
||||
@ -546,8 +446,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns the base flammability of this block. Higher values lead to the block burning away more quickly.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFlammability() : int{
|
||||
return 0;
|
||||
@ -555,8 +453,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns whether fire lit on this block will burn indefinitely.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function burnsForever() : bool{
|
||||
return false;
|
||||
@ -564,8 +460,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Returns whether this block can catch fire.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isFlammable() : bool{
|
||||
return $this->getFlammability() > 0;
|
||||
@ -581,9 +475,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
/**
|
||||
* Returns the Block on the side $side, works like Vector3::getSide()
|
||||
*
|
||||
* @param int $side
|
||||
* @param int $step
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
public function getSide(int $side, int $step = 1){
|
||||
@ -642,10 +533,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* Checks for collision against an AxisAlignedBB
|
||||
*
|
||||
* @param AxisAlignedBB $bb
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function collidesWithBB(AxisAlignedBB $bb) : bool{
|
||||
foreach($this->getCollisionBoxes() as $bb2){
|
||||
@ -657,9 +544,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
*/
|
||||
public function onEntityCollide(Entity $entity) : void{
|
||||
|
||||
}
|
||||
@ -679,16 +563,13 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* @return AxisAlignedBB[]
|
||||
*/
|
||||
protected function recalculateCollisionBoxes() : array{
|
||||
if($bb = $this->recalculateBoundingBox()){
|
||||
if(($bb = $this->recalculateBoundingBox()) !== null){
|
||||
return [$bb];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AxisAlignedBB|null
|
||||
*/
|
||||
public function getBoundingBox() : ?AxisAlignedBB{
|
||||
if($this->boundingBox === null){
|
||||
$this->boundingBox = $this->recalculateBoundingBox();
|
||||
@ -696,9 +577,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
return $this->boundingBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AxisAlignedBB|null
|
||||
*/
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
return new AxisAlignedBB(
|
||||
$this->x,
|
||||
@ -719,15 +597,9 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
$this->collisionBoxes = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos1
|
||||
* @param Vector3 $pos2
|
||||
*
|
||||
* @return RayTraceResult|null
|
||||
*/
|
||||
public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?RayTraceResult{
|
||||
$bbs = $this->getCollisionBoxes();
|
||||
if(empty($bbs)){
|
||||
if(count($bbs) === 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -763,7 +635,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
return $this->level->getBlockMetadata()->getMetadata($this, $metadataKey);
|
||||
}
|
||||
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
|
||||
public function hasMetadata(string $metadataKey) : bool{
|
||||
|
@ -32,23 +32,47 @@ use function min;
|
||||
* Manages block registration and instance creation
|
||||
*/
|
||||
class BlockFactory{
|
||||
/** @var \SplFixedArray<Block> */
|
||||
private static $fullList = null;
|
||||
/**
|
||||
* @var \SplFixedArray|Block[]
|
||||
* @phpstan-var \SplFixedArray<Block>
|
||||
*/
|
||||
private static $fullList;
|
||||
|
||||
/** @var \SplFixedArray<bool> */
|
||||
public static $solid = null;
|
||||
/** @var \SplFixedArray<bool> */
|
||||
public static $transparent = null;
|
||||
/** @var \SplFixedArray<float> */
|
||||
public static $hardness = null;
|
||||
/** @var \SplFixedArray<int> */
|
||||
public static $light = null;
|
||||
/** @var \SplFixedArray<int> */
|
||||
public static $lightFilter = null;
|
||||
/** @var \SplFixedArray<bool> */
|
||||
public static $diffusesSkyLight = null;
|
||||
/** @var \SplFixedArray<float> */
|
||||
public static $blastResistance = null;
|
||||
/**
|
||||
* @var \SplFixedArray|bool[]
|
||||
* @phpstan-var \SplFixedArray<bool>
|
||||
*/
|
||||
public static $solid;
|
||||
/**
|
||||
* @var \SplFixedArray|bool[]
|
||||
* @phpstan-var \SplFixedArray<bool>
|
||||
*/
|
||||
public static $transparent;
|
||||
/**
|
||||
* @var \SplFixedArray|float[]
|
||||
* @phpstan-var \SplFixedArray<float>
|
||||
*/
|
||||
public static $hardness;
|
||||
/**
|
||||
* @var \SplFixedArray|int[]
|
||||
* @phpstan-var \SplFixedArray<int>
|
||||
*/
|
||||
public static $light;
|
||||
/**
|
||||
* @var \SplFixedArray|int[]
|
||||
* @phpstan-var \SplFixedArray<int>
|
||||
*/
|
||||
public static $lightFilter;
|
||||
/**
|
||||
* @var \SplFixedArray|bool[]
|
||||
* @phpstan-var \SplFixedArray<bool>
|
||||
*/
|
||||
public static $diffusesSkyLight;
|
||||
/**
|
||||
* @var \SplFixedArray|float[]
|
||||
* @phpstan-var \SplFixedArray<float>
|
||||
*/
|
||||
public static $blastResistance;
|
||||
|
||||
/**
|
||||
* Initializes the block factory. By default this is called only once on server start, however you may wish to use
|
||||
@ -334,7 +358,6 @@ class BlockFactory{
|
||||
* NOTE: If you are registering a new block type, you will need to add it to the creative inventory yourself - it
|
||||
* will not automatically appear there.
|
||||
*
|
||||
* @param Block $block
|
||||
* @param bool $override Whether to override existing registrations
|
||||
*
|
||||
* @throws \RuntimeException if something attempted to override an already-registered block without specifying the
|
||||
@ -364,12 +387,6 @@ class BlockFactory{
|
||||
|
||||
/**
|
||||
* Returns a new Block instance with the specified ID, meta and position.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param Position $pos
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
public static function get(int $id, int $meta = 0, Position $pos = null) : Block{
|
||||
if($meta < 0 or $meta > 0xf){
|
||||
@ -398,7 +415,7 @@ class BlockFactory{
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @return \SplFixedArray
|
||||
* @phpstan-return \SplFixedArray<Block>
|
||||
*/
|
||||
public static function getBlockStatesArray() : \SplFixedArray{
|
||||
return self::$fullList;
|
||||
@ -406,10 +423,6 @@ class BlockFactory{
|
||||
|
||||
/**
|
||||
* Returns whether a specified block ID is already registered in the block factory.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isRegistered(int $id) : bool{
|
||||
$b = self::$fullList[$id << 4];
|
||||
@ -419,11 +432,6 @@ class BlockFactory{
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function toStaticRuntimeId(int $id, int $meta = 0) : int{
|
||||
return RuntimeBlockMapping::toStaticRuntimeId($id, $meta);
|
||||
@ -433,8 +441,6 @@ class BlockFactory{
|
||||
* @deprecated
|
||||
* @internal
|
||||
*
|
||||
* @param int $runtimeId
|
||||
*
|
||||
* @return int[] [id, meta]
|
||||
*/
|
||||
public static function fromStaticRuntimeId(int $runtimeId) : array{
|
||||
|
@ -80,6 +80,9 @@ class BurningFurnace extends Solid{
|
||||
$furnace = $this->getLevel()->getTile($this);
|
||||
if(!($furnace instanceof TileFurnace)){
|
||||
$furnace = Tile::createTile(Tile::FURNACE, $this->getLevel(), TileFurnace::createNBT($this));
|
||||
if(!($furnace instanceof TileFurnace)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$furnace->canOpenWith($item->getCustomName())){
|
||||
|
@ -46,7 +46,7 @@ class Carpet extends Flowable{
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Carpet";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Carpet";
|
||||
}
|
||||
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
|
@ -109,11 +109,14 @@ class Chest extends Transparent{
|
||||
$chest = $t;
|
||||
}else{
|
||||
$chest = Tile::createTile(Tile::CHEST, $this->getLevel(), TileChest::createNBT($this));
|
||||
if(!($chest instanceof TileChest)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
!$this->getSide(Vector3::SIDE_UP)->isTransparent() or
|
||||
($chest->isPaired() and !$chest->getPair()->getBlock()->getSide(Vector3::SIDE_UP)->isTransparent()) or
|
||||
(($pair = $chest->getPair()) !== null and !$pair->getBlock()->getSide(Vector3::SIDE_UP)->isTransparent()) or
|
||||
!$chest->canOpenWith($item->getCustomName())
|
||||
){
|
||||
return true;
|
||||
|
@ -111,6 +111,9 @@ class CobblestoneWall extends Transparent{
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canConnect(Block $block){
|
||||
return $block instanceof static or $block instanceof FenceGate or ($block->isSolid() and !$block->isTransparent());
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class Concrete extends Solid{
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Concrete";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Concrete";
|
||||
}
|
||||
|
||||
public function getHardness() : float{
|
||||
|
@ -34,7 +34,7 @@ class ConcretePowder extends Fallable{
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Concrete Powder";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Concrete Powder";
|
||||
}
|
||||
|
||||
public function getHardness() : float{
|
||||
@ -53,16 +53,10 @@ class ConcretePowder extends Fallable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|Block
|
||||
*/
|
||||
public function tickFalling() : ?Block{
|
||||
return $this->checkAdjacentWater();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|Block
|
||||
*/
|
||||
private function checkAdjacentWater() : ?Block{
|
||||
for($i = 1; $i < 6; ++$i){ //Do not check underneath
|
||||
if($this->getSide($i) instanceof Water){
|
||||
|
@ -41,7 +41,6 @@ abstract class Crops extends Flowable{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function onActivate(Item $item, Player $player = null) : bool{
|
||||
if($this->meta < 7 and $item->getId() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
$block = clone $this;
|
||||
@ -56,7 +55,7 @@ abstract class Crops extends Flowable{
|
||||
$this->getLevel()->setBlock($this, $ev->getNewState(), true, true);
|
||||
}
|
||||
|
||||
$item->count--;
|
||||
$item->pop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ class Dandelion extends Flowable{
|
||||
return "Dandelion";
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
$down = $this->getSide(Vector3::SIDE_DOWN);
|
||||
if($down->getId() === Block::GRASS or $down->getId() === Block::DIRT or $down->getId() === Block::FARMLAND){
|
||||
|
@ -29,14 +29,13 @@ use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Player;
|
||||
|
||||
|
||||
abstract class Door extends Transparent{
|
||||
|
||||
public function isSolid() : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getFullDamage(){
|
||||
private function getFullDamage() : int{
|
||||
$damage = $this->getDamage();
|
||||
$isUp = ($damage & 0x08) > 0;
|
||||
|
||||
|
@ -39,7 +39,7 @@ class DoublePlant extends Flowable{
|
||||
}
|
||||
|
||||
public function canBeReplaced() : bool{
|
||||
return $this->meta === 2 or $this->meta === 3; //grass or fern
|
||||
return $this->getVariant() === 2 or $this->getVariant() === 3; //grass or fern
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
@ -68,10 +68,9 @@ class DoublePlant extends Flowable{
|
||||
|
||||
/**
|
||||
* Returns whether this double-plant has a corresponding other half.
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidHalfPlant() : bool{
|
||||
if($this->meta & self::BITFLAG_TOP){
|
||||
if(($this->meta & self::BITFLAG_TOP) !== 0){
|
||||
$other = $this->getSide(Vector3::SIDE_DOWN);
|
||||
}else{
|
||||
$other = $this->getSide(Vector3::SIDE_UP);
|
||||
@ -95,15 +94,15 @@ class DoublePlant extends Flowable{
|
||||
}
|
||||
|
||||
public function getToolType() : int{
|
||||
return ($this->meta === 2 or $this->meta === 3) ? BlockToolType::TYPE_SHEARS : BlockToolType::TYPE_NONE;
|
||||
return ($this->getVariant() === 2 or $this->getVariant() === 3) ? BlockToolType::TYPE_SHEARS : BlockToolType::TYPE_NONE;
|
||||
}
|
||||
|
||||
public function getToolHarvestLevel() : int{
|
||||
return ($this->meta === 2 or $this->meta === 3) ? 1 : 0; //only grass or fern require shears
|
||||
return ($this->getVariant() === 2 or $this->getVariant() === 3) ? 1 : 0; //only grass or fern require shears
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array{
|
||||
if($this->meta & self::BITFLAG_TOP){
|
||||
if(($this->meta & self::BITFLAG_TOP) !== 0){
|
||||
if($this->isCompatibleWithTool($item)){
|
||||
return parent::getDrops($item);
|
||||
}
|
||||
|
@ -84,6 +84,9 @@ class EnderChest extends Chest{
|
||||
$enderChest = $t;
|
||||
}else{
|
||||
$enderChest = Tile::createTile(Tile::ENDER_CHEST, $this->getLevel(), TileEnderChest::createNBT($this));
|
||||
if(!($enderChest instanceof TileEnderChest)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->getSide(Vector3::SIDE_UP)->isTransparent()){
|
||||
|
@ -45,9 +45,6 @@ abstract class Fallable extends Solid{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|Block
|
||||
*/
|
||||
public function tickFalling() : ?Block{
|
||||
return null;
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ class Farmland extends Transparent{
|
||||
return BlockToolType::TYPE_SHOVEL;
|
||||
}
|
||||
|
||||
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
return new AxisAlignedBB(
|
||||
$this->x,
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use function count;
|
||||
|
||||
abstract class Fence extends Transparent{
|
||||
|
||||
@ -85,7 +86,7 @@ abstract class Fence extends Transparent{
|
||||
);
|
||||
}
|
||||
|
||||
if(empty($bbs)){
|
||||
if(count($bbs) === 0){
|
||||
//centre post AABB (only needed if not connected on any axis - other BBs overlapping will do this if any connections are made)
|
||||
return [
|
||||
new AxisAlignedBB(
|
||||
@ -102,6 +103,9 @@ abstract class Fence extends Transparent{
|
||||
return $bbs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canConnect(Block $block){
|
||||
return $block instanceof static or $block instanceof FenceGate or ($block->isSolid() and !$block->isTransparent());
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ class FenceGate extends Transparent{
|
||||
return BlockToolType::TYPE_AXE;
|
||||
}
|
||||
|
||||
|
||||
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||
|
||||
if(($this->getDamage() & 0x04) > 0){
|
||||
|
@ -56,7 +56,7 @@ class Flower extends Flowable{
|
||||
self::TYPE_PINK_TULIP => "Pink Tulip",
|
||||
self::TYPE_OXEYE_DAISY => "Oxeye Daisy"
|
||||
];
|
||||
return $names[$this->meta] ?? "Unknown";
|
||||
return $names[$this->getVariant()] ?? "Unknown";
|
||||
}
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
class Furnace extends BurningFurnace{
|
||||
|
||||
protected $id = self::FURNACE;
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
use pocketmine\item\TieredTool;
|
||||
|
||||
class GlowingObsidian extends Solid{
|
||||
|
@ -99,7 +99,7 @@ class Grass extends Solid{
|
||||
|
||||
public function onActivate(Item $item, Player $player = null) : bool{
|
||||
if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){
|
||||
$item->count--;
|
||||
$item->pop();
|
||||
TallGrassObject::growGrass($this->getLevel(), $this, new Random(mt_rand()), 8, 2);
|
||||
|
||||
return true;
|
||||
|
@ -44,4 +44,8 @@ class IronTrapdoor extends Trapdoor{
|
||||
public function getToolHarvestLevel() : int{
|
||||
return TieredTool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 0; //TODO: remove this hack on 4.0
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,9 @@ class ItemFrame extends Flowable{
|
||||
$tile = $this->level->getTile($this);
|
||||
if(!($tile instanceof TileItemFrame)){
|
||||
$tile = Tile::createTile(Tile::ITEM_FRAME, $this->getLevel(), TileItemFrame::createNBT($this));
|
||||
if(!($tile instanceof TileItemFrame)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if($tile->hasItem()){
|
||||
|
@ -90,7 +90,6 @@ class Ladder extends Transparent{
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
if(!$blockClicked->isTransparent()){
|
||||
$faces = [
|
||||
|
@ -39,6 +39,7 @@ class Leaves extends Transparent{
|
||||
public const DARK_OAK = 1;
|
||||
|
||||
protected $id = self::LEAVES;
|
||||
/** @var int */
|
||||
protected $woodType = self::WOOD;
|
||||
|
||||
public function __construct(int $meta = 0){
|
||||
@ -67,8 +68,11 @@ class Leaves extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected function findLog(Block $pos, array $visited, int $distance, ?int $fromSide = null) : bool{
|
||||
/**
|
||||
* @param true[] $visited reference parameter
|
||||
* @phpstan-param array<string, true> $visited
|
||||
*/
|
||||
protected function findLog(Block $pos, array &$visited, int $distance, ?int $fromSide = null) : bool{
|
||||
$index = $pos->x . "." . $pos->y . "." . $pos->z;
|
||||
if(isset($visited[$index])){
|
||||
return false;
|
||||
@ -168,7 +172,7 @@ class Leaves extends Transparent{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array{
|
||||
if($item->getBlockToolType() & BlockToolType::TYPE_SHEARS){
|
||||
if(($item->getBlockToolType() & BlockToolType::TYPE_SHEARS) !== 0){
|
||||
return $this->getDropsForCompatibleTool($item);
|
||||
}
|
||||
|
||||
@ -188,7 +192,7 @@ class Leaves extends Transparent{
|
||||
}
|
||||
|
||||
public function canDropApples() : bool{
|
||||
return $this->meta === self::OAK;
|
||||
return $this->getVariant() === self::OAK;
|
||||
}
|
||||
|
||||
public function getFlameEncouragement() : int{
|
||||
|
@ -29,6 +29,7 @@ use pocketmine\item\ItemFactory;
|
||||
class Leaves2 extends Leaves{
|
||||
|
||||
protected $id = self::LEAVES2;
|
||||
/** @var int */
|
||||
protected $woodType = self::WOOD2;
|
||||
|
||||
public function getName() : string{
|
||||
@ -44,6 +45,6 @@ class Leaves2 extends Leaves{
|
||||
}
|
||||
|
||||
public function canDropApples() : bool{
|
||||
return $this->meta === self::DARK_OAK;
|
||||
return $this->getVariant() === self::DARK_OAK;
|
||||
}
|
||||
}
|
||||
|
@ -32,11 +32,13 @@ use pocketmine\level\sound\FizzSound;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use function array_fill;
|
||||
use function intdiv;
|
||||
use function lcg_value;
|
||||
use function min;
|
||||
|
||||
abstract class Liquid extends Transparent{
|
||||
|
||||
/** @var int */
|
||||
public $adjacentSources = 0;
|
||||
|
||||
/** @var Vector3|null */
|
||||
@ -89,6 +91,9 @@ abstract class Liquid extends Transparent{
|
||||
|
||||
abstract public function getBucketEmptySound() : int;
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getFluidHeightPercent(){
|
||||
$d = $this->meta;
|
||||
if($d >= 8){
|
||||
@ -206,8 +211,6 @@ abstract class Liquid extends Transparent{
|
||||
|
||||
/**
|
||||
* Returns how many liquid levels are lost per block flowed horizontally. Affects how far the liquid can flow.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFlowDecayPerBlock() : int{
|
||||
return 1;
|
||||
@ -372,7 +375,7 @@ abstract class Liquid extends Transparent{
|
||||
*/
|
||||
private function getOptimalFlowDirections() : array{
|
||||
$flowCost = array_fill(0, 4, 1000);
|
||||
$maxCost = 4 / $this->getFlowDecayPerBlock();
|
||||
$maxCost = intdiv(4, $this->getFlowDecayPerBlock());
|
||||
for($j = 0; $j < 4; ++$j){
|
||||
$x = $this->x;
|
||||
$y = $this->y;
|
||||
@ -429,6 +432,9 @@ abstract class Liquid extends Transparent{
|
||||
return ($decay >= 0 && $blockDecay >= $decay) ? $decay : $blockDecay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function checkForHarden(){
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
class MossyCobblestone extends Cobblestone{
|
||||
|
||||
protected $id = self::MOSSY_COBBLESTONE;
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
use pocketmine\event\block\BlockGrowEvent;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
|
@ -46,4 +46,6 @@ class NoteBlock extends Solid{
|
||||
public function getToolType() : int{
|
||||
return BlockToolType::TYPE_AXE;
|
||||
}
|
||||
|
||||
//TODO
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class Quartz extends Solid{
|
||||
}
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
if($this->meta !== self::NORMAL){
|
||||
if($this->getVariant() !== self::NORMAL){
|
||||
$this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face);
|
||||
}
|
||||
return $this->getLevel()->setBlock($blockReplace, $this, true, true);
|
||||
|
@ -40,7 +40,7 @@ class Sand extends Fallable{
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
if($this->meta === 0x01){
|
||||
if($this->getVariant() === 0x01){
|
||||
return "Red Sand";
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class Sapling extends Flowable{
|
||||
//TODO: change log type
|
||||
Tree::growTree($this->getLevel(), $this->x, $this->y, $this->z, new Random(mt_rand()), $this->getVariant());
|
||||
|
||||
$item->count--;
|
||||
$item->pop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ class SignPost extends Transparent{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
if($face !== Vector3::SIDE_DOWN){
|
||||
|
||||
|
@ -78,7 +78,7 @@ abstract class Slab extends Transparent{
|
||||
}
|
||||
}else{ //TODO: collision
|
||||
if($blockReplace->getId() === $this->id){
|
||||
if($blockReplace->getVariant() === $this->meta){
|
||||
if($blockReplace->getVariant() === $this->getVariant()){
|
||||
$this->getLevel()->setBlock($blockReplace, BlockFactory::get($this->getDoubleSlabId(), $this->getVariant()), true);
|
||||
|
||||
return true;
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
class Sponge extends Solid{
|
||||
|
||||
protected $id = self::SPONGE;
|
||||
|
@ -30,6 +30,6 @@ class StainedClay extends HardenedClay{
|
||||
protected $id = self::STAINED_CLAY;
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Stained Clay";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Stained Clay";
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ class StainedGlass extends Glass{
|
||||
protected $id = self::STAINED_GLASS;
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Stained Glass";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Stained Glass";
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ class StainedGlassPane extends GlassPane{
|
||||
protected $id = self::STAINED_GLASS_PANE;
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Stained Glass Pane";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Stained Glass Pane";
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,10 @@ class Stonecutter extends Solid{
|
||||
return "Stonecutter";
|
||||
}
|
||||
|
||||
public function getHardness() : float{
|
||||
return 3.5;
|
||||
}
|
||||
|
||||
public function getToolType() : int{
|
||||
return BlockToolType::TYPE_PICKAXE;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class Sugarcane extends Flowable{
|
||||
$this->getLevel()->setBlock($this, $this, true);
|
||||
}
|
||||
|
||||
$item->count--;
|
||||
$item->pop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ class TNT extends Solid{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function ignite(int $fuse = 80){
|
||||
$this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), true);
|
||||
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use function count;
|
||||
|
||||
abstract class Thin extends Transparent{
|
||||
|
||||
@ -77,7 +78,7 @@ abstract class Thin extends Transparent{
|
||||
);
|
||||
}
|
||||
|
||||
if(empty($bbs)){
|
||||
if(count($bbs) === 0){
|
||||
//centre post AABB (only needed if not connected on any axis - other BBs overlapping will do this if any connections are made)
|
||||
return [
|
||||
new AxisAlignedBB(
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
abstract class Transparent extends Block{
|
||||
|
||||
public function isTransparent() : bool{
|
||||
|
@ -197,7 +197,7 @@ class Vine extends Flowable{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array{
|
||||
if($item->getBlockToolType() & BlockToolType::TYPE_SHEARS){
|
||||
if(($item->getBlockToolType() & BlockToolType::TYPE_SHEARS) !== 0){
|
||||
return $this->getDropsForCompatibleTool($item);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@ class WaterLily extends Flowable{
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||
if($blockClicked instanceof Water){
|
||||
$up = $blockClicked->getSide(Vector3::SIDE_UP);
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
class Wood2 extends Wood{
|
||||
|
||||
public const ACACIA = 0;
|
||||
|
@ -43,7 +43,7 @@ class Wool extends Solid{
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Wool";
|
||||
return ColorBlockMetaHelper::getColorFromMeta($this->getVariant()) . " Wool";
|
||||
}
|
||||
|
||||
public function getBreakTime(Item $item) : float{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user