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


Java Material.LAPIS_BLOCK屬性代碼示例

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


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