15114 Commits

Author SHA1 Message Date
Dylan K. Taylor
e51903d7ea
Merge branch 'minor-next' into major-next 2024-11-24 23:51:07 +00:00
Dylan K. Taylor
30ee0aa63d
Merge branch 'stable' into minor-next 2024-11-24 23:50:56 +00:00
Dylan K. Taylor
aef4fa7174
Remove unused variable 2024-11-24 23:50:30 +00:00
Dylan K. Taylor
53aa380ca3
Candle: fix extinguish logic
closes #5983
2024-11-24 23:49:32 +00:00
Dylan K. Taylor
7f58122ac6
Avoid unnecessary repeated calls 2024-11-24 23:43:51 +00:00
Dylan K. Taylor
1738355357
Remove potentially problematic ephemeral window creation
this is *probably* fine, but best avoided.
2024-11-24 23:43:32 +00:00
Dylan K. Taylor
fe1a8d98e7
namespace tidy 2024-11-24 23:29:13 +00:00
Dylan K. Taylor
1d2b52732e
Chest block now has responsibility for configuring double chest inventories
it already needs to locate the correct pair anyway to know the left/right for DoubleChestInventoryWindow, so we might as well use this logic for initializing the DoubleChestInventory itself too. The old logic in tile/Chest didn't work correctly.
2024-11-24 22:47:35 +00:00
Dylan K. Taylor
9c5df90e9b
Burn more junk 2024-11-24 22:11:38 +00:00
Dylan K. Taylor
dcbf1c706a
this bites me every single time 2024-11-24 21:45:45 +00:00
Dylan K. Taylor
45a4282e8b
First look: Split up Inventory & InventoryWindow
this unblocks a variety of changes, such as positionless tiles, enhanced APIs on Blocks for inventories, and also eliminates a bunch of cyclic references within the core code.

