Commit Graph

18448 Commits

Author SHA1 Message Date
Dylan K. Taylor
25dae2f5ae Fix merge error 2025-09-18 22:17:47 +01:00
pmmp-admin-bot[bot]
1ec8754979 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17841374387
2025-09-18 21:06:04 +00:00
IvanCraft623
6d2d23a210 Implement Trident (#4547)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2025-09-18 19:00:55 +01:00
pmmp-admin-bot[bot]
46b92f8fc3 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17810657304
2025-09-17 21:05:40 +00:00
pmmp-admin-bot[bot]
fbf09d990e Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17810657304
2025-09-17 21:05:39 +00:00
dependabot[bot]
dd5a7adec4 Bump build/php from 1d9cda6 to 627f8d6 (#6802) 2025-09-17 02:15:15 +00:00
Dylan T.
f46fc18c57 Trigger branch merge at 9pm instead of midnight 2025-09-17 01:59:39 +01:00
Dylan K. Taylor
a65722d0aa Merge branch 'minor-next' into major-next 2025-09-17 01:49:29 +01:00
Dylan K. Taylor
7d50c9d146 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into minor-next 2025-09-17 01:38:53 +01:00
pmmp-admin-bot[bot]
40a1a29f0d 5.33.3 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/17748879758
2025-09-15 22:54:12 +00:00
Dylan T.
1e797b9897 Prepare 5.33.2 release (#6804) 5.33.2 2025-09-15 23:53:05 +01:00
Dylan K. Taylor
a056af1617 Update composer dev dependencies 2025-09-15 22:41:02 +01:00
Dylan K. Taylor
b237cacfc9 InGamePacketHandler: don't resync blocks if the client predicted an interact fail
if the prediction was a fail, we can assume that the client didn't do anything visual on its end,
which avoids the need to resend blocks.
This fixes block lag when towering as discussed in #6803.

The more general issue in #6803 remains unresolved (that the server's block resyncing may overwrite
additional client side predictions if it places a block before the server's resync for the initial
placement arrives), but that's more complicated to fix and I'm not convinced on the correct method
to resolve it yet.

In any case, this change nets a decent improvement for everyone, regardless.
2025-09-15 19:36:29 +01:00
Dylan K. Taylor
e7ad3c25fa InGamePacketHandler: ignore CREATIVE_PLAYER_DESTROY_BLOCK
fixes #6757

we get PREDICT_DESTROY_BLOCK anyway, so it's not needed
2025-09-15 18:02:10 +01:00
Dylan K. Taylor
c6a28d8df0 InventoryManager: fixed window sending getting stuck on client rejecting window opening
closes #6778

honestly, we could just stop checking the window ID entirely, considering the need for delaying and waiting
for window close acks, it seems useless at this point...
2025-09-15 17:34:35 +01:00
pmmp-admin-bot[bot]
919492bdca Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17718404883
2025-09-15 00:03:10 +00:00
Dylan K. Taylor
e47c189cb6 Add support for private timings pasting 2025-09-14 18:01:33 +01:00
Dylan K. Taylor
01028ee404 Merge branch 'minor-next' into major-next 2025-09-12 01:15:40 +01:00
Dylan K. Taylor
aee1ab0ae0 Merge branch 'stable' into minor-next 2025-09-12 01:14:16 +01:00
Dylan K. Taylor
636b96a9a5 Updated composer dependencies 2025-09-12 01:13:55 +01:00
Dylan K. Taylor
1a71152195 Merge remote-tracking branch 'origin/minor-next' into major-next 2025-09-12 01:09:35 +01:00
pmmp-admin-bot[bot]
527eda30c9 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17629911301
2025-09-11 00:03:05 +00:00
Dylan K. Taylor
c854f2c765 ItemSerializer: avoid slow NBT check
hasNamedTag() rebuilds the NBT from item properties to decide if there's any NBT.
This is a waste of resources when we then fetch the tag to encode anyway.
2025-09-10 20:06:35 +01:00
Dylan K. Taylor
4b4fc52cd7 Updated Bitcoin donation address 2025-09-10 19:10:56 +01:00
Dylan K. Taylor
54e8ad2a9c Update BedrockProtocol 2025-09-10 16:21:29 +01:00
pmmp-admin-bot[bot]
47dac7244f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17567495443
2025-09-09 00:02:55 +00:00
pmmp-admin-bot[bot]
9fcb16b6c1 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17567495443
2025-09-09 00:02:53 +00:00
dependabot[bot]
ce90835c7b Bump build/php from b839e52 to 1d9cda6 (#6796) 2025-09-08 10:21:54 +00:00
pmmp-admin-bot[bot]
1133d49c92 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17507094833
2025-09-06 00:02:55 +00:00
pmmp-admin-bot[bot]
2f2c53067b Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17507094833
2025-09-06 00:02:53 +00:00
Dylan K. Taylor
dc04992ba9 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2025-09-05 19:25:31 +01:00
dependabot[bot]
bddab47ee8 Bump build/php from ce1b095 to b839e52 (#6795) 2025-09-05 10:32:17 +00:00
Dylan K. Taylor
66b8f2f160 Scrub PHPStan baselines 2025-09-04 23:35:57 +01:00
Dylan K. Taylor
1bc7cf340d Merge branch 'stable' into minor-next 2025-09-04 23:30:09 +01:00
Dylan K. Taylor
3411103e11 Remove dead PHPStan ignores 2025-09-04 23:29:55 +01:00
Dylan K. Taylor
25e937715e Merge branch 'minor-next' into major-next 2025-09-04 22:11:36 +01:00
Dylan K. Taylor
26cd5c471c Merge branch 'stable' into minor-next 2025-09-04 22:03:22 +01:00
Dylan K. Taylor
1868536916 Add PHP 8.4 to test matrix 2025-09-04 21:58:12 +01:00
pmmp-admin-bot[bot]
e276fed3c8 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17449184125
2025-09-04 00:02:51 +00:00
Dylan K. Taylor
82323cc7ca Make CombinedInventoryProxy listener a bit less nasty 2025-09-03 18:18:03 +01:00
Dylan K. Taylor
6610a19640 CombinedInventoryProxy for double chests is now ephemeral
previously we had to make sure that the two chests shared the same instance, so that the viewer
lists would be properly updated. Now, instead, we can just combine the viewer lists of the individual
chests, which is a lot cleaner.
2025-09-03 17:34:37 +01:00
Dylan K. Taylor
f91f5bff9b Fix merge error 2025-09-03 17:11:37 +01:00
Dylan K. Taylor
c61829ee19 Rework double chest handling, move logic to the Block 2025-09-03 16:42:44 +01:00
Darya Markova
3999a1f9f4 Fix sneaking hitbox height (#6771) 2025-09-03 08:53:32 +02:00
pmmp-admin-bot[bot]
344d0af01b Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17418990148
2025-09-03 00:02:54 +00:00
pmmp-admin-bot[bot]
925b34e5c6 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17418990148
2025-09-03 00:02:53 +00:00
Dylan K. Taylor
86c9adca7f Fix minor-next merge error 2025-09-02 19:29:14 +01:00
Dylan T.
644f73aa84 Separate inventory holder info from container & player inventories (#6533)
This PR breaks the cyclic dependency between `Inventory` and its holder, which unblocks a lot of new developments.

### Related issues & PRs
- Fixes #5033
- Removes a blocker for #6147 (which in turn means that async tasks will eventually be able to work with tiles)
- Removes a blocker for #2684

## Changes
### API changes
- `Player->getCurrentWindow()` now returns `?InventoryWindow` instead of `?Inventory`
- `Player->setCurrentWindow()` now accepts `?InventoryWindow` instead of `?Inventory`
- `InventoryWindow` introduced, which is created for each player viewing the inventory, provides decorative information like holder info for `InventoryTransactionEvent`, and is destroyed when the window is closed, eliminating cyclic references
- Added:
  - `player\InventoryWindow`
  - `player\PlayerInventoryWindow` - wraps all permanent inventories of Player with type info for transactions
  - `inventory\Hotbar` - replaces all hotbar usages in `PlayerInventory`
  - `Human->getHotbar()`
  - `Human->getMainHandItem()`, `Human->setMainHandItem()`, `Human->getOffHandItem()`, `Human->setOffHandItem()`
  - `block\utils\AnimatedContainerLike` & `block\utils\AnimatedContainerLikeTrait` (for chests, shulkerboxes, etc)
  - `block\utils\Container` & `block\utils\ContainerTrait` for blocks containing items (chests, etc)
  - `block\utils\MenuAccessor` implemented by all blocks that can open inventory menus
  - `block\utils\MenuAccessorTrait` used by blocks with menus but without inventories (anvils, crafting tables etc)
- Removed:
  - `inventory\DelegateInventory` (only used for ender chests)
  - `inventory\PlayerInventory`,
  - `inventory\PlayerOffHandInventory`,
  - `inventory\PlayerCraftingInventory`,
  - `inventory\PlayerCursorInventory` - these have all been internally replaced by `SimpleInventory` & they will appear as `PlayerInventoryWindow` in transactions (check `getType()` against the `PlayerInventoryWindow::TYPE_*` constants to identify them)
  - `block\inventory\AnimatedBlockInventoryTrait`, (blocks now handle this logic directly using `AnimatedContainer` and `AnimatedContainerTrait`)
  - `block\inventory\BlockInventoryTrait`,
  - `block\inventory\BlockInventory`
- Most `BlockInventory` classes have been transitioned to `InventoryWindow` wrappers
- Tiles now all use `SimpleInventory` internally (no cyclic references) except for `Chest` (which uses `CombinedInventory`, without holder info)
- `InventoryOpenEvent` and `InventoryCloseEvent` now provide `InventoryWindow` instead of `Inventory` (to provide type information)
- `InventoryTransaction` and `SlotChangeAction` now provide `InventoryWindow` instead of `Inventory`
- Renamed `TransactionBuilderInventory` to `SlotChangeActionBuilder`
- `TransactionBuilderInventory->getBuilder()` now accepts `InventoryWindow` instead of `Inventory`
- `DoubleChestInventory` superseded by `CombinedInventory` - this new class allows combining any number of inventories behind a single object; mainly used for double chests but plugins could use it to do lots of fun things

### Impacts to plugins
Plugins can now do the following:
```php
$block = $world->getBlockAt($x, $y, $z);
if($block instanceof MenuAccessor){
    $block->openToUnchecked($player);
}
```
As compared to the old way:
```php
$tile = $world->getTileAt($x, $y, $z);
if($tile instanceof Container){
    $player->setCurrentWindow($tile->getInventory());
}
```

#### Advantages
- No tile access needed
- Works for menu blocks without inventories as well as container blocks
- Less code

### Behavioural changes
Inventories no longer keep permanent cyclic references to their holders.

## Backwards compatibility
This makes significant BC breaks. However, all changes are able to be adapted to and the same amount of information is present on all APIs and events.

## Follow-up
- Implement #6147 
- Support inventory inheritance when copying blocks from one position to another
2025-09-02 19:23:16 +01:00
Dylan T.
fa5cc3301c Strip unnecessary NBT from network items (#6790)
TypeConverter: Strip unnecessary NBT from clientbound items
Item containers like shulker boxes, or chests with block entity data obtained with ctrl+middle click, will often have extremely large NBT payloads.
This problem gets exponentially worse in cases where it's possible to nest inventories, as in #4665.

We can't easily address this at the core level, because tiles are not able to exist within items (due to position requirement)
so we don't have a good way to avoid this useless NBT in the first place. However, we can strip it before the item is sent to
the client, which dramatically reduces the network costs of such items, as well as removing any reason the client could have
to send such enormous items to the server.

A fully loaded shulker box with written books now takes only 5-6 KB on the wire instead of ~1 MB, which is a substantial improvement.

Dealing with this in a less hacky way is currently blocked on #6147.
2025-09-02 18:36:00 +01:00
dependabot[bot]
9a0a8a55b1 Bump shivammathur/setup-php in the github-actions group (#6787) 2025-09-02 13:17:41 +00:00