本文整理匯總了Java中org.bukkit.scheduler.BukkitRunnable.runTaskLaterAsynchronously方法的典型用法代碼示例。如果您正苦於以下問題:Java BukkitRunnable.runTaskLaterAsynchronously方法的具體用法?Java BukkitRunnable.runTaskLaterAsynchronously怎麽用?Java BukkitRunnable.runTaskLaterAsynchronously使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.scheduler.BukkitRunnable
的用法示例。
在下文中一共展示了BukkitRunnable.runTaskLaterAsynchronously方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: save
import org.bukkit.scheduler.BukkitRunnable; //導入方法依賴的package包/類
public void save(final VPPlayer player, boolean force){
BukkitRunnable r = new BukkitRunnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {
IUpdateQuery query = tablePlayer.update();
if(true)//TODO find a way to do this
query.set(username, player.getRealName());
if(true)//TODO find a way to do this
query.set(lang, player.getLanguage().getCode());
if(player.titleChanged())
query.set(title, player.getTitle() == null ? 0 : player.getTitle().getID());
if(player.nick.changed())
query.set(nickname, player.getNick());
int setting = PlayerSettings.toIntChange(player.getSettings());
if(setting != 0)
query.add(settings, setting);
query.where(id, player.getID()).execute();
if(true) // TODO allow disable
VanillaPlusCore.getStatManager().save(player);
if(true) // TODO allow disable
VanillaPlusCore.getAchievementManager().save(player);
if(true) // TODO allow disable
VanillaPlusCore.getTitleManager().save(player);
if(true) // TODO allow disable
VanillaPlusCore.getCurrencyManager().save(player);
player.saved();
}};
if(force)
r.run();
else
r.runTaskLaterAsynchronously(core.getInstance(), 0);
}