Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/commands/FastwalkCommand.java

38 lines
1.2 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
2019-05-26 20:14:53 +02:00
public class FastwalkCommand extends Command {
public FastwalkCommand() {
2018-07-06 15:30:00 +02:00
super("cmd_fastwalk", Emulator.getTexts().getValue("commands.keys.cmd_fastwalk").split(";"));
}
@Override
2019-05-26 20:14:53 +02:00
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getRiding() != null) //TODO Make this an event plugin which fires that can be cancelled
2019-05-26 20:14:53 +02:00
return true;
}
2018-07-06 15:30:00 +02:00
Habbo habbo = gameClient.getHabbo();
2019-05-26 20:14:53 +02:00
if (params.length >= 2) {
2018-07-06 15:30:00 +02:00
String username = params[1];
habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
2019-05-26 20:14:53 +02:00
if (habbo == null)
2018-07-06 15:30:00 +02:00
return false;
}
habbo.getRoomUnit().setFastWalk(!habbo.getRoomUnit().isFastWalk());
return true;
}
return false;
}
}