Commit Graph

13677 Commits

Author SHA1 Message Date
Dylan K. Taylor
db90b40bdd Command: remove unnecessary branching in broadcastCommandMessage()
this problem is handled automatically now that nested translations are supported.
2021-08-15 16:00:16 +01:00
Dylan K. Taylor
4748b0db37 PluginManager: remove unused import 2021-08-14 21:28:38 +01:00
Dylan K. Taylor
8b9d7d6390 Support for nested TranslationContainers 2021-08-14 20:57:13 +01:00
Dylan K. Taylor
804d02b086 TranslationContainer: added prefix(), postfix() and format() 2021-08-14 16:08:22 +01:00
Dylan K. Taylor
13d4131d0d Remove player update warnings
a player ingame is not going to have access to the terminal to update PM, and if they do, they can see the warning on the console themselves anyway.
2021-08-14 13:27:21 +01:00
Dylan K. Taylor
ecdfd9ea26 Terminal: reduce code duplication in getFallbackEscapeCodes() 2021-08-13 14:04:13 +01:00
Dylan K. Taylor
78c2dcaee5 Terminal: fixed crash on platforms which don't support tput fully
in 8-bit colour mode, it seems that ITALIC is not supported. This only showed its face now because of typed properties.
closes #4365
closes #4366
2021-08-13 14:00:17 +01:00
Dylan K. Taylor
2ca7fc7254 Server: add native return types to getters that were skipped first time 2021-08-12 23:56:43 +01:00
Dylan K. Taylor
0e0bbdfb70 Use typed properties in Server 2021-08-12 23:52:39 +01:00
Dylan K. Taylor
e907c70160 ... 2021-08-12 23:37:24 +01:00
Dylan K. Taylor
34309bc810 TextFormat: do not assume that an array given to toHTML() is actually a tokenized string
this is a far stretch, since the documentation doesn't mention that the string needs to be tokenized. Anyone passing an array in here is most likely doing so by mistake.
2021-08-12 23:37:00 +01:00
Dylan K. Taylor
a59ac522ee Terminal: do not assume that an array given to toANSI() is actually a tokenized string
this is a far stretch, since the documentation doesn't mention that the string needs to be tokenized. Anyone passing an array in here is most likely doing so by mistake.
2021-08-12 23:35:45 +01:00
Dylan K. Taylor
ab232ee759 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-08-12 23:32:05 +01:00
Dylan K. Taylor
d30371be11 Command: Assume that TranslationContainer->getText() returns a valid translation key
there's no reason for it not to be.
2021-08-12 23:31:37 +01:00
Rush2929
58bc9332cd Workaround for offhand sync (#4359)
fixes #4231
2021-08-12 23:27:53 +01:00
Dylan T
27e0ecf7ee Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
Dylan K. Taylor
483c16cc41 Updated to ramsey/uuid 4.2.1 2021-08-12 20:42:23 +01:00
Dylan K. Taylor
ce70dc48c0 composer.json: added update-translation-apis custom command 2021-08-12 20:37:03 +01:00
Dylan K. Taylor
fd41a0f510 Remove colors from VersionCommand
these will have to stay gone for now, until we have some way to terminate formatting codes without breaking logger output. (we need &p!! #4364)
2021-08-12 20:35:34 +01:00
Dylan K. Taylor
d18b5cb306 composer.json: added update-registry-annotations command 2021-08-12 20:30:21 +01:00
Dylan K. Taylor
662d1a35ff generate-registry-annotations: skip files that don't contain classes 2021-08-12 20:29:21 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
2782af7e22 Terminal: use typed properties 2021-08-12 19:41:16 +01:00
Dylan K. Taylor
4d683c63d8 TextFormat: remove toJSON()
this is not used in the PM core, and is only used by 1 plugin in the whole public ecosystem: BigBrother. It makes more sense to make BigBrother maintainers shoulder the responsibility of maintaining this code, since they are the only ones that need it - besides, if this changed in any MCJE update in the last 5y, nobody has updated it, and nobody has maintained it either due to not having a fucking clue what the thing is for (the documentation is basically nonexistent).
2021-08-12 13:43:58 +01:00
Dylan K. Taylor
eb24e040f3 TextFormat: add COLORS and FORMATS constants 2021-08-12 13:13:33 +01:00
Dylan K. Taylor
99e68fb5d3 Merge branch 'master' of github.com:pmmp/PocketMine-MP 2021-08-10 19:48:39 +01:00
Dylan K. Taylor
f42c9bb6d6 Removed unused translation 2021-08-10 19:48:30 +01:00
Rush2929
cf77b33c3b Bows can now use offhand arrows (#4356) 2021-08-10 19:36:57 +01:00
Dylan K. Taylor
2cdd6e634f New /version format 2021-08-10 19:32:28 +01:00
Dylan K. Taylor
2ad5de379f HandlerListManager::unregisterAll() accepts RegisteredListener
since all this function is doing is passing the object on to the HandlerList, it should accept RegisteredListener, like HandlerList::unregister().
2021-08-10 15:28:11 +01:00
Dylan K. Taylor
b4c0ddd155 Use native union types for TranslationContainer|string 2021-08-10 15:17:26 +01:00
Dylan K. Taylor
27a2d06083 Fix CS 2021-08-10 14:53:03 +01:00
Dylan K. Taylor
2293bd948d Added KnownTranslationFactory and use it in as many places as possible
this makes translation usage much more statically analysable.
The only places this isn't used are:
- places that prefix translations with colours (those are still a problem)
- places where server/client translations don't match (e.g. gameMode.changed accepts different parameters in vanilla than in PM)
2021-08-10 14:50:40 +01:00
Dylan K. Taylor
d39080c45a TranslationContainer: Add support for named translation parameters
this also fixes use cases like:

[1] = something;
[0] = match(...)

It made no sense whatsoever to discard the keys anyway.

Language::translateString() already supported named parameters since
forever anyway.
2021-08-10 14:26:54 +01:00
Dylan K. Taylor
de61417bb6 Simplify console subprocess require hack 2021-08-08 18:53:13 +01:00
Dylan K. Taylor
4c10dcaa53 ConsoleReaderThread: fixed UTF-8 paths getting corrupted on the way to the subprocess in some cases
I was never able to reproduce this, but it appears that Windows breaks the character encoding of command parameters (and also unicode environment variables, even though UNICODE_ENVIRONMENT should be set in php-src) when the file path contains Unicode characters (such as Cyrillic).
We workaround this problem using base64, which is an abysmally shitty hack, but not worse than using a subprocess for ConsoleReader in the first place. PHP fucking sucks, and so does Windows.
closes #4353
2021-08-08 16:19:08 +01:00
Dylan K. Taylor
91cb374220 LevelDB: fixed isPopulated state getting lost after chunk unload/reload 2021-08-08 16:01:45 +01:00
Dylan K. Taylor
041d314190 HandlerListManager: apply class-string type for getListFor() parameter 2021-08-05 20:11:58 +01:00
Dylan K. Taylor
b72d81be5e Cleanup PHPStan baselines 2021-08-04 21:24:13 +01:00
Dylan K. Taylor
b31dce2119 Player: fixed type of loadQueue field 2021-08-04 21:17:44 +01:00
Dylan K. Taylor
61b7faae08 Simplify BaseInventoryTest 2021-08-04 21:01:01 +01:00
Dylan K. Taylor
00984c1b9f BaseInventory: Move contents of InventoryHelpersTrait back inline
I moved these to a trait in anticipation of having multiple full Inventory implementations. That's no longer necessary because of the abstraction of SimpleInventory.
2021-08-04 20:57:20 +01:00
Dylan K. Taylor
bb79797b68 WhitelistCommand: fixed permission checking
closes #4349
2021-08-04 20:34:54 +01:00
Dylan K. Taylor
71c6f69fd3 Command: standardise permission checking
if subcommands had different permissions, the permissionMessage would not be used.
2021-08-04 20:29:07 +01:00
Dylan K. Taylor
efb677d5d5 Merge branch 'stable' 2021-08-03 20:22:17 +01:00
Dylan K. Taylor
748e9705ba Updated build/php submodule to pmmp/php-build-scripts@49971716b0 2021-08-03 20:20:56 +01:00
Dylan K. Taylor
50b4ec0d20 Override timeout for the subprocess also 2021-08-03 18:50:36 +01:00
Dylan K. Taylor
16965fa742 ConsoleReaderThread: override default socket timeout for accept
otherwise, people can break the console reader by setting the default timeout to zero or some other small value.
2021-08-03 18:48:18 +01:00
Dylan K. Taylor
c567ed4b7a fix build error 2021-08-03 15:32:21 +01:00
Dylan K. Taylor
565cf84e1b MemoryManager: use typed properties 2021-08-03 15:13:28 +01:00