Package com.mtbs3d.minecrift.control

Source Code of com.mtbs3d.minecrift.control.WalkForwardBinding

/**
* Copyright 2013 Mark Browning, StellaArtois
* Licensed under the LGPL 3.0 or later (See LICENSE.md for details)
*/
package com.mtbs3d.minecrift.control;

import net.minecraft.src.EntityClientPlayerMP;
import net.minecraft.src.Minecraft;

public class WalkForwardBinding extends ControlBinding {
  public WalkForwardBinding() {
    super("key.forward","walk.forward");
  }

  @Override
  public void setValue(float value) {
        EntityClientPlayerMP thePlayer = Minecraft.getMinecraft().thePlayer;
        if( thePlayer != null )
          thePlayer.movementInput.baseMoveForward = Math.abs(value);
   
  }

  @Override
  public void setState(boolean state) {
    setValue( state ? Minecraft.getMinecraft().vrSettings.movementSpeedMultiplier: 0.0f );
  }
}
TOP

Related Classes of com.mtbs3d.minecrift.control.WalkForwardBinding

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.