diff --git a/src/com/massivecraft/massivecore/teleport/EngineScheduledTeleport.java b/src/com/massivecraft/massivecore/teleport/EngineScheduledTeleport.java index fef04de9..d381c78b 100644 --- a/src/com/massivecraft/massivecore/teleport/EngineScheduledTeleport.java +++ b/src/com/massivecraft/massivecore/teleport/EngineScheduledTeleport.java @@ -14,6 +14,7 @@ import org.bukkit.plugin.Plugin; import com.massivecraft.massivecore.EngineAbstract; import com.massivecraft.massivecore.MassiveCore; +import com.massivecraft.massivecore.event.EventMassiveCorePlayerLeave; import com.massivecraft.massivecore.mixin.Mixin; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.MUtil; @@ -143,4 +144,15 @@ public class EngineScheduledTeleport extends EngineAbstract this.cancelTeleport(player); } + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void cancelTeleport(EventMassiveCorePlayerLeave event) + { + // If a player quits ... + if (Mixin.isActualLeave(event)) return; + + // ... cancel teleport! + Player player = event.getPlayer(); + this.cancelTeleport(player); + } + }