• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BarAPI类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中me.confuser.barapi.BarAPI的典型用法代码示例。如果您正苦于以下问题:Java BarAPI类的具体用法?Java BarAPI怎么用?Java BarAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BarAPI类属于me.confuser.barapi包,在下文中一共展示了BarAPI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: backToNormal

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void backToNormal(Player player) {
    PlayerStuff playerStuff = playerStuffMap.remove(player);
    players.remove(player);
    if (!playerStuff.allowFlight && player.isFlying()) {
        player.setFlying(false);
    }
    player.setAllowFlight(playerStuff.allowFlight);
    player.setGameMode(playerStuff.gameMode);
    player.getInventory().setContents(playerStuff.inventory.getContents());
    player.updateInventory();
    for (PotionEffect effect : player.getActivePotionEffects()) {
        player.removePotionEffect(effect.getType());
    }
    plugin.sm.removeScoreboard(player);
    BarAPI.removeBar(player);
}
 
开发者ID:ddonofrio,项目名称:libelula,代码行数:17,代码来源:PlayerManager.java


示例2: start

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void start()
/* 29:   */   {
/* 30:36 */     this.config = this.main.getConfig();
/* 31:37 */     this.proc = Bukkit.getScheduler().scheduleSyncRepeatingTask(this.main, new Runnable()
/* 32:   */     {
/* 33:   */       public void run()
/* 34:   */       {
/* 35:41 */         if (EndGameProcedure.this.time <= 0)
/* 36:   */         {
/* 37:43 */           EndGameProcedure.this.config = EndGameProcedure.this.main.getConfig();
/* 38:44 */           EndGameProcedure.ServerName = EndGameProcedure.this.config.getString("ServerInfo.Name");
/* 39:46 */           for (Player p : Bukkit.getOnlinePlayers()) {
/* 40:47 */             p.kickPlayer("" + ChatColor.AQUA + ChatColor.BOLD + "NSHC " + ChatColor.YELLOW + "The game is over!");
/* 41:   */           }
/* 42:50 */           Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "wr reset now");
/* 43:   */         }
/* 44:   */         else
/* 45:   */         {
/* 46:53 */           BarAPI.setMessage("" + ChatColor.DARK_AQUA + ChatColor.BOLD + "NSHC" + ChatColor.GRAY + " | " + ChatColor.AQUA + "Game will be ending in..." + ChatColor.GREEN + " " + EndGameProcedure.this.ConvertInteger(EndGameProcedure.this.time));
/* 47:54 */           EndGameProcedure.this.time -= 1;
/* 48:   */         }
/* 49:   */       }
/* 50:60 */     }, 0L, 20L);
/* 51:   */   }
 
开发者ID:Wintergrasped,项目名称:NSHC,代码行数:25,代码来源:EndGameProcedure.java


示例3: end

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
private void end() {
	String text = ConversionUtil.commaList(Var.teams, ChatColor.GRAY);
	for (Player Online : Bukkit.getOnlinePlayers()) {
		BarAPI.setMessage(Online, text + ChatColor.RED + " Wins!", 100f);
		}
	Var.teams.remove(Var.teams);
	Rixor.broadcast(ChatColor.DARK_PURPLE+"# # # # # # # # # # # # # # # # ");
	Rixor.broadcast(ChatColor.DARK_PURPLE+"# # "+ChatColor.GOLD+"The match has ended!"+ChatColor.DARK_PURPLE+" # #");
	Rixor.broadcast(ChatColor.DARK_PURPLE+"# # # # # # # # # # # # # # # #");
	timingTask.getTask().cancel();
	 //cycle(20);
	//Auto Cycle*/
	for(MapTeam team : getMap().getTeams())
		for(Client client : team.getPlayers()) {
			//client.setTeam(getMap().getObservers(), true, false, false);
			client.getPlayer().setGameMode(GameMode.CREATIVE);
			client.getPlayer().getInventory().setItem(0, new ItemStack(Material.COMPASS));
		}


	
	setCurrentlyRunning(false);
	setCurrentlyCycling(true);
}
 
开发者ID:ProjectRixor,项目名称:Rixor,代码行数:25,代码来源:Match.java


