本文整理汇总了Java中org.bukkit.Material.LAPIS_BLOCK属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LAPIS_BLOCK属性的具体用法?Java Material.LAPIS_BLOCK怎么用?Java Material.LAPIS_BLOCK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.LAPIS_BLOCK属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSpectateMenu
public void updateSpectateMenu(final GamePlayer gamePlayer) {
if (!SkyWarsReloaded.getIC().has(gamePlayer.getP()) || gamePlayer.isSpectating() || !SkyWarsReloaded.getIC().getMenu(gamePlayer.getP()).getName().equalsIgnoreCase(menuName)) {
return;
} else {
ArrayList<Game> games = SkyWarsReloaded.getGC().getGames();
for (int iii = 0; iii < games.size(); iii++) {
if (iii >= menuSize) {
break;
}
Game game = games.get(iii);
List<String> loreList = Lists.newLinkedList();
loreList.add(ChatColor.RED + "" + ChatColor.BOLD + game.getMapName().toUpperCase());
loreList.add((new Messaging.MessageFormatter().format("menu.spectate-game-header") + " " + game.getPlayers().size() + "/" + game.getNumberOfSpawns()));
for (GamePlayer gPlayer: game.getPlayers()) {
if (gPlayer.getP() != null) {
loreList.add(ChatColor.WHITE + gPlayer.getP().getName());
}
}
Material gameIcon = Material.REDSTONE_BLOCK;
String gameNumber = String.valueOf(game.getGameNumber());
if (game.getState() == GameState.PREGAME) {
gameIcon = Material.EMERALD_BLOCK;
} else if (game.getState() == GameState.ENDING) {
gameIcon = Material.LAPIS_BLOCK;
}
if (gamePlayer.getP() != null) {
SkyWarsReloaded.getIC().setOption(
gamePlayer.getP(),
iii,
new ItemStack(gameIcon, 1),
gameNumber,
loreList.toArray(new String[loreList.size()]));
}
}
if (gamePlayer.getP() != null) {
SkyWarsReloaded.getIC().update(gamePlayer.getP());
}
final GamePlayer player = gamePlayer;
SkyWarsReloaded.get().getServer().getScheduler().scheduleSyncDelayedTask(SkyWarsReloaded.get(), new Runnable() {
@Override
public void run() {
updateSpectateMenu(player);
}
}, 40);
}
}