Rewritten Projectile movement handling, added ProjectileHitBlockEvent and ProjectileHitEntityEvent, fixed a swathe of arrow-related bugs

I usually avoid mega-commits, but one thing led to another.
This commit is contained in:
Dylan K. Taylor
2018-03-08 12:23:03 +00:00
parent c1a2144f60
commit 8cc6a32a04
7 changed files with 345 additions and 102 deletions

View File

@ -355,7 +355,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
protected $lastDamageCause = null;
/** @var Block[] */
private $blocksAround = [];
protected $blocksAround = [];
/** @var float|null */
public $lastX = null;
@ -1387,7 +1387,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
* Returns whether the entity needs a movement update on the next tick.
* @return bool
*/
final public function hasMovementUpdate() : bool{
public function hasMovementUpdate() : bool{
return (
$this->forceMovementUpdate or
$this->motionX != 0 or