0c463a8721
PlayerCreationEvent: update woefully inadequate documentation
...
closes #4581
2022-11-15 21:45:08 +00:00
39e10da88d
PlayerChatEvent: replace hardcoded translation key with KnownTranslationKeys constant
2022-11-15 15:15:34 +00:00
c1fbac412e
event: ensure that modifications to items expected to be readonly have no effect
...
this isn't a very glorious fix, but it's the best I have for now.
2022-10-07 11:33:14 +01:00
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
179cac45f5
Merge branch 'stable' into next-minor
2022-05-22 16:21:05 +01:00
1154c7c1ab
PlayerQuitEvent: improve documentation
2022-05-21 21:23:13 +01:00
4a3e42f82e
PlayerTransferEvent: add documentation
2022-05-21 21:21:51 +01:00
8ecf9717d6
PlayerItemHeldEvent: add documentation
...
since some nuances of the intended behaviour were previously unclear...
2022-05-21 21:21:13 +01:00
7d172e2211
PlayerCommandPreprocessEvent: updated documentation
2022-05-21 21:07:29 +01:00
e934e2bd26
PlayerDropItemEvent: updated documentation
...
this can be triggered by dropping an item outside of the inventory menu while the inventory window is open.
2022-05-21 21:05:27 +01:00
3177d19730
PlayerKickEvent: improved woefully inadequate documentation
2022-05-21 21:03:56 +01:00
a31bd19b5a
Deprecated PlayerCommandPreProcessEvent
...
to be removed in PM5
see #4284
2022-05-21 20:20:09 +01:00
02cf6ae46c
Added PlayerDeathEvent->setKeepXp(), closes #4002 ( #4015 )
2022-05-21 16:41:14 +01:00
d4b7f66e15
Promote some constructors
2022-05-17 22:34:58 +01:00
8b8560a701
Added PlayerPostChunkSendEvent ( #4937 )
...
this is primarily useful for debugging plugins, but could also be useful for other things, such as spawning fake blocks, particles, etc.
2022-05-17 15:40:01 +01:00
937bb4c6ce
Merge branch 'stable' into next-minor
2022-04-28 21:00:23 +01:00
c8a7a53d70
event: modernize property declarations where possible
...
only private fields are modified; protected ones can't be changed in case someone extended the classes
2022-04-25 00:06:26 +01:00
223893fd5c
PlayerChangeSkinEvent: remove obsolete doc comment
2022-04-24 21:56:49 +01:00
f924208881
Update PlayerPreLoginEvent documentation ( #4940 )
...
Removed outdated documentation that was very misleading. Replaced with better documentation that accurately describes how to cancel the event.
2022-04-03 17:59:07 +01:00
f97ce6afef
Harden APIs which accept Vector3/Position/Location in event namespace
2022-03-09 22:22:37 +00:00
b9f1bcf0e4
Implement PlayerViewDistanceChangeEvent ( #4749 )
...
closes #4550
2022-01-25 18:00:26 +00:00
86bcc49972
Merge branch 'stable' into next-minor
2022-01-20 16:30:49 +00:00
a67aef0477
PlayerInteractEvent: updated documentation
2022-01-20 16:10:37 +00:00
75fc7a2d1f
Merge branch 'stable' into next-minor
2022-01-07 20:16:35 +00:00
6d249026cc
Merge branch 'legacy/pm3' into stable
2022-01-07 20:15:15 +00:00
d41f933e7b
Implement swimming/gliding including AABB recalculation ( #4446 )
...
- The following events have been added:
- PlayerToggleGlideEvent
- PlayerToggleSwimEvent
- The following API methods have been added:
- Entity->getSize()
- Living->isSwimming()
- Living->setSwimming()
- Living->isGliding()
- Living->setSwimming()
- Player->toggleSwim()
- Player->toggleGlide()
2021-12-19 17:10:41 +00:00
bcf8a3424c
Merge branch 'legacy/pm3' into stable
2021-12-10 18:02:06 +00:00
f066199971
Implement emote support ( #4523 )
2021-11-02 23:04:55 +00:00
a4b65d6a3f
PlayerCreationEvent: verify that the class actually exists and is instantiable
...
this ensures that crashdumps blame the plugin instead of the core on bad classes, such as in this case: https://crash.pmmp.io/view/5331225
2021-10-21 20:37:45 +01:00
f138004913
PlayerDeathEvent: fixed property type variance issue PHPStan complains about
2021-09-26 21:20:42 +01:00
6e68e99ec0
Added PlayerEntityInteractEvent ( #4374 )
2021-08-24 11:56:10 +01:00
789a669395
Rename TranslationContainer -> Translatable
2021-08-15 16:17:46 +01:00
b4c0ddd155
Use native union types for TranslationContainer|string
2021-08-10 15:17:26 +01:00
2293bd948d
Added KnownTranslationFactory and use it in as many places as possible
...
this makes translation usage much more statically analysable.
The only places this isn't used are:
- places that prefix translations with colours (those are still a problem)
- places where server/client translations don't match (e.g. gameMode.changed accepts different parameters in vanilla than in PM)
2021-08-10 14:50:40 +01:00
f3bd48e6cb
Updated some more hardcoded translation key usages missed by 94e16f416d
2021-06-30 14:02:55 +01:00
97a4d80854
PlayerDataSaveEvent: provide online player if possible, otherwise don't load offline data from disk for no reason (we already have it, that's the whole point of the event ...)
2020-11-28 21:43:23 +00:00
dd200ca8cd
Rewrite message broadcasting system to not depend on PermissionManager subscriptions
...
relying on permission subscriptions for this was unreliable (a permissible is not always subscribed to a permission even when it does have it), and also difficult to control (for example there have been various bugs in the past where a Player ended up subscribed to broadcast permissions when it didn't expect to be, thanks to permission recalculation happening too early).
In addition, we might in the future want to have broadcast receivers which are not permissibles (i.e. a more general interface than CommandSender (why does a broadcast receiver need to also be a command sender, anyway?)), which the permission system wouldn't be suitable for.
2020-11-28 19:28:47 +00:00
4439781124
Merge branch 'stable'
...
# Conflicts:
# resources/vanilla
# src/event/player/PlayerCreationEvent.php
2020-11-28 16:16:15 +00:00
6734dcc79f
Introduce PlayerDisplayNameChangeEvent (listen only) ( #3847 )
2020-10-01 22:23:02 +01:00
e3dce1f8bd
Merge branch 'stable'
...
# Conflicts:
# resources/vanilla
# src/event/player/PlayerChatEvent.php
2020-07-21 19:28:00 +01:00
d9c3ec5f91
Merge branch 'stable'
...
# Conflicts:
# resources/vanilla
2020-07-11 20:14:42 +01:00
923ea46476
PlayerPreLoginEvent: implement Cancellable again
2020-07-11 17:47:53 +01:00
d840e8c4d4
Merge commit 'a34f3261c'
...
# Conflicts:
# resources/vanilla
# src/event/entity/EntityExplodeEvent.php
# src/pocketmine/event/block/SignChangeEvent.php
# src/utils/Utils.php
2020-07-04 22:39:40 +01:00
1f90aa07aa
Merge branch 'stable'
...
# Conflicts:
# resources/vanilla
# src/command/defaults/TeleportCommand.php
# src/pocketmine/event/entity/EntityDespawnEvent.php
# src/pocketmine/event/entity/EntityInventoryChangeEvent.php
# src/pocketmine/event/entity/EntityLevelChangeEvent.php
# src/pocketmine/event/entity/EntitySpawnEvent.php
# tests/phpstan/configs/actual-problems.neon
2020-06-21 00:30:45 +01:00
4c51f1dda3
Scrap TextContainer, make TranslationContainer immutable
...
TextContainer provided zero real value as a base of TranslationContainer, given that it required its own logic to be handled wherever accepted. As such, it's no better than a simple string.
Removing it also allows fixing an ambiguity when embedding translations inside other translations, allowing it to be made immutable.
2020-02-08 13:38:27 +00:00
aac7da6c96
eliminate remaining empty() usages
2020-02-07 21:51:50 +00:00
f66efa1aa2
Merge commit 'a67fa5c007de3a5e7e689c63955849ceba9d7541'
2020-01-31 19:18:35 +00:00
cd55cdf5c6
Merge commit '9cd6b3e1c7cd81d0a4b0da68d9b3ff026c9f6495'
2020-01-22 15:04:06 +00:00
67bcc1c0fb
phpdoc armageddon for master, pass 1
2020-01-22 11:55:03 +00:00
cda1143a79
Merge branch 'stable'
2020-01-09 17:17:42 +00:00