本文整理汇总了Java中org.bukkit.Bukkit.createBossBar方法的典型用法代码示例。如果您正苦于以下问题:Java Bukkit.createBossBar方法的具体用法?Java Bukkit.createBossBar怎么用?Java Bukkit.createBossBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.Bukkit
的用法示例。
在下文中一共展示了Bukkit.createBossBar方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBar
import org.bukkit.Bukkit; //导入方法依赖的package包/类
/**
* Set a boss bar with a given color, style, percentage to a given
* player. Also you can enable the darken sky, the boss music ambiance
* and enable fog to a given player
*
* @param message Message on the top of the bar
* @param color Color of the bar
* @param style Style of the bar
* @param progress Filling percentage
* @param darkenSky Enable darken sky
* @param playMusic Enable boss music
* @param createFog Enable the fog
*/
public static Pair<UUID, BossBar> getBar(String message, BarColor color, BarStyle style, double progress, boolean darkenSky, boolean playMusic, boolean createFog)
{
BossBar bossBar = Bukkit.createBossBar(message, color, style);
bossBar.setProgress(progress < 0 ? 0D : progress / 100.0D);
if (darkenSky)
bossBar.addFlag(BarFlag.DARKEN_SKY);
if (playMusic)
bossBar.addFlag(BarFlag.PLAY_BOSS_MUSIC);
if (createFog)
bossBar.addFlag(BarFlag.CREATE_FOG);
UUID random = UUID.randomUUID();
bossBars.put(random, bossBar);
return Pair.of(random, bossBar);
}
示例2: doInit
import org.bukkit.Bukkit; //导入方法依赖的package包/类
private void doInit() {
voters = new ArrayList();
plugin.getServer().getPluginManager().registerEvents(this, plugin);
messageArray[0] = Messages.voteStarted();
messageArray[1] = Messages.voteButtons();
yes = 1;
no = 0;
countDown = 30;
bar = Bukkit.createBossBar("Current Vote: "
+ ChatColor.GREEN + ChatColor.BOLD + "Yes "
+ ChatColor.RESET + "- " + yes
+ ChatColor.DARK_RED + ChatColor.BOLD + " No "
+ ChatColor.RESET + "- " + no, BarColor.PURPLE, BarStyle.SOLID);
voters = updateAll(voters, messageArray, player);
timer = Timer.OPERATION;
plugin.getServer().getScheduler().runTaskLater(plugin, this, 20);
}
示例3: start
import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public void start() {
super.start();
originalTicks = ticks;
log.finer("start timed phase with name " + getName());
bossBar = Bukkit.createBossBar(getName(), BarColor.BLUE, BarStyle.SEGMENTED_20);
getGame().getPlayers().forEach(u -> bossBar.addPlayer(u.getPlayer()));
getGame().getSpectators().forEach(u -> bossBar.addPlayer(u.getPlayer()));
started = true;
}
示例4: initBossBar
import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public BossBar initBossBar() {
BossBar bossBar = Bukkit.createBossBar("", BarColor.BLUE, BarStyle.SOLID);
bossBar.setVisible(false);
return bossBar;
}
示例5: initBossBar
import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public BossBar initBossBar() {
BossBar bossBar = Bukkit.createBossBar("", BarColor.GREEN, BarStyle.SOLID);
bossBar.setVisible(false);
return bossBar;
}
示例6: start
import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public void start() {
bossBar = Bukkit.createBossBar(message, color, style);
getPhase().getGame().getPlayers().forEach(user -> bossBar.addPlayer(user.getPlayer()));
}
示例7: onEnable
import org.bukkit.Bukkit; //导入方法依赖的package包/类
/**
* Basic game enabling and loading method.<br>
* <br>
* For proper runs use:<br>
* name = "GameName";<br>
* super.onEnable();<br>
* <br>
* If you create teams add:<br>
* team = new OMGTeam(...);<br>
* Inventories.update();
*/
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
Bukkit.getPluginManager().registerEvents(new BukkitEventHandler(), OMGPI.instance);
gamefig = new Gamefig();
state = GameState.PRELOBBY;
gamePreparer = new ClijmartTeamAsserter();
shootSources = new HashMap<>();
mapsDirectory = new File(getDataFolder() + File.separator + "maps");
defaultTeam = new OMGTeam("default", ChatColor.YELLOW + "Default", ChatColor.YELLOW + "", true, GameMode.ADVENTURE);
spectatorTeam = new OMGTeam("spectator", ChatColor.GRAY + "Spectator", ChatColor.GRAY + "", false, GameMode.SPECTATOR);
OMGKit.dir = new File(getDataFolder() + File.separator + "kits");
OMGKit def = new OMGKit("Default");
def.setUnpresent("displayItem", "{id:stone,Count:1,tag:{display:{Name:\"Default\"}}}");
def.save();
String[] kitarr = OMGKit.dir.list();
List<String> kits = kitarr == null ? new ArrayList<>() : Arrays.asList(kitarr);
kits.stream().filter(k -> k.endsWith(".kit") && OMGKit.kits.stream().noneMatch(k1 -> (k1 + ".kit").equalsIgnoreCase(k))).forEach(k -> new OMGKit(k.replaceAll("\\.kit", "")));
OMGLoot.dir = new File(getDataFolder() + File.separator + "loots");
String[] lootarr = OMGLoot.dir.list();
List<String> loots = lootarr == null ? new ArrayList<>() : Arrays.asList(lootarr);
loots.stream().filter(l -> l.endsWith(".loot") && OMGLoot.loots.stream().noneMatch(l1 -> (l1 + ".loot").equalsIgnoreCase(l))).forEach(l -> new OMGLoot(l.replaceAll("\\.loot", "")));
settings = new GameSettings(this);
infoBar = Bukkit.createBossBar(ChatColor.AQUA + "", BarColor.WHITE, BarStyle.SOLID);
infoBar.setVisible(false);
voteSystem = new VoteSystem();
countdown = new Countdown();
updator = new BukkitRunnable() {
public void run() {
update();
}
};
updator.runTaskTimer(this, 0, 1);
Inventories.update();
Bukkit.getOnlinePlayers().forEach(p -> {
while (OMGPlayer.get(p) == null) event_player_join(new OMGPlayer(p));
});
OMGPI.iLog(name + " initialized, can be played.");
}