當前位置: 首頁>>代碼示例>>Java>>正文


Java BukkitScheduler.scheduleSyncDelayedTask方法代碼示例

本文整理匯總了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();
	}
}
 
開發者ID:Limeth,項目名稱:Breakpoint,代碼行數:19,代碼來源:SoundManager.java

示例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;
  }
 
開發者ID:EmilHernvall,項目名稱:tregmine,代碼行數:22,代碼來源:SpawnCommand.java

示例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
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:10,代碼來源:CoreMatchModule.java

示例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);
}
 
開發者ID:Ratismal,項目名稱:MoneyThief,代碼行數:24,代碼來源:FanfarePlayer.java

示例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);
}
 
開發者ID:Ratismal,項目名稱:MoneyThief,代碼行數:24,代碼來源:FanfarePlayer.java

示例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);
}
 
開發者ID:Ratismal,項目名稱:MoneyThief,代碼行數:24,代碼來源:FanfarePlayer.java

示例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);
}
 
開發者ID:EstiNet,項目名稱:gFeatures,代碼行數:16,代碼來源:Listeners.java

示例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);
}
 
開發者ID:EstiNet,項目名稱:gFeatures,代碼行數:9,代碼來源:MusicMenu.java

示例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);
}
 
開發者ID:itstake,項目名稱:SteakGUI,代碼行數:16,代碼來源:Menu.java

示例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);
    }
}
 
開發者ID:rmichela,項目名稱:rxjava-bukkit,代碼行數:9,代碼來源:BukkitRxScheduler.java

示例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);
}
 
開發者ID:sabersamus,項目名稱:Bytecraft,代碼行數:9,代碼來源:ScoreboardClearTask.java

示例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);
}
 
開發者ID:EmilHernvall,項目名稱:tregmine,代碼行數:9,代碼來源:ScoreboardClearTask.java

示例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);
}
 
開發者ID:EmilHernvall,項目名稱:tregmine,代碼行數:11,代碼來源:GrinchSpawnSpeech.java

示例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);
}
 
開發者ID:EmilHernvall,項目名稱:tregmine,代碼行數:11,代碼來源:GrinchSpawnSpeech.java

示例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);
}
 
開發者ID:EmilHernvall,項目名稱:tregmine,代碼行數:11,代碼來源:GrinchSpawnSpeech.java


注:本文中的org.bukkit.scheduler.BukkitScheduler.scheduleSyncDelayedTask方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。