Commit Graph

313 Commits

Author SHA1 Message Date
33a7c05425 Updated PHPStan baselines 2021-09-11 23:12:43 +01:00
3b7580688c Stop auto-translating string descriptions/usages for commands
Require usage of Translatable for translations.
2021-09-11 16:46:40 +01:00
34f01a3ce3 World: Track entities separately from chunks
this allows entities to exist outside of generated chunks, with one caveat: they won't be saved in such cases.
Obviously, for player entities, this doesn't matter.

fixes #3947
2021-09-09 01:17:41 +01:00
668df85e3f Merge branch 'stable' 2021-08-20 23:08:17 +01:00
ff4aa148ef phpstan 0.12.95 2021-08-20 22:47:29 +01:00
e43d39c0bc UpdateChecker: improve type handling 2021-08-20 20:06:09 +01:00
d488c25a1a Rename AutoUpdater -> UpdateChecker 2021-08-20 19:54:08 +01:00
b4b3c21d30 Merge branch 'stable' 2021-08-19 15:39:16 +01:00
7bd8d09023 GitHub Actions: automatically build and upload release artifacts, and auto-update update.pmmp.io (#4376) 2021-08-18 14:02:52 +01:00
dfc82f6820 VanillaCommand: fix bogus mixed typehints 2021-08-15 19:32:33 +01:00
6a2a4cca4d Terminal: use match instead of switch in toANSI()
phpstan seems to have some trouble with large match statements (phpstan/phpstan#5454)
2021-08-12 20:13:44 +01:00
041d314190 HandlerListManager: apply class-string type for getListFor() parameter 2021-08-05 20:11:58 +01:00
b72d81be5e Cleanup PHPStan baselines 2021-08-04 21:24:13 +01:00
b31dce2119 Player: fixed type of loadQueue field 2021-08-04 21:17:44 +01:00
2b5667a56b Move PHP minimum to 8.0 2021-07-26 20:29:39 +01:00
09eac0e129 Merge remote-tracking branch 'origin/stable' 2021-07-26 20:14:33 +01:00
01fe497c49 phpstan: use PHP 8.0 as primary version
I'm using 8.0 for local development now, so having the phpstan configs targeted at 7.4 by default makes things inconvenient.
2021-07-26 14:34:47 +01:00
1246d1b7ef Use a subprocess for reading lines from STDIN (#4332)
this FINALLY provides us with a way to deal with Windows without needing to forcibly terminate the entire server on shutdown.
2021-07-24 22:10:50 +01:00
58498c2b0b Merge remote-tracking branch 'origin/stable' 2021-07-23 16:40:19 +01:00
85effa5240 Remove junk from php8 baseline 2021-07-23 15:56:06 +01:00
81c5b83bd9 actions: test on 8.0 2021-07-23 15:55:01 +01:00
0eb4231b51 Use OpenSSL for ECDH during client login, drop mdanter/ecc (#4328)
This brings a significant performance improvement to login sequence handling, reducing CPU cost of `PrepareEncryptionTask` by over 90% and `ProcessLoginTask` by over 60%. It also allows us to shed a dependency.
2021-07-22 23:04:00 +01:00
9f11be25cb LevelSoundEventPacket: fixed bad null assignment in ::create() 2021-07-14 15:21:33 +01:00
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
3997e612b1 silence phpstan bug phpstan/phpstan#5271 2021-07-09 19:44:25 +01:00
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
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
e14bad4ea6 Rename CommandReader and friends to ConsoleReader 2021-06-26 19:29:58 +01:00
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
0910054c41 NetworkSession: Fixed InventoryManager nullability disaster
fixes #4277
fixes #4275
fixes #3139
2021-06-26 17:44:42 +01:00
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
735c656f9d Merge remote-tracking branch 'origin/stable' 2021-06-18 18:52:04 +01:00
155e516f74 phpstan 0.12.90 2021-06-18 18:46:30 +01:00
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
57d274901d Protocol changes for 1.17.0 2021-06-08 19:40:28 +01:00
0402e7e697 Separate CommandReader impl from CommandReaderThread 2021-05-29 23:41:11 +01:00
80e4da85df Fixed PHPStan build 2021-05-12 12:12:29 +01:00
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
33eb97da97 Remove dead PHPStan pattern 2021-05-08 15:53:55 +01:00
73420819f6 Clean PHPStan baselines 2021-05-05 14:51:39 +01:00
652de2632a Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
e8cb49f7ae php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
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
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
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
4e0bc6c98e Scrub PHPStan baselines 2021-04-19 16:18:22 +01:00
09a2402f01 Fixed precondition on double chunk send being useless
this is messy, but necessary for now.
2021-04-19 00:50:43 +01:00
d19c21e2e1 Updated PHPStan baseline 2021-04-19 00:38:27 +01:00
8d1a1628de Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
53ebe4f9f9 World: added getHighestAdjacentFullLightAt() 2021-04-18 20:20:08 +01:00