Cancel teleport on leave
This commit is contained in:
parent
036f7a720e
commit
a0b3156610
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user