Arcturus-Community/src/main/java/com/eu/habbo/messages/incoming/rooms/items/TriggerOneWayGateEvent.java
2019-05-26 21:15:26 +03:00

28 lines
941 B
Java

package com.eu.habbo.messages.incoming.rooms.items;
import com.eu.habbo.habbohotel.items.interactions.InteractionOneWayGate;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.incoming.MessageHandler;
public class TriggerOneWayGateEvent extends MessageHandler {
@Override
public void handle() throws Exception {
if (this.client.getHabbo().getHabboInfo().getCurrentRoom() == null)
return;
int itemId = this.packet.readInt();
HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId);
if (item == null)
return;
if (item instanceof InteractionOneWayGate) {
if (!item.getExtradata().equals("0") || this.client.getHabbo().getRoomUnit().isTeleporting)
return;
item.onClick(this.client, this.client.getHabbo().getHabboInfo().getCurrentRoom(), null);
}
}
}