本文整理匯總了Java中org.bukkit.scheduler.BukkitScheduler.scheduleSyncDelayedTask方法的典型用法代碼示例。如果您正苦於以下問題:Java BukkitScheduler.scheduleSyncDelayedTask方法的具體用法?Java BukkitScheduler.scheduleSyncDelayedTask怎麽用?Java BukkitScheduler.scheduleSyncDelayedTask使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.scheduler.BukkitScheduler
的用法示例。
在下文中一共展示了BukkitScheduler.scheduleSyncDelayedTask方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: playSetForPlayers
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void playSetForPlayers(Breakpoint plugin, BPSoundSet set, final Game game)
{
BukkitScheduler scheduler = Bukkit.getScheduler();
double delay = 0;
for(final BPSound sound : set.getSounds())
{
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run()
{
playSoundForPlayers(game, sound);
}
}, (long) (delay * 20L));
delay += sound.getLengthInSeconds();
}
}
示例2: handlePlayer
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
@Override
public boolean handlePlayer(TregminePlayer player, String[] args)
{
if ( (player.getWorld().getName().equalsIgnoreCase(tregmine.getRulelessWorld().getName()) ||
player.getWorld().getName().equalsIgnoreCase(tregmine.getRulelessEnd().getName()) ||
player.getWorld().getName().equalsIgnoreCase(tregmine.getRulelessNether().getName())) &&
!player.getRank().canBypassWorld()) {
if (player.isCombatLogged()) {
player.sendMessage(ChatColor.RED + "You are combat logged... Please wait!");
return true;
}
player.sendMessage(ChatColor.RED + "Teleporting to spawn... Please wait 30 seconds.");
player.sendMessage(ChatColor.DARK_BLUE + "Oh, and don't move! Moving will stop the teleportation.");
BukkitScheduler scheduler = plugin.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(tregmine, new SpawnTask(player, player.getWorld().getSpawnLocation(), player.getLocation()), 20*30);
return true;
}
player.teleportWithHorse(player.getWorld().getSpawnLocation());
return true;
}
示例3: enable
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
@Override
public void enable() {
if (this.match.getMapInfo().proto.isOlderThan(MODES_IMPLEMENTATION_VERSION)) {
CoreConvertMonitor ccm = new CoreConvertMonitor(this);
BukkitScheduler scheduler = this.match.getServer().getScheduler();
this.ccmTaskId1 = scheduler.scheduleSyncDelayedTask(this.match.getPlugin(), ccm, 15*60*20); // 15 minutes
this.ccmTaskId2 = scheduler.scheduleSyncDelayedTask(this.match.getPlugin(), ccm, 20*60*20); // 20 minutes
}
}
示例4: natural
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
/**
* Plays a natural note
*
* @param player player
* @param tone note
* @param octave octave
* @param instrum instrument
* @param delay delay
*/
public void natural(Player player, Tone tone, int octave, Instrument instrum, long delay) {
final Player play = player;
final Instrument inst = instrum;
final Note note = Note.natural(octave, tone);
final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {
@Override
public void run() {
play.playNote(play.getLocation(), inst, note);
}
}, delay);
}
示例5: sharp
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
/**
* Plays a sharp note
*
* @param player player
* @param tone note
* @param octave octave
* @param instrum instrument
* @param delay delay
*/
public void sharp(Player player, Tone tone, int octave, Instrument instrum, long delay) {
final Player play = player;
final Instrument inst = instrum;
final Note note = Note.sharp(octave, tone);
final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {
@Override
public void run() {
play.playNote(play.getLocation(), inst, note);
}
}, delay);
}
示例6: flat
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
/**
* Plays a flat note
*
* @param player player
* @param tone note
* @param octave octave
* @param instrum instrument
* @param delay delay
*/
public void flat(Player player, Tone tone, int octave, Instrument instrum, long delay) {
final Player play = player;
final Instrument inst = instrum;
final Note note = Note.flat(octave, tone);
final BukkitScheduler scheduler = MoneyThief.plugin.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(MoneyThief.plugin, new Runnable() {
@Override
public void run() {
play.playNote(play.getLocation(), inst, note);
}
}, delay);
}
示例7: onPlayerJoin
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public void onPlayerJoin(PlayerJoinEvent event){
final Player p = event.getPlayer();
final BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(Bukkit.getServer().getPluginManager().getPlugin("gFeatures"), new Runnable() {
public void run(){
/*p.sendMessage(ChatColor.DARK_AQUA+"Do /music to open up the music menu!");
p.sendMessage(ChatColor.DARK_AQUA+"Make sure you have the resource pack! It might take a while to download.");
p.sendMessage(ChatColor.DARK_AQUA+"DISCLAIMER:");
p.sendMessage(ChatColor.DARK_AQUA+"We haven't found a way to actually stop the music.");
p.sendMessage(ChatColor.DARK_AQUA+"Don't play a song while another is playing or else they will play at the same time.");
p.sendMessage(ChatColor.GOLD + "" + ChatColor.BOLD + "For all songs other than the minecraft ones, you'll need a resource pack.");*/
//p.sendMessage(ChatColor.GOLD + "https://www.dropbox.com/s/cguhado3piwo9fb/GenesisMusic.zip?dl=1");
}
}, 20L);
}
示例8: inToTwo
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public void inToTwo(final Player p){
final BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(Bukkit.getServer().getPluginManager().getPlugin("gFeatures"), new Runnable() {
public void run(){
Constants.listen.remove(p);
}
}, 20L);
}
示例9: update
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public void update(final Player player) {
final ItemMenu menu = new ItemMenu(SteakGUI.convertMessage(TITLE, this, player), ItemMenu.Size.fit(SIZE), PLUGIN);
for(Integer key:ITEM_ARRAY.keySet()) {
if(canInclude(player, ITEM_ARRAY.get(key))) {
menu.setItem(key, ITEM_ARRAY.get(key).getMenuItem(this, player));
}
}
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(SteakGUI.p, new Runnable() {
@Override
public void run() {
menu.update(player);
}
}, 2);
}
示例10: scheduleOnBukkitScheduler
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
private static int scheduleOnBukkitScheduler(Plugin plugin, Runnable command, long ticks, ConcurrencyMode concurrencyMode) {
BukkitScheduler scheduler = plugin.getServer().getScheduler();
if (concurrencyMode == ConcurrencyMode.SYNCHRONOUS) {
return scheduler.scheduleSyncDelayedTask(plugin, command, ticks);
} else {
return scheduler.scheduleAsyncDelayedTask(plugin, command, ticks);
}
}
示例11: start
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void start(Plugin plugin, BytecraftPlayer player)
{
Runnable runnable = new ScoreboardClearTask(player);
Server server = Bukkit.getServer();
BukkitScheduler scheduler = server.getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, runnable, 400);
}
示例12: start
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void start(Plugin plugin, TregminePlayer player)
{
Runnable runnable = new ScoreboardClearTask(player);
Server server = Bukkit.getServer();
BukkitScheduler scheduler = server.getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, runnable, 400);
}
示例13: speech
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void speech(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string1);
speechPt2(p, witch, loc);
}
}, 60L);
}
示例14: speechPt2
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void speechPt2(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string2);
speechPt3(p, witch, loc);
}
}, 60L);
}
示例15: speechPt3
import org.bukkit.scheduler.BukkitScheduler; //導入方法依賴的package包/類
public static void speechPt3(final Player p, final Witch witch, final Location loc){
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
p.sendMessage(string3);
speechPt4(p, witch, loc);
}
}, 60L);
}