示例4: setBar

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public static void setBar(Player player, String message, int count, int seconds, float percent, TNTRun plugin) {
	try {
		message = message.replace("{COUNT}", String.valueOf(count));
		message = message.replace("{SECONDS}", String.valueOf(seconds));
		message = FormattingCodesParser.parseFormattingCodes(message);
		if(plugin.getConfig().getBoolean("special.UseBarApi") == false){
			return;
		}
		if (Bukkit.getPluginManager().getPlugin("BarAPI") != null) {
			if (!message.equals("")) {
				BarAPI.setMessage(player, message, percent);
			}
		}
	} catch (Throwable t) {
	}
}
 
开发者ID:ShevchikUnsupportedProjects,项目名称:TNTRun,代码行数:17,代码来源:Bars.java


示例5: ProgressTask

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void ProgressTask(int amount, EpicPlayer player, boolean sendMessage){
	taskCurrent += amount;
	if(!sendMessage) return;
	
	if(player.getPlayer() != null && SendText()){
		player.playerStatistics.AddTasksCompleted(1);
		if(EpicSystem.useBarAPI()){
			BarAPI.setMessage(player.getPlayer(), getPlayerTaskProgressText(), (float)getTaskProgress()/getTaskGoal());
		}else{
			player.getPlayer().sendMessage(getPlayerTaskProgressText());
		}
		
		if(IsComplete() && quest.getQuestAutoComplete() && quest.isCompleted()){
			quest.completeQuest();
		}
	}
}
 
开发者ID:Randehh,项目名称:EpicQuest,代码行数:18,代码来源:EpicQuestTask.java


示例6: setMessage

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@Override
public void setMessage(Player player, SkillType skill, String newMessage, float percent) {
    String oldMessage = BarAPI.getMessage(player);
    if (!newMessage.equals(oldMessage)) {
        //if the player level ups the message would be different.
        //BarPluginApi doesn't update the message if the player already has a bar
        BarAPI.removeBar(player);
    }

    BarAPI.setMessage(player, newMessage, percent);
    lastSkillType = skill;
}
 
开发者ID:games647,项目名称:mcMMOExtras,代码行数:13,代码来源:BarPluginApi.java


示例7: delayedStart

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void delayedStart(String arenaName, int c) {
	final String aName = arenaName;
	cg = c;
	num = 6;
	if (Bukkit.getPluginManager().isPluginEnabled("BarAPI")) {
		if (Players.getPlayerAmountOnFloor(aName) != 1) {
			for (String name : Players.getPlayersOnFloor(aName)) {
				Player p = Bukkit.getPlayer(name);
				BarAPI.setMessage(p, BlockParty.messageManager.BAR_WAITING, 100.0F);
			}
		} else {
			BarAPI.setMessage(Bukkit.getPlayer((String) Players.getPlayersOnFloor(aName).get(0)), BlockParty.messageManager.BAR_WAITING, 100.0F);
		}
	}
	dc = Bukkit.getScheduler().scheduleSyncRepeatingTask(BlockParty.getInstance(), new Runnable() {
		public void run() {
			if (Period.num != 0) {
				if (Period.num > 1) {
					Period.num -= 1;
				} else {
					Period.this.start(aName, Period.cg, null);
					Bukkit.getScheduler().cancelTask(Period.dc);
				}
			}
		}
	}, 0L, 20L);
}
 
开发者ID:Hansdekip,项目名称:BlockParty-1.8,代码行数:28,代码来源:Period.java


示例8: playerswitchworld

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@EventHandler
public void playerswitchworld(PlayerChangedWorldEvent e){
	if(e.getFrom().equals(Bukkit.getWorld("Hub"))){
		BarAPI.removeBar(e.getPlayer());
		
		bartask.get(e.getPlayer()).cancel();
		bartask.remove(e.getPlayer());
		}
	if(e.getFrom().equals(Bukkit.getWorld("MG"))){
		BarAPI.removeBar(e.getPlayer());
		doBar(e.getPlayer());
	}
}
 
开发者ID:devBuzzy,项目名称:Dexoria-Hub,代码行数:14,代码来源:BarManager.java


