Cancel teleport on leave

This commit is contained in:
BuildTools 2015-10-19 14:04:54 +02:00 committed by Olof Larsson
parent 036f7a720e
commit a0b3156610

View File

@ -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);
}
}