summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/block/EndGateway.java
blob: 4849436eca436e7b4d384210e0ea1fd4527f2eff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package org.bukkit.block;

import org.bukkit.Location;

/**
 * Represents a captured state of an end gateway.
 */
public interface EndGateway extends BlockState {

    /**
     * Gets the location that entities are teleported to when 
     * entering the gateway portal.
     * <p>
     * If this block state is not placed the location's world will be null.
     * 
     * @return the gateway exit location
     */
    Location getExitLocation();

    /**
     * Sets the exit location that entities are teleported to when
     * they enter the gateway portal.
     * <p>
     * If this block state is not placed the location's world has to be null.
     * 
     * @param location the new exit location
     * @throws IllegalArgumentException for differing worlds
     */
    void setExitLocation(Location location);

    /**
     * Gets whether this gateway will teleport entities directly to
     * the exit location instead of finding a nearby location.
     * 
     * @return true if the gateway is teleporting to the exact location
     */
    boolean isExactTeleport();

    /**
     * Sets whether this gateway will teleport entities directly to
     * the exit location instead of finding a nearby location.
     * 
     * @param exact whether to teleport to the exact location
     */
    void setExactTeleport(boolean exact);

    /**
     * Gets the age in ticks of the gateway.
     * <br>
     * If the age is less than 200 ticks a magenta beam will be emitted, whilst
     * if it is a multiple of 2400 ticks a purple beam will be emitted.
     *
     * @return age in ticks
     */
    long getAge();

    /**
     * Sets the age in ticks of the gateway.
     * <br>
     * If the age is less than 200 ticks a magenta beam will be emitted, whilst
     * if it is a multiple of 2400 ticks a purple beam will be emitted.
     *
     * @param age new age in ticks
     */
    void setAge(long age);
}