本文整理汇总了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);
}