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

28 lines
1.1 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.messages.outgoing.rooms.users.RoomUserHandItemComposer;
2019-05-26 20:14:53 +02:00
public class HandItemCommand extends Command {
public HandItemCommand() {
2018-07-06 15:30:00 +02:00
super("cmd_hand_item", Emulator.getTexts().getValue("commands.keys.cmd_hand_item").split(";"));
}
@Override
2019-05-26 20:14:53 +02: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 15:30:00 +02:00
}
}
return true;
}
}