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;
|
|
|
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserHandItemComposer;
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public class HandItemCommand extends Command {
|
|
|
|
public HandItemCommand() {
|
2018-07-06 13:30:00 +00:00
|
|
|
super("cmd_hand_item", Emulator.getTexts().getValue("commands.keys.cmd_hand_item").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
|
|
|
if (params.length == 2) {
|
|
|
|
try {
|
|
|
|
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
|
|
|
int effectId = Integer.parseInt(params[1]);
|
|
|
|
gameClient.getHabbo().getRoomUnit().setHandItem(effectId);
|
|
|
|
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserHandItemComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
//Don't handle incorrect parse exceptions :P
|
2018-07-06 13:30:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|