Commits
Black Hole authored and Travis Watkins committed 9b978055c93
1 1 | package org.bukkit.event.player; |
2 2 | |
3 3 | import java.net.InetAddress; |
4 + | import java.util.UUID; |
4 5 | |
5 6 | import org.bukkit.event.Event; |
6 7 | import org.bukkit.event.HandlerList; |
7 8 | |
8 9 | /** |
9 10 | * Stores details for players attempting to log in. |
10 11 | * <p> |
11 12 | * This event is asynchronous, and not run using main thread. |
12 13 | */ |
13 14 | public class AsyncPlayerPreLoginEvent extends Event { |
14 15 | private static final HandlerList handlers = new HandlerList(); |
15 16 | private Result result; |
16 17 | private String message; |
17 18 | private final String name; |
18 19 | private final InetAddress ipAddress; |
20 + | private final UUID uniqueId; |
19 21 | |
22 + | |
20 23 | public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress) { |
24 + | this(name, ipAddress, null); |
25 + | } |
26 + | |
27 + | public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress, final UUID uniqueId) { |
21 28 | super(true); |
22 29 | this.result = Result.ALLOWED; |
23 30 | this.message = ""; |
24 31 | this.name = name; |
25 32 | this.ipAddress = ipAddress; |
33 + | this.uniqueId = uniqueId; |
26 34 | } |
27 35 | |
28 36 | /** |
29 37 | * Gets the current result of the login, as an enum |
30 38 | * |
31 39 | * @return Current Result of the login |
32 40 | */ |
33 41 | public Result getLoginResult() { |
34 42 | return result; |
35 43 | } |
133 141 | |
134 142 | /** |
135 143 | * Gets the player IP address. |
136 144 | * |
137 145 | * @return The IP address |
138 146 | */ |
139 147 | public InetAddress getAddress() { |
140 148 | return ipAddress; |
141 149 | } |
142 150 | |
151 + | /** |
152 + | * Gets the player's unique ID. |
153 + | * |
154 + | * @return The unique ID |
155 + | */ |
156 + | public UUID getUniqueId() { |
157 + | return uniqueId; |
158 + | } |
159 + | |
143 160 | |
144 161 | public HandlerList getHandlers() { |
145 162 | return handlers; |
146 163 | } |
147 164 | |
148 165 | public static HandlerList getHandlerList() { |
149 166 | return handlers; |
150 167 | } |
151 168 | |
152 169 | /** |