mirror of
https://github.com/chylex/Better-Controls.git
synced 2025-08-18 19:24:59 +02:00
Fix interfering with sprint speed boost during survival mode flight
Closes #35
This commit is contained in:
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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user