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


Java Material.IRON_BOOTS屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.IRON_BOOTS屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.IRON_BOOTS屬性的具體用法?Java Material.IRON_BOOTS怎麽用?Java Material.IRON_BOOTS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.IRON_BOOTS屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isApplicableFor

@Override
public boolean isApplicableFor(Player player) {
    PlayerInventory playerInventory = player.getInventory();

    ItemStack helmet = playerInventory.getHelmet();
    if (helmet == null || helmet.getType() != Material.IRON_HELMET)
        return false;

    ItemStack chestplate = playerInventory.getChestplate();
    if (chestplate == null || chestplate.getType() != Material.IRON_CHESTPLATE)
        return false;

    ItemStack leggings = playerInventory.getLeggings();
    if (leggings == null || leggings.getType() != Material.IRON_LEGGINGS)
        return false;

    ItemStack boots = playerInventory.getBoots();
    return !(boots == null || boots.getType() != Material.IRON_BOOTS);
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:19,代碼來源:MinerClass.java

示例2: isApplicableFor

@Override
public boolean isApplicableFor(Player player) {
    PlayerInventory playerInventory = player.getInventory();

    ItemStack helmet = playerInventory.getHelmet();
    if (helmet == null || helmet.getType() != Material.IRON_HELMET || !helmet.getEnchantments().isEmpty())
        return false;

    ItemStack chestplate = playerInventory.getChestplate();
    if (chestplate == null || chestplate.getType() != Material.IRON_CHESTPLATE || !chestplate.getEnchantments().isEmpty())
        return false;

    ItemStack leggings = playerInventory.getLeggings();
    if (leggings == null || leggings.getType() != Material.IRON_LEGGINGS || !leggings.getEnchantments().isEmpty())
        return false;

    ItemStack boots = playerInventory.getBoots();
    return !(boots == null || boots.getType() != Material.IRON_BOOTS || !boots.getEnchantments().isEmpty());
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:19,代碼來源:AssassinClass.java

示例3: 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;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:15,代碼來源:PlayerProtectionListener.java

示例4: 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);
	}
 
}
 
開發者ID:Maximuspayne,項目名稱:NavyCraft2-Lite,代碼行數:37,代碼來源:NavyCraft_InventoryListener.java

示例5: onInventoryClick

@EventHandler
public void onInventoryClick(InventoryClickEvent event)
{
    if (event.getClickedInventory() != null && event.getCurrentItem() != null)
    {
        if (event.getCurrentItem().getType() == Material.LEATHER_BOOTS || event.getCurrentItem().getType() == Material.IRON_BOOTS || event.getCurrentItem().getType() == Material.CHAINMAIL_BOOTS || event.getCurrentItem().getType() == Material.GOLD_BOOTS || event.getCurrentItem().getType() == Material.DIAMOND_BOOTS)
        {
            if ((event.getClickedInventory().getType() == InventoryType.ENCHANTING || event.getClickedInventory().getType() == InventoryType.ANVIL) && event.getSlot() == 0)
                event.getCurrentItem().removeEnchantment(Enchantment.DEPTH_STRIDER);
            else if (event.getClickedInventory().getType() == InventoryType.ANVIL && event.getSlot() == 2)
                event.getCurrentItem().addEnchantment(Enchantment.DEPTH_STRIDER, 2);
        }
    }
}
 
開發者ID:SamaGames,項目名稱:DoubleRunner,代碼行數:14,代碼來源:DoubleRunnerGameLoop.java

示例6: 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;  
 }
}
 
開發者ID:Maximuspayne,項目名稱:NavyCraft2-Lite,代碼行數:55,代碼來源:Craft.java

示例7: onEnchantItem

@EventHandler
public void onEnchantItem(EnchantItemEvent event)
{
    if (event.getItem().getType() == Material.LEATHER_BOOTS || event.getItem().getType() == Material.IRON_BOOTS || event.getItem().getType() == Material.CHAINMAIL_BOOTS || event.getItem().getType() == Material.GOLD_BOOTS || event.getItem().getType() == Material.DIAMOND_BOOTS)
        event.getItem().addEnchantment(Enchantment.DEPTH_STRIDER, 2);
}
 
開發者ID:SamaGames,項目名稱:DoubleRunner,代碼行數:6,代碼來源:DoubleRunnerGameLoop.java

示例8: BasicKitHandler

public BasicKitHandler()
{
    this.kits = new HashSet<>();

    if (MWAPI.getConfig().isDefaultKitsEnabled())
    {
        // *** FIGHTER KIT *** //

        // Fighter Armor
        ItemStack fighterHelmet = new ItemStack(Material.IRON_HELMET, 1);
        fighterHelmet.addEnchantment(Enchantment.DAMAGE_ALL, 1);
        KitItem fighterHelmetKitItem = MWAPI.getKitItemBuilder()
                                            .stack(fighterHelmet)
                                            .drop(false)
                                            .unbreakable(true)
                                            .create();

        ItemStack fighterChestplate = new ItemStack(Material.IRON_CHESTPLATE, 1);
        fighterChestplate.addEnchantment(Enchantment.DAMAGE_ALL, 1);
        KitItem fighterChestplateKitItem = MWAPI.getKitItemBuilder()
                                                .stack(fighterChestplate)
                                                .drop(false)
                                                .unbreakable(true)
                                                .create();

        ItemStack fighterPants = new ItemStack(Material.IRON_LEGGINGS, 1);
        fighterPants.addEnchantment(Enchantment.DAMAGE_ALL, 1);
        KitItem fighterPantsKitItem = MWAPI.getKitItemBuilder()
                                           .stack(fighterPants)
                                           .drop(false)
                                           .unbreakable(true)
                                           .create();

        ItemStack fighterBoots = new ItemStack(Material.IRON_BOOTS, 1);
        fighterBoots.addEnchantment(Enchantment.DAMAGE_ALL, 1);
        KitItem fighterBootsKitItem = MWAPI.getKitItemBuilder()
                                           .stack(fighterPants)
                                           .drop(false)
                                           .unbreakable(true)
                                           .create();

        // Fighter Items
        ItemStack fighterSword = new ItemStack(Material.IRON_SWORD, 1);
        fighterSword.addEnchantment(Enchantment.DAMAGE_ALL, 2);
        KitItem fighterSwordKitItem = MWAPI.getKitItemBuilder()
                                           .stack(fighterSword)
                                           .drop(false)
                                           .unbreakable(true)
                                           .create();

        ItemStack fighterFood = new ItemStack(Material.GOLDEN_APPLE, 10);
        KitItem fighterFoodKitItem = MWAPI.getKitItemBuilder()
                                          .stack(fighterSword)
                                          .drop(true)
                                          .unbreakable(true)
                                          .create();

        registerKit(MWAPI.getKitBuilder("Fighter")
                         .setBoots(fighterBootsKitItem)
                         .setPants(fighterPantsKitItem)
                         .setChestPlate(fighterChestplateKitItem)
                         .setHelmet(fighterHelmetKitItem)
                         .setItemAt(0, fighterSwordKitItem)
                         .setItemAt(1, fighterFoodKitItem)
                         .create());
    }
}
 
開發者ID:WoutDev,項目名稱:Mega-Walls,代碼行數:67,代碼來源:BasicKitHandler.java


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