2018-09-28 19:25:00 +00:00
|
|
|
package com.eu.habbo.habbohotel.commands;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
2019-05-16 20:11:11 +03:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
2019-05-16 20:46:25 +03:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
2018-09-28 19:25:00 +00:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
2019-05-16 20:11:11 +03:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
|
2019-05-16 20:46:25 +03:00
|
|
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
2019-05-16 20:11:11 +03:00
|
|
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
|
|
|
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
2018-09-28 19:25:00 +00:00
|
|
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
|
2019-05-16 20:11:11 +03:00
|
|
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
|
|
|
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
|
2019-05-16 20:46:25 +03:00
|
|
|
import com.eu.habbo.threading.runnables.RoomUnitTeleport;
|
2018-09-28 19:25:00 +00:00
|
|
|
|
|
|
|
public class InvisibleCommand extends Command
|
|
|
|
{
|
|
|
|
public InvisibleCommand()
|
|
|
|
{
|
|
|
|
super("cmd_invisible", Emulator.getTexts().getValue("commands.keys.cmd_invisible").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception
|
|
|
|
{
|
|
|
|
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
|
|
|
|
|
2019-05-16 20:11:11 +03:00
|
|
|
if (roomUnit.isInvisible()) {
|
|
|
|
RoomLayout roomLayout = roomUnit.getRoom().getLayout();
|
2018-09-28 19:25:00 +00:00
|
|
|
|
2019-05-16 20:46:25 +03:00
|
|
|
new RoomUnitTeleport(roomUnit, roomUnit.getRoom(), roomLayout.getDoorTile().x, roomLayout.getDoorTile().y, roomLayout.getDoorTile().z, 0).run();
|
|
|
|
|
2019-05-16 20:11:11 +03:00
|
|
|
roomUnit.setInvisible(false);
|
|
|
|
roomUnit.setInRoom(true);
|
|
|
|
|
|
|
|
roomUnit.getRoom().sendComposer(new RoomUsersComposer(gameClient.getHabbo()).compose());
|
|
|
|
roomUnit.getRoom().sendComposer(new RoomUserStatusComposer(roomUnit).compose());
|
|
|
|
|
|
|
|
WiredHandler.handle(WiredTriggerType.ENTER_ROOM, roomUnit, roomUnit.getRoom(), null);
|
|
|
|
roomUnit.getRoom().habboEntered(gameClient.getHabbo());
|
2018-09-28 19:25:00 +00:00
|
|
|
|
2019-05-16 20:11:11 +03:00
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated.back"));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
roomUnit.setInvisible(true);
|
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
|
2018-09-28 19:25:00 +00:00
|
|
|
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|