linked to #5033
2024-11-24 21:40:47 +00:00
Dylan K. Taylor
473bbe64e0
BaseInventory no longer uses viewers to send updates to players
we want viewers to be as close to decorative as possible, so that they provide useful information to plugins, but don't get in the way of other changes.
2024-11-24 21:22:44 +00:00
Dylan K. Taylor
f98cebbd62
Separate hotbar from player inventory
this allows this functionality to be used with any type of inventory, and also makes it a little nicer to use in many cases.
2024-11-24 17:58:58 +00:00
zSALLAZAR
a5f607138c
Implement Ice Bomb (#5452)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2024-11-24 15:01:26 +00:00
ShockedPlot7560
8338ebaffd
Add generic types for TaskHandler (#6030) 2024-11-24 14:14:34 +00:00
pmmp-restrictedactions-bot[bot]
c61434d87b Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11964819241
2024-11-22 01:36:17 +00:00
pmmp-restrictedactions-bot[bot]
a523ed6e40 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11964819241
2024-11-22 01:36:16 +00:00
GameParrot
7c2ed7d884
Fix insta break check (#6528) 2024-11-21 02:22:10 +00:00
pmmp-restrictedactions-bot[bot]
dcc258706f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11944832380
2024-11-21 01:27:14 +00:00
Dylan T.
9195c88670
ConsoleReader: Use proc_open()'s socket support to send commands back to the main server process (#5273)
Support for this was introduced in PHP 8.0, though not mentioned in any changelog: php/php-src#5777

This simplifies the subprocess handling considerably. However, there is a potential for problems if PHP generates any E_* errors, since these get written to STDOUT as well.
To avoid error messages being treated as a command, a hash is attached to each IPC message, seeded with an incrementing counter. This prevents error messages causing command replays or unintended commands.

Unfortunately, PHP doesn't support binding pipes other than stdin/stdout/stderr on Windows for the child process, so we have to use stdout for this. In the future, if it becomes possible, a dedicated pipe for the purpose should be introduced. We'd need something like php://fd/<number> to work on Windows.
2024-11-20 14:56:52 +00:00
pmmp-restrictedactions-bot[bot]
820e2d4a2f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11924942897
2024-11-20 01:27:32 +00:00
pmmp-restrictedactions-bot[bot]
ae19d05fd5 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11924942897
2024-11-20 01:27:30 +00:00
Markus Staab
e710b3750f
Adjust pretty name of closures on PHP 8.4 (#6351)
related to https://github.com/php/php-src/pull/13550

see analog symfony change: https://github.com/symfony/symfony/pull/54614
2024-11-19 17:05:21 +00:00
pmmp-restrictedactions-bot[bot]
0fb1415f7f Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11904511045
2024-11-19 01:36:12 +00:00
pmmp-restrictedactions-bot[bot]
8ccd1edb17 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11904511045
2024-11-19 01:36:11 +00:00
Akmal Fairuz
faf1e26bac
Fix: implicitly nullable parameter declarations deprecated (#6522) 2024-11-18 23:54:22 +00:00
Dylan T.
a6534ecbbb
Fixed merge error 2024-11-17 01:55:46 +00:00
pmmp-restrictedactions-bot[bot]
330bcd2423 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11874902000
2024-11-17 01:39:53 +00:00
ipad54
1555fa17e7
Added ability to pick end crystal item (#6509) 2024-11-16 19:06:03 +00:00
ipad54
e77f2c5198
Implemented End Crystal (#4715)
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-11-16 17:57:57 +00:00
pmmp-restrictedactions-bot[bot]
9e2d91bae6 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11865975725
2024-11-16 01:26:32 +00:00
Javier León
d3add78d3e
Add support for basic entity picking via middle-click (#5397)
Support for more advanced stuff like NBT copying wasn't added in this PR, as the NBT used by PM is currently an inconsistent mess and doesn't play nice with vanilla. In the interests of avoiding this mess propagating, it's been left for another time.

Adds PlayerEntityPickEvent a la PlayerBlockPickEvent
and Entity->getPickedItem().
2024-11-15 21:27:10 +00:00
Dylan T.
ff695a5f97
PlayerInteractEvent: added APIs to independently control reaction of item and block (#4683)
This allows, for example, banning the usage of spawn eggs, without preventing opening of doors, without the need for item ID whitelists.

It also allows customizing the behaviour of item and block interactions when sneaking - it's now possible to force spawn eggs to work when sneaking, or force containers to open.

Finally, this also allows preventing any interaction at all without preventing block placement (by setting both to false). Since cancelling the event will typically prevent placement too (which might not be desired).

Side note: Blocks are now always synced when right-clicking on a block.
This differs from the previous behaviour, where the blocks were only synced when the action "failed".
However, since this change introduces a situation where the action may succeed but have different results than the client expects, it's best to just always sync blocks in this situation.

Fixes #3267
2024-11-15 21:19:54 +00:00
github-actions
b6f55b78a9 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11862895039
2024-11-15 20:21:33 +00:00
github-actions
fb1213e964 Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11862895039
2024-11-15 20:21:32 +00:00
bonbionseker
8474eaf5f1
Adjust Sugar Cane to break when there is no water (#6486) 2024-11-15 16:27:27 +00:00
ipad54
a75d4687ce
Implemented vanilla /xp command (#6429) 2024-11-15 16:09:55 +00:00
ipad54
0b0c425805
Extract glow lichen multi face logic into traits (#6396)
This will be useful for future block additions
2024-11-15 15:47:26 +00:00
ipad54
b5469dede2
Flowable blocks now can't be placed inside liquid (#5392) 2024-11-15 00:10:43 +00:00
Dylan K. Taylor
ab5176baf9
Merge branch 'minor-next' into major-next 2024-11-14 23:16:44 +00:00
Dylan K. Taylor
e0d270a870
Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into minor-next 2024-11-14 23:14:33 +00:00
Dylan K. Taylor
2d9cee3d62
Update Language dependency 2024-11-14 23:14:23 +00:00
Dylan K. Taylor
ed64231c57
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into minor-next 2024-11-14 23:12:26 +00:00
Dylan T.
33a7b46329
Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems (#6498)
Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems

Since BlockTypeIds and ItemTypeIds are derived from VanillaBlocks and VanillaItems respectively anyway (they only exist to allow identifying blocks/items without having to create instances of them), this hack is probably OK, and reduces the chances of mistakes.
Previously it was explored to have these IDs generated by auto-incrementing in VanillaBlocks/Items and have the constants generated that way, but this proved to be too problematic because of unstable diffs no matter how we chose to sort the elements. See #6313 for previous research on the subject.

This is obviously not a desirable hack to keep long-term. In the future it will probably make sense to redesign VanillaBlocks like so:

enum VanillaBlocks { ... }
VanillaBlocks::STONE (the type ID)
VanillaBlocks::STONE->new() (to create a block)

However, more research is needed on this, as I'd prefer not to make block creation any more verbose.
2024-11-14 17:32:22 +00:00
IvanCraft623
9b58d35516
Implement Goat horns (#5232)
Co-authored-by: ipad54 <63200545+ipad54@users.noreply.github.com>
Co-authored-by: Dylan T. <dktapps@pmmp.io>
2024-11-14 13:57:07 +00:00
github-actions
ef6fce4091 Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11824307499
2024-11-13 19:21:19 +00:00
github-actions
3629ee7e7b Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11824307499
2024-11-13 19:21:16 +00:00
Dylan K. Taylor
fbeb017670
Promise: allow zero promises
not supporting this has caused problems every time this function has been used in reality so far (#6092 and #6333).
2024-11-13 14:55:14 +00:00
Dylan T.
09bf203267
Update RuntimeDataDescriber.php 2024-11-12 22:57:14 +00:00
Dylan K. Taylor
f3cc4a28e1
Easy wins for PHPStan 2.0 support 2024-11-12 22:12:54 +00:00