Commit Graph

228 Commits

Author SHA1 Message Date
Dylan K. Taylor
8ecf9717d6 PlayerItemHeldEvent: add documentation
since some nuances of the intended behaviour were previously unclear...
2022-05-21 21:21:13 +01:00
Dylan K. Taylor
3ca80b353b InventoryTransactionEvent: rewrite documentation 2022-05-21 21:20:11 +01:00
Dylan K. Taylor
7d172e2211 PlayerCommandPreprocessEvent: updated documentation 2022-05-21 21:07:29 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
3177d19730 PlayerKickEvent: improved woefully inadequate documentation 2022-05-21 21:03:56 +01:00
Dylan K. Taylor
82104a8251 UpdateNotifyEvent: updated documentation 2022-05-21 20:32:30 +01:00
Dylan K. Taylor
e9a17374d1 Rewrite documentation of CommandEvent
no wonder people get the idea to use this shit for banning commands ...
2022-05-21 20:29:25 +01:00
Dylan K. Taylor
a31bd19b5a Deprecated PlayerCommandPreProcessEvent
to be removed in PM5

see #4284
2022-05-21 20:20:09 +01:00
TheNewHEROBRINEX
02cf6ae46c Added PlayerDeathEvent->setKeepXp(), closes #4002 (#4015) 2022-05-21 16:41:14 +01:00
Dylan K. Taylor
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
Dylan K. Taylor
c0b15de504 Modernize private static property declarations 2022-05-17 21:55:16 +01:00
Dylan K. Taylor
eb95e2a97e Modernize private property declarations in src/event 2022-05-17 20:45:50 +01:00
Dylan T
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
Dylan K. Taylor
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
223893fd5c PlayerChangeSkinEvent: remove obsolete doc comment 2022-04-24 21:56:49 +01:00
Armen Deroian
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
Dylan K. Taylor
f97ce6afef Harden APIs which accept Vector3/Position/Location in event namespace 2022-03-09 22:22:37 +00:00
ShockedPlot7560
b9f1bcf0e4 Implement PlayerViewDistanceChangeEvent (#4749)
closes #4550
2022-01-25 18:00:26 +00:00
VixikHD
e0da99a973 feat: Implement Brewing (#4413)
The following API constants have been added:
- tile\BrewingStand::BREW_TIME_TICKS
The following public API methods have been added:
- utils\BrewingStandSlot->getSlotNumber() : int
- CraftingManager->getPotionTypeRecipes() : array<string, array<string, PotionTypeRecipe>>
- CraftingManager->getPotionContainerChangeRecipes() : array<int, array<string, PotionContainerChangeRecipe>>
- CraftingManager->registerPotionTypeRecipe(PotionTypeRecipe $recipe) : void
- CraftingManager->registerPotionContainerChangeRecipe(PotionContainerChangeRecipe $recipe) : void
The following classes have been added:
- BrewingRecipe
- PotionTypeRecipe
- PotionContainerChangeRecipe
- BrewItemEvent
- BrewingFuelUseEvent
- PotionFinishBrewingSound
2022-01-22 16:54:58 +00:00
Dylan K. Taylor
aa6bd4438a Replace disallowed operators in src/event/ 2022-01-20 19:17:17 +00:00
Dylan K. Taylor
86bcc49972 Merge branch 'stable' into next-minor 2022-01-20 16:30:49 +00:00
Dylan K. Taylor
a67aef0477 PlayerInteractEvent: updated documentation 2022-01-20 16:10:37 +00:00
Dylan K. Taylor
088745cf3b Implemented ChestPairEvent
closes #2829
2022-01-19 22:08:06 +00:00
Dylan K. Taylor
a0bb7059c1 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-19 19:48:51 +00:00
Dylan K. Taylor
858024afb7 Remove useless docs noticed by php-cs-fixer 3.5 2022-01-18 00:24:12 +00:00
Dylan K. Taylor
661848c5e7 fix more EOF newlines 2022-01-07 20:39:43 +00:00
Dylan K. Taylor
75fc7a2d1f Merge branch 'stable' into next-minor 2022-01-07 20:16:35 +00:00
Dylan K. Taylor
6d249026cc Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
Dries C
95b6cb21f2 Implement BlockMeltEvent (#4666) 2021-12-27 16:36:59 +00:00
XenialDan
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
Dylan K. Taylor
a94b88424e Merge branch 'stable' into next-minor 2021-12-10 19:15:57 +00:00
Dylan K. Taylor
bcf8a3424c Merge branch 'legacy/pm3' into stable 2021-12-10 18:02:06 +00:00
Dylan K. Taylor
5b868e6d5e Merge branch 'stable' into next-minor 2021-12-08 19:40:25 +00:00
Dylan K. Taylor
3d9e19546f EntityShootBowEvent: fixed incorrect field type 2021-12-07 23:35:45 +00:00
Rush2929
8f2ca92f02 Implement dropped item merging (#4419)
- The following classes have been added:
  - `ItemMergeEvent`
  - `ItemEntityStackSizeChangeAnimation`
- The following API methods have been added:
  - `ItemEntity->isMergeable()`
  - `ItemEntity->tryMergeInto()`
  - `ItemEntity->setStackSize()`
2021-12-06 22:23:18 +00:00
Hashim
f066199971 Implement emote support (#4523) 2021-11-02 23:04:55 +00:00
Dylan K. Taylor
e34364412b Replace InvalidStateException usages with InvalidArgument or LogicException 2021-11-02 16:05:54 +00:00
Dylan K. Taylor
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
Matt
09715906c8 StructureGrowEvent: added API to get the player who caused the growth (#4445) 2021-10-09 22:51:46 +01:00
Dylan K. Taylor
f138004913 PlayerDeathEvent: fixed property type variance issue PHPStan complains about 2021-09-26 21:20:42 +01:00
Cosmic
710345d4b0 Implemented Farmland turns to dirt when jumped on. (#4434) 2021-09-06 12:55:52 +01:00
Colin
2139171a55 added BlockItemPickupEvent class (#4402) 2021-08-29 00:40:09 +01:00
Colin
4189fbdaef Added StructureGrowEvent (#4354)
This event is currently fired for tree and bamboo growth. Its intended use is for any plant growth that affects multiple blocks at once.

TODO: We could explore using this for cacti and sugarcane?
2021-08-25 14:05:30 +01:00
marshall
6e68e99ec0 Added PlayerEntityInteractEvent (#4374) 2021-08-24 11:56:10 +01:00
Rush2929
eb9188c309 Replace InventoryPickup*Event with EntityItemPickupEvent (#4384)
The rationale here is that inventories don't actually pick items up - their holders do.
It's especially misleading to say that an inventory is picking up an item in creative mode when the picked-up item can't actually be added to the target inventory in the first place.

This change allows a range of new functionality, such as:
- Allowing survival players to pick items up even when their inventories are full, similarly to creative players
- Changing the destination inventory of collected items (e.g. items could be redirected to the offhand or ender chest inventory, while still allowing other plugins to understand what's happening)

As an added bonus, this obsoletes one more use case for Inventory->getHolder(), bringing us one step closer to removing the cyclic reference nightmare from inventories.

The choice of naming (EntityItemPickup, instead of EntityPickupItem) is to be consistent with other events, where the word order is SubjectObjectActionEvent.
2021-08-20 22:59:35 +01:00
Dylan K. Taylor
d488c25a1a Rename AutoUpdater -> UpdateChecker 2021-08-20 19:54:08 +01:00
Dylan K. Taylor
789a669395 Rename TranslationContainer -> Translatable 2021-08-15 16:17:46 +01:00
Dylan K. Taylor
2ad5de379f HandlerListManager::unregisterAll() accepts RegisteredListener
since all this function is doing is passing the object on to the HandlerList, it should accept RegisteredListener, like HandlerList::unregister().
2021-08-10 15:28:11 +01:00
Dylan K. Taylor
b4c0ddd155 Use native union types for TranslationContainer|string 2021-08-10 15:17:26 +01:00