15302 Commits

Author SHA1 Message Date
Dylan K. Taylor
788ee9a008
Allow overriding deserializers for block and item IDs
there's no technical reason not to support this, since it doesn't violate any assumptions and the type returned is a base anyway.

this enables implementing stuff like snow cauldrons in a plugin, which previously would require reflection due to the minecraft:cauldron deserializer being registered already.
it also enables overriding IDs to map to custom blocks, which might be useful for overriding some functionality (although this is inadvisable - and won't alter the usage of stuff like VanillaBlocks::WHATEVER()).

we do *not* allow overriding serializers, since type IDs are expected to be paired to block implementations, and allowing them to be reassigned could lead to crashes if the new class was incorrect. So the correct approach for overriding nether portals would be to create a custom type ID as if you were adding a fully custom item. This will also allow other plugins to distinguish between your implementation and the built-in one.
2025-02-16 22:49:40 +00:00
pmmp-admin-bot[bot]
34f801ee3c 5.25.1 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/13359320328
2025-02-16 22:18:20 +00:00
Dylan T.
d96ef21c4d
Prepare 5.25.0 release (#6631) 2025-02-16 22:16:47 +00:00
Dylan K. Taylor
246c1776df
InventoryAction: avoid throwaway Item clones 2025-02-16 21:47:35 +00:00
Dylan K. Taylor
03e4b53ac4
BedrockDataFiles: added constants for folders as well as files
we probably should have it recurse too, but this is an easy win.
2025-02-16 20:57:16 +00:00
Dries C
91ac64783f
Bedrock 1.21.60 (#6627)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2025-02-16 20:51:53 +00:00
Dylan T.
9402a20ee3
Update Utils::getOS() doc comment
closes #6628
2025-02-16 16:12:29 +00:00
pmmp-admin-bot[bot]
c9441e1078 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13276594014
2025-02-12 02:16:01 +00:00
ipad54
e29aa2f337
Added resin material color (#6622) 2025-02-11 16:15:42 +00:00
pmmp-admin-bot[bot]
b0ac8863c4 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13191240897
2025-02-07 01:23:45 +00:00
Dylan T.
9b3b45258a
Optimise collision box checks by caching some basic info (#6606)
This PR significantly improves performance of entity movement calculation.

Previous attempts to optimise this were ineffective, as they used a cache to mitigate the cost of recomputing AABBs. Entities tend to move around randomly, so the non-cached pathway really needed to be optimized.

This change improves performance on multiple fronts:
1) avoiding Block allocations for blocks with 1x1x1 AABBs and with no AABBs (the most common)
2) avoiding Block allocations and overlapping intersection checks unless a stateID is specifically known to potentially exceed its cell boundaries (like fences)
3) avoiding overlapping AABB checks when overlaps can't make any difference anyway (cubes)

Together, these changes improve the performance of World->getBlockCollisionBoxes() by a factor of 5. In real-world terms, this shows up as a major performance improvement in situations with lots of entities moving in random directions. Testing with item entities showed an increase from 400 to 1200 moving items with the same CPU usage.

This change is built on the assumption that `Block->recalculateCollisionBoxes()` and its overrides don't interact with any world. This is technically possible due to the crappy design of the `Block` architecture, but should be avoided. As a world is not available during `RuntimeBlockStateRegistry` initialization, attempting to interact with a world during `recalculateCollisionBoxes()` will now cause a crash.

This turned out to be a problem for `ChorusPlant`, which was fixed by 70fb9bbdfd06c7eda00b4cd2c2c3840755e6b8f6. The correct solution in this case was to use dynamic states similar to how we currently deal with fence connections.
2025-02-06 15:42:10 +00:00
pmmp-admin-bot[bot]
b3723b5b3e Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13104521333
2025-02-03 01:23:13 +00:00
Dylan K. Taylor
21ccd90147
ChunkCache: parameterize dimension ID
(cc @Muqsit)
2025-02-02 19:43:04 +00:00
GameParrot
0a9a45a126
Improve block break progress
closes #6500

This fixes break time animations for mining fatigue and haste, and
improves the underwater and on-ground behaviour.

on-ground is still not quite right for reasons not related to this PR
(see #6547).
I'm also not quite sure the underwater logic is correct (in water vs
underwater?) but it's definitely better than what we have currently.
2025-02-02 19:34:14 +00:00
pmmp-admin-bot[bot]
8af2d05ec0 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13001707314
2025-01-28 01:21:44 +00:00
Dylan K. Taylor
70fb9bbdfd
ChorusPlant: fixed recalculateCollisionBoxes() depending on the world 2025-01-27 21:28:26 +00:00
pmmp-admin-bot[bot]
4d186b52da Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12920308572
2025-01-23 01:22:04 +00:00
pmmp-admin-bot[bot]
fc86d3a44e 5.24.1 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12916833718
2025-01-22 20:50:42 +00:00
Dylan K. Taylor
b625fee94b
Prepare 5.24.0 release 2025-01-22 18:00:41 +00:00
Dylan K. Taylor
6b606dca95
UPnP: better fix for postURL error that doesn't require behavioural breaks 2025-01-22 17:46:43 +00:00
Dylan K. Taylor
406ddf3e53
Revert "Internet: make postURL() error reporting behaviour more predictable"
This reverts commit 97c5902ae2fea587faaee7487bbe14fa6100d67e.
2025-01-22 17:44:23 +00:00
Dylan K. Taylor
ec6077776a
Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into minor-next 2025-01-22 16:45:49 +00:00
pmmp-admin-bot[bot]
e6ff55823f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12899221905
2025-01-22 01:23:50 +00:00
pmmp-admin-bot[bot]
f7b5cd7ff3 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12899221905
2025-01-22 01:23:49 +00:00
pmmp-admin-bot[bot]
3453ff03fd 5.23.4 is next
Commit created by: https://github.com/pmmp/RestrictedActions/actions/runs/12898306655
2025-01-22 00:10:10 +00:00
Dylan T.
04e63172c3
5.23.3 (#6597) 2025-01-22 00:08:49 +00:00
pmmp-admin-bot[bot]
d556389b11 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12839491049
2025-01-18 01:19:33 +00:00
pmmp-admin-bot[bot]
51cb1875bb Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12839491049
2025-01-18 01:19:32 +00:00
Dries C
0b60a47cde
Noteblock instrument changes from 1.21.50 (#6596)
Good thing this isn't saved on disk :|
2025-01-17 19:56:19 +00:00
pmmp-admin-bot[bot]
976fc63567 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12701510185
2025-01-10 01:26:17 +00:00
Sergi del Olmo
f349ce75e4
Player: add ability to get & set flight speed multiplier (#6076)
Since this doesn't directly correspond to flight speed (it's multiplied by different values depending on whether sprinting or not, and possibly other states), "multiplier" was preferred instead of directly calling it flight speed.

Default value is 0.05.
2025-01-09 20:13:46 +00:00
Dylan K. Taylor
02ac512b4e
Merge branch 'minor-next' into major-next 2025-01-08 15:25:12 +00:00
Dylan K. Taylor
b3f15435cc
Projectile: clean up dodgy code 2025-01-08 02:31:50 +00:00
Dylan K. Taylor
847ae26cad
PHPStan: don't remember possibly-impure function return values
I don't think we get much benefit from this, and the assumption that functions with a return value are pure is sketchy.
In any case, it's better to avoid these repeated calls anyway.
2025-01-08 02:04:06 +00:00
Dylan K. Taylor
d42ec06647
ZippedResourcePack: don't pass exception code to new exception
this is a BUT (int|string) under PHPStan, and we don't need the errors. We don't care about this code anyway.
2025-01-08 01:48:55 +00:00
Dylan K. Taylor
5e0f03dff0
Stub PalettedBlockArray functions that work with arrays
and workaround PHPStan stupidity
2025-01-08 01:48:15 +00:00
Dylan K. Taylor
4a83920db9
PlayerPreLoginEvent: improve array type info 2025-01-08 01:47:04 +00:00
Dylan K. Taylor
0a16daa619
Avoid dodgy array_flip hash building
the conventional way is using array_keys and array_fill_keys. Behaviour is more predictable & also avoids benevolent union fuckery from PHPStan.
2025-01-08 01:45:28 +00:00
Dylan K. Taylor
e8c4b743b5
LevelDB: stop overriding types from NBT
NBT has better quality type info already
2025-01-07 22:54:10 +00:00
Dylan K. Taylor
794641c0f8
Utils: split some horrifying code across multiple lines 2025-01-07 22:35:19 +00:00
Dylan K. Taylor
9633b7d8a7
Update to PHPStan 2.x 2025-01-07 22:34:43 +00:00
Dylan K. Taylor
d69a887b0d
Utils: fix parameter doc for printableExceptionInfo() 2025-01-07 22:24:26 +00:00
Dylan K. Taylor
b1c7fc017a
CS 2025-01-07 22:13:20 +00:00
Dylan K. Taylor
cd59e272bc
PHPStan 2.0 fixes 2025-01-07 22:10:42 +00:00
Dylan K. Taylor
7b1b35ab1f
generator: fixup issues reported by PHPStan 2.0 2025-01-07 22:07:38 +00:00
Dylan K. Taylor
28d31c97f8
Server: fixup PHPStan 2.x reported issues 2025-01-07 22:05:01 +00:00
pmmp-admin-bot[bot]
708784b0a2 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12643390650
2025-01-07 01:24:48 +00:00
Dylan K. Taylor
a17512de93
Command: don't trust plugins not to pass junk 2025-01-06 23:26:13 +00:00
Dylan K. Taylor
601be3fb33
stfu 2025-01-06 23:09:26 +00:00
Dylan K. Taylor
2e32c50670
NetworkSession: apparently aliases are already a list at this point??? 2025-01-06 23:08:48 +00:00