Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTeleportTile.java

47 lines
1.5 KiB
Java
Raw Normal View History

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