Skip to content

Commit

Permalink
CreativeFly: Test if the player is gliding with elytra not just wearing.
Browse files Browse the repository at this point in the history
While i can't use the elytra while in creative mode, others might be
able to do so with a plugin.
  • Loading branch information
asofold committed May 2, 2017
1 parent bd370ba commit 2cca81f
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -448,9 +448,9 @@ public ModelFlying getModelFlying(final Player player, final PlayerLocation from
return modelGameMode;
}
// TODO: Short touch of water/vines (/ground?) is possible - use past moves or in-medium-count.
final boolean isUsingElytra = Bridge1_9.isWearingElytra(player);
final boolean isGlidingWithElytra = Bridge1_9.isGlidingWithElytra(player);
if (player.isFlying()
|| !isUsingElytra && !ignoreAllowFlight && player.getAllowFlight()) {
|| !isGlidingWithElytra && !ignoreAllowFlight && player.getAllowFlight()) {
return modelGameMode;
}
// TODO: ORDER IS RANDOM GUESSING. Is mixtures possible?
Expand All @@ -465,7 +465,7 @@ public ModelFlying getModelFlying(final Player player, final PlayerLocation from
// TODO: INCONSISTENT.
return modelGameMode;
}
if (isUsingElytra) { // Defensive: don't demand isGliding.
if (isGlidingWithElytra) { // Defensive: don't demand isGliding.
return flyingModelElytra;
}
// Default by game mode.
Expand Down

0 comments on commit 2cca81f

Please sign in to comment.