diff --git a/src/main/java/com/hamusuke/flycommod/command/CommandEntityAbilities.java b/src/main/java/com/hamusuke/flycommod/command/CommandEntityAbilities.java index 219dd63..d0aac02 100644 --- a/src/main/java/com/hamusuke/flycommod/command/CommandEntityAbilities.java +++ b/src/main/java/com/hamusuke/flycommod/command/CommandEntityAbilities.java @@ -29,7 +29,7 @@ public static void register(CommandDispatcher dispatcher) { private static int noGravity(ServerCommandSource source, Collection entities, boolean flag) { entities.forEach((entity) -> { entity.setNoGravity(flag); - if (flag) { + if (!flag) { entity.fallDistance = -(float) (entity.getY() + 10.0D); } }); @@ -78,4 +78,4 @@ private static int setInvisible(ServerCommandSource source, Collection too public TypedActionResult use(World world, PlayerEntity playerIn, Hand handIn) { ItemStack item = playerIn.getStackInHand(handIn); - if(!playerIn.abilities.allowFlying) { + if (!playerIn.abilities.allowFlying) { playerIn.abilities.allowFlying = true; playerIn.sendAbilitiesUpdate(); - }else { + } else { playerIn.abilities.allowFlying = false; playerIn.abilities.flying = false; playerIn.sendAbilitiesUpdate(); - playerIn.fallDistance = -(float)(playerIn.getY() + 10.0D); + playerIn.fallDistance = -(float) (playerIn.getY() + 10.0D); } return new TypedActionResult<>(ActionResult.SUCCESS, item); }