本文整理汇总了Java中org.bukkit.Material.EMERALD_BLOCK属性的典型用法代码示例。如果您正苦于以下问题:Java Material.EMERALD_BLOCK属性的具体用法?Java Material.EMERALD_BLOCK怎么用?Java Material.EMERALD_BLOCK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.EMERALD_BLOCK属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: acceptOrDeny
public static Inventory acceptOrDeny(ItemStack clickedRequest) {
String temp = ChatColor.stripColor(clickedRequest.getItemMeta().getDisplayName());
int clickedId = Integer.parseInt(temp.substring(9, temp.length()));
BanRequest br = new BanRequest(clickedId);
Inventory i = Bukkit.createInventory(null, 54, Messager.color("&eRequest #" + br.id));
i.setItem(22, br.getItem());
ItemStack em = new ItemStack(Material.EMERALD_BLOCK);
ItemMeta emM = em.getItemMeta();
emM.setDisplayName(Messager.color("&aAccept Ban Request."));
emM.setLore(Arrays.asList(Messager.color("&7This can only be undone manually.")));
em.setItemMeta(emM);
ItemStack red = new ItemStack(Material.REDSTONE_BLOCK);
ItemMeta redM = red.getItemMeta();
redM.setDisplayName(Messager.color("&cDeny Ban Request."));
redM.setLore(Arrays.asList(Messager.color("&7This can only be undone manually.")));
red.setItemMeta(redM);
i.setItem(9, em);
i.setItem(10, em);
i.setItem(11, em);
i.setItem(15, red);
i.setItem(16, red);
i.setItem(17, red);
i.setItem(18, em);
i.setItem(19, em);
i.setItem(20, em);
i.setItem(24, red);
i.setItem(25, red);
i.setItem(26, red);
i.setItem(27, em);
i.setItem(28, em);
i.setItem(29, em);
i.setItem(33, red);
i.setItem(34, red);
i.setItem(35, red);
ItemStack back = new ItemStack(Material.ARROW);
ItemMeta im = back.getItemMeta();
im.setDisplayName(Messager.color("&cBack"));
back.setItemMeta(im);
i.setItem(45, back);
return i;
}