forked from TownyAdvanced/Towny
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- API: Add SuccessfulTownyTeleportEvent
- Thrown when a player is spawned by Towny after they use /res, /town, or /nation spawn.
- Loading branch information
Showing
4 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...c/main/java/com/palmergames/bukkit/towny/event/teleport/SuccessfulTownyTeleportEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.palmergames.bukkit.towny.event.teleport; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.Location; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
import com.palmergames.bukkit.towny.object.Resident; | ||
|
||
/** | ||
* Thrown when Towny teleports a player after they have used /res, /town, or | ||
* /nation spawn. | ||
* | ||
* @author LlmDl | ||
* @since 0.100.2.12 | ||
*/ | ||
public class SuccessfulTownyTeleportEvent extends Event { | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
private Resident resident; | ||
private Location teleportLocation; | ||
|
||
public SuccessfulTownyTeleportEvent(Resident resident, Location loc) { | ||
super(!Bukkit.isPrimaryThread()); | ||
this.resident = resident; | ||
this.teleportLocation = loc; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
public Resident getResident() { | ||
return resident; | ||
} | ||
|
||
public Location getTeleportLocation() { | ||
return teleportLocation; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters