12012 Commits

Author SHA1 Message Date
Dylan K. Taylor
0a1bb0041b Player: avoid using NBT for onGround hack 2020-06-19 10:51:27 +01:00
Dylan K. Taylor
1205432c34 Extract mandatory parameters into constructor parameters
the goal is obviously to ditch NBT entirely here, but there's more work to be done before that becomes possible.
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
3f135da704 Simplify motion handling in ProjectileItem 2020-06-19 10:51:27 +01:00
Dylan K. Taylor
6a26c0bebf EntityFactory now exclusively handles loading data from disk
this commit removes the ability to replace centrally registered entity classes in favour of using constructors directly.
In future commits I may introduce a dedicated factory interface which allows an _actual_ factory pattern (e.g. factory->createArrow(world, pos, shooter, isCritical) with proper static analysability) but for now it's peripheral to my intended objective.
The purpose of this change is to facilitate untangling of NBT from entity constructors so that they can be properly created without using NBT at all, and instead use nice APIs.

Spawn eggs now support arbitrary entity creation functions like EntityFactory does, allowing much more flexibility in what can be passed to an entity's constructor (e.g. a Plugin reference can be injected by use()ing it in a closure or via traditional DI.
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
72a7fc68c1 First look at making entity creation closure-driven
this allows doing stuff like injecting plugin references to entity constructors for now. I want to make this more flexible still, but I've done about as much as I feel like doing today and don't want this disappearing into a stash to never be seen again.
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
3bdd9ee860 phpstan: drop a bunch of error patterns that don't appear on 0.12.29+ 2020-06-19 10:49:21 +01:00
Dylan K. Taylor
64e9647334 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/convert/LegacySkinAdapter.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/phpstan-bugs.neon
2020-06-19 10:48:27 +01:00
Dylan K. Taylor
e32180ce93 phpstan: drop an obsolete phpstan-bugs ignoreError 2020-06-19 10:41:41 +01:00
Dylan K. Taylor
ced89add3c Human: remove dead function 2020-06-19 01:13:00 +01:00
Dylan K. Taylor
cf85857660 Entity: remove duplicated code from saveNBT() 2020-06-19 01:07:18 +01:00
Dylan K. Taylor
0ae357cf8f ProjectileItem: get NBT as far away as possible 2020-06-18 20:25:19 +01:00
Dylan K. Taylor
e105578be0 LegacySkinAdapter: an extra check for resourcePatch (fixes 3 phpstan explicitMixed errors) 2020-06-18 20:08:38 +01:00
Dylan K. Taylor
b3df5f4e95 CS: strip unneeded phpdoc 2020-06-18 20:01:49 +01:00
Dylan K. Taylor
11eb1f1c5e imports cleanup 2020-06-18 20:01:19 +01:00
Dylan K. Taylor
44814a8421 AutoUpdater: remove useless check (details_url is mandatory) 2020-06-18 19:06:42 +01:00
Dylan K. Taylor
98f0447912 AutoUpdater: use JsonMapper to handle API response information 2020-06-18 19:03:11 +01:00
Dylan K. Taylor
2687e63645 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/block/Cake.php
2020-06-18 18:10:27 +01:00
Dylan K. Taylor
a9d98bdf73 phpstan: baseline our way into checkExplicitMixed territory 2020-06-18 18:07:21 +01:00
Dylan K. Taylor
755e53cd71 JwtUtils: added a split() function to reduce code duplication 2020-06-18 12:05:54 +01:00
Dylan K. Taylor
222399d178 EncryptionContext: fix exception message 2020-06-18 11:52:05 +01:00
Dylan K. Taylor
d931a5bcc0 phpstan: drop an obsolete level 7 ignoreErrors pattern 2020-06-18 11:51:07 +01:00
Dylan K. Taylor
95114dcc1e EncryptionContext: fixed a phpstan level 7 error (openssl_digest() might return false for god knows what reason) 2020-06-18 11:50:43 +01:00
Dylan K. Taylor
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
Matt
c601352777
Fixed wrong meta value when pick cake block. (#3593) 2020-06-18 11:14:57 +01:00
Dylan K. Taylor
82b3e3398b make more use of igbinary_serialize() and igbinary_unserialize() 2020-06-17 23:03:03 +01:00
Dylan K. Taylor
6f4d4be3da InGamePacketHandler: handle InvalidSkinException thrown by SkinAdapter::fromSkinData() 2020-06-17 22:31:44 +01:00
Dylan K. Taylor
05615b3eb7 ClientDataToSkinDataHelper: move safeB64Decode to its own function 2020-06-17 22:27:13 +01:00
Dylan K. Taylor
e6a3f7baa2 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
2020-06-17 22:23:17 +01:00
Dylan K. Taylor
77c71e22b2 SkinAdapter::fromSkinData() may now throw InvalidSkinException
fixes a rogue TODO in LegacySkinAdapter and invalid skins maybe showing up as Steve instead of getting kicked off the server
2020-06-17 21:44:22 +01:00
Dylan K. Taylor
a686840e5e RuntimeBlockMapping: fixed palette cache never being initialized
I must have been very tired when I wrote this code
2020-06-17 21:33:56 +01:00
Dylan K. Taylor
333ed8ed2f RuntimeBlockMapping: remove unnecessary nullable flag 2020-06-17 21:32:51 +01:00
Dylan K. Taylor
715fca8986 LoginPacketHandler: use playerInfo directly again, fix another 2 PHPStan level 8 errors 2020-06-17 21:30:34 +01:00
Dylan K. Taylor
eefb6ae8e7 LoginPacketHandler: use reference to new PlayerInfo directly, fixes a PHPStan level 8 error 2020-06-17 21:29:16 +01:00
Dylan K. Taylor
7558f2cb12 regenerated phpstan level 8 baseline 2020-06-17 21:27:51 +01:00
Dylan K. Taylor
503782d67c moved skin-parsing code from LoginPacketHandler to its own dedicated helper class 2020-06-17 21:24:12 +01:00
Dylan K. Taylor
55e6b2dfbc Merge commit '1c13ba565660e0985c08f2c6b59e26f8216f87e4'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
2020-06-17 21:14:04 +01:00
Dylan K. Taylor
5c94c6992d Merge commit 'f970be0e4ddf90e64c2e87cc6b2123aa933b3ab1'
# Conflicts:
#	resources/vanilla
2020-06-17 21:12:46 +01:00
Dylan K. Taylor
6a8bb89734 Merge commit '11a3f9f1b906d0a73adb5a81a6eff120b56cf6fa'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/network/mcpe/VerifyLoginTask.php
2020-06-17 21:12:27 +01:00
Dylan K. Taylor
8cabab20e3 Merge commit '09771849aefb70bc29202b160f65723cf926c974'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/network/mcpe/VerifyLoginTask.php
2020-06-17 21:10:59 +01:00
Dylan K. Taylor
543023793c Merge commit '57a310230acd8b13e96fa4f24dbdabb19927b483'
# Conflicts:
#	resources/vanilla
2020-06-17 21:04:23 +01:00
Dylan K. Taylor
d58ea80dca Merge commit '130c55d9f1c3b350c2767f7656366e08a63cf1ad'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
#	src/network/mcpe/protocol/types/entity/EntityLink.php
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 21:03:45 +01:00
Dylan K. Taylor
1c13ba5656 Avoid parameter ordering bugs during packet decoding
A PhpStorm refactor could have side effects on code that directly reads stuff from the packet input stream in the arguments block, because those calls will get moved into a different order if the constructor gets refactored. This would, obviously, break packet decoding, so that's something we should avoid and really should not encourage.
2020-06-17 21:01:01 +01:00
Dylan K. Taylor
7c79a28fdb Merge commit '2712befa82dc92fe26d2b913a47200ad84927799'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 20:49:46 +01:00
Dylan K. Taylor
fb059cda69 Merge commit 'a4e250a3e61cbf1e75fe2785e71158f16a4a9039'
# Conflicts:
#	resources/vanilla
2020-06-17 20:48:19 +01:00
Dylan K. Taylor
8d537eaae8 Merge commit '23b97d8e2dca50cca77061c1080911ab610fa708'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 20:47:51 +01:00
Dylan K. Taylor
f1fd8a13e9 Merge commit '1fb5043eb1b495e6926caecf3fb493837724c770'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 20:46:18 +01:00
Dylan K. Taylor
d310c8b782 Merge commit 'b0b1b29de4d4cbf60ca54d9043f01c9b2b21f136' 2020-06-17 20:44:32 +01:00
Dylan K. Taylor
7e6a7d4611 Merge commit '1c3b641e37471833523f50f818571f25f85a52f9' 2020-06-17 20:43:57 +01:00
Dylan K. Taylor
a2677eba02 Merge commit 'f3063e797fab56ff8d0213c8e5a3904085a6eb79'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/format/io/ChunkUtils.php
2020-06-17 20:43:30 +01:00
Dylan K. Taylor
d2130265f8 Merge commit '8dcc88712c6b8a4d4a0c6be2f6b908ae85378209'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/format/io/ChunkUtils.php
#	tests/phpstan/configs/l7-baseline.neon
2020-06-17 20:42:28 +01:00