Commit Graph

38 Commits

Author SHA1 Message Date
2ffc38c835 Implement campfire & soul campfire (#4696) 2024-07-07 15:01:34 -05:00
8814d06dfd Fix CS 2023-08-23 17:00:18 +01:00
998fcf20db Remove useless Cancellable from PressurePlateUpdateEvent 2023-08-23 16:52:22 +01:00
e323c5dd76 Implement pressure plate activation logic and events (#5991)
closes #5936

This implements all of the basic activation logic for pressure plates.
It also introduces a PressurePlateUpdateEvent, which is called in pulses when entities are standing on top of the plate and when it deactivates. Deactivation can be detected by checking if the list of activating entities is empty.

---------

Co-authored-by: Javier León <58715544+JavierLeon9966@users.noreply.github.com>
2023-08-16 13:00:23 +01:00
a5d8ef7a6c Add FarmlandHydrationChangeEvent (#5916) 2023-08-09 12:33:25 +01:00
9d0d60afd1 BlockPlaceEvent: ensure that getPosition() is always correct
since BlockTransaction was designed to be World-agnostic, it can't position() any blocks, since Position requires a World.

This workaround is the best we can do for now; however, it would probably be wise to deprecate getTransaction() in favour of a dedicated getBlocks() method which takes care of this, as BlockPlaceEvent is currently quite obnoxious to use.
2023-06-21 15:36:48 +01:00
40be564689 BlockSpreadEvent: document poorly-named constructor parameters 2023-06-03 17:08:02 +01:00
d834266635 BlockGrowEvent: add player information for bonemeal usage (#5596)
this is in line with StructureGrowEvent, which also has a similar API.
2023-05-08 17:38:07 +01:00
cbaff1caec BlockPlaceEvent: use BlockTransaction, closes #1760
BlockPlaceEvent no longer extends BlockEvent, since it's now a multi-block event
getBlockReplaced() is removed
getTransaction() is added

to be honest, BlockPlaceEvent should be something like PlayerBlockPlaceEvent...
2023-01-24 15:49:42 +00:00
b6982a84ef Merge branch 'next-minor' into next-major 2022-11-25 14:52:56 +00:00
d79e6354a0 Merge branch 'stable' into next-minor 2022-11-25 14:41:05 +00:00
e5f5fe80f9 BlockGrowEvent: Remove unnecessary Cancellable implementation (#5359)
this is already implemented by BaseBlockChangeEvent
2022-11-23 13:29:23 +00:00
36ab34df29 Implement BlockDeathEvent (#5420)
closes #4711
2022-11-23 12:57:26 +00:00
8dc0d506f4 Merge branch 'next-minor' into next-major 2022-10-11 22:29:21 +01: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
304bb84af2 BlockFormEvent: Added getCausingBlock() method (#5226) 2022-08-15 16:26:48 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +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
f97ce6afef Harden APIs which accept Vector3/Position/Location in event namespace 2022-03-09 22:22:37 +00:00
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
088745cf3b Implemented ChestPairEvent
closes #2829
2022-01-19 22:08:06 +00:00
a0bb7059c1 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-19 19:48:51 +00:00
858024afb7 Remove useless docs noticed by php-cs-fixer 3.5 2022-01-18 00:24:12 +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
95b6cb21f2 Implement BlockMeltEvent (#4666) 2021-12-27 16:36:59 +00:00
09715906c8 StructureGrowEvent: added API to get the player who caused the growth (#4445) 2021-10-09 22:51:46 +01:00
2139171a55 added BlockItemPickupEvent class (#4402) 2021-08-29 00:40:09 +01:00
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
69fa8e8db7 Added documentation to BlockFormEvent 2021-05-19 00:17:39 +01:00
f8cfa191dd Fixed confusing hierarchy of BlockGrow/Form/SpreadEvent, closes #2792 2021-05-19 00:17:38 +01:00
3e1ac66abf Merge branch 'stable' 2021-02-02 13:46:29 +00:00
d3a3a41d2b Revert back to separated floor/wall sign
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
055b13a6cf strip extra blank lines (php-cs-fixer) 2020-01-22 15:14:10 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00