Commit Graph

21 Commits

Author SHA1 Message Date
38afe22b79 Move Event cancellable parts to trait 2019-01-16 22:14:25 +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
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +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
8cae20e818 Removed hotbar slot linking (works like PC now) 2017-09-19 18:36:57 +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
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
598e7aac8f More PhpStorm inspections, import cleanup 2017-01-04 14:55:11 +00: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
62af784d37 Removed unused imports 2014-10-08 17:00:23 +02:00
c40f9f65a5 Optimize imports 2014-08-26 11:54:24 +02:00
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
279a438ae6 Fixed spawning of Tile entities via chunk packets 2014-06-22 18:05:42 +02:00
fa50cbf4b3 Working Threaded Generation 2014-06-10 20:45:09 +02:00
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
7cd29f0fcf Added block updates, correct block placing 2014-04-02 05:36:45 +02:00
7e9304a0c9 Formatting 2014-04-01 19:48:28 +02:00
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00