Commits

Thinkofname authored 2b61299288d
Revert "SPIGOT-264: Remove PlayerPortalEvent's handler list"

This reverts commit dcd92097e987ccd4030fa11135cf5147d6b6f7ad.
No tags

src/main/java/org/bukkit/event/player/PlayerPortalEvent.java

Modified
1 1 package org.bukkit.event.player;
2 2
3 3 import org.bukkit.Location;
4 4 import org.bukkit.TravelAgent;
5 5 import org.bukkit.entity.Player;
6 +import org.bukkit.event.HandlerList;
6 7
7 8 /**
8 9 * Called when a player is about to teleport because it is in contact with a
9 10 * portal.
10 11 * <p>
11 12 * For other entities see {@link org.bukkit.event.entity.EntityPortalEvent}
12 13 */
13 14 public class PlayerPortalEvent extends PlayerTeleportEvent {
15 + private static final HandlerList handlers = new HandlerList();
14 16 protected boolean useTravelAgent = true;
15 17 protected TravelAgent travelAgent;
16 18
17 19 public PlayerPortalEvent(final Player player, final Location from, final Location to, final TravelAgent pta) {
18 20 super(player, from, to);
19 21 this.travelAgent = pta;
20 22 }
21 23
22 24 public PlayerPortalEvent(Player player, Location from, Location to, TravelAgent pta, TeleportCause cause) {
23 25 super(player, from, to, cause);
66 68 }
67 69
68 70 /**
69 71 * Sets the Travel Agent used (or not) in this event.
70 72 *
71 73 * @param travelAgent the Travel Agent used (or not) in this event
72 74 */
73 75 public void setPortalTravelAgent(TravelAgent travelAgent) {
74 76 this.travelAgent = travelAgent;
75 77 }
76 -}
78 +
79 + @Override
80 + public HandlerList getHandlers() {
81 + return handlers;
82 + }
83 +
84 + public static HandlerList getHandlerList() {
85 + return handlers;
86 + }
87 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut