10 Commits

Author SHA1 Message Date
Dylan K. Taylor
78dfcc5f2d Move Effect and EffectInstance to entity\effect namespace 2019-01-28 15:41:07 +00:00
Dylan K. Taylor
eb0276d459 Apply nullable and void typehints to events namespace 2018-06-11 13:49:16 +01:00
Dylan K. Taylor
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +01:00
SOFe
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
Dylan K. Taylor
dc3bf8546e Refactored effects handling, split up concerns of effect types and instances
Removed json insanity for effects

Split up effect types and effect instances

Saturation is an instant effect
2018-03-07 12:42:31 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
21f09d5fdb Cleaned up Effect handling and replacement 2017-08-30 12:53:41 +01:00
Dylan K. Taylor
adc6b03d4c Typehinted up Entity API and some cleanup 2017-08-30 12:17:56 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
JackNoordhuis
5d16ecc003 Entity Effect Events (#141)
Add EntityEffectEvent class that the EntityEffectAddEvent and
EntityEffectRemoveEvent classes extend. Add event calls to Effect class.
2016-12-06 11:59:49 +00:00