2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.habbohotel.items.interactions;
|
|
|
|
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
|
|
|
import com.eu.habbo.habbohotel.items.Item;
|
|
|
|
import com.eu.habbo.habbohotel.rooms.Room;
|
2019-05-04 11:22:20 +02:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
2018-07-06 15:30:00 +02:00
|
|
|
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
|
|
|
|
import java.sql.ResultSet;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
public class InteractionTeleportTile extends InteractionTeleport
|
|
|
|
{
|
|
|
|
public InteractionTeleportTile(ResultSet set, Item baseItem) throws SQLException
|
|
|
|
{
|
|
|
|
super(set, baseItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
public InteractionTeleportTile(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells)
|
|
|
|
{
|
|
|
|
super(id, userId, item, extradata, limitedStack, limitedSells);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2018-09-12 18:45:00 +02:00
|
|
|
|
2019-05-04 11:22:20 +02:00
|
|
|
@Override
|
|
|
|
public boolean isWalkable() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-09-12 18:45:00 +02:00
|
|
|
@Override
|
|
|
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception
|
|
|
|
{
|
2019-05-26 20:08:03 +02:00
|
|
|
if (roomUnit != null && this.canWalkOn(roomUnit, room, objects))
|
2018-09-12 18:45:00 +02:00
|
|
|
{
|
2019-05-26 20:08:03 +02:00
|
|
|
Habbo habbo = room.getHabbo(roomUnit);
|
2019-05-04 11:22:20 +02:00
|
|
|
|
2019-05-26 20:08:03 +02:00
|
|
|
if (habbo != null)
|
2018-09-12 18:45:00 +02:00
|
|
|
{
|
2019-05-26 20:08:03 +02:00
|
|
|
if(!canUseTeleport(habbo.getClient(), room))
|
|
|
|
return;
|
2018-09-12 18:45:00 +02:00
|
|
|
|
2019-05-26 20:08:03 +02:00
|
|
|
if (!habbo.getRoomUnit().isTeleporting)
|
2018-09-12 18:45:00 +02:00
|
|
|
{
|
2019-05-26 20:08:03 +02:00
|
|
|
habbo.getRoomUnit().setGoalLocation(habbo.getRoomUnit().getCurrentLocation());
|
|
|
|
this.startTeleport(room, habbo);
|
2018-09-12 18:45:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|