示例9: start

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void start()
/* 23:   */   {
/* 24:26 */     this.proc = Bukkit.getScheduler().scheduleSyncRepeatingTask(this.main, new Runnable()
/* 25:   */     {
/* 26:27 */       Player[] pc = Bukkit.getOnlinePlayers();
/* 27:   */       
/* 28:   */       public void run()
/* 29:   */       {
/* 30:30 */         if (Donator20StartProcedure.this.time == 20) {
/* 31:31 */           for (Player s : this.pc)
/* 32:   */           {
/* 33:32 */             s.sendMessage(ChatColor.YELLOW + "Donator's have 20 seconds to select a team! /Team");
/* 34:33 */             MainClass.donatorteam = true;
/* 35:   */           }
/* 36:   */         }
/* 37:36 */         if (Donator20StartProcedure.this.time <= 0)
/* 38:   */         {
/* 39:37 */           MainClass.donatorteam = false;
/* 40:   */           
/* 41:   */ 
/* 42:40 */           Bukkit.broadcastMessage(ChatColor.AQUA + "The Donator period has expired!");
/* 43:41 */           for (Player op : Bukkit.getOnlinePlayers()) {
/* 44:42 */             BarAPI.removeBar(op);
/* 45:   */           }
/* 46:44 */           Bukkit.getScheduler().cancelTask(Donator20StartProcedure.this.proc);
/* 47:   */         }
/* 48:   */         else
/* 49:   */         {
/* 50:46 */           BarAPI.setMessage("" + ChatColor.DARK_AQUA + ChatColor.BOLD + "NSHC" + ChatColor.GRAY + " | " + ChatColor.AQUA + "Donators can change teams! /Team" + ChatColor.GREEN + " " + Donator20StartProcedure.this.ConvertInteger(Donator20StartProcedure.this.time));
/* 51:47 */           Donator20StartProcedure.this.time -= 1;
/* 52:   */         }
/* 53:   */       }
/* 54:53 */     }, 0L, 20L);
/* 55:   */   }
 
开发者ID:Wintergrasped,项目名称:NSHC,代码行数:35,代码来源:Donator20StartProcedure.java


示例10: showBarChanging

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void showBarChanging(final Player p){
plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable(){
	public void run(){
		Random random = new Random();
		List<String> list = new ArrayList<String>();
		list.add(y + "Welcome " + g + p.getName() + y + " to the Xaeus Network!");
		list.add(y + "Want to support the server? - store.xaeus.net");
		list.add(y + "Check out our website! - www.xaeus.net");
		
		 String message = (String)list.get(random.nextInt(list.size()));
	     BarAPI.setMessage(p, message);
		}
	}, 0L, 100L);
}
 
开发者ID:McKiller5252,项目名称:XaeusHub,代码行数:15,代码来源:XaeusBar.java


示例11: delayedStart

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void delayedStart(String arenaName, int c) {
	final String aName = arenaName;
	cg = c;
	num = 6;
	if (BlockParty.getArena.get(aName).getEnableActionbarInfo() || Bukkit.getPluginManager().isPluginEnabled("BarAPI")) {
		if (Players.getPlayerAmountOnFloor(aName) != 1) {
			for (String name : Players.getPlayersOnFloor(aName)) {
				Player p = Bukkit.getPlayer(name);
                   if (Bukkit.getPluginManager().isPluginEnabled("BarAPI"))
				    BarAPI.setMessage(p, BlockParty.messageManager.BAR_WAITING, 100.0F);
                   if (BlockParty.getArena.get(aName).getEnableActionbarInfo())
                       Action.sendAction(p, BlockParty.messageManager.ACTIONBAR_WAITING);
               }
		} else {
               if (Bukkit.getPluginManager().isPluginEnabled("BarAPI"))
			    BarAPI.setMessage(Bukkit.getPlayer((String) Players.getPlayersOnFloor(aName).get(0)), BlockParty.messageManager.BAR_WAITING, 100.0F);
               if (BlockParty.getArena.get(aName).getEnableActionbarInfo())
                   Action.sendAction(Bukkit.getPlayer((String) Players.getPlayersOnFloor(aName).get(0)), BlockParty.messageManager.ACTIONBAR_WAITING);
		}
	}
	dc = Bukkit.getScheduler().scheduleSyncRepeatingTask(BlockParty.getInstance(), new Runnable() {
		public void run() {
			if (Period.num != 0) {
				if (Period.num > 1) {
					Period.num -= 1;
				} else {
					Period.this.start(aName, Period.cg, null);
					Bukkit.getScheduler().cancelTask(Period.dc);
				}
			}
		}
	}, 0L, 20L);
}
 
