1
0
mirror of https://github.com/pmmp/PocketMine-MP.git synced 2025-05-08 23:09:43 +00:00

492 Commits

Author SHA1 Message Date
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
e105578be0 LegacySkinAdapter: an extra check for resourcePatch (fixes 3 phpstan explicitMixed errors) 2020-06-18 20:08:38 +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
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
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
7c79a28fdb Merge commit '2712befa82dc92fe26d2b913a47200ad84927799'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 20:49:46 +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
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
Dylan K. Taylor
921aa091e0 Merge commit '04191ec44a00dd058f5d7e9e315d451e44285494'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l7-baseline.neon
2020-06-17 20:40:12 +01:00
Dylan K. Taylor
6c096c44aa Rename NetworkBinaryStream -> PacketSerializer 2020-06-17 11:31:13 +01:00
Dylan K. Taylor
130c55d9f1 EntityLink: remove rogue default ctor parameters 2020-06-15 23:58:11 +01:00
Dylan K. Taylor
2712befa82 SkinData: fixed capeImage type violation (doesn't accept null) 2020-06-15 23:51:48 +01:00
Dylan K. Taylor
23b97d8e2d TextFormat: wrap all preg_replace() usages in a type-safe exception-throwing version
fixes 3 phpstan level 8 errors
2020-06-15 23:31:46 +01:00
Dylan K. Taylor
1fb5043eb1 build/server-phar: fixed a phpstan level 8 error 2020-06-15 23:16:40 +01:00
Dylan K. Taylor
b0b1b29de4 Chunk: specify list<int> for heightMap 2020-06-15 23:07:35 +01:00
Dylan K. Taylor
1c3b641e37 ChunkUtils: be more specific in extension stub too 2020-06-15 23:07:05 +01:00
Dylan K. Taylor
8dcc88712c ChunkUtils: fixed phpstan level 7 type inference error 2020-06-15 23:04:12 +01:00
Dylan K. Taylor
04191ec44a Rail: specify type for local static variable
fixes a phpstan level 7 error
phpstan doesn't make any assumptions about local static variable types because analysing them would require too much work, apparently.
2020-06-15 22:47:20 +01:00
Dylan K. Taylor
cf06b5b8cf Player: explicitly check for false return of dataPacket()
fixes a phpstan error on l7
this won't ever actually be a problem, but this isn't obvious from the type system.
2020-06-15 21:24:19 +01:00
Dylan K. Taylor
a8ec51daac Player: do not assign maybe-false result of json_encode() to ModalFormRequestPacket
fixes a phpstan error on l7
2020-06-15 21:22:33 +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
b902f9ded0 RegionLoader: fixed 2 phpstan level 7 errors (eof reading region header) 2020-06-15 15:09:37 +01:00
Dylan K. Taylor
f55a7f8b53 Merge commit 'd8d994351'
# Conflicts:
#	composer.lock
#	resources/vanilla
#	tests/phpstan/configs/l7-baseline.neon
2020-06-14 19:47:21 +01:00
Dylan K. Taylor
d8d994351b phpstan 0.12.29 2020-06-14 16:25:55 +01:00
Dylan K. Taylor
dba059d8da Merge commit 'a7f10d8cc'
# Conflicts:
#	resources/vanilla
2020-06-13 11:52:17 +01:00
Dylan K. Taylor
ee6b980b98 Merge commit '42613618a'
# Conflicts:
#	phpstan.neon.dist
#	resources/vanilla
2020-06-13 11:46:39 +01:00
Dylan K. Taylor
69aa6a51b4 Merge commit '3f971a0c6'
# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l7-baseline.neon
2020-06-13 11:29:12 +01:00
Dylan K. Taylor
a7f10d8ccf phpstan: ignore a FP (fixed in 0.12.26, but we can't upgrade yet) 2020-06-10 10:45:28 +01:00
Dylan K. Taylor
42613618a5 phpstan: add LevelDB::get() stub to fix return type 2020-06-10 10:31:54 +01:00
Dylan K. Taylor
3f971a0c65 phpstan: fixed analyze failure caused by a27b29897c58ec91c497f9bd7cd6bedb64ce77b4 2020-06-05 12:58:18 +01:00
Dylan K. Taylor
6df43338df Merge commit 'c3a795e87'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/entity/Entity.php
2020-05-31 14:56:37 +01:00
Dylan K. Taylor
fe649d8d70 Extract ServerConfigGroup from Server
this API isn't very nice, but it's pretty much the same as the original, and at least this can be _kinda_ unit-tested...
2020-05-24 15:48:03 +01:00
Dylan K. Taylor
c9af5ce7a9 Convert GeneratorManager to singleton 2020-05-23 10:13:03 +01:00
Dylan K. Taylor
640428c415 Convert WorldProviderManager to singleton 2020-05-23 10:02:09 +01:00
Dylan K. Taylor
1aa92bd6a8 Living: Do not rely on attribute map for moveSpeed attribute access 2020-05-21 20:13:24 +01:00
Dylan K. Taylor
ec8ee29291 moving sneak & sprint properties to Living 2020-05-21 19:55:58 +01:00
Dylan K. Taylor
74e1f6320a Store attributes as local vars, reduce usage of AttributeMap
ideally we want attribute map to only be used for properties that need synchronization.
2020-05-21 19:18:00 +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
64bb126bf5 ignore some more l8 errors (architectural issue in NetworkSession) 2020-05-20 20:25:32 +01:00