mirror of
https://github.com/chylex/Better-Controls.git
synced 2025-02-20 20:45:59 +01:00
Fix interfering with sprint speed boost during survival mode flight
Closes #35
This commit is contained in:
parent
ba0d04ba51
commit
767ab9cb7d
src/main/java/chylex/bettercontrols
@ -32,7 +32,7 @@ public abstract class HookPlayerHorizontalFlightSpeed extends LivingEntity {
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
Player me = (Player)(Object)this;
|
||||
|
||||
if (me instanceof LocalPlayer) {
|
||||
if (me instanceof LocalPlayer localPlayer && FlightHelper.isFlyingCreativeOrSpectator(localPlayer)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
@ -19,7 +19,7 @@ public final class FlightHelper {
|
||||
return BetterControlsCommon.getConfig();
|
||||
}
|
||||
|
||||
static boolean isFlyingCreativeOrSpectator(LocalPlayer player) {
|
||||
public static boolean isFlyingCreativeOrSpectator(LocalPlayer player) {
|
||||
return player.getAbilities().flying && (player.isCreative() || player.isSpectator());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user