-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add WarmUpCancelled Event & Expose TPType #6351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
81efba8
Expose tpType
Koora7334 bb7fa35
Add an event when the warmup is cancelled
Koora7334 3f8a21f
Merge branch 'EssentialsX:2.x' into 2.x
Koora7334 11a1061
Merge branch '2.x' into 2.x
JRoy 7b61891
Resolve requested changes
Koora7334 67be3b3
Merge branch '2.x' of https://github.com/Koora7334/Essentials into 2.x
Koora7334 6667506
Fix possible npe
Koora7334 7e0cde8
Fixed wrong relocation ://
Koora7334 fcb8fbe
Fix checkstyle
Koora7334 5b8c8c6
Merge branch 'EssentialsX:2.x' into 2.x
Koora7334 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
77 changes: 77 additions & 0 deletions
77
Essentials/src/main/java/net/essentialsx/api/v2/events/TeleportWarmupCancelledEvent.java
This file contains hidden or 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,77 @@ | ||
| package net.essentialsx.api.v2.events; | ||
|
|
||
| import org.bukkit.entity.Player; | ||
| import org.bukkit.event.Event; | ||
| import org.bukkit.event.HandlerList; | ||
| import com.earth2me.essentials.AsyncTeleport.TeleportType; | ||
|
|
||
| /** | ||
| * Called when a player's teleport warmup is cancelled. | ||
| */ | ||
| public class TeleportWarmupCancelledEvent extends Event { | ||
|
|
||
| private static final HandlerList handlers = new HandlerList(); | ||
|
|
||
| private final Player player; | ||
| private final TeleportType teleportType; | ||
| private final CancelReason cancelReason; | ||
| private final boolean notifyUser; | ||
|
|
||
| public TeleportWarmupCancelledEvent(final Player player, final TeleportType teleportType, CancelReason cancelReason, final boolean notifyUser) { | ||
| this.player = player; | ||
| this.teleportType = teleportType; | ||
| this.cancelReason = cancelReason; | ||
| this.notifyUser = notifyUser; | ||
| } | ||
|
|
||
| public static HandlerList getHandlerList() { | ||
| return handlers; | ||
| } | ||
|
|
||
| @Override | ||
| public HandlerList getHandlers() { | ||
| return handlers; | ||
| } | ||
|
|
||
| /** | ||
| * @return the player whose teleport was canceled. | ||
| */ | ||
| public Player getPlayer() { | ||
| return this.player; | ||
| } | ||
|
|
||
| /** | ||
| * @return the type of teleport that was canceled. | ||
| */ | ||
| public TeleportType getTeleportType() { | ||
| return this.teleportType; | ||
| } | ||
|
|
||
| /** | ||
| * @return the reason the teleport was cancelled. | ||
| */ | ||
| public CancelReason getCancelReason() { | ||
| return this.cancelReason; | ||
| } | ||
|
|
||
| /** | ||
| * @return true if the player was notified that the teleport was canceled, otherwise false. | ||
| */ | ||
| public boolean isPlayerNotified() { | ||
| return this.notifyUser; | ||
| } | ||
|
|
||
| /** | ||
| * Indicates the reason why the teleportation was cancelled. | ||
| */ | ||
| public enum CancelReason { | ||
| /** | ||
| * Indicates that the cancellation occurred because the player disconnected | ||
| */ | ||
| LEAVE, | ||
| /** | ||
| * Indicates that the cancellation occurred because the player moved | ||
| */ | ||
| MOVE, | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.