491 Commits

Author SHA1 Message Date
Dylan K. Taylor
9f11be25cb
LevelSoundEventPacket: fixed bad null assignment in ::create() 2021-07-14 15:21:33 +01:00
Dylan K. Taylor
1ad38d499c
Deglobalize ItemTypeDictionary usage, at least for the protocol
while this is a bit hacky outside of the protocol namespace, it makes it much easier to use the protocol library for alternative purposes, such as for a client or MITM proxy.
It also removes all but one remaining core dependency of the protocol library, making it very close to being able to be separated from the server core entirely.
2021-07-14 14:26:32 +01:00
Dylan K. Taylor
3997e612b1
silence phpstan bug phpstan/phpstan#5271 2021-07-09 19:44:25 +01:00
Dylan K. Taylor
b7ea10b905
MainLogger: do not assume that exception codes are always integers
PDOException most notably breaks this rule.
closes #4294
2021-07-05 19:20:59 +01:00
Dylan K. Taylor
91d54ff0ad
Removed unnecessary and/or obsolete GC hacks
the intent of these hacks was to break cyclic references to avoid having objects lingering in memory. However, all of the stuff that's being removed in this commit no longer has any effect anyway, due to the fact that these things don't circularly reference each other anymore. Notably, Tile inventories now keep Position instead of a Tile ref.
2021-06-30 19:16:25 +01:00
Dylan K. Taylor
e14bad4ea6
Rename CommandReader and friends to ConsoleReader 2021-06-26 19:29:58 +01:00
Dylan K. Taylor
a70bd115f1
Moved console-specific stuff to its own namespace
this stuff has different functionality than everything else in the
command namespace (specifically console handling), so it doesn't belong
in here.

I know that this will probably break some plugins, but I don't care,
because plugins shouldn't have been abusing ConsoleCommandSender in the
first place.
2021-06-26 19:24:46 +01:00
Dylan K. Taylor
0910054c41
NetworkSession: Fixed InventoryManager nullability disaster
fixes #4277
fixes #4275
fixes #3139
2021-06-26 17:44:42 +01:00
Dylan K. Taylor
981b0285d1
Isolate config casting nastiness in one place
this doesn't solve the underlying problem, but it does reduce the amount of noise made by PHPStan about it, as well as avoiding code litter.
2021-06-19 19:14:02 +01:00
Dylan K. Taylor
735c656f9d
Merge remote-tracking branch 'origin/stable' 2021-06-18 18:52:04 +01:00
Dylan K. Taylor
155e516f74
phpstan 0.12.90 2021-06-18 18:46:30 +01:00
Dylan K. Taylor
e5dd5a5745
NetworkSession: Fixed missing nullable declarations
phpstan doesn't report these because .. reasons .. @ondrejmirtes this is causing bugs to go unfound :(
I'm aware of the irony that I just silenced the bugs that were exposed by this commit .. that's an architectural problem for another day
2021-06-13 22:24:12 +01:00
Dylan K. Taylor
57d274901d
Protocol changes for 1.17.0 2021-06-08 19:40:28 +01:00
Dylan K. Taylor
0402e7e697
Separate CommandReader impl from CommandReaderThread 2021-05-29 23:41:11 +01:00
Dylan K. Taylor
80e4da85df
Fixed PHPStan build 2021-05-12 12:12:29 +01:00
Dylan K. Taylor
624495f4d3
Added a generic Promise type
I anticipate increasing demand for promises, and since all the libraries I could find suck, we'll stick to our own impl for now.
2021-05-08 15:57:30 +01:00
Dylan K. Taylor
33eb97da97
Remove dead PHPStan pattern 2021-05-08 15:53:55 +01:00
Dylan K. Taylor
73420819f6
Clean PHPStan baselines 2021-05-05 14:51:39 +01:00
Dylan K. Taylor
652de2632a
Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
Dylan K. Taylor
e8cb49f7ae
php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
Dylan K. Taylor
b8645f5c15
Clean up EnderChestInventory implementation
now, EnderChestInventory is just a temporary window, much like anvil/enchanting windows. It provides a gateway to the player's PlayerEnderInventory.