开发者ID:LekoHD,项目名称:BlockParty,代码行数:34,代码来源:Period.java


示例12: onGameLeave

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@EventHandler
public void onGameLeave(GameLeaveEvent event) {
    Game game = game(event);
    if (game == null) {
        return;
    }

    Player p = event.getPlayer();
    FFAParticipants state = (FFAParticipants) game.getParticipants();

    // Kills check
    boolean failedKillsCheck = game.getStats().getKillCount(p) == 0;

    // Distance check
    boolean failedDistanceCheck = false;
    for (Player player : state.getPlayers()) {
        if (p.getWorld().equals(player.getWorld()) && p.getLocation().distanceSquared(player.getLocation()) < 20 * 20) {
            failedDistanceCheck = true;
            break;
        }
    }

    if (failedKillsCheck) {
        game.getGameplay().sendGameMessage(p, "You must kill at least one person before leaving!");
    }
    if (failedDistanceCheck) {
        game.getGameplay().sendGameMessage(p, "You must be at least 20 blocks away from another player!");
    }

    if (failedKillsCheck || failedDistanceCheck) {
        event.setCancelled(true);
        return;
    }

    if (barAPI) {
        BarAPI.removeBar(p);
    }
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + p.getName());
}
 
开发者ID:macalinao,项目名称:cloudgame,代码行数:40,代码来源:HostedFFA.java


示例13: onGameQuit

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@EventHandler
public void onGameQuit(GameQuitEvent event) {
    Game game = game(event);
    if (game == null) {
        return;
    }

    if (barAPI) {
        BarAPI.removeBar(event.getPlayer());
    }
    Player p = event.getPlayer();
    p.setGameMode(GameMode.SURVIVAL);
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + p.getName());
}
 
开发者ID:macalinao,项目名称:cloudgame,代码行数:15,代码来源:HostedFFA.java


示例14: restarting

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public void restarting(){
	String p = "s";

	if(restarting == 1) p = "";
	for (Player Online : Bukkit.getOnlinePlayers()) {
			BarAPI.setMessage(Online, ChatColor.DARK_AQUA + "Restarting "
					+ "in " + ChatColor.DARK_RED + restarting + ChatColor.DARK_AQUA + " second" + p + "!", (float) restarting / originalRestart * 100);

	}
	setCurrentlyRestarting(true);
	if (restarting == 0){
		this.restartingTask.getTask().cancel();
		for (Player p1 : Bukkit.getOnlinePlayers()){
			p1.kickPlayer(ChatColor.GREEN + "Server has shutdown! " + ChatColor.GOLD + "Rejoin!");
		}

		for (Map m : Rixor.getMapsPlayed()){
			Rixor.getInstance().getServer().unloadWorld(m.getWorld(), false);
			//Scrimmage.getInstance().getLogger().info(m.getName() + " " + m.getFolder().getAbsolutePath());
			//for (File file : m.getFolder().listFiles()) {
			//	try{
			//		FileDeleteStrategy.FORCE.delete(file);
			//	}catch(IOException e){
		//			Scrimmage.getInstance().getLogger().info(e.getMessage());
		//		}
		//	}
	//	}
		Rixor.getInstance().getServer().shutdown();
	}
	restarting--;
	}
}
 
开发者ID:ProjectRixor,项目名称:Rixor,代码行数:33,代码来源:Match.java


