Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THROWER and PROJECTILE_SOURCE EventContextKeys #1774

Closed
RedNesto opened this issue Feb 9, 2018 · 4 comments
Closed

THROWER and PROJECTILE_SOURCE EventContextKeys #1774

RedNesto opened this issue Feb 9, 2018 · 4 comments

Comments

@RedNesto
Copy link
Contributor

RedNesto commented Feb 9, 2018

During the implementation of the LaunchProjectileEvent, I saw there were two EventContextKeys that can be used for the same event: THROWER and PROJECTILE_SOURCE.

What is the difference between these?

I don't see any to be honest. For me, PROJECTILE_SOURCE is more general than THROWER (which may imply a projectile launched by hand to me, but still a projectile), so if we need to remove one, I would remove THROWER.

@ImMorpheus
Copy link
Contributor

ImMorpheus commented Feb 9, 2018

From what I see, PROJECTILE_SOURCE is only used here as the second parameter of the method handleCollideImpactEvent.
This method is called:
MixinEntityThrowable with the argument this.getShooter()
MixinEntityArrow with the argument getShooter()
MixinEntityFireball with the argument this.getShooter()

But, when added as a context key in the CSM getShooter() is always the EventContextKeys.THROWER: MixinEntityLargeFireball, MixinEntityWitherSkull, MixinEntityFireworkRocket, ...

So, yeah... They represent the same thing.

@Zidane
Copy link
Member

Zidane commented Feb 10, 2018

We need to just go with Projectile_Source for API 8.

@ryantheleach
Copy link
Contributor

Should we deprecate thrower asap then, with the note that Projectile_Source replaces it in API 8 ?

@parlough
Copy link
Contributor

This has been solved with #1779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants