@Override public void handle(Session client, MessageEvent msg) throws Exception { int itemId = msg.readInt(); RoomItemWall item = client.getPlayer().getEntity().getRoom().getItems().getWallItem(itemId); if (item == null) { return; } if (!client.getPlayer().getEntity().isVisible()) { return; } item.onInteract(client.getPlayer().getEntity(), 0, false); }
public void handle(Session client, MessageEvent msg) { int danceId = msg.readInt(); if (client.getPlayer().getEntity().getDanceId() == danceId) { return; } client.getPlayer().getEntity().unIdle(); if (!client.getPlayer().getEntity().isVisible()) { return; } client.getPlayer().getEntity().setDanceId(danceId); client .getPlayer() .getEntity() .getRoom() .getEntities() .broadcastMessage( new DanceMessageComposer(client.getPlayer().getEntity().getId(), danceId)); client.getPlayer().getQuests().progressQuest(QuestType.SOCIAL_DANCE); }