mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
Send teleportation cancellation message immediately on movement, rather than after the timer has finished. This fixes PS-33.
This commit is contained in:
@ -822,7 +822,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
// Cancel teleport
|
||||
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
||||
if (TaskManager.TELEPORT_QUEUE.remove(pp.getName())) {
|
||||
MainUtil.sendMessage(pp, Captions.TELEPORT_FAILED);
|
||||
}
|
||||
// Set last location
|
||||
Location location = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
@ -882,7 +884,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
// Cancel teleport
|
||||
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
||||
if (TaskManager.TELEPORT_QUEUE.remove(pp.getName())) {
|
||||
MainUtil.sendMessage(pp, Captions.TELEPORT_FAILED);
|
||||
}
|
||||
// Set last location
|
||||
Location location = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
|
Reference in New Issue
Block a user