This removes one of the remaining obstacles to disallowing null World in Position constructor.
2021-05-02 14:26:27 +01:00
Dylan K. Taylor
129ca7fee0
Silence a PHPStan bug
I'm not able to reproduce this one on the playground, but it still shows up even when disabling certain phpdocs...
2021-05-02 13:55:32 +01:00
Dylan T
127b57048c
Allow plugins to use PSR-4 namespace mapping (#4188)
* Allow plugins to use PSR-4 namespace mapping
this is a reduced implementation which serves the 99% use case without being horribly breakable.

Plugins may now specify a `src-namespace-prefix`, which should be set to the namespace of the classes in `src`.
If the old system is used, `src-namespace-prefix` can be omitted, or set to an empty string.

Examples:
- If `src-namespace-prefix` is `dktapps\test`, `dktapps\test\Main` will be searched for in `src/Main.php`, instead of `src/dktapps/test/Main.php`.

* Migrate TesterPlugin to PSR-4
2021-04-23 19:34:46 +01:00
Dylan K. Taylor
4e0bc6c98e
Scrub PHPStan baselines 2021-04-19 16:18:22 +01:00
Dylan K. Taylor
09a2402f01
Fixed precondition on double chunk send being useless
this is messy, but necessary for now.
2021-04-19 00:50:43 +01:00
Dylan K. Taylor
d19c21e2e1
Updated PHPStan baseline 2021-04-19 00:38:27 +01:00
TheNewHEROBRINEX
8d1a1628de
Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
Dylan K. Taylor
53ebe4f9f9
World: added getHighestAdjacentFullLightAt() 2021-04-18 20:20:08 +01:00
Dylan K. Taylor
7aa336f5e4
Remove dead baseline 2021-04-07 19:44:00 +01:00
Dylan K. Taylor
7578bca006
Merge tag '3.18.2' 2021-04-07 19:41:57 +01:00
Dylan K. Taylor
e22b6ff566
Revert "Revert "Backport InventoryTransactionPacket impl from PM4""
This reverts commit c7cdaeae8569c766df7db9f889c67f4e65a38d15.
2021-04-07 18:42:07 +01:00
Dylan K. Taylor
21378b7f27
Regenerate PHPStan baselines
this should be the last time we get baselines randomly rearranging themselves on changes ...
2021-04-03 22:36:15 +01:00
Ali
3b3fb5e662
fix ItemFrames (#4101)
removing items from item frames was broken due to behavioural changes in 1.16.210.
2021-03-28 18:53:46 +01:00
Dylan K. Taylor
9ee80357b0
phpstan baselines cleanup 2021-03-23 15:24:20 +00:00
Dylan K. Taylor
ad048f0b7f
Merge remote-tracking branch 'origin/stable' 2021-03-23 15:17:10 +00:00
Dylan K. Taylor
c7cdaeae85
Revert "Backport InventoryTransactionPacket impl from PM4"
This reverts commit cb06be615aa3780d4c83a947520fa55c0d908618.

we can't push this to stable because it would break plugins without any
way to know (no protocol or API change).

At most, this should have been wrapped into a protocol change.
2021-03-22 21:21:11 +00:00
Dylan K. Taylor
cb06be615a
Backport InventoryTransactionPacket impl from PM4
this version is far better, and we're going to need it to deal with the PlayerAuthInputPacket bullshit.
2021-03-19 22:16:30 +00:00
Dylan K. Taylor
0d3c11699c
Clean up PHPStan baselines 2021-03-19 22:14:07 +00:00
Dylan K. Taylor
b3c6c11b20
BulkCurlTask now accepts a closure callback for onCompletion
this requires much less boilerplate code than an anonymous class.
2021-03-16 23:56:14 +00:00
Dylan K. Taylor
6d622c4020
Merge branch 'stable' 2021-03-14 23:32:09 +00:00
Yosshi999
cbc8576d4a
Implement UPnP support without dotNET (#3378)
UPnP forwarding is now available on all supported platforms.
com_dotnet is no longer required for UPnP forwarding to work.

Closes #3216 .
2021-03-14 22:50:33 +00:00
Dylan K. Taylor
19bb8a00df
Updated PHPStan baselines 2021-03-12 22:05:15 +00:00
Dylan K. Taylor
c1e5dd2a4e
Merge branch 'stable' 2021-03-07 20:15:11 +00:00
Dylan K. Taylor
fac2bd3379
Liquid: mark getSmallestFlowDecay() as impure
this fixes two bogus PHPStan warnings.
2021-02-25 22:41:07 +00:00
Dylan K. Taylor
dff13a884f
Merge branch 'stable' 2021-02-12 17:34:25 +00:00
Dylan K. Taylor
094102fe92
fopen() might return FALSE if permission was denied to read/write the file 2021-02-12 16:16:36 +00:00
Dylan K. Taylor
c61f66d973
Removed ext-ds dependency 2021-02-11 15:40:37 +00:00
Dylan K. Taylor
ae75d73f48
Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
Dylan K. Taylor
bbae02264d
Merge branch 'stable' 2021-01-27 20:04:13 +00:00
Dylan K. Taylor
f9e42b716a
Scrub PHPStan baselines
these are now always generated with level 8.
2021-01-24 20:31:22 +00:00