Commit Graph

21 Commits

Author SHA1 Message Date
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
49fbbea7bf Implemented event handler inheritance, allow registering handlers for any valid event (#1792)
* Event handlers always handle subclass events. public static $handlerList no longer required.
* Removed $handlerList declarations
* HandlerList cleanup: Removed HandlerList->handlers and related bake methods
* Removed obsolete Event->getHandlers()
* EventPriority: Added fromString()
* PluginManager: throw exceptions on registering handlers with invalid priorities

This allows specifying a handler of `EntityDamageEvent` which will handle any instanceof it (as per current behaviour), AND also now allows specifying a handler specifically for `EntityDamageByEntityEvent`, which only handles `EntityDamageEvent`.

This was not previously possible due to limitations in the way handlers were registered.

Abstract events may not be handled unless they declare the `@allowHandle` PhpDoc tag.
2018-03-20 17:05:09 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
d0bf0ff083 Imports cleanup 2017-09-28 10:51:05 +01:00
6cd4d2c5a2 Added typehints and PhpDoc for events API
excluded blocks and entities events API to avoid merge conflicts
2017-07-05 16:42:06 +01:00
a73c6f1861 Fixed some unnecessary FQNs in docs 2017-06-25 12:43:04 +01:00
846be84324 Fixed all file headers 2017-06-16 16:18:16 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
c21197ef17 Removed entanglement between chunks and providers. WARNING: BREAKING API CHANGES.
- All entity and tile constructors now require a \pocketmine\level\Level instead of a \pocketmine\level\format\Chunk.
- Chunk->getProvider() and Chunk->setProvider() have been removed.
- Chunk::__construct() has had the $provider parameter removed.
- Chunk->unload() has had the unused $save parameter removed.
- ChunkEvents now take a Level parameter instead of going through the Chunk

API bump to 3.0.0-ALPHA4
2017-02-21 17:08:45 +00:00
4c49db6036 New generic in-memory chunk format, fixed 0.17.0.1 chunk loading
Terrible performance, needs profiling. TODO: fix this.
2016-11-27 21:57:59 +00:00
98d129f1f4 Fix bad copy-paste job, blame @shoghicp 2016-10-01 14:54:50 +01:00
7d406066a7 Added outdated event static properties 2015-01-11 19:37:21 +01:00
350cee3d41 Added Event allocation pool, updated SPL with Class::onClassLoaded() 2014-10-28 10:47:40 +01:00
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
269a10fadd Modified Level and Chunk deprecated methods 2014-08-06 16:22:55 +02:00
eee7e659e9 Added ChunkLoadEvent, ChunkUnloadEvent, ChunkPopulateEvent 2014-08-02 17:19:33 +02:00
1b6fcf7942 Added LevelLoadEvent 2014-07-06 00:07:42 +02:00
cbbdb42092 Added LevelUnloadEvent 2014-07-06 00:06:03 +02:00
81492acb0c Added LevelSaveEvent 2014-07-06 00:02:27 +02:00
6576c88a08 Added LevelInitEvent 2014-07-06 00:01:05 +02:00
387677e957 Level rewrite middle step 2014-05-22 17:53:56 +02:00