Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(KeyInputHandler.claxon.isPressed()) {
- player.sendMessage(new TextComponentString("CLAXOOOONNNN"));
- return true;
- }else {
- switch (key) {
- case 0: // Accelerate : Increase the throttle, up to 1.
- {
- throttle += 0.01F;
- if (throttle > 1F)
- throttle = 1F;
- return true;
- }
- case 1: // Decelerate : Decrease the throttle, down to -1, or 0 if the vehicle cannot reverse
- {
- throttle -= 0.01F;
- if (throttle < -1F)
- throttle = -1F;
- if (throttle < 0F && type.maxNegativeThrottle == 0F)
- throttle = 0F;
- return true;
- }
- case 2: // Left : Yaw the wheels left
- {
- wheelsYaw -= 1F;
- return true;
- }
- case 3: // Right : Yaw the wheels right
- {
- wheelsYaw += 1F;
- return true;
- }
- case 4: // Up : Brake
- {
- throttle *= 0.8F;
- if (onGround) {
- motionX *= 0.8F;
- motionZ *= 0.8F;
- }
- return true;
- }
- case 7: //Inventory
- {
- if (world.isRemote) {
- FlansMod.proxy.openDriveableMenu((EntityPlayer) getSeat(0).getControllingPassenger(), world, this);
- }
- return true;
- }
- case 14: // Door
- {
- if (toggleTimer <= 0) {
- varDoor = !varDoor;
- if (type.hasDoor)
- player.sendMessage(new TextComponentString("Doors " + (varDoor ? "open" : "closed")));
- toggleTimer = 10;
- FlansMod.getPacketHandler().sendToServer(new PacketVehicleControl(this));
- }
- return true;
- }
- default: {
- return super.pressKey(key, player, isOnEvent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement