changed controls

This commit is contained in:
drPepper 2014-07-31 18:21:16 +04:00
parent 0cf81874b4
commit a98429e24a

View file

@ -52,6 +52,8 @@ public final class EntityCamera extends EntityLivingBase
private float oldFOV; private float oldFOV;
private float oldSens; private float oldSens;
private boolean isCentered = true;
public EntityCamera(World world, ChunkPosition pos, EntityPlayer player) public EntityCamera(World world, ChunkPosition pos, EntityPlayer player)
{ {
super(world); super(world);
@ -74,7 +76,6 @@ public final class EntityCamera extends EntityLivingBase
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) if (FMLCommonHandler.instance().getEffectiveSide().isClient())
{ {
mc.renderViewEntity.rotationYaw = player.rotationYaw; mc.renderViewEntity.rotationYaw = player.rotationYaw;
//mc.renderViewEntity.rotationYawHead = player.rotationYawHead;
mc.renderViewEntity.rotationPitch = player.rotationPitch; mc.renderViewEntity.rotationPitch = player.rotationPitch;
// Perform zoom // Perform zoom
@ -89,7 +90,7 @@ public final class EntityCamera extends EntityLivingBase
ClientCameraUtils.resetCam(); ClientCameraUtils.resetCam();
this.setDead(); this.setDead();
} }
else if (Keyboard.isKeyDown(Keyboard.KEY_SPACE) && fireWaitTicks-- == 0) else if (Mouse.isButtonDown(0) && fireWaitTicks-- == 0)
{ {
fireWaitTicks = 1; fireWaitTicks = 1;
@ -127,13 +128,19 @@ public final class EntityCamera extends EntityLivingBase
} }
else if (Keyboard.isKeyDown(Keyboard.KEY_C)) //centering view else if (Keyboard.isKeyDown(Keyboard.KEY_C)) //centering view
{ {
this.setPosition(xCoord + 0.5, yCoord + 0.75, zCoord + 0.5); isCentered = !isCentered;
return; return;
} }
} }
// this.setPosition(xCoord + dx, yCoord + dy, zCoord + dz); if (isCentered)
this.setPosition(xCoord + 0.5, yCoord + 0.75, zCoord + 0.5); {
this.setPosition(xCoord + 0.5, yCoord + 0.75, zCoord + 0.5);
} else {
this.setPosition(xCoord + dx, yCoord + dy, zCoord + dz);
}
} }
} }