mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Compare commits
31 Commits
4.11.0-BET
...
4.12.0
Author | SHA1 | Date | |
---|---|---|---|
cd233b123b | |||
64dd5e3bf6 | |||
4e5cc57560 | |||
95263795a8 | |||
2db86d151f | |||
f0358b09b7 | |||
80a432d9ff | |||
ec9f9a469f | |||
d450264e1c | |||
5e92f55d35 | |||
58c1bfe5d2 | |||
641d35a30f | |||
642630a4d2 | |||
d79e6354a0 | |||
ff63983de4 | |||
588215044e | |||
5c1e9a35a9 | |||
aad9f5fb45 | |||
a8dca190c6 | |||
e5f5fe80f9 | |||
36ab34df29 | |||
dda8ff18b1 | |||
6562335120 | |||
0c463a8721 | |||
a66f966b08 | |||
cca22046ab | |||
d19f0bf7be | |||
ff2391e74a | |||
39e10da88d | |||
beed6efd4e | |||
9650b7f03a |
2
.github/workflows/draft-release.yml
vendored
2
.github/workflows/draft-release.yml
vendored
@ -69,7 +69,7 @@ jobs:
|
||||
${{ github.workspace }}/build_info.json
|
||||
|
||||
- name: Create draft release
|
||||
uses: ncipollo/release-action@v1.11.1
|
||||
uses: ncipollo/release-action@v1.11.2
|
||||
with:
|
||||
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json
|
||||
commit: ${{ github.sha }}
|
||||
|
Submodule build/php updated: 14ed8eaadd...27cc1fcdfa
@ -36,3 +36,18 @@ Released 7th November 2022.
|
||||
- Added validation for the array given to `BaseInventory->setContents()` to ensure that it contains only `Item` instances.
|
||||
- Silenced `PlayerAuthInputPacket` spam when the session is in the "spawn response" state.
|
||||
- Updated to PHPStan 1.9.
|
||||
|
||||
# 4.10.2
|
||||
Released 25th November 2022.
|
||||
|
||||
## Fixes
|
||||
- Fixed crashes on macOS and Linux when using console colours without the `TERM` environment variable set.
|
||||
- Fixed crashdumps not being generated when error messages contained invalid UTF-8 characters.
|
||||
|
||||
## Documentation
|
||||
- Clarified documentation of caching behaviour for `Internet::getIP()`.
|
||||
- Added and improved documentation for many `Inventory` methods.
|
||||
- Rewritten documentation for `PlayerCreationEvent` with warnings and more detail.
|
||||
|
||||
## Internals
|
||||
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.
|
||||
|
102
changelogs/4.11.md
Normal file
102
changelogs/4.11.md
Normal file
@ -0,0 +1,102 @@
|
||||
**For Minecraft: Bedrock Edition 1.19.40**
|
||||
|
||||
This is a minor feature release for PocketMine-MP, introducing some new features and improvements.
|
||||
|
||||
### Note about API versions
|
||||
Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps.
|
||||
Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
|
||||
|
||||
# 4.11.0
|
||||
Released 25th November 2022.
|
||||
|
||||
## General
|
||||
- Packet receive timings have now been split into two subcategories - Decode and Handle.
|
||||
- Console command entry can now be disabled via the `console.enable-input` setting in `pocketmine.yml`.
|
||||
- Best suited for headless servers (e.g. in a Docker container) where the console will never be used anyway.
|
||||
- Disabling the console reader slightly reduces memory usage, because console reading currently requires an additional subprocess.
|
||||
- Console command output now appears on the terminal only, and is not written to the log file.
|
||||
- The output from console commands now appears with a `Command output |` prefix, instead of as a log message.
|
||||
- User-defined `pocketmine.yml` custom commands now use a generic description which makes clear the command is config-defined.
|
||||
- Introduced validation for the `--data` and `--plugins` command line options.
|
||||
- Encrypted resource packs are now supported, by means of adding a `.key` file alongside the pack in the `resource_packs` folder.
|
||||
- e.g. `MyEncryptedPack.zip` -> `MyEncryptedPack.zip.key`
|
||||
- The file must contain the raw key bytes, and must not end with a newline.
|
||||
|
||||
## Configuration
|
||||
- The `chunk-ticking.per-tick` setting is now deprecated, and will be removed in a future release.
|
||||
- The functionality of this setting has been removed, since it caused more problems than it solved.
|
||||
- Setting it to zero will still disable chunk ticking (for now), but this should now be done by setting `chunk-ticking.tick-radius` to `0` instead.
|
||||
|
||||
## Gameplay
|
||||
- Fixed supporting blocks of dead bush to be in line with vanilla.
|
||||
- Sugarcane can now be grown using bonemeal on any part of the sugarcane. Previously, it only worked when used on the bottom block.
|
||||
- Fixed missing sounds when adding, rotating, or removing items in item frames.
|
||||
- Fixed modifier values for Instant Damage and Regeneration effects.
|
||||
- Implemented Darkness effect.
|
||||
- Improved chunk random ticking:
|
||||
- Removed the limit on chunks ticked per tick, and its associated config option is no longer respected.
|
||||
- This change significantly improves crop and plant growth with large numbers of players.
|
||||
- This limit was causing a linear decrease in chunk ticking speed with larger numbers of players, leading to worsened gameplay experience.
|
||||
- **Warning: This change will result in increased CPU usage if players are spread over a very large area.**
|
||||
- Every chunk within the configured tick radius of a player will be ticked. Previously, chunks were randomly selected from the radius.
|
||||
|
||||
## API
|
||||
### General
|
||||
- Plugins are now always disabled before their dependencies, to ensure that they are able to shutdown properly (e.g. a core plugin depending on a database plugin may want to save data to a DB during `onDisable()`).
|
||||
- [`webmozart/path-util`](https://packagist.org/packages/webmozart/path-util) has been deprecated, and will be dropped in favour of [`symfony/filesystem`](https://packagist.org/packages/symfony/filesystem) in PM5.
|
||||
- To prepare for this change, simply replace any usage of `Webmozart\PathUtil\Path` with `Symfony\Component\Filesystem\Path`, which is available as a dependency in this release.
|
||||
|
||||
### `pocketmine`
|
||||
- The following API methods are now deprecated:
|
||||
- `Server->getPlayerByPrefix()`
|
||||
|
||||
### `pocketmine\entity`
|
||||
- `EntitySpawnEvent` and `ItemSpawnEvent` are now fired on the first tick after the entity is added to the world. Previously, these events were called directly from the entity constructor, making it impossible to get properties like velocity which are often set after the entity is created.
|
||||
- The following API methods are now deprecated:
|
||||
- `Living->hasLineOfSight()`
|
||||
|
||||
### `pocketmine\event\block`
|
||||
- The following new classes have been added:
|
||||
- `BlockDeathEvent` - event called when coral or coral blocks die due to lack of water
|
||||
|
||||
### `pocketmine\item`
|
||||
- The following new API methods have been added:
|
||||
- `public Armor->clearCustomColor() : $this`
|
||||
|
||||
### `pocketmine\inventory\transaction`
|
||||
- Introduced a `TransactionBuilder` class. This makes it less of a hassle to build an `InventoryTransaction` server-side, since the regular `Inventory` API methods can be used, rather than having to manually create `SlotChangeAction`s.
|
||||
|
||||
### `pocketmine\lang`
|
||||
- The following new API methods have been added:
|
||||
- `public Language->getAll() : array<string, string>`
|
||||
|
||||
### `pocketmine\player`
|
||||
- The following new API methods have been added:
|
||||
- `public Player->sendToastNotification(string $title, string $body) : void` - makes a grey box appear at the top of the player's screen containing the specified message
|
||||
|
||||
### `pocketmine\utils`
|
||||
- The following new API methods have been added:
|
||||
- `public static TextFormat::addBase(string $baseFormat, string $string) : string` - used for coloured log messages, changes the base formatting of a string by inserting the given formatting codes after every RESET code
|
||||
|
||||
### `pocketmine\world`
|
||||
- The following new API methods have been added:
|
||||
- `public World->getChunkTickRadius() : int` - returns the world's simulation radius
|
||||
- `public World->setChunkTickRadius(int $radius) : void` - sets the world's simulation radius
|
||||
|
||||
### `pocketmine\world\sound`
|
||||
- The following new classes have been added:
|
||||
- `ItemFrameAddItemSound`
|
||||
- `ItemFrameRemoveItemSound`
|
||||
- `ItemFrameRotateItemSound`
|
||||
|
||||
## Internals
|
||||
- Improved performance of `ContainerTrait` dropping items on block destroy. ([link](https://github.com/pmmp/PocketMine-MP/commits/24e72ec109c1442b09558df89b6833cf2f2e0ec7))
|
||||
- Avoid repeated calls to `Position->getWorld()` (use local variables). ([link](https://github.com/pmmp/PocketMine-MP/commit/2940547026db40ce76deb46e992870de3ead79ad))
|
||||
- Revamped the way `InventoryManager` handles fake inventory slot mappings for stuff like crafting tables. ([link](https://github.com/pmmp/PocketMine-MP/commit/e90abecf38d9c57635fa0497514bba7e546a2469))
|
||||
- Console polling is now done on the main thread (no longer a performance concern). ([link](https://github.com/pmmp/PocketMine-MP/commit/b3f03d7ae645de67a54b7300c09b94eeca16298e))
|
||||
- Console reader subprocess should now automatically die if the server main process is killed, instead of persisting as a zombie. ([link](https://github.com/pmmp/PocketMine-MP/commit/2585160ca2c4df5758b8b980331307402ff9f0fb))
|
||||
- `ConsoleCommandSender` is no longer responsible for relaying broadcast messages to `MainLogger`. A new `BroadcastLoggerForwarder` has been added, which is subscribed to the appropriate server broadcast channels in order to relay messages. This ensures that chat messages and command audit messages are logged. ([link](https://github.com/pmmp/PocketMine-MP/commit/83e5b0adb6fa0dddec377182bb1c7945ac8f7820))
|
||||
- `DelegateInventory` now uses `WeakReference` to track its inventory listener. This allows the delegate to be reused. ([link](https://github.com/pmmp/PocketMine-MP/commit/3feaa18f6c10c3a99c0deca75f57ec2d74b92ab4))
|
||||
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.
|
14
changelogs/4.12.md
Normal file
14
changelogs/4.12.md
Normal file
@ -0,0 +1,14 @@
|
||||
**For Minecraft: Bedrock Edition 1.19.50**
|
||||
|
||||
### Note about API versions
|
||||
Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps.
|
||||
Plugin developers should **only** update their required API to this version if you need the changes in this build.
|
||||
|
||||
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
|
||||
|
||||
# 4.12.0
|
||||
Released 30th November 2022.
|
||||
|
||||
## General
|
||||
- Added support for Minecraft: Bedrock Edition 1.19.50.
|
||||
- Removed support for older versions.
|
@ -34,14 +34,14 @@
|
||||
"adhocore/json-comment": "^1.1",
|
||||
"fgrosse/phpasn1": "^2.3",
|
||||
"netresearch/jsonmapper": "^4.0",
|
||||
"pocketmine/bedrock-data": "~1.12.0+bedrock-1.19.40",
|
||||
"pocketmine/bedrock-protocol": "~14.0.0+bedrock-1.19.40",
|
||||
"pocketmine/bedrock-data": "~1.13.0+bedrock-1.19.50",
|
||||
"pocketmine/bedrock-protocol": "~17.0.0+bedrock-1.19.50",
|
||||
"pocketmine/binaryutils": "^0.2.1",
|
||||
"pocketmine/callback-validator": "^1.0.2",
|
||||
"pocketmine/classloader": "^0.2.0",
|
||||
"pocketmine/color": "^0.2.0",
|
||||
"pocketmine/errorhandler": "^0.6.0",
|
||||
"pocketmine/locale-data": "~2.9.0",
|
||||
"pocketmine/locale-data": "~2.11.0",
|
||||
"pocketmine/log": "^0.4.0",
|
||||
"pocketmine/log-pthreads": "^0.4.0",
|
||||
"pocketmine/math": "^0.4.0",
|
||||
@ -54,7 +54,7 @@
|
||||
"webmozart/path-util": "^2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "1.9.1",
|
||||
"phpstan/phpstan": "1.9.2",
|
||||
"phpstan/phpstan-phpunit": "^1.1.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.2.0",
|
||||
"phpunit/phpunit": "^9.2"
|
||||
|
132
composer.lock
generated
132
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b535dc262141936698680b92902f8e28",
|
||||
"content-hash": "6818c4f3d55e45758df83a56d60653cf",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/json-comment",
|
||||
@ -249,16 +249,16 @@
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/bedrock-data",
|
||||
"version": "1.12.0+bedrock-1.19.40",
|
||||
"version": "1.13.0+bedrock-1.19.50",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/BedrockData.git",
|
||||
"reference": "32690f1dac05608b558fe7c40b6d634772c8e416"
|
||||
"reference": "57337ddc9433a0e245a1ce48c51af05f0573d58d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/32690f1dac05608b558fe7c40b6d634772c8e416",
|
||||
"reference": "32690f1dac05608b558fe7c40b6d634772c8e416",
|
||||
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/57337ddc9433a0e245a1ce48c51af05f0573d58d",
|
||||
"reference": "57337ddc9433a0e245a1ce48c51af05f0573d58d",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
@ -269,22 +269,22 @@
|
||||
"description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/BedrockData/issues",
|
||||
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.40"
|
||||
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.50"
|
||||
},
|
||||
"time": "2022-10-25T21:45:24+00:00"
|
||||
"time": "2022-11-30T16:19:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/bedrock-protocol",
|
||||
"version": "14.0.0+bedrock-1.19.40",
|
||||
"version": "17.0.0+bedrock-1.19.50",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/BedrockProtocol.git",
|
||||
"reference": "b455a742779fee94d25f931cc2cbf6b2c5d61c1f"
|
||||
"reference": "272e10197bb1603c0a81075bf5b9dae0d081a6e2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/b455a742779fee94d25f931cc2cbf6b2c5d61c1f",
|
||||
"reference": "b455a742779fee94d25f931cc2cbf6b2c5d61c1f",
|
||||
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/272e10197bb1603c0a81075bf5b9dae0d081a6e2",
|
||||
"reference": "272e10197bb1603c0a81075bf5b9dae0d081a6e2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -298,7 +298,7 @@
|
||||
"ramsey/uuid": "^4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "1.8.8",
|
||||
"phpstan/phpstan": "1.9.0",
|
||||
"phpstan/phpstan-phpunit": "^1.0.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.0.0",
|
||||
"phpunit/phpunit": "^9.5"
|
||||
@ -316,9 +316,9 @@
|
||||
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
|
||||
"source": "https://github.com/pmmp/BedrockProtocol/tree/bedrock-1.19.40"
|
||||
"source": "https://github.com/pmmp/BedrockProtocol/tree/17.0.0+bedrock-1.19.50"
|
||||
},
|
||||
"time": "2022-10-25T21:51:46+00:00"
|
||||
"time": "2022-11-30T16:16:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/binaryutils",
|
||||
@ -536,16 +536,16 @@
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/locale-data",
|
||||
"version": "2.9.2",
|
||||
"version": "2.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Language.git",
|
||||
"reference": "8813ffd2a4501521ca9433c534f3009f941de136"
|
||||
"reference": "4b33d8fa53eda53d9662a7478806ebae2e4a5c53"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Language/zipball/8813ffd2a4501521ca9433c534f3009f941de136",
|
||||
"reference": "8813ffd2a4501521ca9433c534f3009f941de136",
|
||||
"url": "https://api.github.com/repos/pmmp/Language/zipball/4b33d8fa53eda53d9662a7478806ebae2e4a5c53",
|
||||
"reference": "4b33d8fa53eda53d9662a7478806ebae2e4a5c53",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
@ -553,9 +553,9 @@
|
||||
"description": "Language resources used by PocketMine-MP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/Language/issues",
|
||||
"source": "https://github.com/pmmp/Language/tree/2.9.2"
|
||||
"source": "https://github.com/pmmp/Language/tree/2.11.0"
|
||||
},
|
||||
"time": "2022-10-21T20:30:38+00:00"
|
||||
"time": "2022-11-25T14:24:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/log",
|
||||
@ -1086,16 +1086,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1110,7 +1110,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -1148,7 +1148,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1164,20 +1164,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1192,7 +1192,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -1231,7 +1231,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1247,20 +1247,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1269,7 +1269,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -1314,7 +1314,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1330,20 +1330,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-10T07:21:04+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
|
||||
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1352,7 +1352,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -1393,7 +1393,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1409,7 +1409,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
@ -1653,16 +1653,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
"version": "v4.15.1",
|
||||
"version": "v4.15.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
|
||||
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1703,9 +1703,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
||||
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1"
|
||||
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2"
|
||||
},
|
||||
"time": "2022-09-04T07:30:47+00:00"
|
||||
"time": "2022-11-12T15:38:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phar-io/manifest",
|
||||
@ -1820,16 +1820,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f"
|
||||
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f",
|
||||
"reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa",
|
||||
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1859,7 +1859,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpstan/issues",
|
||||
"source": "https://github.com/phpstan/phpstan/tree/1.9.1"
|
||||
"source": "https://github.com/phpstan/phpstan/tree/1.9.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1875,7 +1875,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-04T13:35:59+00:00"
|
||||
"time": "2022-11-10T09:56:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-phpunit",
|
||||
@ -1979,16 +1979,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "9.2.18",
|
||||
"version": "9.2.19",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a"
|
||||
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
|
||||
"reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559",
|
||||
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2044,7 +2044,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2052,7 +2052,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-10-27T13:35:33+00:00"
|
||||
"time": "2022-11-18T07:47:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
|
@ -31,9 +31,9 @@ use function str_repeat;
|
||||
|
||||
final class VersionInfo{
|
||||
public const NAME = "PocketMine-MP";
|
||||
public const BASE_VERSION = "4.11.0-BETA2";
|
||||
public const BASE_VERSION = "4.12.0";
|
||||
public const IS_DEVELOPMENT_BUILD = false;
|
||||
public const BUILD_CHANNEL = "beta";
|
||||
public const BUILD_CHANNEL = "stable";
|
||||
|
||||
private function __construct(){
|
||||
//NOOP
|
||||
|
@ -26,6 +26,7 @@ namespace pocketmine\block;
|
||||
use pocketmine\block\utils\CoralType;
|
||||
use pocketmine\block\utils\CoralTypeTrait;
|
||||
use pocketmine\block\utils\SupportType;
|
||||
use pocketmine\event\block\BlockDeathEvent;
|
||||
use pocketmine\item\Item;
|
||||
|
||||
abstract class BaseCoral extends Transparent{
|
||||
@ -50,7 +51,11 @@ abstract class BaseCoral extends Transparent{
|
||||
|
||||
//TODO: check water inside the block itself (not supported on the API yet)
|
||||
if(!$hasWater){
|
||||
$world->setBlock($this->position, $this->setDead(true));
|
||||
$ev = new BlockDeathEvent($this, $this->setDead(true));
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
$world->setBlock($this->position, $ev->getNewState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ use pocketmine\block\utils\CoralType;
|
||||
use pocketmine\block\utils\CoralTypeTrait;
|
||||
use pocketmine\block\utils\InvalidBlockStateException;
|
||||
use pocketmine\data\bedrock\CoralTypeIdMap;
|
||||
use pocketmine\event\block\BlockDeathEvent;
|
||||
use pocketmine\item\Item;
|
||||
use function mt_rand;
|
||||
|
||||
@ -77,7 +78,11 @@ final class CoralBlock extends Opaque{
|
||||
}
|
||||
}
|
||||
if(!$hasWater){
|
||||
$world->setBlock($this->position, $this->setDead(true));
|
||||
$ev = new BlockDeathEvent($this, $this->setDead(true));
|
||||
$ev->call();
|
||||
if(!$ev->isCancelled()){
|
||||
$world->setBlock($this->position, $ev->getNewState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,9 @@ use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\world\BlockTransaction;
|
||||
use pocketmine\world\sound\ItemFrameAddItemSound;
|
||||
use pocketmine\world\sound\ItemFrameRemoveItemSound;
|
||||
use pocketmine\world\sound\ItemFrameRotateItemSound;
|
||||
use function is_infinite;
|
||||
use function is_nan;
|
||||
use function lcg_value;
|
||||
@ -136,8 +139,12 @@ class ItemFrame extends Flowable{
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
if($this->framedItem !== null){
|
||||
$this->itemRotation = ($this->itemRotation + 1) % self::ROTATIONS;
|
||||
|
||||
$this->position->getWorld()->addSound($this->position, new ItemFrameRotateItemSound());
|
||||
}elseif(!$item->isNull()){
|
||||
$this->framedItem = $item->pop();
|
||||
|
||||
$this->position->getWorld()->addSound($this->position, new ItemFrameAddItemSound());
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
@ -154,6 +161,7 @@ class ItemFrame extends Flowable{
|
||||
$world = $this->position->getWorld();
|
||||
if(lcg_value() <= $this->itemDropChance){
|
||||
$world->dropItem($this->position->add(0.5, 0.5, 0.5), clone $this->framedItem);
|
||||
$world->addSound($this->position, new ItemFrameRemoveItemSound());
|
||||
}
|
||||
$this->setFramedItem(null);
|
||||
$world->setBlock($this->position, $this);
|
||||
|
@ -52,7 +52,7 @@ class FormattedCommandAlias extends Command{
|
||||
string $alias,
|
||||
private array $formatStrings
|
||||
){
|
||||
parent::__construct($alias);
|
||||
parent::__construct($alias, KnownTranslationFactory::pocketmine_command_userDefined_description());
|
||||
}
|
||||
|
||||
public function execute(CommandSender $sender, string $commandLabel, array $args){
|
||||
|
@ -43,6 +43,7 @@ use function get_loaded_extensions;
|
||||
use function json_encode;
|
||||
use function ksort;
|
||||
use function max;
|
||||
use function mb_scrub;
|
||||
use function mb_strtoupper;
|
||||
use function microtime;
|
||||
use function ob_end_clean;
|
||||
@ -196,12 +197,14 @@ class CrashDump{
|
||||
$error["message"] = substr($error["message"], 0, $pos);
|
||||
}
|
||||
}
|
||||
$error["message"] = mb_scrub($error["message"], 'UTF-8');
|
||||
|
||||
if(isset($lastError)){
|
||||
if(isset($lastError["trace"])){
|
||||
$lastError["trace"] = Utils::printableTrace($lastError["trace"]);
|
||||
}
|
||||
$this->data->lastError = $lastError;
|
||||
$this->data->lastError["message"] = mb_scrub($this->data->lastError["message"], 'UTF-8');
|
||||
}
|
||||
|
||||
$this->data->error = $error;
|
||||
|
32
src/event/block/BlockDeathEvent.php
Normal file
32
src/event/block/BlockDeathEvent.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\block;
|
||||
|
||||
/**
|
||||
* Called when a block dies.
|
||||
* This could be things like corals dying due to no water being nearby.
|
||||
*/
|
||||
class BlockDeathEvent extends BaseBlockChangeEvent{
|
||||
|
||||
}
|
@ -23,11 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
|
||||
/**
|
||||
* Called when plants or crops grow.
|
||||
*/
|
||||
class BlockGrowEvent extends BaseBlockChangeEvent implements Cancellable{
|
||||
class BlockGrowEvent extends BaseBlockChangeEvent{
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace pocketmine\event\player;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
@ -47,7 +48,7 @@ class PlayerChatEvent extends PlayerEvent implements Cancellable{
|
||||
/**
|
||||
* @param CommandSender[] $recipients
|
||||
*/
|
||||
public function __construct(Player $player, string $message, array $recipients, string $format = "chat.type.text"){
|
||||
public function __construct(Player $player, string $message, array $recipients, string $format = KnownTranslationKeys::CHAT_TYPE_TEXT){
|
||||
$this->player = $player;
|
||||
$this->message = $message;
|
||||
|
||||
|
@ -30,7 +30,20 @@ use pocketmine\utils\Utils;
|
||||
use function is_a;
|
||||
|
||||
/**
|
||||
* Allows the creation of players overriding the base Player class
|
||||
* Allows the use of custom Player classes. This enables overriding built-in Player methods to change behaviour that is
|
||||
* not possible to alter any other way.
|
||||
*
|
||||
* You probably don't need this event, and found your way here because you looked at some code in an old plugin that
|
||||
* abused it (very common). Instead of using custom player classes, you should consider making session classes instead.
|
||||
*
|
||||
* @see https://github.com/pmmp/SessionsDemo
|
||||
*
|
||||
* This event is a power-user feature, and multiple plugins using it at the same time will conflict and break unless
|
||||
* they've been designed to work together. This means that it's only usually useful in private plugins.
|
||||
*
|
||||
* WARNING: This should NOT be used for adding extra functions or properties. This is intended for **overriding existing
|
||||
* core behaviour**, and should only be used if you know EXACTLY what you're doing.
|
||||
* Custom player classes may break in any update without warning. This event isn't much more than glorified reflection.
|
||||
*/
|
||||
class PlayerCreationEvent extends Event{
|
||||
|
||||
@ -54,6 +67,8 @@ class PlayerCreationEvent extends Event{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base class that the final player class must extend.
|
||||
*
|
||||
* @return string
|
||||
* @phpstan-return class-string<Player>
|
||||
*/
|
||||
@ -62,6 +77,10 @@ class PlayerCreationEvent extends Event{
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class that the final player class must extend.
|
||||
* The new base class must be a subclass of the current base class.
|
||||
* This can (perhaps) be used to limit the options for custom player classes provided by other plugins.
|
||||
*
|
||||
* @param string $class
|
||||
* @phpstan-param class-string<Player> $class
|
||||
*/
|
||||
@ -74,6 +93,8 @@ class PlayerCreationEvent extends Event{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class that will be instantiated to create the player after the event.
|
||||
*
|
||||
* @return string
|
||||
* @phpstan-return class-string<Player>
|
||||
*/
|
||||
@ -82,6 +103,9 @@ class PlayerCreationEvent extends Event{
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class that will be instantiated to create the player after the event. The class must not be abstract,
|
||||
* and must be an instance of the base class.
|
||||
*
|
||||
* @param string $class
|
||||
* @phpstan-param class-string<Player> $class
|
||||
*/
|
||||
|
@ -33,12 +33,25 @@ use pocketmine\utils\ObjectSet;
|
||||
interface Inventory{
|
||||
public const MAX_STACK = 64;
|
||||
|
||||
/**
|
||||
* Returns the number of slots in the inventory.
|
||||
*/
|
||||
public function getSize() : int;
|
||||
|
||||
/**
|
||||
* Returns the maximum stack size for items in this inventory. Individual item types (such as armor or tools) may
|
||||
* have a smaller maximum stack size.
|
||||
*/
|
||||
public function getMaxStackSize() : int;
|
||||
|
||||
/**
|
||||
* Sets the maximum stack size for items in this inventory.
|
||||
*/
|
||||
public function setMaxStackSize(int $size) : void;
|
||||
|
||||
/**
|
||||
* Returns the item in the specified slot.
|
||||
*/
|
||||
public function getItem(int $index) : Item;
|
||||
|
||||
/**
|
||||
@ -65,10 +78,11 @@ interface Inventory{
|
||||
public function setContents(array $items) : void;
|
||||
|
||||
/**
|
||||
* Stores the given Items in the inventory. This will try to fill
|
||||
* existing stacks and empty slots as well as it can.
|
||||
* Stores the given Items in the inventory.
|
||||
* This will add to any non-full existing stacks first, and then put the remaining items in empty slots if there are
|
||||
* any available.
|
||||
*
|
||||
* Returns the Items that did not fit.
|
||||
* Returns an array of items which could not fit in the inventory.
|
||||
*
|
||||
* @return Item[]
|
||||
*/
|
||||
@ -85,15 +99,20 @@ interface Inventory{
|
||||
public function getAddableItemQuantity(Item $item) : int;
|
||||
|
||||
/**
|
||||
* Checks if the inventory contains any Item with the same material data.
|
||||
* It will check id, amount, and metadata (if not null)
|
||||
* Returns whether the total amount of matching items is at least the stack size of the given item. Multiple stacks
|
||||
* of the same item are added together.
|
||||
*
|
||||
* If the input item has specific NBT, only items with the same type and NBT will match. Otherwise, only the item
|
||||
* type is checked.
|
||||
*/
|
||||
public function contains(Item $item) : bool;
|
||||
|
||||
/**
|
||||
* Will return all the Items that has the same id and metadata (if not null).
|
||||
* Won't check amount
|
||||
* The returned array is indexed by slot number.
|
||||
* Returns all matching items in the inventory, irrespective of stack size. The returned array is indexed by slot
|
||||
* number.
|
||||
*
|
||||
* If the input item has specific NBT, only items with the same type and NBT will match. Otherwise, only the item
|
||||
* type is checked.
|
||||
*
|
||||
* @return Item[]
|
||||
* @phpstan-return array<int, Item>
|
||||
@ -101,10 +120,10 @@ interface Inventory{
|
||||
public function all(Item $item) : array;
|
||||
|
||||
/**
|
||||
* Returns the first slot number containing an item with the same ID, damage (if not any-damage), NBT (if not empty)
|
||||
* and count >= to the count of the specified item stack.
|
||||
* Returns the first slot number containing a matching item with a stack size greater than or equal to the input item.
|
||||
*
|
||||
* If $exact is true, only items with equal ID, damage, NBT and count will match.
|
||||
* If the input item has specific NBT, or if $exact is true, only items with the same type and NBT will match.
|
||||
* Otherwise, only the item type is checked.
|
||||
*/
|
||||
public function first(Item $item, bool $exact = false) : int;
|
||||
|
||||
@ -119,13 +138,19 @@ interface Inventory{
|
||||
public function isSlotEmpty(int $index) : bool;
|
||||
|
||||
/**
|
||||
* Will remove all the Items that has the same id and metadata (if not null)
|
||||
* Clears all slots containing items equivalent to the given item.
|
||||
*
|
||||
* If the input item has specific NBT, only items with the same type and NBT will match. Otherwise, only the item
|
||||
* type is checked.
|
||||
*/
|
||||
public function remove(Item $item) : void;
|
||||
|
||||
/**
|
||||
* Removes the given Item from the inventory.
|
||||
* It will return the Items that couldn't be removed.
|
||||
* Removes items from the inventory in the amounts specified by the given itemstacks.
|
||||
* Returns an array of items that couldn't be removed.
|
||||
*
|
||||
* If the input item has specific NBT, only items with the same type and NBT will match. Otherwise, only the item
|
||||
* type is checked.
|
||||
*
|
||||
* @return Item[]
|
||||
*/
|
||||
|
@ -121,7 +121,7 @@ abstract class Durable extends Item{
|
||||
* Returns whether the item is broken.
|
||||
*/
|
||||
public function isBroken() : bool{
|
||||
return $this->damage >= $this->getMaxDurability();
|
||||
return $this->damage >= $this->getMaxDurability() || $this->isNull();
|
||||
}
|
||||
|
||||
protected function deserializeCompoundTag(CompoundTag $tag) : void{
|
||||
|
@ -43,6 +43,34 @@ final class KnownTranslationFactory{
|
||||
return new Translatable(KnownTranslationKeys::ACCEPT_LICENSE, []);
|
||||
}
|
||||
|
||||
public static function action_interact_armorstand_equip() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_ARMORSTAND_EQUIP, []);
|
||||
}
|
||||
|
||||
public static function action_interact_armorstand_pose() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_ARMORSTAND_POSE, []);
|
||||
}
|
||||
|
||||
public static function action_interact_exit_boat() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_EXIT_BOAT, []);
|
||||
}
|
||||
|
||||
public static function action_interact_fishing() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_FISHING, []);
|
||||
}
|
||||
|
||||
public static function action_interact_name() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_NAME, []);
|
||||
}
|
||||
|
||||
public static function action_interact_ride_boat() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_RIDE_BOAT, []);
|
||||
}
|
||||
|
||||
public static function action_interact_ride_minecart() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ACTION_INTERACT_RIDE_MINECART, []);
|
||||
}
|
||||
|
||||
public static function chat_type_achievement(Translatable|string $param0, Translatable|string $param1) : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::CHAT_TYPE_ACHIEVEMENT, [
|
||||
0 => $param0,
|
||||
@ -627,6 +655,12 @@ final class KnownTranslationFactory{
|
||||
]);
|
||||
}
|
||||
|
||||
public static function death_attack_fallingBlock(Translatable|string $param0) : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::DEATH_ATTACK_FALLINGBLOCK, [
|
||||
0 => $param0,
|
||||
]);
|
||||
}
|
||||
|
||||
public static function death_attack_generic(Translatable|string $param0) : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::DEATH_ATTACK_GENERIC, [
|
||||
0 => $param0,
|
||||
@ -691,6 +725,13 @@ final class KnownTranslationFactory{
|
||||
]);
|
||||
}
|
||||
|
||||
public static function death_attack_trident(Translatable|string $param0, Translatable|string $param1) : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::DEATH_ATTACK_TRIDENT, [
|
||||
0 => $param0,
|
||||
1 => $param1,
|
||||
]);
|
||||
}
|
||||
|
||||
public static function death_attack_wither(Translatable|string $param0) : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::DEATH_ATTACK_WITHER, [
|
||||
0 => $param0,
|
||||
@ -863,6 +904,10 @@ final class KnownTranslationFactory{
|
||||
return new Translatable(KnownTranslationKeys::ENCHANTMENT_SOUL_SPEED, []);
|
||||
}
|
||||
|
||||
public static function enchantment_swift_sneak() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ENCHANTMENT_SWIFT_SNEAK, []);
|
||||
}
|
||||
|
||||
public static function enchantment_thorns() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ENCHANTMENT_THORNS, []);
|
||||
}
|
||||
@ -954,6 +999,10 @@ final class KnownTranslationFactory{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_13_DESC, []);
|
||||
}
|
||||
|
||||
public static function item_record_5_desc() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_5_DESC, []);
|
||||
}
|
||||
|
||||
public static function item_record_blocks_desc() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_BLOCKS_DESC, []);
|
||||
}
|
||||
@ -978,6 +1027,10 @@ final class KnownTranslationFactory{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_MELLOHI_DESC, []);
|
||||
}
|
||||
|
||||
public static function item_record_otherside_desc() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_OTHERSIDE_DESC, []);
|
||||
}
|
||||
|
||||
public static function item_record_pigstep_desc() : Translatable{
|
||||
return new Translatable(KnownTranslationKeys::ITEM_RECORD_PIGSTEP_DESC, []);
|
||||
}
|
||||
|
@ -33,6 +33,13 @@ final class KnownTranslationKeys{
|
||||
public const ABILITY_FLIGHT = "ability.flight";
|
||||
public const ABILITY_NOCLIP = "ability.noclip";
|
||||
public const ACCEPT_LICENSE = "accept_license";
|
||||
public const ACTION_INTERACT_ARMORSTAND_EQUIP = "action.interact.armorstand.equip";
|
||||
public const ACTION_INTERACT_ARMORSTAND_POSE = "action.interact.armorstand.pose";
|
||||
public const ACTION_INTERACT_EXIT_BOAT = "action.interact.exit.boat";
|
||||
public const ACTION_INTERACT_FISHING = "action.interact.fishing";
|
||||
public const ACTION_INTERACT_NAME = "action.interact.name";
|
||||
public const ACTION_INTERACT_RIDE_BOAT = "action.interact.ride.boat";
|
||||
public const ACTION_INTERACT_RIDE_MINECART = "action.interact.ride.minecart";
|
||||
public const CHAT_TYPE_ACHIEVEMENT = "chat.type.achievement";
|
||||
public const CHAT_TYPE_ADMIN = "chat.type.admin";
|
||||
public const CHAT_TYPE_ANNOUNCEMENT = "chat.type.announcement";
|
||||
@ -138,6 +145,7 @@ final class KnownTranslationKeys{
|
||||
public const DEATH_ATTACK_EXPLOSION = "death.attack.explosion";
|
||||
public const DEATH_ATTACK_EXPLOSION_PLAYER = "death.attack.explosion.player";
|
||||
public const DEATH_ATTACK_FALL = "death.attack.fall";
|
||||
public const DEATH_ATTACK_FALLINGBLOCK = "death.attack.fallingBlock";
|
||||
public const DEATH_ATTACK_GENERIC = "death.attack.generic";
|
||||
public const DEATH_ATTACK_INFIRE = "death.attack.inFire";
|
||||
public const DEATH_ATTACK_INWALL = "death.attack.inWall";
|
||||
@ -148,6 +156,7 @@ final class KnownTranslationKeys{
|
||||
public const DEATH_ATTACK_OUTOFWORLD = "death.attack.outOfWorld";
|
||||
public const DEATH_ATTACK_PLAYER = "death.attack.player";
|
||||
public const DEATH_ATTACK_PLAYER_ITEM = "death.attack.player.item";
|
||||
public const DEATH_ATTACK_TRIDENT = "death.attack.trident";
|
||||
public const DEATH_ATTACK_WITHER = "death.attack.wither";
|
||||
public const DEATH_FELL_ACCIDENT_GENERIC = "death.fell.accident.generic";
|
||||
public const DEFAULT_GAMEMODE = "default_gamemode";
|
||||
@ -190,6 +199,7 @@ final class KnownTranslationKeys{
|
||||
public const ENCHANTMENT_PROTECT_FIRE = "enchantment.protect.fire";
|
||||
public const ENCHANTMENT_PROTECT_PROJECTILE = "enchantment.protect.projectile";
|
||||
public const ENCHANTMENT_SOUL_SPEED = "enchantment.soul_speed";
|
||||
public const ENCHANTMENT_SWIFT_SNEAK = "enchantment.swift_sneak";
|
||||
public const ENCHANTMENT_THORNS = "enchantment.thorns";
|
||||
public const ENCHANTMENT_TRIDENTCHANNELING = "enchantment.tridentChanneling";
|
||||
public const ENCHANTMENT_TRIDENTIMPALING = "enchantment.tridentImpaling";
|
||||
@ -211,12 +221,14 @@ final class KnownTranslationKeys{
|
||||
public const IP_WARNING = "ip_warning";
|
||||
public const ITEM_RECORD_11_DESC = "item.record_11.desc";
|
||||
public const ITEM_RECORD_13_DESC = "item.record_13.desc";
|
||||
public const ITEM_RECORD_5_DESC = "item.record_5.desc";
|
||||
public const ITEM_RECORD_BLOCKS_DESC = "item.record_blocks.desc";
|
||||
public const ITEM_RECORD_CAT_DESC = "item.record_cat.desc";
|
||||
public const ITEM_RECORD_CHIRP_DESC = "item.record_chirp.desc";
|
||||
public const ITEM_RECORD_FAR_DESC = "item.record_far.desc";
|
||||
public const ITEM_RECORD_MALL_DESC = "item.record_mall.desc";
|
||||
public const ITEM_RECORD_MELLOHI_DESC = "item.record_mellohi.desc";
|
||||
public const ITEM_RECORD_OTHERSIDE_DESC = "item.record_otherside.desc";
|
||||
public const ITEM_RECORD_PIGSTEP_DESC = "item.record_pigstep.desc";
|
||||
public const ITEM_RECORD_STAL_DESC = "item.record_stal.desc";
|
||||
public const ITEM_RECORD_STRAD_DESC = "item.record_strad.desc";
|
||||
|
@ -173,6 +173,14 @@ class Language{
|
||||
return $this->internalGet($id) ?? $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @phpstan-return array<string, string>
|
||||
*/
|
||||
public function getAll() : array{
|
||||
return $this->lang;
|
||||
}
|
||||
|
||||
protected function parseTranslation(string $text, ?string $onlyPrefix = null) : string{
|
||||
$newString = "";
|
||||
|
||||
|
@ -54,7 +54,7 @@ class Network{
|
||||
|
||||
private BidirectionalBandwidthStatsTracker $bandwidthTracker;
|
||||
private string $name;
|
||||
private NetworkSessionManager$sessionManager;
|
||||
private NetworkSessionManager $sessionManager;
|
||||
|
||||
public function __construct(
|
||||
private \Logger $logger
|
||||
|
@ -166,8 +166,10 @@ abstract class Terminal{
|
||||
case Utils::OS_LINUX:
|
||||
case Utils::OS_MACOS:
|
||||
case Utils::OS_BSD:
|
||||
self::getEscapeCodes();
|
||||
return;
|
||||
if(getenv('TERM') !== false){
|
||||
self::getEscapeCodes();
|
||||
return;
|
||||
}
|
||||
|
||||
case Utils::OS_WINDOWS:
|
||||
case Utils::OS_ANDROID:
|
||||
|
35
src/world/sound/ItemFrameAddItemSound.php
Normal file
35
src/world/sound/ItemFrameAddItemSound.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\LevelEvent;
|
||||
|
||||
class ItemFrameAddItemSound implements Sound{
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::create(LevelEvent::SOUND_ITEMFRAME_ADD_ITEM, 0, $pos)];
|
||||
}
|
||||
}
|
35
src/world/sound/ItemFrameRemoveItemSound.php
Normal file
35
src/world/sound/ItemFrameRemoveItemSound.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\LevelEvent;
|
||||
|
||||
class ItemFrameRemoveItemSound implements Sound{
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::create(LevelEvent::SOUND_ITEMFRAME_REMOVE_ITEM, 0, $pos)];
|
||||
}
|
||||
}
|
35
src/world/sound/ItemFrameRotateItemSound.php
Normal file
35
src/world/sound/ItemFrameRotateItemSound.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\LevelEvent;
|
||||
|
||||
class ItemFrameRotateItemSound implements Sound{
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::create(LevelEvent::SOUND_ITEMFRAME_ROTATE_ITEM, 0, $pos)];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user