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

31 lines
949 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;
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);
}
}
}