Reverted vehicle class back to "we have movement" commit
Not sure what i did but i changed just enough that nothing was working
This commit is contained in:
parent
372c83dc34
commit
3387b2a3d2
1 changed files with 3 additions and 22 deletions
|
@ -40,7 +40,7 @@ public class EntityDrivable extends EntityAdvanced implements IControlReceiver
|
||||||
@Override
|
@Override
|
||||||
public boolean keyTyped(EntityPlayer player, int keycode)
|
public boolean keyTyped(EntityPlayer player, int keycode)
|
||||||
{
|
{
|
||||||
System.out.println("Key: " + keycode + " P: " + (player != null ? player.username : "null"));
|
System.out.println("Key: "+keycode+" P: " + (player != null ? player.username : "null"));
|
||||||
if (player != null && this.riddenByEntity instanceof EntityPlayer && ((EntityPlayer) this.riddenByEntity).username.equalsIgnoreCase(player.username))
|
if (player != null && this.riddenByEntity instanceof EntityPlayer && ((EntityPlayer) this.riddenByEntity).username.equalsIgnoreCase(player.username))
|
||||||
{
|
{
|
||||||
//TODO add auto forward and backwards keys like those in WoT
|
//TODO add auto forward and backwards keys like those in WoT
|
||||||
|
@ -48,22 +48,18 @@ public class EntityDrivable extends EntityAdvanced implements IControlReceiver
|
||||||
{
|
{
|
||||||
player.sendChatToPlayer(ChatMessageComponent.createFromText("Forward we go!"));
|
player.sendChatToPlayer(ChatMessageComponent.createFromText("Forward we go!"));
|
||||||
this.accelerate(true);
|
this.accelerate(true);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindBack.keyCode)
|
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindBack.keyCode)
|
||||||
{
|
{
|
||||||
this.accelerate(false);
|
this.accelerate(false);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindLeft.keyCode)
|
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindLeft.keyCode)
|
||||||
{
|
{
|
||||||
this.turn(true);
|
this.rotationYaw += 6;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindRight.keyCode)
|
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindRight.keyCode)
|
||||||
{
|
{
|
||||||
this.turn(false);
|
this.rotationYaw -= 6;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
//Power brakes
|
//Power brakes
|
||||||
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindJump.keyCode)
|
if (keycode == Minecraft.getMinecraft().gameSettings.keyBindJump.keyCode)
|
||||||
|
@ -73,7 +69,6 @@ public class EntityDrivable extends EntityAdvanced implements IControlReceiver
|
||||||
{
|
{
|
||||||
speed = 0;
|
speed = 0;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -88,8 +83,6 @@ public class EntityDrivable extends EntityAdvanced implements IControlReceiver
|
||||||
double deltaX = Math.cos(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D;
|
double deltaX = Math.cos(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D;
|
||||||
double deltaZ = Math.sin(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D;
|
double deltaZ = Math.sin(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D;
|
||||||
this.riddenByEntity.setPosition(this.posX + deltaX, this.posY + this.riddenByEntity.getYOffset(), this.posZ + deltaZ);
|
this.riddenByEntity.setPosition(this.posX + deltaX, this.posY + this.riddenByEntity.getYOffset(), this.posZ + deltaZ);
|
||||||
|
|
||||||
this.riddenByEntity.rotationYaw = this.rotationYaw;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,18 +174,6 @@ public class EntityDrivable extends EntityAdvanced implements IControlReceiver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void turn(boolean left)
|
|
||||||
{
|
|
||||||
if (left)
|
|
||||||
{
|
|
||||||
this.rotationYaw -= 6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.rotationYaw += 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** By default this slows the vehicle down with a constant. However this can be used to apply
|
/** By default this slows the vehicle down with a constant. However this can be used to apply
|
||||||
* advanced friction based on materials */
|
* advanced friction based on materials */
|
||||||
public void applyFriction()
|
public void applyFriction()
|
||||||
|
|
Loading…
Reference in a new issue