Arcturus-Community/src/main/java/com/eu/habbo/messages/incoming/rooms/items/TriggerOneWayGateEvent.java

28 lines
941 B
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
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;
2019-05-26 20:14:53 +02:00
public class TriggerOneWayGateEvent extends MessageHandler {
2018-07-06 15:30:00 +02:00
@Override
2019-05-26 20:14:53 +02:00
public void handle() throws Exception {
if (this.client.getHabbo().getHabboInfo().getCurrentRoom() == null)
2018-07-06 15:30:00 +02:00
return;
int itemId = this.packet.readInt();
HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId);
2019-05-26 20:14:53 +02:00
if (item == null)
2018-07-06 15:30:00 +02:00
return;
2019-05-26 20:14:53 +02:00
if (item instanceof InteractionOneWayGate) {
if (!item.getExtradata().equals("0") || this.client.getHabbo().getRoomUnit().isTeleporting)
2018-07-06 15:30:00 +02:00
return;
item.onClick(this.client, this.client.getHabbo().getHabboInfo().getCurrentRoom(), null);
}
}
}