2018-07-06 13:30:00 +00:00
|
|
|
package com.eu.habbo.habbohotel.commands;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
2018-09-12 16:45:00 +00:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
2018-07-06 13:30:00 +00:00
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public class SitDownCommand extends Command {
|
|
|
|
public SitDownCommand() {
|
2018-07-06 13:30:00 +00:00
|
|
|
super("cmd_sitdown", Emulator.getTexts().getValue("commands.keys.cmd_sitdown").split(";"));
|
|
|
|
}
|
2019-05-26 21:14:53 +03:00
|
|
|
|
2018-07-06 13:30:00 +00:00
|
|
|
@Override
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
|
|
|
for (Habbo habbo : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos()) {
|
|
|
|
if (habbo.getRoomUnit().isWalking()) {
|
2018-07-06 13:30:00 +00:00
|
|
|
habbo.getRoomUnit().stopWalking();
|
2019-05-26 21:14:53 +03:00
|
|
|
} else if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) {
|
2018-07-06 13:30:00 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(habbo);
|
|
|
|
}
|
2019-05-26 21:14:53 +03:00
|
|
|
|
2018-07-06 13:30:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|