本文整理匯總了Java中org.bukkit.inventory.meta.LeatherArmorMeta.addItemFlags方法的典型用法代碼示例。如果您正苦於以下問題:Java LeatherArmorMeta.addItemFlags方法的具體用法?Java LeatherArmorMeta.addItemFlags怎麽用?Java LeatherArmorMeta.addItemFlags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.inventory.meta.LeatherArmorMeta
的用法示例。
在下文中一共展示了LeatherArmorMeta.addItemFlags方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: build
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
/**
* Get the final {@link ItemStack} with all the attributes you have been adding
*
* @return the {@link ItemStack} of this {@link ItemBuilder}
*/
@Override
public ItemStack build() {
ItemStack s = new ItemStack(this.getMaterial());
s.setAmount(this.getAmount());
s.setDurability(this.getDamage());
LeatherArmorMeta m = (LeatherArmorMeta) s.getItemMeta();
for (ItemFlag iflag : this.getAllItemflags()) {
m.addItemFlags(iflag);
}
m.setDisplayName(this.getName());
m.setLore(this.getLore());
m.setColor(color);
s.setItemMeta(m);
for (Map.Entry<Enchantment, Integer> temp : this.getAllEnchantments().entrySet()) {
s.addUnsafeEnchantment(temp.getKey(), temp.getValue());
}
return s;
}
示例2: createTeamJoinButton
import org.bukkit.inventory.meta.LeatherArmorMeta; //導入方法依賴的package包/類
private ItemStack createTeamJoinButton(final MatchPlayer player, final Team team) {
ItemStack item = new ItemStack(Button.TEAM_JOIN.material);
String capacityMessage = this.getTeamSizeDescription(team.getPlayers().size(), team.getMaxPlayers());
List<String> lore = Lists.newArrayList(capacityMessage);
final JoinResult result = jmm.queryJoin(player, JoinRequest.user(team));
if(result.isAllowed()) {
final String label = result.isRejoin() ? "teamSelection.picker.clickToRejoin"
: "teamSelection.picker.clickToJoin";
lore.add(renderer.renderLegacy(new Component(new TranslatableComponent(label), ChatColor.GREEN), player.getBukkit()));
} else if(result.message().isPresent()) {
lore.add(renderer.renderLegacy(new Component(result.message().get(), ChatColor.RED), player.getBukkit()));
result.extra().forEach(line -> {
lore.add(renderer.renderLegacy(line, player.getBukkit()));
});
}
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.addItemFlags(ItemFlag.values());
meta.setColor(team.getFullColor());
meta.setDisplayName(team.getColor().toString() + ChatColor.BOLD + team.getName());
meta.setLore(lore);
meta.addItemFlags(ItemFlag.values()); // Hides a lot more than potion effects
item.setItemMeta(meta);
return item;
}