Timer Tm = new Timer();
int i = Value;
Player Pl = (Player) Sender;
Pl.setAllowFlight(true);
MinecraftFunctions.SendMsg(Sender, MsgType.Success, "Uçuş modu aktif edildi.");
TimerTask TmTask = new TimerTask()
{
@Override
public void run()
{
if (i <= 0)
{
Pl.setAllowFlight(false);
MinecraftFunctions.SendMsg(Sender, MsgType.Success, "Uçuş modu devre dışı bırakıldı.");
Tm.cancel();
}
if (i == 10)
{
MinecraftFunctions.SendMsg(Sender, MsgType.Success, "Uçuş modunun kapatılmasına 10 saniye kaldı.");
}
i--;
}
};
Tm.schedule(TmTask, 1000);