本文整理汇总了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;
}