Skip to content

Commit

Permalink
Better velocity settings for Normalized Speed
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkArc committed Nov 10, 2012
1 parent 32e2b97 commit 766c5d1
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -233,10 +233,7 @@ public void onVehicleMove(VehicleMoveEvent event) {
&& RailUtil.isTrack(event.getTo().getBlock().getTypeId())
&& event.getVehicle().getVelocity().lengthSquared() > 0) {
Vector vel = event.getVehicle().getVelocity();
if (vel.getX() > 0) vel.setX(config.minecartConstantSpeed);
if (vel.getY() > 0) vel.setY(config.minecartConstantSpeed);
if (vel.getZ() > 0) vel.setZ(config.minecartConstantSpeed);
event.getVehicle().setVelocity(vel);
event.getVehicle().setVelocity(vel.normalize().multiply(config.minecartConstantSpeed));
}

cartman.impact(event);
Expand Down

0 comments on commit 766c5d1

Please sign in to comment.