954 Commits

Author SHA1 Message Date
Dylan K. Taylor
0330b25768
Merge branch 'minor-next' into major-next 2025-06-08 18:44:54 +01:00
Dylan K. Taylor
baafaed362
Stem drops seeds according to binomial distribution
fixes #6709

we really need a better way to reverse-engineer the chance parameter for these
as the wiki just gives a probability table, which is quite tiresome to extract
patterns from.
2025-05-28 21:00:40 +01:00
pmmp-admin-bot[bot]
d5a1007c80 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/15288247521
2025-05-28 00:03:15 +00:00
Adam
bf33a625c9
Implemented Respawn Anchor (#6646)
PlayerRespawnAnchorUseEvent is also added with options SET_SPAWN and EXPLODE, which allows plugins to customise the outcome of using the anchor in PM, which currently doesn't support dimensions. The event is also cancellable.
2025-05-27 21:57:28 +01:00
pmmp-admin-bot[bot]
b20d1b84b5 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/15232190072
2025-05-25 00:03:31 +00:00
ipad54
4d5c27a734
Unit test block hardness & blast resistance values (#6629) 2025-05-24 21:01:36 +01:00
Dylan K. Taylor
1d26b21fe0
Merge branch 'minor-next' into major-next 2025-05-04 17:21:24 +01:00
Dylan K. Taylor
6196b9c995
Merge branch 'stable' into minor-next 2025-05-04 17:20:27 +01:00
Dylan K. Taylor
f2e7473629
Update PHP-CS-Fixer 2025-05-04 17:19:15 +01:00
pmmp-admin-bot[bot]
d86943fa8c Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/14565559872
2025-04-21 01:45:18 +00:00
Dylan K. Taylor
ad6f7dfedb
World: verify saveability of blocks, entities and tiles at entry points
I want to do the same for items, but items are going to be a pain in the ass.
For items there are multiple possible entry points and all of them will need to be checked:
- dropped items
- inventory contents
- lecterns
- item frames

I don't see a good way to deal with all these. We can't check for registration in the constructor
because we need to fully construct the item in order to register it.

Blocks are also a potential issue in other areas, but setBlock() is definitely the biggest offender.
2025-04-20 19:48:28 +01:00
pmmp-admin-bot[bot]
baee0110c7 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/14544397106
2025-04-19 01:36:21 +00:00
zSALLAZAR
028815490e
Add EntityExtinguishEvent (#6671) 2025-04-18 11:19:46 +02:00
pmmp-admin-bot[bot]
510ef94698 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13878654456
2025-03-16 01:41:31 +00:00
Dylan K. Taylor
c2f8e9365b
BlockStateToObjectDeserializer: check that the returned state is actually registered
if not, this will cause random crashes in core code, which assumes that state IDs found on runtime chunk memory are valid and registered.

this problem exists in other places too, and probably requires a rethink of how we're dealing with this, but for now, this will do as a band-aid.
2025-03-15 20:53:49 +00:00
pmmp-admin-bot[bot]
dae3e2b336 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13868087288
2025-03-15 01:26:48 +00:00
Dylan K. Taylor
069ecf007f
Merge branch 'stable' into minor-next 2025-03-14 15:41:46 +00:00
Dylan K. Taylor
341c7a03a9
CopperMaterial: fixed missing @return $this docs 2025-03-14 15:40:27 +00:00
pmmp-admin-bot[bot]
ec140f7861 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13666455727
2025-03-05 01:27:21 +00:00
pmmp-admin-bot[bot]
09f0ce458c Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13666455727
2025-03-05 01:27:20 +00:00
Dylan K. Taylor
d0d84d4c51
New rule: explode() limit parameter must be set 2025-03-04 20:44:01 +00:00
pmmp-admin-bot[bot]
1ad08e2432 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13488997706
2025-02-24 01:26:36 +00:00
pmmp-admin-bot[bot]
19425e35ea Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13488997706
2025-02-24 01:26:36 +00:00
Dylan K. Taylor
1fed9f6cb5
BlockBreakInfo: fixed confusing error message 2025-02-23 20:02:27 +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]
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]
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
5c905d9a95
BlockBreakInfo: use strict comparison
weak compare isn't needed here since this can be float/float
2025-01-06 22:44:16 +00:00
Dylan K. Taylor
8b23231537
Fixup PHPDoc for blocks 2025-01-06 22:44:16 +00:00
Dylan K. Taylor
3e69ee87e4
Remove deprecated stuff
except Permission subscriptions; turns out we still need those
perhaps they should be marked @internal
2024-12-19 00:14:18 +00:00
Dylan K. Taylor
7a2427ace2
Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into major-next 2024-12-14 02:40:03 +00:00
ipad54
b10caf7437
Remove tool tier of some blocks to match vanilla (#6573) 2024-12-13 21:54:48 +00:00
ipad54
de66d84d29
Implement new 1.20 and 1.21 records (#6572) 2024-12-13 21:10:34 +03:00
pmmp-admin-bot[bot]
f82c8dd3d3 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12307996607
2024-12-13 01:40:43 +00:00
ipad54
42094e6768
Implement resin blocks & items (#6571) 2024-12-12 23:21:41 +03:00
ipad54
b341078765
Implement new pale oak blocks (#6570) 2024-12-12 17:53:52 +03:00
pmmp-admin-bot[bot]
6d2329128a Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12191303914
2024-12-06 01:38:37 +00:00
Dylan K. Taylor
6b2da15b80
Fixed signs 2024-12-05 19:58:52 +00:00
pmmp-restrictedactions-bot[bot]
007673cb96 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12111121061
2024-12-02 01:41:02 +00:00
IvanCraft623
f1a3b42620
Implement frost walker enchantment (#5497)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-12-01 19:46:38 +00:00
Dylan K. Taylor
02d181d0c8
Merge branch 'minor-next' into major-next 2024-12-01 15:02:36 +00:00
Dylan K. Taylor
a593180ef9
Deprecate some stuff 2024-12-01 15:01:41 +00:00
pmmp-restrictedactions-bot[bot]
a078f653f4 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12042121495
2024-11-27 01:39:13 +00:00
Akmal Fairuz
269effcecf
Introduce Utils::getRandomFloat() (#6532)
Drop-in replacement for lcg_value() for PHP 8.4
2024-11-26 11:33:29 +00:00
Dylan K. Taylor
15eaf67a0c
Merge branch 'minor-next' into major-next 2024-11-25 14:36:25 +00:00
Dylan K. Taylor
12ae8dc03b
Merge branch 'stable' into minor-next 2024-11-25 14:32:30 +00:00
Dylan K. Taylor
5325ecee37
Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
Dylan K. Taylor
e51903d7ea
Merge branch 'minor-next' into major-next 2024-11-24 23:51:07 +00:00