14220 Commits

Author SHA1 Message Date
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
28bfe9fbb4
emit_performance_warnings(): Log a warning when using a PHP debug build 2021-08-11 20:14:03 +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
cd53fa162b
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-08-03 20:22:41 +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
Dylan K. Taylor
dcd203370b
Player: make use of typed properties
readability significantly benefits from use of typed properties here.
2021-08-03 15:02:32 +01:00
Leo Lee
219ed81389
Player: Fixed items on the crafting grid disappearing when the player disconnects (#4344) 2021-08-02 19:48:36 +01:00
Dylan K. Taylor
8221475ce2
BlockDataSerializer: fix wrong exception type being thrown 2021-08-02 19:20:19 +01:00
Dylan K. Taylor
bdac98beaf
Block: get rid of getNonPersistentStateBitmask(), add writeStateToItemMeta()
this is more flexible and less confusing.
2021-08-02 19:17:24 +01:00
Dylan K. Taylor
01b48a21d9
Simplify NetworkSession ticking
we need to tick sessions every tick anyway, because other stuff is happening (e.g. sync attributes/entity metadata, batch buffer flush).
2021-08-02 14:32:00 +01:00
dependabot[bot]
6a7196530c
Bump phpunit/phpunit from 9.5.7 to 9.5.8 (#4345)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.7 to 9.5.8.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-02 11:52:17 +01:00
Dylan T
eb23d27004 composer: accept ext-leveldb ^0.3.0 2021-07-31 18:11:34 +01:00
Sensei Tarzan
1bbf739385
the function stringToLegacy gives already null useless to put a default null (#4338) 2021-07-31 16:54:31 +01:00
Dylan K. Taylor
22c3736d63
LightUpdate: micro optimisations opcache isn't smart enough for
this removes 6 unnecessary opcodes from computeSpreadLight() and 3 from computeRemoveLight(). Tested with opcache.opt_debug_level=0x20000.
2021-07-30 23:30:28 +01:00