Commit Graph

18184 Commits

Author SHA1 Message Date
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
b2d0be5b75 Support editing the back side of signs (#6774)
* Deprecate BaseSign get/set/updateText(), add get/set/updateFaceText() which accepts true/false for front/back
* add isFrontFace() to SignChangeEvent
* add optional frontFace to Player::openSignEditor()
* add BaseSign::getFacingDegrees() and getHitboxCenter() which need to be implemented by subclasses
2025-09-01 17:15:29 +01:00
d3c36e6287 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17364003235
2025-09-01 00:03:50 +00:00
e569cc3275 stfu 2025-08-31 21:47:49 +01:00
c931437a30 InventoryTransaction: Remove action shuffling
we used to have this to prevent dependence on client ordering, and make ordering consistently not work.
However, since the introduction of the ItemStackRequest protocol, we don't expect to see client actions
in the wrong order anymore, so this shouldn't be needed anymore.

closes #6701
2025-08-31 21:45:55 +01:00
09cc76ae2b 5.33.2 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/17351431906
2025-08-31 02:28:17 +00:00
a540de1e3c Prepare 5.33.1 patch release (#6784) 5.33.1 2025-08-31 03:27:21 +01:00
9eee1a9a6e Banner: don't bail on missing type tags
we didn't set these prior to 5.33.0, so these won't be present on older worlds.
2025-08-31 03:22:58 +01:00
dca9d3a010 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17346805858
2025-08-30 17:49:04 +00:00
f673159471 5.33.1 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/17346780638
2025-08-30 17:46:07 +00:00
831c5a0464 Merge pull request #6783 from pmmp/r5.33.0
Release 5.33.0
5.33.0
2025-08-30 18:45:11 +01:00
5c363965f0 Fix build date
we really need a better way to deal with this
2025-08-30 18:43:18 +01:00
95679b5a29 Update BedrockData and some transient deps 2025-08-30 18:36:42 +01:00
9310c46ea1 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17336647491
2025-08-30 00:02:47 +00:00
f1b1e1977e Harden validation for server auth block breaking 2025-08-29 20:37:29 +01:00
23d612f1af Suggested additions 2025-08-29 18:49:08 +01:00
8f7e16a9ad Prepare 5.33.0 release 2025-08-29 14:11:50 +01:00
beaedc3627 Tidy up in block properties aisle 2025-08-29 13:07:09 +01:00
48ba334218 CS again :< 2025-08-29 12:33:50 +01:00
0be15a7403 Rename MultiFacing -> MultiAnyFacing
to match the trait name
2025-08-29 12:33:04 +01:00
2404d63b1f Ageable: added getMaxAge()
we'll probably need this...
2025-08-29 12:24:24 +01:00
dd9030f1f5 tools/generate-bedrock-data-from-packets: generate less noise for items
if we have only a name (the majority case), we can just return the name directly instead of an object.
this massively reduces the amount of noise in the files as seen in pmmp/BedrockData@f814036229
2025-08-28 21:15:09 +01:00
de234d1f38 Improved placement logic 2025-08-26 00:10:50 +01:00
db54c481aa Fixed hanging signs placement criteria (#6775) 2025-08-25 23:27:17 +01:00
ac2c07c3fe Added a space after hanging sign wood type (#6776) 2025-08-25 17:00:41 +01:00
ec56d65bcc Fix BC break in BaseBanner 2025-08-25 02:17:45 +01:00
c548923116 ... 2025-08-25 02:16:38 +01:00
4a2c7dc684 Apparently hanging signs are self supporting 2025-08-25 02:15:24 +01:00
f04c458e54 Merge branch 'stable' into minor-next 2025-08-25 01:49:19 +01:00
5c0a109f18 Sign: Strip trailing newlines from text blobs
fixes sign editor always putting the cursor on the last line when right-clicking to edit
2025-08-25 01:48:29 +01:00
31f6f5d252 CS again 2025-08-24 20:13:15 +01:00
0e498720bd Regenerate phpstan-bugs baseline 2025-08-24 20:10:34 +01:00
00d6171463 Implement hanging signs 2025-08-24 20:07:59 +01:00
be90c6c399 World: trigger readStateFromWorld on tile blocks immediately on load
this ensures that the state IDs reflect the actual PM block type, which would probably
be important for a bunch of different async things.
2025-08-24 17:01:59 +01:00
17ecf11a1b Remove stupid thing PhpStorm keeps doing 2025-08-24 16:49:49 +01:00
93e33dad8e tidy CS 2025-08-24 16:42:05 +01:00
4cdf064344 VanillaBlockMappings: Use some model mappings
this way there are some minor symmetry benefits, and the only asymmetric parts are the code that selects which model to use.

it also has the added benefit of removing some duplicated code paths (e.g. now it's possible to get rid of readUnitEnum() and such).
2025-08-24 16:37:42 +01:00
5bf0cbec87 ... 2025-08-24 15:39:23 +01:00
ef53676a59 Fix unit tests 2025-08-24 15:38:07 +01:00
8f9478e82f Illager banners finally working
closes #2951
2025-08-24 15:31:10 +01:00
7c521b456e Unify block serializers (#6769)
This has several advantages:

    Easier to implement new blocks (one less file to modify)
    Easier to adjust serialization of existing blocks
    Guaranteed consistency between serializers and deserializers
    Potentially, exposes more metadata for programmatic analysis, instead of having everything baked inside opaque Closures

There are some exceptions which still use the old approach: big dripleaf, cauldrons, mushroom stems, and pitcher crops. These all have multiple PM block types for a single ID, with relatively complex logic to select which to use. These weren't worth the effort to unify due to their small number. I may revisit this in the future, but I already spent a lot of brainpower on it.
2025-08-24 14:12:18 +01:00
47140cb8d7 RedstoneLamp: implement Lightable, shimmed to powered 2025-08-22 18:27:32 +01:00
e824266457 ChiseledBookshelf: add setSlots() 2025-08-22 18:27:06 +01:00
2bb78f2a94 Fixed Furnace not implementing HorizontalFacing
looks like this was missed in #6639
I checked all other uses of HorizontalFacingTrait and FacesOppositePlacingPlayerTrait and this seems to be the only one.
2025-08-20 00:58:57 +01:00
547544b5b4 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into minor-next 2025-08-17 15:25:57 +01:00
eea4f40138 BlockStateToObjectDeserializer: Remove duplicated CHISELED_COPPER registration
allowing overriding of serializers by the same method as first registration was a mistake...
2025-08-17 15:24:40 +01:00
237ac0f802 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17001748601
2025-08-16 00:03:09 +00:00
431790a319 Additional specialisation for colored blocks
this reduces boilerplate even further
2025-08-15 22:24:27 +01:00
c0fad353a2 missed one
sadly glazed_terracotta had to be special
2025-08-15 22:09:54 +01:00
e89523ce66 First look at flattened ID specialisation for block serializers
in the future we should be able to unify these, similarly to simple mappings.
unifying blocks with states will, however, be considerably more work.

only color benefits from this so far
2025-08-15 22:02:12 +01:00