254 Commits

Author SHA1 Message Date
Dylan K. Taylor
02ac512b4e
Merge branch 'minor-next' into major-next 2025-01-08 15:25:12 +00:00
Dylan K. Taylor
9633b7d8a7
Update to PHPStan 2.x 2025-01-07 22:34:43 +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
c5a1c15389
TimingsCommand: beware crash on invalid timings server response 2025-01-06 22:44:17 +00:00
Dylan K. Taylor
e30ae487dc
SimpleCommandMap: ensure we always pass a list to Command::setAliases()
some offsets may have been removed if the alias failed to be registered.
2025-01-06 22:44:17 +00:00
Dylan K. Taylor
59f6c85105
Command: mark execute $args as being list<string> 2025-01-06 22:44:17 +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
Dylan T.
93a9007f3c
Added ClosureCommand (#6063)
this is intended to replace PluginCommand and CommandExecutor, both of which are overengineered and unfit for purpose.
Allowing a closure allows much greater flexibility.

We can't use this within the core yet, as plugins will expect PluginBase->getCommand() to return PluginCommand (with its associated setExecutor() and similar APIs).
However, I think this is useful enough to add by itself.
2024-12-01 15:10:07 +00:00
Dylan K. Taylor
02d181d0c8
Merge branch 'minor-next' into major-next 2024-12-01 15:02:36 +00:00
Dylan T.
61560ec375
Support for collecting timings from threads, and implement async task timings (#6333)
The following callbacks can now be registered in timings, to allow threads to be notified of these events:
- Turning on/off (`TimingsHandler::getToggleCallbacks()->add(...)`)
- Reset (`TimingsHandler::getReloadCallbacks()->add(...)`)
- Collect (`TimingsHandler::getCollectCallbacks()->add(...)`)

Collect callbacks must return `list<Promise>`. The promises must be `resolve()`d with `list<string>` of printed timings records, as returned by `TimingsHandler::printCurrentThreadRecords()`. It's recommended to use 1 promise per thread.

A timings report will be produced once all promises have been resolved.

This system is used internally to collect timings for async tasks (closes #6166).

For timings viewer developers:
Timings format version has been bumped to 3 to accommodate this change. Timings groups should now include a `ThreadId`  at the end of timings group names to ensure that their record IDs are segregated correctly, as they could otherwise conflict between threads. The main thread is not required to specify a thread ID. See pmmp/timings@13cefa6279 for implementation examples.

New PHPStan error is caused by phpstan/phpstan#10924
2024-12-01 14:49:27 +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
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
ipad54
a75d4687ce
Implemented vanilla /xp command (#6429) 2024-11-15 16:09:55 +00:00
Dylan K. Taylor
a4f3476190
Merge branch 'minor-next' into major-next 2023-09-08 11:22:44 +01:00
Dylan K. Taylor
7ce33d9375
Migrate final remaining EnumTrait users to native enums 2023-09-08 10:34:12 +01:00
Dylan K. Taylor
4dc9d696d0
Merge branch 'minor-next' into major-next 2023-09-06 13:03:51 +01:00
Dylan K. Taylor
31d8cc1cb5
Generate and use constants for pocketmine.yml constant names
a couple of usages of properties that no longer exist couldn't be migrated.
in addition, this revealed a couple of dead properties in the default file.

this is not an ideal solution (I'd much rather model the configs using classes and map them) but in the absence of a good and reliable library to do that, this is the next best thing.
2023-08-25 13:23:38 +01:00
Dylan K. Taylor
d1a7c1d453
Constify server.properties references 2023-08-25 12:49:39 +01:00
Dylan K. Taylor
1504fdca24
Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb.
All these things pertain to the act of enchanting.

This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
2023-08-23 16:14:17 +01:00
Dylan K. Taylor
bf668c0f6c
Rename EnchantHelper related stuff
Perhaps this and EnchantOption should be called EnchantingHelper and EnchantingOption respectively. The terminology used is rather inconsistent, but 'enchantment' definitely isn't the right word here.
2023-08-23 16:07:02 +01:00
Dylan K. Taylor
5c915a3dfe
Merge branch 'minor-next' into major-next 2023-08-18 12:33:54 +01:00
Dylan K. Taylor
f516c3c502
EnchantCommand: ensure that books are turned into enchanted book items 2023-08-15 19:10:48 +01:00
Dylan K. Taylor
3c0e7ae492
Merge branch 'minor-next' into major-next 2023-07-24 12:07:55 +01:00
ShockedPlot7560
aac5944396
Accept Translatable permission messages in Command (#5830) 2023-07-19 16:38:15 +01:00
Dylan T
24d979bd08
Fixed /kill not properly killing the player under certain conditions, closes #4680 (#5919)
This occurs if the player had very high levels of Health Boost or other weird modifications.

It doesn't really make sense to apply damage modifiers to suicide anyway.

Really I'm doubtful that suicide should even be considered a damage type (perhaps we should add an EntitySuicideEvent), but that's a discussion for another time.
2023-07-19 16:33:16 +01:00
Dylan K. Taylor
0dca85af44
Merge branch 'minor-next' into major-next 2023-04-26 23:28:27 +01:00
Dylan K. Taylor
8102616ff4
Added ticking chunk count to /status
closes #5716
2023-04-26 17:05:31 +01:00
Dylan K. Taylor
1026811741
Merge branch 'minor-next' into major-next 2023-04-14 21:00:08 +01:00
Dylan K. Taylor
6fc4ce0f86
ÂTimingsCommand: include HTTP response code in debug message
we should probably show this in the regular response message, but we need new translations for that.
2023-04-14 16:02:27 +01:00
Dylan K. Taylor
a0dadc6e37
Merge branch 'minor-next' into major-next 2023-04-10 14:38:23 +01:00
Dylan K. Taylor
734adec90d
TimingsCommand: log the response body on failed paste 2023-04-06 14:46:02 +01:00
Dylan K. Taylor
b2f755720d
Use a proper Breakdown timing group instead of the unwieldy INCLUDED_BY_OTHER_TIMINGS_PREFIX 2023-04-05 20:47:47 +01:00
Dylan K. Taylor
948aa059c3
ÂCommand: fixed inconsistent API method name 2023-03-02 15:09:52 +00:00
Dylan K. Taylor
7611155ff9
CS 2023-02-15 15:13:12 +00:00
Dylan K. Taylor
aacd92bf08
Command: fix setPermissions docblock 2023-02-13 14:46:37 +00:00
Dylan K. Taylor
caebe14dab
Use an array for command permissions
it doesn't make sense to have to parse the string every time we want to verify permissions, nor to expect that people will somehow know to use ; to separate them without it being documented anywhere...
2023-02-13 14:44:55 +00:00
Dylan K. Taylor
cb10360c20
SimpleCommandMap: require commands to have a permission
fixes #5305
2023-02-13 14:24:30 +00:00
Dylan K. Taylor
082f9e1647
Deny permission to use a command if no permission is set
Having no permission is almost always a bug. We already have behaviour elsewhere in the core that assumes undefined permission = permission denied.

This behaviour might confuse some people, but I think it's much less dangerous than accidentally allowing everyone to use your command.
2023-02-13 14:22:36 +00:00
Dylan K. Taylor
a4494a2133
Merge branch 'next-minor' into next-major 2023-01-12 22:11:14 +00:00
Dylan K. Taylor
fc487b17be
DumpMemoryCommand: use localized description 2023-01-12 22:10:13 +00:00
BrandPVP
9c391a6809
Declare built-in command names inside the constructor (#5487)
This increases code consistency by placing the name in the same place where everything else about the command is defined.
2023-01-09 20:43:08 +00:00
Dylan K. Taylor
c2918709a3
Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +00:00
Alexey
172ce659b8
Use str_starts_with, str_ends_with and str_contains instead of strpos (#5485) 2022-12-31 13:02:23 +00:00
Alexey
0d31b25fba
Use str_starts_with and str_contains instead of strpos (#5482) 2022-12-30 21:41:30 +00:00
Dylan K. Taylor
7ac6bd79a9
Localized remaining disconnection screens (except one or two that should never actually happen) 2022-12-27 20:05:59 +00:00
Dylan K. Taylor
d37841c214
Merge branch 'next-minor' into next-major 2022-12-24 17:34:37 +00:00
Dylan T
567bd8abb5
Add .self and .other permissions for gameplay-altering commands (#5470)
I'm not quite sure this is the best way to enable such functionality, but it's already used for some other stuff, so I'm not too worried for now.

This allows the following commands to have their usage limited to self or others:
- /effect
- /enchant
- /gamemode
- /give
- /spawnpoint
- /teleport
- /title

I envision this being useful for creative mode servers, and test servers such as test.pmmp.io.
2022-12-24 17:22:18 +00:00