示例15: cycling

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public boolean cycling(RotationSlot next) {
	String p = "s";
	if (next == null){
		restart(30);
		return true;
	}
	if(cycling == 1) p = "";
	for (Player Online : Bukkit.getOnlinePlayers()) {
		BarAPI.setMessage(Online, ChatColor.DARK_AQUA + "Cycling to " + ChatColor.AQUA + next.getLoader().getName() + ChatColor.DARK_AQUA
				+ " in " + ChatColor.DARK_RED + cycling + ChatColor.DARK_AQUA + " second" + p + "!", (float) cycling / cycleTime * 100);
	}
	
	setCurrentlyCycling(true);
	if(cycling == 0) {

		Var.canSetNext = 0;
		cyclingTask.getTask().cancel();
		setCurrentlyCycling(false);
		Rixor.callEvent(new MatchCycleEvent(getMap(), next.getMap()));
		Rixor.getRotation().setSlot(next);
		for(Client client : Client.getClients())
			client.setTeam(next.getMap().getObservers(), true, true, true);

		next.getMatch().start();
		Rixor.addMapToMapsPlayed(next.getMap());
		hasEnded = false;
		return true;
	}
	
	if(cycling == 1 && !loaded && next != null) {
		setLoaded(true);
		next.load();
	}
	
	cycling--;
	return false;
}
 
开发者ID:ProjectRixor,项目名称:Rixor,代码行数:38,代码来源:Match.java


示例16: setBossBarAll

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
/**
 * Set's boss bar content for all players.
 * 
 * @param replace
 *            message (max 40 char.)
 */
public void setBossBarAll(final String message) {
    for (Player p : this.activePlayers) {
        BarAPI.removeBar(p);
        BarAPI.setMessage(p, message);
    }
}
 
开发者ID:dobrakmato,项目名称:PexelCore,代码行数:13,代码来源:AdvancedArena.java


示例17: onPlayerLeft

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
/**
 * Called when player left the arena. If is arena in LOBBY/WAITING_PLAYERS state, and flag
 * {@link AdvancedArena#countdownCanCancel} is set to <b>true</b>, stops the countdown.
 */
@Override
public void onPlayerLeft(final Player player, final DisconnectReason reason) {
    super.onPlayerLeft(player, reason);
    
    this.chatAll(ChatManager.minigame(this.getMinigame(),
            "Player '" + player.getName() + "' has left arena (" + reason.name()
                    + ")!"));
    
    NetworkCCFormatter.sendPlayerLeft(this, player);
    
    this.tryStopCountdown();
    
    this.checkForEnd();
    
    // BarApi fix.
    if (BarAPI.hasBar(player))
        BarAPI.removeBar(player);
    
    // Alway remove from spectating mode.
    if (this.isSpectating(player)) {
        this.setSpectating(player, false);
    }
    
    this.updateGameState();
    
    // Clear player's inventory.
    this.clearPlayerInventory(player);
}
 
开发者ID:dobrakmato,项目名称:PexelCore,代码行数:33,代码来源:AdvancedArena.java


示例18: run

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@Override
public void run() {
    String message = getNextColor() + "-=- " + messages.get(timer) + " -=-";
    float progress = ((float) timer) / (messages.size() - 1);

    for (Player player : plugin.getServer().getOnlinePlayers()) {
        BarAPI.setMessage(player, message, progress * 100);
    }

    timer++;
    if (timer == messages.size()) timer = 0;
}
 
开发者ID:EyeOfEnder-Ltd,项目名称:EOEHub,代码行数:13,代码来源:BarTimer.java


示例19: removeBar

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
public static void removeBar(Player player) {
	try {
		if (Bukkit.getPluginManager().getPlugin("BarAPI") != null) {
			BarAPI.removeBar(player);
		}
	} catch (Throwable t) {
	}
}
 
开发者ID:ShevchikUnsupportedProjects,项目名称:TNTRun,代码行数:9,代码来源:Bars.java


示例20: removeBar

import me.confuser.barapi.BarAPI; //导入依赖的package包/类
@Override
public void removeBar(Player player, SkillType skill) {
    if (lastSkillType == skill) {
        BarAPI.removeBar(player);
    }
}
 
开发者ID:games647,项目名称:mcMMOExtras,代码行数:7,代码来源:BarPluginApi.java



注:本文中的me.confuser.barapi.BarAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GenericRequestBuilder类代码示例发布时间:2022-05-21
下一篇:
Java TiUIView类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap