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

Java BossBarAPI类代码示例

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

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



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

示例1: checkWinner

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
private void checkWinner() {
    RagePlayer[] users = plugin.getGm().reorder().keySet().toArray(new RagePlayer[plugin.getGm().reorder().size()]);
    if (users.length == 0) return;

    Utils.broadcastMsg("------------------------");
    Utils.broadcastMsg("");
    Utils.broadcastMsg("1º &c" + users[0].getName() + "&7: &6" + plugin.getGm().getScore().get(users[0]) + " puntos.");
    Utils.broadcastMsg("2º &c" + users[1].getName() + "&7: &6" + plugin.getGm().getScore().get(users[1]) + " puntos.");

    if(users.length >= 3) {
        Utils.broadcastMsg("3º &c" + users[2].getName() + "&7: &6" + plugin.getGm().getScore().get(users[2]) + " puntos.");
    }

    Utils.broadcastMsg("");
    Utils.broadcastMsg("------------------------");

    plugin.getGm().getPlaying().forEach(p ->{
        p.getPlayer().getInventory().clear();
        p.getPlayer().setGameMode(GameMode.SPECTATOR);
        BossBarAPI.removeAllBars(p.getPlayer());
    });
}
 
开发者ID:cadox8,项目名称:PA,代码行数:23,代码来源:GameTask.java


示例2: SendNotifyMsg

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
public void SendNotifyMsg(Player p, String notify, String color){
    if (RPConfig.getString("notify.region-enter-mode").equalsIgnoreCase("OFF")){
        return;
    }
	if (!notify.equals("")){
		if (RPConfig.getString("notify.region-enter-mode").equalsIgnoreCase("BOSSBAR")){
			if (RedProtect.get().version >= 1110){
				RPMine111.sendBarMsg(notify, color, p);
			} else {
				if (RedProtect.get().BossBar){
    				BossBarAPI.setMessage(p,notify);
    			} else {
    				p.sendMessage(notify);
    			}
			}    			
		} 
		if (RPConfig.getString("notify.region-enter-mode").equalsIgnoreCase("CHAT")){
			p.sendMessage(notify);
		}
	}
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:22,代码来源:RPPlayerListener.java


示例3: SendWelcomeMsg

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
public void SendWelcomeMsg(final Player p, String wel){
if (RPConfig.getString("notify.welcome-mode").equalsIgnoreCase("OFF")){
	return;
}
if (RPConfig.getString("notify.welcome-mode").equalsIgnoreCase("BOSSBAR")){
	if (RedProtect.get().version >= 1110){
		RPMine111.sendBarMsg(wel, "GREEN", p);
	} else {
		if (RedProtect.get().BossBar){
			BossBarAPI.setMessage(p,wel);
		} else {
			p.sendMessage(wel);
		}
	}			
} 
if (RPConfig.getString("notify.welcome-mode").equalsIgnoreCase("CHAT")){
	p.sendMessage(wel);
}
  }
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:20,代码来源:RPPlayerListener.java


示例4: setupBossBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
protected void setupBossBar(Player p) {
	String timeString = Options.msg.get("bossBarMessage");
	
	if (getTime() == Time.DAY) {
		timeString = timeString.replace("[TIME]", Options.msg.get("text.1"));
	} else {
		timeString = timeString.replace("[TIME]", Options.msg.get("text.2"));
	}
	
	try {
		BossBarAPI.addBar(p, new TextComponent(timeString), BossBarAPI.Color.YELLOW, BossBarAPI.Style.PROGRESS, 1.0f, 0, 1);
	} catch (Exception e) {
		ServerLog.err("Faild to send the BossBar Message with BossBarAPI [" + e.getMessage() +"]");
	}
}
 
开发者ID:fof1092,项目名称:TimeVote,代码行数:16,代码来源:TimeVote.java


示例5: removeBossBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void removeBossBar(Player p) {
	try {
		if (BossBarAPI.getBossBar(p) != null) {
			BossBarAPI.getBossBar(p).removePlayer(p);
		}
	} catch (Exception e) {
		ServerLog.err("Faild to remove the BossBar Message with BossBarAPI [" + e.getMessage() +"]");
	}
}
 
开发者ID:fof1092,项目名称:TimeVote,代码行数:11,代码来源:TimeVote.java


示例6: createIfNotExists

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
/**
 * Creates a boss bar if doesn't exist
 *
 * @param player the player
 * @return the boss bar
 */
private BossBar createIfNotExists(Player player) {
	if(!v1_9) {
		return null;
	}

	if(hasBar(player)) {
		return getBossBar(player);
	}

	BossBar bossBar = BossBarAPI.addBar(player, new TextComponent(""), Config.BOSSBAR_RAIDBAR_COLOR.toEnum(BossBarAPI.Color.class), Config.BOSSBAR_RAIDBAR_STYLE.toEnum(BossBarAPI.Style.class), 0);

	bossBarMap.put(player.getUniqueId(), bossBar);
	return bossBar;
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:21,代码来源:BossBarUtilsBossBarImpl.java


示例7: setMessage

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void setMessage(Player player, String message, float percent) {
	if(v1_9) {
		BossBar bar = createIfNotExists(player);
		bar.setMessage(new TextComponent(message).toString());
		bar.setProgress(percent / 100F);
	}
	else {
		BossBarAPI.setMessage(player, message, percent);
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:12,代码来源:BossBarUtilsBossBarImpl.java


示例8: removeBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void removeBar(Player player) {
	if(v1_9) {
		BossBar bar = bossBarMap.remove(player.getUniqueId());
		bar.removePlayer(player);
	}
	else {
		BossBarAPI.removeBar(player);
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:11,代码来源:BossBarUtilsBossBarImpl.java


示例9: setHealth

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void setHealth(Player player, float percent) {
	if(v1_9) {
		createIfNotExists(player).setProgress(percent / 100F);
	}
	else {
		BossBarAPI.setHealth(player, percent);
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:10,代码来源:BossBarUtilsBossBarImpl.java


示例10: execute

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void execute(Event evt) {
  BossBarAPI.setMessage(player.getSingle(evt), title.getSingle(evt).toString().replace("\"", ""),
      per.getSingle(evt).floatValue());
  // BossBarAPI.addBar(player.getSingle(evt), new TextComponent(t.getSingle(evt).replace("\"",
  // "")),null,null, per.getSingle(evt).floatValue()/100);
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:9,代码来源:EffCreateBossBar.java


示例11: convert

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
@Nullable
public Number convert(Player evt) {
  return BossBarAPI.getBossBar(evt).getMaxHealth();
  /*
   * for(BossBar bar : BossBarAPI.getBossBars(evt)){ return ((bar.getProgress()-1) * 100); }
   * return null;
   */
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:11,代码来源:ExprBaseBossBar.java


示例12: execute

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void execute(Event evt) {
  BossBarAPI.setMessage(player.getSingle(evt), text.getSingle(evt).toString().replace("\"", ""),
      100, time.getSingle(evt).getTicks() / 20);
  // BossBarAPI.addBar(player.getSingle(evt), new TextComponent(text.getSingle(evt).replace("\"",
  // "")),null,null, 1, t.getSingle(evt).getTicks()/20,5);
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:9,代码来源:EffTimedBossBar.java


示例13: updateBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
private void updateBar(Player player){
    if(visible) {
        if (bossBarAPI){
            TextComponent text = new TextComponent(title);
            BossBarAPI.addBar(player, text, BossBarAPI.Color.PURPLE, BossBarAPI.Style.PROGRESS, (float) progress);
        }else {
            StatusBarAPI.setStatusBar(player, title, (float) progress);
        }
    }
}
 
开发者ID:endercrest,项目名称:ColorCube,代码行数:11,代码来源:V1_8_R3BossBar.java


示例14: removeBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
private void removeBar(Player player){
    if(bossBarAPI){
        BossBarAPI.removeAllBars(player);
    }else{
        StatusBarAPI.removeStatusBar(player);
    }
}
 
开发者ID:endercrest,项目名称:ColorCube,代码行数:8,代码来源:V1_8_R3BossBar.java


示例15: run

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
public void run() {
    plugin.getGm().getPlaying().forEach(p -> {
        BossBarUtils.create(p.getPlayer(), "&cTiempo restante: &6" + count, BossBarAPI.Color.BLUE, BossBarAPI.Style.PROGRESS);
        p.getPlayer().setFireTicks(0);
        p.getPlayer().setHealthScale(20d);
    });

    hasEnoughPlayers();

    switch (count) {
        case 210:
            plugin.getGm().getPlaying().forEach(p -> {
                p.teleport(plugin.getAm().getRandomSpawn());
                Title.sendTitle(p.getPlayer(),1,2,1, ChatColor.GREEN + "Ronda de calentamiento","");
                p.getPlayer().setWalkSpeed(0.3f);
            });
            break;
        case 180:
            plugin.getGm().getPlaying().forEach(p -> {
                plugin.getGm().resetPoint(p);
                p.resetPlayer();
                p.teleport(plugin.getAm().getRandomSpawn());
                Title.sendTitle(p.getPlayer(),1,2,1,ChatColor.RED + "¡Empieza el juego!","");
                p.getPlayer().setWalkSpeed(0.3f);
            });
            break;
        case 60:
            plugin.getGm().getPlaying().forEach(p -> {
                Title.sendTitle(p.getPlayer(),1,2,1,ChatColor.RED + "¡60 segundos!",ChatColor.GOLD + "¡Velocidad x2!");
                p.getPlayer().setWalkSpeed(0.4f);
            });

            break;
        case 3:
            checkWinner();
            break;
        case 0:
            end();
            break;
    }
    count--;
}
 
开发者ID:cadox8,项目名称:PA,代码行数:43,代码来源:GameTask.java


示例16: create

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
public static void create(Player p, String title, BossBarAPI.Color color, BossBarAPI.Style style) {
    BossBarAPI.removeAllBars(p);
    BossBarAPI.addBar(p, new TextComponent(Utils.colorize(title)), color, style, 1f);
}
 
开发者ID:cadox8,项目名称:PA,代码行数:5,代码来源:BossBarUtils.java


示例17: removeBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void removeBar(Player player, SkillType skill) {
    if (lastUsedSkill == skill) {
        BossBarAPI.removeAllBars(player);
    }
}
 
开发者ID:games647,项目名称:mcMMOExtras,代码行数:7,代码来源:BossBarMessageAPI.java


示例18: removeAllBars

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void removeAllBars(Player player) {
    BossBarAPI.removeAllBars(player);
}
 
开发者ID:games647,项目名称:mcMMOExtras,代码行数:5,代码来源:BossBarMessageAPI.java


示例19: setMessage

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public void setMessage(Player player, SkillType skill, String newMessage, float percent) {
    BossBarAPI.setMessage(player, newMessage, percent);
    lastUsedSkill = skill;
}
 
开发者ID:games647,项目名称:mcMMOExtras,代码行数:6,代码来源:BossBarMessageAPI.java


示例20: hasBar

import org.inventivetalent.bossbar.BossBarAPI; //导入依赖的package包/类
@Override
public boolean hasBar(Player player) {
	return BossBarAPI.hasBar(player) || bossBarMap.containsKey(player.getUniqueId());
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:5,代码来源:BossBarUtilsBossBarImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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