本文整理汇总了Java中org.bukkit.Material.CHAINMAIL_CHESTPLATE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.CHAINMAIL_CHESTPLATE属性的具体用法?Java Material.CHAINMAIL_CHESTPLATE怎么用?Java Material.CHAINMAIL_CHESTPLATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.CHAINMAIL_CHESTPLATE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isApplicableFor
@Override
public boolean isApplicableFor(Player player) {
PlayerInventory playerInventory = player.getInventory();
ItemStack helmet = playerInventory.getHelmet();
if (helmet == null || helmet.getType() != Material.CHAINMAIL_HELMET) {
return false;
}
ItemStack chestplate = playerInventory.getChestplate();
if (chestplate == null || chestplate.getType() != Material.CHAINMAIL_CHESTPLATE) {
return false;
}
ItemStack leggings = playerInventory.getLeggings();
if (leggings == null || leggings.getType() != Material.CHAINMAIL_LEGGINGS) {
return false;
}
ItemStack boots = playerInventory.getBoots();
return !(boots == null || boots.getType() != Material.CHAINMAIL_BOOTS);
}
示例2: isPieceOfArmor
private static boolean isPieceOfArmor(ItemStack stack)
{
if (stack.getType() == Material.LEATHER_HELMET || stack.getType() == Material.LEATHER_CHESTPLATE || stack.getType() == Material.LEATHER_LEGGINGS || stack.getType() == Material.LEATHER_BOOTS)
return true;
else if (stack.getType() == Material.IRON_HELMET || stack.getType() == Material.IRON_CHESTPLATE || stack.getType() == Material.IRON_LEGGINGS || stack.getType() == Material.IRON_BOOTS)
return true;
else if (stack.getType() == Material.CHAINMAIL_HELMET || stack.getType() == Material.CHAINMAIL_CHESTPLATE || stack.getType() == Material.CHAINMAIL_LEGGINGS || stack.getType() == Material.CHAINMAIL_BOOTS)
return true;
else if (stack.getType() == Material.GOLD_HELMET || stack.getType() == Material.GOLD_CHESTPLATE || stack.getType() == Material.GOLD_LEGGINGS || stack.getType() == Material.GOLD_BOOTS)
return true;
else if (stack.getType() == Material.DIAMOND_HELMET || stack.getType() == Material.DIAMOND_CHESTPLATE || stack.getType() == Material.DIAMOND_LEGGINGS || stack.getType() == Material.DIAMOND_BOOTS)
return true;
return false;
}
示例3: onCraftItem
@EventHandler(priority = EventPriority.HIGH)
public void onCraftItem(CraftItemEvent event)
{
if( event.getRecipe().getResult().getType() == Material.STONE_SWORD
|| event.getRecipe().getResult().getType() == Material.IRON_SWORD
|| event.getRecipe().getResult().getType() == Material.GOLD_SWORD
|| event.getRecipe().getResult().getType() == Material.DIAMOND_SWORD
|| event.getRecipe().getResult().getType() == Material.LEATHER_BOOTS
|| event.getRecipe().getResult().getType() == Material.LEATHER_LEGGINGS
|| event.getRecipe().getResult().getType() == Material.LEATHER_CHESTPLATE
|| event.getRecipe().getResult().getType() == Material.LEATHER_HELMET
|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_BOOTS
|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_LEGGINGS
|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_CHESTPLATE
|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_HELMET
|| event.getRecipe().getResult().getType() == Material.GOLD_BOOTS
|| event.getRecipe().getResult().getType() == Material.GOLD_LEGGINGS
|| event.getRecipe().getResult().getType() == Material.GOLD_CHESTPLATE
|| event.getRecipe().getResult().getType() == Material.GOLD_HELMET
|| event.getRecipe().getResult().getType() == Material.IRON_BOOTS
|| event.getRecipe().getResult().getType() == Material.IRON_LEGGINGS
|| event.getRecipe().getResult().getType() == Material.IRON_CHESTPLATE
|| event.getRecipe().getResult().getType() == Material.IRON_HELMET
|| event.getRecipe().getResult().getType() == Material.DIAMOND_BOOTS
|| event.getRecipe().getResult().getType() == Material.DIAMOND_LEGGINGS
|| event.getRecipe().getResult().getType() == Material.DIAMOND_CHESTPLATE
|| event.getRecipe().getResult().getType() == Material.DIAMOND_HELMET)
{
if( event.getWhoClicked().getType() == EntityType.PLAYER )
{
Player p = (Player)event.getWhoClicked();
p.sendMessage("Sorry, you are not allowed to craft this item. Purchase it from a Safe Dock instead.");
}
event.setCancelled(false);
}
}
示例4: isDressed
public boolean isDressed(Player p)
{
if( this.type.canFly )
{
if( p.getInventory().getHelmet() != null && p.getInventory().getHelmet().getType() == Material.CHAINMAIL_HELMET )
{
if( p.getInventory().getChestplate() != null && p.getInventory().getChestplate().getType() == Material.CHAINMAIL_CHESTPLATE )
{
if( p.getInventory().getLeggings() != null && p.getInventory().getLeggings().getType() == Material.CHAINMAIL_LEGGINGS )
{
if( p.getInventory().getBoots() != null && p.getInventory().getBoots().getType() == Material.CHAINMAIL_BOOTS )
{
return true;
}
}
}
}
p.sendMessage(ChatColor.RED + "You need to wear pilot (chainmail) uniform to use this.");
return false;
}else if( this.type.isTerrestrial)
{
if( p.getInventory().getHelmet() != null && p.getInventory().getHelmet().getType() == Material.IRON_HELMET )
{
if( p.getInventory().getChestplate() != null && p.getInventory().getChestplate().getType() == Material.IRON_CHESTPLATE )
{
if( p.getInventory().getLeggings() != null && p.getInventory().getLeggings().getType() == Material.IRON_LEGGINGS )
{
if( p.getInventory().getBoots() != null && p.getInventory().getBoots().getType() == Material.IRON_BOOTS )
{
return true;
}
}
}
}
p.sendMessage(ChatColor.RED + "You need to wear soldier (iron) uniform to use this.");
return false;
}else
{
if( p.getInventory().getHelmet() != null && (p.getInventory().getHelmet().getType() == Material.LEATHER_HELMET || p.getInventory().getHelmet().getType() == Material.GOLD_HELMET || p.getInventory().getHelmet().getType() == Material.DIAMOND_HELMET) )
{
if( p.getInventory().getChestplate() != null && (p.getInventory().getChestplate().getType() == Material.LEATHER_CHESTPLATE || p.getInventory().getChestplate().getType() == Material.GOLD_CHESTPLATE || p.getInventory().getChestplate().getType() == Material.DIAMOND_CHESTPLATE) )
{
if( p.getInventory().getLeggings() != null && (p.getInventory().getLeggings().getType() == Material.LEATHER_LEGGINGS || p.getInventory().getLeggings().getType() == Material.GOLD_LEGGINGS || p.getInventory().getLeggings().getType() == Material.DIAMOND_LEGGINGS) )
{
if( p.getInventory().getBoots() != null && (p.getInventory().getBoots().getType() == Material.LEATHER_BOOTS || p.getInventory().getBoots().getType() == Material.GOLD_BOOTS || p.getInventory().getBoots().getType() == Material.DIAMOND_BOOTS) )
{
return true;
}
}
}
}
p.sendMessage(ChatColor.RED + "You need to wear sailor (leather) or captain (gold) uniform to use this.");
return false;
}
}