RuneHive-Game
Loading...
Searching...
No Matches
TeleportTablet.java
Go to the documentation of this file.
1package com.runehive.content.teleport;
2
3import com.runehive.Config;
4import com.runehive.game.world.position.Position;
5
6import java.util.Arrays;
7import java.util.Optional;
8
9/**
10 * Holds all the teleport tablet data.
11 *
12 * @author Daniel
13 */
14public enum TeleportTablet {
15 VARROCK_TABLET(8007, new Position(3213, 3424, 0)),
16 LUMBRIDGE_TABLET(8008, new Position(3222, 3218, 0)),
17 FALADOR_TABLET(8009, new Position(2965, 3379, 0)),
18 CAMELOT_TABLET(8010, new Position(2757, 3477, 0)),
19 ARDOUGNE_TABLET(8011, new Position(2661, 3305, 0)),
20 WATCHTOWER_TABLET(8012, new Position(2549, 3112, 0)),
22 RIMMINGTON_TABLET(8007, new Position(3159, 3485, 0));
23
24 /** The item identification of the tablet. */
25 private final int item;
26
27 /** The position which the tablet will teleport the player. */
28 private final Position position;
29
30 /**
31 * The teleport tablet data.
32 *
33 * @param item
34 * The item identification of the tablet.
35 * @param position
36 * The teleport position of the tablet.
37 */
39 this.item = item;
40 this.position = position;
41 }
42
43 /**
44 * Gets the item identification of the tablet.
45 *
46 * @return The item identification.
47 */
48 public int getItem() {
49 return item;
50 }
51
52 /**
53 * Gets the position of the teleport tablet.
54 *
55 * @return The position.
56 */
58 return position;
59 }
60
61 /**
62 * Gets the teleport tablet data based on the item identification.
63 *
64 * @param id
65 * The item identification.
66 * @return The teleport tablet data.
67 */
68 public static Optional<TeleportTablet> forId(int id) {
69 return Arrays.stream(values()).filter(a -> a.item == id).findAny();
70 }
71}
The class that contains setting-related constants for the server.
Definition Config.java:24
static final Position DEFAULT_POSITION
The default, i.e.
Definition Config.java:197
Represents a single tile on the game world.
Definition Position.java:14
Position getPosition()
Gets the position of the teleport tablet.
final int item
The item identification of the tablet.
TeleportTablet(int item, Position position)
The teleport tablet data.
final Position position
The position which the tablet will teleport the player.
static Optional< TeleportTablet > forId(int id)
Gets the teleport tablet data based on the item identification.
int getItem()
Gets the item identification of the tablet.