Spongeapi: Checking if a player (or entity?) is currently elytra-flying (DataManipulator)

Created on 20 Jul 2017  路  5Comments  路  Source: SpongePowered/SpongeAPI

There has to be a way to detect if a player/entity is currently flying with an elytra.
Something like:

Optional<Boolean> isFlying = player.get(Keys.IS_ELYTRA_FLYING);

Most helpful comment

@TBlueF Uh sorry, I haven't had a chance to be on much, but I will come back to this branch soon. If I can't find time in the next few days I'll just add the IS_ELYTRA_FLYING data for now since I think I have that done.

I'll probably create an issue on SpongeAPI with a larger proposal to see what people think of some of the others changes/additions I'd like to handle in these data manipulators.

All 5 comments

player.get(Keys.SUPER_STEVE)? @Meronat

ELYTRA_FLYING mode should probably be in the API in some manner, @connorhartley will need it for guardian.

@Meronat Do you know if you can set this independently of the player wearing elytra in Minecraft? I know it's possible to tell that to the client at least thanks to Lantern.

I'm wondering if it would be a failable data, or if it's more like a property in Vanilla MC.

Super Steve to the rescue! @ryantheleach

I agree blue. This is a key we have in lantern, and it would be useful in Sponge. Shouldn't be too hard to add either, I'll do it :)

What data manipulator should I put it in though? FlyingData or a new ElytraFlyingData?

@ryantheleach Hmm I will have to look into that. There is this method, not sure what it actually does yet though -
image

Almost have it implemented, now on to testing.

...

So it's all done, just having some issues with offering the value. I am missing something somewhere. Will try to finish this tomorrow.

...

So after going on a trip, I hope to come back to this soon. I finished the core idea actually, but ended up adding more data to allow players to fly elytra like without an elytra on. There is some cleanup I have to do and I might also add a key that can control whether they stop elytra flying once the player hits the ground.

Any news on this? :)

@TBlueF Uh sorry, I haven't had a chance to be on much, but I will come back to this branch soon. If I can't find time in the next few days I'll just add the IS_ELYTRA_FLYING data for now since I think I have that done.

I'll probably create an issue on SpongeAPI with a larger proposal to see what people think of some of the others changes/additions I'd like to handle in these data manipulators.

Closing in favor of Meronat's proposal found here: https://github.com/SpongePowered/SpongeAPI/issues/1663

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lesbleu picture lesbleu  路  4Comments

Lergin picture Lergin  路  5Comments

JonathanBrouwer picture JonathanBrouwer  路  6Comments

kashike picture kashike  路  3Comments

Katrix picture Katrix  路  3Comments