115 Commits

Author SHA1 Message Date
Dylan K. Taylor
164c1552d1 Add test to make sure DyeColorIdMap recognizes all colours
this will be useful for integrity testing if more colours get added.
2020-08-03 16:48:34 +01:00
Dylan K. Taylor
798efc370c PacketBatch: get rid of putPacket() 2020-07-22 15:24:08 +01:00
Dylan K. Taylor
d3c90c4dce update block factory consistency check 2020-07-11 18:54:35 +01:00
Dylan K. Taylor
30591d047c PacketBatch: added a getPackets() method which encapsulates some logic 2020-07-01 13:38:06 +01:00
Dylan K. Taylor
dae2a4ffce SignText: added failing test case for index omission in constructor 2020-06-29 19:35:09 +01:00
Dylan K. Taylor
c618932d25 Eliminate usages of BinaryStream->setBuffer() and BinaryStream->reset() 2020-06-17 13:49:43 +01:00
Dylan K. Taylor
9c46a1f141 Rename Packet->getBinaryStream() -> Packet->getSerializer() 2020-06-17 11:33:59 +01:00
Dylan K. Taylor
6c096c44aa Rename NetworkBinaryStream -> PacketSerializer 2020-06-17 11:31:13 +01:00
Dylan K. Taylor
7d73630fb7 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/world/format/io/region/RegionGarbageMap.php
#	src/world/format/io/region/RegionLoader.php
#	tests/phpstan/configs/l7-baseline.neon
#	tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php
2020-06-15 20:10:15 +01:00
Dylan K. Taylor
e05bee5ffb RegionLoader: do a full check for chunk overlaps during initial load 2020-06-14 22:39:01 +01:00
Dylan K. Taylor
640428c415 Convert WorldProviderManager to singleton 2020-05-23 10:02:09 +01:00
Dylan K. Taylor
f93bc0739c Force types of RegistryTrait usages to shut PHPStan up
we need generic traits to solve this problem properly.
2020-05-21 19:12:48 +01:00
Dylan K. Taylor
8ec2ba79de Unhackify Registry member cloning, fixes #3519 2020-05-21 11:38:02 +01:00
Dylan K. Taylor
11ef9fb0c0 Item-from-string parsing no longer depends on ItemIds
after this is done I'm banning the constant() function.
2020-05-13 00:18:49 +01:00
Dylan K. Taylor
e3dec95b75 Convert AsyncPool tests into PHPUnit tests 2020-05-11 11:34:50 +01:00
Dylan K. Taylor
0b6d6306cf LoginPacket: fixed error handling edge case with malformed chain data JSON 2020-05-06 21:46:35 +01:00
Dylan K. Taylor
acd37b95b8 Merge branch 'next-minor' 2020-05-06 20:41:48 +01:00
Dylan K. Taylor
717b866605 Merge branch 'stable' into next-minor 2020-05-06 20:25:11 +01:00
Dylan T
ef97c8f99e
Utils: fix parsing of single-line doc comments, closes #3388 (#3469)
* Utils: fix parsing of single-line doc comments, closes #3388

* correctly handle the empty doc-comment case, add another test case

* ignore an extra phpstan bug
2020-05-06 14:17:08 +01:00
Dylan K. Taylor
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
Dylan K. Taylor
5a94af40e2 Convert ItemFactory to singleton 2020-04-24 00:18:31 +01:00
Dylan K. Taylor
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
Dylan K. Taylor
1b26cf1df9 break the hard cycle between mcpe\handler and mcpe\protocol
preparing to move mcpe\protocol to a separate library
2020-04-23 15:38:11 +01:00
Dylan K. Taylor
f8ce01e2fd ItemFactory: extract fromStringSingle() from fromString()
on PM4, the multiple functionality is removed, but on PM3 this is a problem for phpstan.
2020-03-13 17:54:25 +00:00
Dylan K. Taylor
78394a336c Merge branch 'stable' 2020-02-25 20:45:39 +00:00
Dylan K. Taylor
7aa8bd18d3 Revert "Item: restrict bounds of count to 0-255"
This reverts commit 10317527e4012fb1dbb1661f2f7fc33b05a7a6d1.

this breaks user code which exceeds stack limits in legitimate
circumstances. For example, it should be OK to add 6000x diamond to a
player's inventory without being forced to manually split the count up
for addItem().
2020-02-25 20:42:03 +00:00
Dylan K. Taylor
5c2ae0257c DataPacket: inject buffer via parameter instead of class field (packet & stream separation, step 2)
this is not complete yet, but the final change (having the binarystream actually come from outside) is a little more disruptive, and some extra changes need to be made. This will grant some sanity in the meantime without breaking too much stuff.
2020-02-25 16:19:11 +00:00
Dylan K. Taylor
bd00ee5038 Merge branch 'stable' 2020-02-24 22:11:13 +00:00
Dylan K. Taylor
04581e2700 DataPacket: account for splitscreen header when decoding 2020-02-24 21:20:25 +00:00
Dylan K. Taylor
8a770d837e Merge branch 'stable' 2020-02-24 20:32:43 +00:00
Dylan K. Taylor
10317527e4 Item: restrict bounds of count to 0-255 2020-02-23 17:23:53 +00:00
Dylan K. Taylor
31405f7587 EnumTraitTest: use @doesNotPerformAssertions 2020-02-07 18:35:55 +00:00
Dylan K. Taylor
31fcd8e5fa ItemTest: use the proper method to explicitly fail a test 2020-02-07 18:35:26 +00:00
Dylan K. Taylor
95896eb911 tests/phpunit: fill in some phpstan types 2020-02-07 18:34:57 +00:00
Dylan K. Taylor
091873ca51 HandlerListManagerTest: fix phpunit 8.x compatibility 2020-02-07 18:14:43 +00:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
a1622fa345 UtilsTest: silence a phpstan-strict-rules warning 2020-02-06 18:53:05 +00:00
Dylan K. Taylor
5ad66c3c9b BlockTest: throw exception instead of always-false assert 2020-02-06 13:21:39 +00:00
Dylan K. Taylor
532dc0fb6f tests/phpunit: populate iterable types for phpstan 2020-02-06 13:11:56 +00:00
Dylan K. Taylor
e12618c705 tests/phpunit: added missing native typehints 2020-02-06 12:13:42 +00:00
Dylan K. Taylor
269066b2d0 added unit test for Enum lazy initialization 2020-02-01 20:42:04 +00:00
Dylan K. Taylor
464b2116a6 Merge remote-tracking branch 'origin/stable' 2019-10-01 14:41:54 +01:00
Dylan K. Taylor
8a6381c3fa StupidJsonDecodeTest: add some extra test vectors 2019-10-01 13:25:20 +01:00
Dylan K. Taylor
735efeaa13 Merge branch 'stable' 2019-09-26 11:30:36 +01:00
Dylan K. Taylor
d0d61597c7 StupidJsonDecodeTest: use getClosure() instead of traditional mess
this is faster and requires less code.
2019-09-26 11:28:40 +01:00
Dylan K. Taylor
15694279c7 Merge branch 'stable' 2019-09-18 13:30:58 +01:00
Dylan T
d724374d1a
StupidJsonDecodeTest: add failing test case for #3113 2019-09-16 15:53:00 +01:00
Dylan K. Taylor
d1a8bef1e6 fix test 2019-08-25 17:52:39 +01:00
Dylan K. Taylor
e5b02ee5e0 make logic for fetching handler lists more consistent 2019-08-23 17:16:07 +01:00
Dylan K. Taylor
b543744534 Rename Solid -> Opaque
the old naming was misleading, particularly in conjunction with isSolid().
2019-07-22 19:56:01 +01:00